]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
rockchip: fix boot from non-MMC devices 14398/head
authorJustin Klaassen <justin@tidylabs.app>
Sat, 13 Jan 2024 20:28:57 +0000 (20:28 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 19 Jan 2024 20:31:39 +0000 (21:31 +0100)
Booting from non-MMC devices on Rockchip targets without this
change results in a boot failure:

Model: FriendlyElec NanoPi R5S
Net:   eth0: ethernet@fe2a0000
Hit any key to stop autoboot:  0
** Booting bootflow 'nvme#0.blk#1.bootdev.part_1' with script
** No partition table - mmc 0 **
** No partition table - mmc 0 **
Couldn't find partition mmc 0:1
Can't set block device
Wrong Image Type for bootm command
ERROR -91: Protocol wrong type for socket: can't get kernel image!
Boot failed (err=1)

This change fixes the default boot script for Rockchip targets to
support booting from non-MMC devices such as NVMe or USB drives.

Some targets with only a boot rom (e.g. NanoPi R5S) may require u-boot
to be installed on the eMMC or a MicroSD card in order to boot from
non-MMC devices.

Fixes: #14420
Reviewed-by: Tianling Shen <cnsztl@immortalwrt.org>
Signed-off-by: Justin Klaassen <justin@tidylabs.app>
target/linux/rockchip/image/Makefile
target/linux/rockchip/image/default.bootscript [moved from target/linux/rockchip/image/mmc.bootscript with 80% similarity]

index d34948f6aed98c915152b2729086785ecdb68d81..5de053bdb6bbb9a93877bfc40fccf49aa077b491 100644 (file)
@@ -21,7 +21,7 @@ endef
 
 define Build/boot-script
        # Make an U-boot image and copy it to the boot partition
-       mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d $(if $(1),$(1),mmc).bootscript $@.boot/boot.scr
+       mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d $(if $(1),$(1),default).bootscript $@.boot/boot.scr
 endef
 
 define Build/pine64-img
similarity index 80%
rename from target/linux/rockchip/image/mmc.bootscript
rename to target/linux/rockchip/image/default.bootscript
index 60b59e1b6b73c65a676ae9c06f3d94e1153e6aa9..e9de14ff7ac018e430216e01acc2274e6208067a 100644 (file)
@@ -1,4 +1,4 @@
-part uuid mmc ${devnum}:2 uuid
+part uuid ${devtype} ${devnum}:2 uuid
 
 if test $stdout = 'serial@fe660000' ;
 then serial_addr=',0xfe660000';
@@ -10,6 +10,6 @@ fi;
 
 setenv bootargs "console=ttyS2,1500000 console=tty1 earlycon=uart8250,mmio32${serial_addr} swiotlb=1 root=PARTUUID=${uuid} rw rootwait";
 
-load mmc ${devnum}:1 ${kernel_addr_r} kernel.img
+load ${devtype} ${devnum}:1 ${kernel_addr_r} kernel.img
 
 bootm ${kernel_addr_r}