Make booting from SD-Card to behave same as from SPI flash
This commit is contained in:
parent
3391398a5f
commit
3f649077b1
|
@ -512,19 +512,34 @@ void spisdcardboot(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_CPU_TYPE_VEXRISCV) && defined(CONFIG_CPU_VARIANT_LINUX)
|
unsigned int result;
|
||||||
if(spi_sdcard_readFile("IMAGE","",MAIN_RAM_BASE+KERNEL_IMAGE_RAM_OFFSET)==0) return;
|
|
||||||
if(spi_sdcard_readFile("ROOTFS~1","CPI",MAIN_RAM_BASE+ROOTFS_IMAGE_RAM_OFFSET)==0) return;
|
|
||||||
if(spi_sdcard_readFile("RV32","DTB",MAIN_RAM_BASE+DEVICE_TREE_IMAGE_RAM_OFFSET)==0) return;
|
|
||||||
if(spi_sdcard_readFile("EMULATOR","BIN",MAIN_RAM_BASE+EMULATOR_IMAGE_RAM_OFFSET)==0) return;
|
|
||||||
|
|
||||||
boot(0,0,0,MAIN_RAM_BASE + EMULATOR_IMAGE_RAM_OFFSET);
|
#if defined(CONFIG_CPU_TYPE_VEXRISCV) && defined(CONFIG_CPU_VARIANT_LINUX)
|
||||||
#else
|
result = spi_sdcard_readFile("IMAGE", "",
|
||||||
if(spi_sdcard_readFile("BOOT","BIN",MAIN_RAM_BASE)==0) {
|
MAIN_RAM_BASE + KERNEL_IMAGE_RAM_OFFSET);
|
||||||
printf("SD Card SPI boot failed\n");
|
|
||||||
|
if(result)
|
||||||
|
result &= spi_sdcard_readFile("ROOTFS~1", "CPI",
|
||||||
|
MAIN_RAM_BASE + ROOTFS_IMAGE_RAM_OFFSET);
|
||||||
|
|
||||||
|
if(result)
|
||||||
|
result &= spi_sdcard_readFile("RV32", "DTB",
|
||||||
|
MAIN_RAM_BASE + DEVICE_TREE_IMAGE_RAM_OFFSET);
|
||||||
|
|
||||||
|
if(result)
|
||||||
|
result &= spi_sdcard_readFile("EMULATOR", "BIN",
|
||||||
|
MAIN_RAM_BASE + EMULATOR_IMAGE_RAM_OFFSET);
|
||||||
|
|
||||||
|
if(result) {
|
||||||
|
boot(0, 0, 0, MAIN_RAM_BASE + EMULATOR_IMAGE_RAM_OFFSET);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
boot(0, 0, 0, MAIN_RAM_BASE);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
result = spi_sdcard_readFile("BOOT", "BIN", MAIN_RAM_BASE);
|
||||||
|
if(result)
|
||||||
|
boot(0, 0, 0, MAIN_RAM_BASE);
|
||||||
|
else
|
||||||
|
printf("SD Card SPI boot failed\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue