From 51976008126d25ed70268ffbe112f24969ed9432 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 10 Jun 2020 17:39:09 +0200 Subject: [PATCH] software/bios/boot: add sdcardboot support for VexRiscv SMP. --- litex/soc/software/bios/boot.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/litex/soc/software/bios/boot.c b/litex/soc/software/bios/boot.c index 9a17b02ee..2c8d844eb 100644 --- a/litex/soc/software/bios/boot.c +++ b/litex/soc/software/bios/boot.c @@ -631,6 +631,29 @@ void sdcardboot(void) boot(0, 0, 0, MAIN_RAM_BASE + EMULATOR_IMAGE_RAM_OFFSET); printf("Unable to load all Linux images, falling back to boot.bin...\n"); #endif + +#if defined(CONFIG_CPU_TYPE_VEXRISCV) && \ + (defined(CONFIG_CPU_VARIANT_1C) || \ + defined(CONFIG_CPU_VARIANT_2C) || \ + defined(CONFIG_CPU_VARIANT_4C) || \ + defined(CONFIG_CPU_VARIANT_8C) || \ + defined(CONFIG_CPU_VARIANT_MP1C) || \ + defined(CONFIG_CPU_VARIANT_MP2C) || \ + defined(CONFIG_CPU_VARIANT_MP4C) || \ + defined(CONFIG_CPU_VARIANT_MP8C)) + printf("Loading Linux images from SDCard to RAM...\n"); + result = copy_image_from_sdcard_to_ram("Image", 0x40000000); + if (result) + result &= copy_image_from_sdcard_to_ram("dtb", 0x40ef0000); + if (result) + result &= copy_image_from_sdcard_to_ram("rootfs.cpio", 0x41000000); + if (result) + result &= copy_image_from_sdcard_to_ram("fw_jump.bin", 0x40f00000); + if (result) + boot(0, 0, 0, 0x40f00000); + printf("Unable to load all Linux images, falling back to boot.bin...\n"); +#endif + result = copy_image_from_sdcard_to_ram("boot.bin", MAIN_RAM_BASE); if(result) boot(0, 0, 0, MAIN_RAM_BASE);