From: Florent Kermarrec Date: Sat, 4 May 2019 09:27:01 +0000 (+0200) Subject: bios/boot: add specific flash_boot for linux with vexriscv X-Git-Tag: 24jan2021_ls180~1240 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fcd518b5d03233450965a968e55c52b82125942d;p=litex.git bios/boot: add specific flash_boot for linux with vexriscv --- diff --git a/litex/soc/software/bios/boot.c b/litex/soc/software/bios/boot.c index 877b719e..6ff682db 100644 --- a/litex/soc/software/bios/boot.c +++ b/litex/soc/software/bios/boot.c @@ -304,6 +304,28 @@ void netboot(void) #endif +#ifdef FLASHBOOT_LINUX_VEXRISCV + +/* TODO: add configurable flash mapping, improve integration */ + +void flashboot(void) +{ + printf("Loading Image from flash...\n"); + memcpy((void *)MAIN_RAM_BASE + 0x00000000, (void *)0x50400000, 0x400000); + + printf("Loading rootfs.cpio from flash...\n"); + memcpy((void *)MAIN_RAM_BASE + 0x02000000, (void *)0x50800000, 0x700000); + + printf("Loading rv32.dtb from flash...\n"); + memcpy((void *)MAIN_RAM_BASE + 0x03000000, (void *)0x50f00000, 0x001000); + + printf("Loading emulator.bin from flash...\n"); + memcpy((void *)EMULATOR_RAM_BASE + 0x00000000, (void *)0x50f80000, 0x004000); + + boot(0, 0, 0, EMULATOR_RAM_BASE); +} +#else + #ifdef FLASH_BOOT_ADDRESS /* On systems with exernal SDRAM we copy out of the SPI flash into the SDRAM @@ -346,6 +368,8 @@ void flashboot(void) } #endif +#endif + #ifdef ROM_BOOT_ADDRESS /* When firmware is small enough, it can be interesting to run code from an embedded blockram memory (faster and not impacted by memory controller