From aafa99eb1b741fd1371701fcf30ce6143500eea5 Mon Sep 17 00:00:00 2001 From: Zoltan HERPAI Date: Fri, 15 Mar 2024 14:03:33 +0100 Subject: [PATCH] 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 --- target/linux/starfive/image/mmc.bootscript.jh7110 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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 -- 2.30.2