Work of samueldr to run NixOS on the Pine64 Pinebook Pro
Go to file
Samuel Dionne-Riel 002045ab17 Force s2idle until suspend is fixed. 2020-01-16 20:16:01 -05:00
firmware Add known-good firmwares 2020-01-07 15:09:54 -05:00
kernel Add kernel build 2020-01-06 15:21:57 -05:00
keyboard-updater Add keyboard updater 2020-01-07 15:58:41 -05:00
nixos Prefer tty0 console 2020-01-06 20:28:54 -05:00
u-boot Add leed beep boop at start 2020-01-06 20:29:08 -05:00
.gitignore initial commit 2019-11-14 17:40:51 -05:00
README.md Add missing final poweroff 2020-01-07 16:00:44 -05:00
build.sh Allow unfree for build, because of the firmwares 2020-01-07 15:15:08 -05:00
configuration.nix Split configuration in a way that can be imported 2020-01-06 21:24:31 -05:00
cross-hacks.nix Adds (incomplete) system image build 2020-01-06 15:22:39 -05:00
default.nix Set this up using a proper overlay 2020-01-06 15:21:02 -05:00
overlay.nix Add keyboard updater 2020-01-07 15:58:41 -05:00
pinebook_pro.nix Force s2idle until suspend is fixed. 2020-01-16 20:16:01 -05:00
system.nix Adds (incomplete) system image build 2020-01-06 15:22:39 -05:00
with-cross.nix Adds (incomplete) system image build 2020-01-06 15:22:39 -05:00

README.md

WIP stuff to get started on the pinebook pro.

Using in your configuration

Clone this repository somwhere, and in your configuration.nix

{
  imports = [
    .../pinebook-pro/pinebook_pro.nix
  ];
}

That entry point will try to stay unopinionated, while maximizing the hardware compatibility.

Compatibility

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.

Tips

The backlight can be controlled using light (programs.light.enable).

Image build

$ ./build.sh
$ lsblk /dev/mmcblk0 && sudo dd if=$(echo result/sd-image/*.img) of=/dev/mmcblk0 bs=8M oflag=direct status=progress

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.

The required modules (and maybe a bit more) are present in stage-1 so the display should start early enough in the boot process.

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.

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.

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.

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
 $ sudo poweroff