software/bios/boot: add sdcardboot support for VexRiscv SMP.

This commit is contained in:
Florent Kermarrec 2020-06-10 17:39:09 +02:00
parent 72026d44f7
commit 5197600812
1 changed files with 23 additions and 0 deletions

View File

@ -631,6 +631,29 @@ void sdcardboot(void)
boot(0, 0, 0, MAIN_RAM_BASE + EMULATOR_IMAGE_RAM_OFFSET); boot(0, 0, 0, MAIN_RAM_BASE + EMULATOR_IMAGE_RAM_OFFSET);
printf("Unable to load all Linux images, falling back to boot.bin...\n"); printf("Unable to load all Linux images, falling back to boot.bin...\n");
#endif #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); result = copy_image_from_sdcard_to_ram("boot.bin", MAIN_RAM_BASE);
if(result) if(result)
boot(0, 0, 0, MAIN_RAM_BASE); boot(0, 0, 0, MAIN_RAM_BASE);