NixOS on ARM/PINE64 ROCKPro64: Difference between revisions
imported>Lopsided98 No edit summary |
imported>Lopsided98 No edit summary |
||
Line 26: | Line 26: | ||
== Status == | == Status == | ||
This board has upstream U-Boot and kernel support, although the mainline kernel may still be missing some features. NixOS can be installed using manual partitioning and <code>nixos-install</code> or by modifying the aarch64 installation image as described in the next section. | |||
U-Boot for this board is packaged in nixpkgs, and Hydra builds can be found here: https://hydra.nixos.org/job/nixpkgs/trunk/ubootRockPro64.aarch64-linux | U-Boot for this board is packaged in nixpkgs, and Hydra builds can be found here: https://hydra.nixos.org/job/nixpkgs/trunk/ubootRockPro64.aarch64-linux | ||
Line 32: | Line 32: | ||
== Board-specific installation notes == | == Board-specific installation notes == | ||
U-Boot needs to be copied to | U-Boot needs to be copied to specific sectors on the microSD card, eMMC or image with <code>dd</code>. Download/build U-Boot for the board, and write <code>idbloader.img</code> and <code>u-boot.itb</code> to the correct locations with (replace <code>/dev/mmcblkX</code> with the correct path to the card or image): | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
dd if=idbloader.img of=/dev/mmcblkX conv=fsync,notrunc bs=512 seek=64 | |||
dd if=u-boot.itb of=/dev/mmcblkX conv=fsync,notrunc bs=512 seek=16384 | |||
</syntaxhighlight> | |||
{{note|Prior to NixOS 20.03, a downstream version of U-Boot 2017.09 was packaged, which placed U-Boot in a single <code>idbloader.img</code> file. If that version is used, simply disregard the second command above.}} | |||
== Serial console== | == Serial console== | ||
Line 66: | Line 71: | ||
* [https://github.com/ayufan-rock64/linux-kernel ayufan-rock64/linux-kernel] 4.4 based on Rockchip BSP | * [https://github.com/ayufan-rock64/linux-kernel ayufan-rock64/linux-kernel] 4.4 based on Rockchip BSP | ||
* [https://github.com/ayufan-rock64/linux-mainline-kernel ayufan-rock64/linux-mainline-kernel] mainline based, with potentially fewer hardware features supported. This kernel is not based on a kernel stable branch, so it may have more bugs (unrelated to the hardware). {{note|The | * [https://github.com/ayufan-rock64/linux-mainline-kernel ayufan-rock64/linux-mainline-kernel] mainline based, with potentially fewer hardware features supported. This kernel is not based on a kernel stable branch, so it may have more bugs (unrelated to the hardware). | ||
{{note|The old vendor U-Boot 2017.09 did not leave enough room between the kernel and initrd, causing recent kernels to overwrite the beginning of the initrd. This can be fixed by increasing <code>ramdisk_addr_r</code> in the U-Boot console, or using upstream U-Boot. }} | |||
== Custom NixOS Installer == | == Custom NixOS Installer == |
Revision as of 18:31, 6 December 2019
PINE64 ROCKPro64 | |
---|---|
Manufacturer | PINE64 (Pine Microsystems Inc.) |
Architecture | AArch64 |
Bootloader | Downstream (ayufan) U-Boot[1] |
Boot options | microSD, eMMC, SPI NOR Flash |
The ROCKPro64 is a powerful single board computer built around the Rockchip RK3399 SoC.
There are two models of the board, with 2 or 4 GB of RAM. It can boot from an microSD card or an eMMC. It also has a 128 Mbit SPI flash that can be used to store the bootloader.
Status
This board has upstream U-Boot and kernel support, although the mainline kernel may still be missing some features. NixOS can be installed using manual partitioning and nixos-install
or by modifying the aarch64 installation image as described in the next section.
U-Boot for this board is packaged in nixpkgs, and Hydra builds can be found here: https://hydra.nixos.org/job/nixpkgs/trunk/ubootRockPro64.aarch64-linux
Board-specific installation notes
U-Boot needs to be copied to specific sectors on the microSD card, eMMC or image with dd
. Download/build U-Boot for the board, and write idbloader.img
and u-boot.itb
to the correct locations with (replace /dev/mmcblkX
with the correct path to the card or image):
dd if=idbloader.img of=/dev/mmcblkX conv=fsync,notrunc bs=512 seek=64
dd if=u-boot.itb of=/dev/mmcblkX conv=fsync,notrunc bs=512 seek=16384
Serial console
The ROCKPro64 uses a GPIO pinout compatible with the Raspberry Pi 2 and newer. This means that the following pins can be used to connect a serial adapter:
Pi-2 Bus | |
---|---|
Pin | Function |
6 | GND |
8 | UART0_TX |
10 | UART0_RX |
The serial console runs at 1500000 baud in the bootloader.
Downstream kernel
Although the mainline kernel contains a device tree for the ROCKPro64, it does not seem to boot correctly as of 4.20. Therefore it is necessary to use a downstream kernel:
- ayufan-rock64/linux-kernel 4.4 based on Rockchip BSP
- ayufan-rock64/linux-mainline-kernel mainline based, with potentially fewer hardware features supported. This kernel is not based on a kernel stable branch, so it may have more bugs (unrelated to the hardware).
Custom NixOS Installer
It is possible to build a custom nixos installer image with a downstream kernel that will boot as-is on the rockpro64. For a working example see this repo: nixos-installer-rockpro64
Panfrost GPU Driver
The ROCKPro64's GPU is supported by the open source Panfrost driver. The downstream ayufan-rock64/linux-mainline-kernel is known to work. The mainline kernel may also work, but has not been tested. At the time of writing, support has been added to the required userspace libraries, but the changes have not yet been released. It is therefore necessary to build libdrm, mesa, mesa-glu and kmscube from their respective git sources.