2019-11-14 23:40:51 +01:00
|
|
|
WIP stuff to get started on the pinebook pro.
|
2019-11-14 23:47:56 +01:00
|
|
|
|
2020-01-07 21:20:13 +01:00
|
|
|
## Using in your configuration
|
2019-11-14 23:47:56 +01:00
|
|
|
|
2020-01-07 21:20:13 +01:00
|
|
|
Clone this repository somwhere, and in your configuration.nix
|
2019-11-14 23:47:56 +01:00
|
|
|
|
|
|
|
```
|
2020-01-07 21:20:13 +01:00
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
.../pinebook-pro/pinebook_pro.nix
|
|
|
|
];
|
|
|
|
}
|
2019-11-14 23:47:56 +01:00
|
|
|
```
|
|
|
|
|
2020-01-07 21:20:13 +01:00
|
|
|
That entry point will try to stay unopinionated, while maximizing the hardware
|
|
|
|
compatibility.
|
2019-11-14 23:47:56 +01:00
|
|
|
|
2020-01-07 21:20:13 +01:00
|
|
|
## Compatibility
|
2019-11-14 23:47:56 +01:00
|
|
|
|
2020-01-07 21:20:13 +01:00
|
|
|
### Tested
|
|
|
|
|
|
|
|
* X11 with modesetting
|
|
|
|
* Wi-Fi
|
|
|
|
* Brightness controls
|
|
|
|
|
|
|
|
### Untested
|
|
|
|
|
|
|
|
* Bluetooth
|
|
|
|
|
|
|
|
### Known issues
|
|
|
|
|
|
|
|
* Suspend (or resume) fails.
|
|
|
|
* Rebooting fails somewhere early in the u-boot SPL.
|
2020-01-06 21:36:56 +01:00
|
|
|
|
2020-01-07 21:36:28 +01:00
|
|
|
### Tips
|
|
|
|
|
|
|
|
The backlight can be controlled using `light` (`programs.light.enable`).
|
|
|
|
|
2020-01-06 21:36:56 +01:00
|
|
|
## Image build
|
|
|
|
|
|
|
|
```
|
|
|
|
$ ./build.sh
|
2020-01-06 22:57:27 +01:00
|
|
|
$ lsblk /dev/mmcblk0 && sudo dd if=$(echo result/sd-image/*.img) of=/dev/mmcblk0 bs=8M oflag=direct status=progress
|
2020-01-06 21:36:56 +01:00
|
|
|
```
|
|
|
|
|
2020-01-06 23:30:19 +01:00
|
|
|
The `build.sh` script transmits parameters to `nix-build`, so e.g. `-j0` can
|
|
|
|
be used.
|
|
|
|
|
|
|
|
Once built, this image is self-sufficient, meaning that it should already be
|
|
|
|
booting, no need burn u-boot to it.
|
|
|
|
|
2020-01-07 02:28:37 +01:00
|
|
|
The required modules (and maybe a bit more) are present in stage-1 so the
|
|
|
|
display should start early enough in the boot process.
|
2020-01-06 23:30:19 +01:00
|
|
|
|
2020-01-07 02:29:08 +01:00
|
|
|
The LED should start up "amber, red, amber, green, amber" with this u-boot
|
|
|
|
configuration, as a way to show activity early. The kernel should set it to
|
|
|
|
green as soon as it can.
|
|
|
|
|
2020-01-06 23:30:19 +01:00
|
|
|
## Note about cross-compilation
|
|
|
|
|
|
|
|
This will automatically detect the need for cross-compiling or not.
|
|
|
|
|
|
|
|
When cross-compiled, all caveats apply. Here this mainly means that the kernel
|
|
|
|
will need to be re-compiled on the device on the first nixos-rebuild switch,
|
|
|
|
while most other packages can be fetched from the cache.
|
2020-01-07 21:20:13 +01:00
|
|
|
|
|
|
|
## `u-boot`
|
|
|
|
|
|
|
|
Assuming `/dev/mmcblk0` is an SD card.
|
|
|
|
|
|
|
|
```
|
|
|
|
$ nix-build -A pkgs.uBootPinebookPro
|
|
|
|
$ lsblk /dev/mmcblk0 && sudo dd if=result/idbloader.img of=/dev/mmcblk0 bs=512 seek=64 oflag=direct,sync && sudo dd if=result/u-boot.itb of=/dev/mmcblk0 bs=512 seek=16384 oflag=direct,sync
|
|
|
|
```
|
|
|
|
|
|
|
|
The eMMC has to be zeroed (in the relevant sectors) or else the RK3399 will use
|
|
|
|
the eMMC as a boot device first.
|
|
|
|
|
|
|
|
Alternatively, this u-boot can be installed to the eMMC.
|
|
|
|
|
|
|
|
Installing to SPI has yet to be investigated.
|
2020-01-07 21:58:47 +01:00
|
|
|
|
|
|
|
## Keyboard firmware
|
|
|
|
|
|
|
|
As rebooting doesn't work here, poweroff and boot manually.
|
|
|
|
|
|
|
|
```
|
|
|
|
$ nix-build -A pkgs.pinebookpro-keyboard-updater
|
|
|
|
$ sudo ./result/bin/updater step-1
|
|
|
|
$ sudo poweroff
|
|
|
|
# ...
|
|
|
|
$ sudo ./result/bin/updater step-2
|
2020-01-07 22:00:44 +01:00
|
|
|
$ sudo poweroff
|
2020-01-07 21:58:47 +01:00
|
|
|
```
|