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 <wigyori@uid0.hu>
-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