bios: make SPI SDCard boot configs other than linux-on-litex-vexriscv
authorGabriel Somlo <gsomlo@gmail.com>
Thu, 19 Mar 2020 23:36:24 +0000 (19:36 -0400)
committerGabriel Somlo <gsomlo@gmail.com>
Thu, 19 Mar 2020 23:37:47 +0000 (19:37 -0400)
When NOT on linux-on-litex-vexriscv, we load 'boot.bin' to MAIN_RAM_BASE,
and jump to it.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
litex/soc/software/bios/boot.c

index b132a8126dc8fe2c474b5a2925992ac0e5837d69..24937ec122f8fb92b33dfd64c1e713bd43076780 100644 (file)
@@ -505,11 +505,19 @@ void spisdcardboot(void)
                return;
        }
 
+#if defined(CONFIG_CPU_TYPE_VEXRISCV) && defined(CONFIG_CPU_VARIANT_LINUX)
        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",EMULATOR_RAM_BASE)==0) return;
 
        boot(0,0,0,EMULATOR_RAM_BASE + EMULATOR_IMAGE_RAM_OFFSET);
+#else
+       if(spi_sdcard_readFile("BOOT","BIN",MAIN_RAM_BASE)==0) {
+               printf("SD Card SPI boot failed\n");
+               return;
+       }
+       boot(0, 0, 0, MAIN_RAM_BASE);
+#endif
 }
 #endif