From: Zoltan HERPAI Date: Fri, 15 Mar 2024 13:03:33 +0000 (+0100) Subject: starfive: support mmc0/1 boot/rootdevices X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c98137088f4c9ae678fb55c1b61044ecbf1fa350;p=openwrt%2Fstaging%2Fwigyori.git starfive: support mmc0/1 boot/rootdevices The Visionfive2 board uses mmc1 as the SD-card (with mmc0 being an eMMC module). Upcoming boards have only mmc device - prepare support for them as well. Signed-off-by: Zoltan HERPAI --- diff --git a/target/linux/starfive/image/mmc.bootscript.jh7110 b/target/linux/starfive/image/mmc.bootscript.jh7110 index aeb2e82275..1789ee5d7a 100644 --- a/target/linux/starfive/image/mmc.bootscript.jh7110 +++ b/target/linux/starfive/image/mmc.bootscript.jh7110 @@ -1,5 +1,13 @@ -fatload mmc 1:3 0xa0000000 Image -fatload mmc 1:3 0x46000000 dtb +if mmc dev 1; then + setenv mmcdev 1 + setenv rootdev 'root=/dev/mmcblk1p4' +elif mmc dev 0; then + setenv mmcdev 0 + setenv rootdev 'root=/dev/mmcblk0p4' +fi + +fatload mmc ${mmcdev}:3 0xa0000000 Image +fatload mmc ${mmcdev}:3 0x46000000 dtb run chipa_set_linux -setenv bootargs "earlyprintk console=ttyS0,115200 debug rootwait earlycon=sbi root=/dev/mmcblk1p4" +setenv bootargs "earlyprintk console=ttyS0,115200 debug rootwait earlycon=sbi $rootdev" booti 0xa0000000 - 0x46000000