> From: Steffen Beyer <stef...@beyer.io> > Date: Sat, 3 Aug 2024 14:11:34 +0200 > > Good evening, > > I’m running into trouble getting OpenBSD 7.5 to run on my R6S. The > instructions in INSTALL.arm64 only mention RK356x explicitly, so I > went with that: > > # pkg_add u-boot-rk3588 > # cp /usr/local/share/u-boot/nanopi-r6s-rk3588s/u-boot-rockchip.bin . > # dd if=u-boot-rockchip.bin of=miniroot75_u-boot-rockchip.img \ > seek=64 conv=notrunc > > ...trying to boot that image from SD card. But U-Boot gets stuck: > > > DDR V1.12 52218f4949 cym 23/07/06-19:46:50 > LPDDR4X, 2112MHz > channel[0] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB > channel[1] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB > channel[2] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB > channel[3] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB > Manufacturer ID:0x1 > CH0 RX Vref:26.3%, TX Vref:19.8%,20.8% > CH1 RX Vref:26.7%, TX Vref:20.8%,20.8% > CH2 RX Vref:27.5%, TX Vref:20.8%,19.8% > CH3 RX Vref:27.1%, TX Vref:21.8%,21.8% > change to F1: 528MHz > change to F2: 1068MHz > change to F3: 1560MHz > change to F0: 2112MHz > out > U-Boot SPL board init > U-Boot SPL 2017.09-g82417168bf-230508 #root (Sep 08 2023 - 20:53:43) > unknown raw ID 0 0 0 > unrecognized JEDEC id bytes: 00, 00, 00 > Trying to boot from MMC2 > part_get_info_efi: *** ERROR: Invalid GPT *** > part_get_info_efi: *** Using Backup GPT *** > Magic is incorrect. > Error validating A/B metadata from disk. Resetting and writing new A/B > metadata to disk. > SPL: A/B-slot: _a, successful: 0, tries-remain: 7 > Trying fit image at 0x4000 sector > ## Verified-boot: 0 > ## Checking atf-1 0x00040000 ... sha256(b40ce543bb...) + OK > ## Checking u-boot 0x00a00000 ... sha256(f4f330e67c...) + OK > ## Checking fdt-1 0x00ac46e0 ... sha256(eaf416bfba...) + OK > ## Checking atf-2 0x000f0000 ... sha256(f202de33d9...) + OK > ## Checking atf-3 0xff100000 ... sha256(af08976afd...) + OK > Jumping to U-Boot(0x00a00000) via ARM Trusted Firmware(0x00040000) > Total: 376.682/529.613 ms > > INFO: Preloader serial: 2 > NOTICE: BL31: v2.3():v2.3-616-gdc1125f48:finley.xiao > NOTICE: BL31: Built : 16:41:17, Jul 13 2023 > INFO: spec: 0x13 > INFO: ext 32k is valid > INFO: ddr: stride-en 4CH > INFO: GICv3 without legacy support detected. > INFO: ARM GICv3 driver initialized in EL3 > INFO: valid_cpu_msk=0xff bcore0_rst = 0x0, bcore1_rst = 0x0 > INFO: system boots from cpu-hwid-0 > INFO: idle_st=0x21fff, pd_st=0x11fff9, repair_st=0xfff70001 > INFO: dfs DDR fsp_params[0].freq_mhz= 2112MHz > INFO: dfs DDR fsp_params[1].freq_mhz= 528MHz > INFO: dfs DDR fsp_params[2].freq_mhz= 1068MHz > INFO: dfs DDR fsp_params[3].freq_mhz= 1560MHz > INFO: BL31: Initialising Exception Handling Framework > 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 = 0xa00000 > INFO: SPSR = 0x3c9 > > > With miniroot and U-Boot package from snapshot (August 2nd) the result is > slightly > different: > > > DDR Version V1.08 20220617 > LPDDR4X, 2112MHz > channel[0] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB > channel[1] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB > channel[2] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB > channel[3] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB > Manufacturer ID:0x1 Samsung > CH0 RX Vref:30.7%, TX Vref:19.8%,20.8% > CH1 RX Vref:31.7%, TX Vref:20.8%,20.8% > CH2 RX Vref:30.7%, TX Vref:20.8%,19.8% > CH3 RX Vref:32.7%, TX Vref:21.8%,21.8% > change to F1: 528MHz > change to F2: 1068MHz > change to F3: 1560MHz > change to F0: 2112MHz > out > U-Boot SPL board init > U-Boot SPL 2017.09-gc060f28d70-220414 #zyf (Apr 18 2022 - 18:13:34) > Failed to set cpub01 > Failed to set cpub23 > unknown raw ID phN > unrecognized JEDEC id bytes: 00, 00, 00 > Trying to boot from MMC2 > part_get_info_efi: *** ERROR: Invalid GPT *** > GUID Partition Table Header signature is wrong: 0xX != 0xX > part_get_info_efi: *** ERROR: Invalid Backup GPT *** > part_get_info_efi: *** ERROR: Invalid GPT *** > GUID Partition Table Header signature is wrong: 0xX != 0xX > part_get_info_efi: *** ERROR: Invalid Backup GPT *** > spl: partition error > Trying fit image at 0x4000 sector > ## Verified-boot: 0 > ## Checking atf-1 0x00040000 ... sha256(a7d1d8d191...) + OK > ## Checking u-boot 0x00a00000 ... sha256(678e24dde1...) + OK > ## Checking fdt-1 0x00ac9b50 ... sha256(5d8d2315ba...) + OK > ## Checking atf-2 0x000f0000 ... sha256(aa71013e72...) + OK > ## Checking atf-3 0xff100000 ... sha256(4b2065349b...) + OK > Jumping to U-Boot(0x00a00000) via ARM Trusted Firmware(0x00040000) > Total: 370.636 ms > > INFO: Preloader serial: 2 > NOTICE: BL31: v2.3():v2.3-682-g4ca8a8422:derrick.huang, fwver: v1.45 > NOTICE: BL31: Built : 10:11:21, Dec 27 2023 > INFO: spec: 0x13 > INFO: code: 0x88 > INFO: ext 32k is valid > INFO: ddr: stride-en 4CH > INFO: GICv3 without legacy support detected. > INFO: ARM GICv3 driver initialized in EL3 > INFO: valid_cpu_msk=0xff bcore0_rst = 0x0, bcore1_rst = 0x0 > INFO: l3 cache partition cfg-0 > INFO: system boots from cpu-hwid-0 > INFO: disable memory repair > INFO: idle_st=0x21fff, pd_st=0x11fff9, repair_st=0xfff70001 > ERROR: dfs get fsp_params[0] error, 0xfead0001 != 0xfead0004 > ERROR: dfs get fsp_params[1] error, 0xa54 != 0xfead0004 > ERROR: dfs get fsp_params[2] error, 0xbc != 0xfead0004 > ERROR: dfs get fsp_params[3] error, 0x3f0033 != 0xfead0004 > ERROR: loader&trust unmatch!!! Please update loader if need enable dmc > ERROR: current trust bl31 need match with loader ddr bin V1.13 or newer > ERROR: current loader need match with trust bl31 V1.07-V1.37 > INFO: BL31: Initialising Exception Handling Framework > 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 = 0xa00000 > INFO: SPSR = 0x3c9 > > > (Yes, I bricked and unbricked the machine in between, that's why the > DDR version changed.) > > Ideal would be to install OpenBSD to eMMC, but SD would do. > > Where is my mistake?
Two issues: 1. You're using serial console rate of 1500000 baud. But the U-Boot from OpenBSD packages uses 115200 (because 1500000 isn't supported by many USB serial dongles and often unreliable with the ones that do support it). 2. You still have the first bootloader stages (DRAM initialization and U-Boot SPL) from the vendor firmware in SPI flash or on eMMC. Those will be incompatible with the U-Boot from OpenBSD packages and OpenBSD's kernel. I don't think the NanoPi R6S has SPI flash, so it must be the eMMC that's the problem. My recommendation would be to erase the first 32MB or so of the eMMC. You could do this from Linux or the (vendor) U-Boot. Something like: # mmc erase 0 65536 after first selecting the eMMC using the "mmc dev" command should do the trick. > As a side question, is it possible to use RockChip's RKDevTool to > flash the eMMC? It is parameterised with partitions like this: > > FIRMWARE_VER: 12.0 > MACHINE_MODEL: RK3588 > MACHINE_ID: 007 > MANUFACTURER: RK3588 > MAGIC: 0x5041524B > ATAG: 0x00200800 > MACHINE: NanoPi6 > CHECK_MASK: 0x80 > PWR_HLD: 0,0,A,0,1 > TYPE: GPT > CMDLINE: mtdparts=rk29xxnand: \ > 0x00002000@0x00004000(uboot), \ > 0x00002000@0x00006000(misc), \ > 0x00002000@0x00008000(dtbo), \ > 0x00008000@0x0000a000(resource), \ > 0x00014000@0x00012000(kernel), \ > 0x00010000@0x00026000(boot), \ > 0x00010000@0x00036000(recovery), \ > 0x00120000@0x00046000(rootfs), \ > -@0x00166000(userdata:grow) In theory it should be possible, but I don't think that partition layout is compatible with mainline U-Boot and OpenBSD's installer. It should be possible to boot the OpenBSD installer from uSD card and then install on the eMMC. But I'm not 100% confident the eMMC on the NanoPi R6S will work with OpenBSD. You will have to install U-Boot on the eMMC yourself after installation. Or use a uSD card with just U-Boot on it as your "servicable firmware".