I finalized my setup so I can now boot Armbian with 5.3 kernel from SPI + nvme unattended (no mmc). Here is what is needed:
- Get Radxa’s u-boot flashed to SPI (see here how to do it https://wiki.radxa.com/Rockpi4/Linux_system_runs_on_M.2_NVME_SSD)
- Build Armbian image with PCI/NVME enabled. By default the
Device Drivers/PCI Support/PCI Controller Drivers/Rockchip PCIe host controlleris set to be compiled into module. It needs to be built into the kernel. So the default<M>needs to be changed to<*>.
git clone --depth 1 https://github.com/armbian/build
cd build
./compile.sh EXPERT=yes
or a faster way to get most options correct for 18.04 server image
./compile.sh BOARD=rockpi-4b BRANCH=dev RELEASE=bionic BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_ONLY=no KERNEL_CONFIGURE=yes
- Write the image to NVME drive. I used an USB to NVME adapter (https://www.amazon.com/QNINE-Adapter-Performance-Portable-Support/dp/B07JKWHFRC) and balenaEtcher to do this.
- Mount the image somewhere so you can modify it. The image has only one ext4 partition. It is easy to modify on a PC running linux. For mac - https://www.paragon-software.com/us/home/extfs-mac/ - will probably work. It is also possible to modify the downloaded image and then write to the NVME.
- Append to
/boot/armbianEnv.txtthis linefdtfile=rockchip/rk3399-rock-pi-4.dtb. You can do it like thisecho "fdtfile=rockchip/rk3399-rock-pi-4.dtb" >> /boot/armbianEnv.txtThis is needed as Radxa’s u-boot name for the rock pi 4 dtb is different than what Armbian has. - Create a file
/boot/fixup.cmdwith the folowing:
fdt set /pcie@f8000000 status okay
fdt set /pcie@f8000000 num-lanes <4>
fdt set /pcie@f8000000 max-link-speed <2>
fdt set /syscon@ff770000/pcie-phy status okay
fdt set /pcie@f8000000 ep-gpios <0xb7 27 0>
fdt set /pcie@f8000000 pinctrl-names default
fdt set /pcie@f8000000 pinctrl-0 <0x145>
After creating the file you need to use mkimage to generate image for U-boot like this mkimage -C none -A arm -T script -d fixup.cmd fixup.scr
I used the mkimage from Armbian. It may be available elsewhere too. I also found this http://macappstore.org/u-boot-tools/ for OS X - it has mkimage
- You should be able to boot fine at this point. The serial console works too but doesn’t show the boot messages from the kernel. For me it shows the login prompt when the boot is finished. It takes around 7 sec from start to see
Starting Kernel ...in U-boot