January 23, 2023

Orange Pi R1 Plus LTS (RK3328) - Experiments with NetBSD ROCK64 images

The ROCK64 is a RK3328 based board just like our R1+, let's see how far we get trying to boot up the NetBSD ROCK64 image.

I download the image from here:

I gunzip it, then copy it to an SD card using "dd".

The result is pretty disappointing. U-boot runs, but it doesn't even try to launch the kernel. It goes into some kind of mode trying to do BOOTP, then times out on that and drops me to the U-boot prompt. Some choice information from that is:

fdt_addr_r=0x01f00000
fdtcontroladdr=3df051c8
fdtfile=rockchip/rk3328-rock64.dtb
kernel_addr_r=0x02000000
The full log of the attempt is as follows:
DDR version 1.13 20180428
ID:0x805 N
In
LPDDR3
786MHz
Bus Width=32 Col=10 Bank=8 Row=14/14 CS=2 Die Bus-Width=32 Size=1024MB
ddrconfig:6
OUT

U-Boot SPL 2017.09-rockchip-ayufan-1060-g56bd958253 (Jun 05 2019 - 09:41:25)
board_init_sdmmc_pwr_en
setup_ddr_param  1
booted from SD
Trying to boot from MMC2
NOTICE:  BL31: v1.3(debug):9d3f591
NOTICE:  BL31: Built : 14:39:02, Jan 17 2018
NOTICE:  BL31:Rockchip release version: v1.3
INFO:    ARM GICv2 driver initialized
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 1
INFO:    plat_rockchip_pmu_init: pd status 0xe
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2017.09-rockchip-ayufan-1060-g56bd958253 (Jun 05 2019 - 09:41:31 +0000)

Model: Pine64 Rock64
DRAM:  1022 MiB
MMC:   rksdmmc@ff520000: 0, rksdmmc@ff500000: 1
SF: unrecognized JEDEC id bytes: 5e, 40, 18
*** Warning - spi_flash_probe_bus_cs() failed, using default environment

In:    serial@ff130000
Out:   serial@ff130000
Err:   serial@ff130000
Model: Pine64 Rock64
misc_init_r
cpuid=55524b553339303237000000000e2207
serial=2a73990c9e9d370
Net:   eth0: ethernet@ff540000
Hit any key to stop autoboot:  0
Card did not respond to voltage select!
mmc_init: -95, time 9
switch to partitions #0, OK
mmc1 is current device
** Bad device mmc 1 **
** Bad device mmc 1 **
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   Core Release: 3.10a
USB3:   Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
scanning bus 3 for devices... r8152 Unknown Device
1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
Speed: 1000, full duplex
BOOTP broadcast 1
BOOTP broadcast 2
.....
.....
=> printenv
arch=arm
baudrate=1500000
board=rock64_rk3328
board_name=rock64_rk3328
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc0 mmc1 usb0 pxe dhcp
bootcmd=run distro_bootcmd
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00011:UNDI:003000;setenv bootp_arch 0xb;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_mmc1=setenv devnum 1; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
bootcmd_usb0=setenv devnum 0; run usb_boot
bootdelay=0
cpu=armv8
cpuid#=55524b553339303237000000000e2207
devnum=0
devplist=1
devtype=mmc
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
eth1addr=32:87:c7:a6:0b:1a
ethact=ethernet@ff540000
ethaddr=32:87:c7:a6:0b:fa
fdt_addr_r=0x01f00000
fdtcontroladdr=3df051c8
fdtfile=rockchip/rk3328-rock64.dtb
kernel_addr_r=0x02000000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
partitions=uuid_disk=${uuid_gpt_disk};name=loader1,start=32K,size=4000K,uuid=${uuid_gpt_loader1};name=loader2,start=8MB,size=4MB,uuid=${uuid_gpt_loader2};name=trust,size=4M,uuid=${uuid_gpt_atf};name=boot,size=112M,bootable,uuid=${uuid_gpt_boot};name=rootfs,size=-,uuid=B921B045-1DF0-41C3-AF44-4C6F280D3FAE;
pxefile_addr_r=0x00600000
ramdisk_addr_r=0x04000000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootaa64.efi; then echo Found EFI removable media binary efi/boot/bootaa64.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x00500000
serial#=2a73990c9e9d370
soc=rockchip
stderr=serial@ff130000
stdin=serial@ff130000
stdout=serial@ff130000
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
vendor=rockchip

Environment size: 4098/32764 bytes
But wait! I almost missed this because NetBSD has this annoying habit of wanting the "clear the screen" or some such and when I skipped past all the chatter about BOOTP retries, I missed it:
>> NetBSD/evbarm efiboot (arm64), Revision 1.13 (Thu Aug  4 15:30:37 UTC 2022)
Press return to boot now, any other key for boot prompt
booting netbsd - starting in 0 seconds.
5482464+2521184+2680948+1527188 [437266+711504+498085]=0xf96120

Have any comments? Questions? Drop me a line!

Tom's electronics pages / [email protected]