From: Florent Kermarrec Date: Tue, 14 Jul 2015 15:33:24 +0000 (+0200) Subject: bios: add romboot X-Git-Tag: 24jan2021_ls180~2206 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=35250f5b110da0749929f160ceb21f0286fb01b9;p=litex.git bios: add romboot When firmware is small enough, it can be interesting to run code from an embedded blockram memory (faster and not impacted by memory controller activity). It can also be a fallback option in case boot from flash failed. To use this, define ROM_BOOT_ADDRESS and initialize the blockram with the firmware data. --- diff --git a/software/bios/boot.c b/software/bios/boot.c index b40e6598..54b77899 100644 --- a/software/bios/boot.c +++ b/software/bios/boot.c @@ -269,3 +269,14 @@ void flashboot(void) boot(0, 0, 0, MAIN_RAM_BASE); } #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 + activity). Define ROM_BOOT_ADDRESS for that and initialize the blockram + with the firmware data. */ +void romboot(void) +{ + boot(0, 0, 0, ROM_BOOT_ADDRESS); +} +#endif diff --git a/software/bios/boot.h b/software/bios/boot.h index 97a30e52..aa9cd88a 100644 --- a/software/bios/boot.h +++ b/software/bios/boot.h @@ -4,5 +4,6 @@ void serialboot(void); void netboot(void); void flashboot(void); +void romboot(void); #endif /* __BOOT_H */ diff --git a/software/bios/main.c b/software/bios/main.c index 938ebe3e..2a9aaa98 100644 --- a/software/bios/main.c +++ b/software/bios/main.c @@ -325,6 +325,9 @@ static void help(void) puts("serialboot - boot via SFL"); #ifdef FLASH_BOOT_ADDRESS puts("flashboot - boot from flash"); +#endif +#ifdef ROM_BOOT_ADDRESS + puts("romboot - boot from embedded rom"); #endif puts("revision - display revision"); #ifdef CSR_SDRAM_BASE @@ -365,6 +368,9 @@ static void do_command(char *c) #ifdef FLASH_BOOT_ADDRESS else if(strcmp(token, "flashboot") == 0) flashboot(); +#endif +#ifdef ROM_BOOT_ADDRESS + else if(strcmp(token, "romboot") == 0) romboot(); #endif else if(strcmp(token, "serialboot") == 0) serialboot(); #ifdef CSR_ETHMAC_BASE @@ -506,6 +512,9 @@ static void boot_sequence(void) if(test_user_abort()) { #ifdef FLASH_BOOT_ADDRESS flashboot(); +#endif +#ifdef ROM_BOOT_ADDRESS + romboot(); #endif serialboot(); #ifdef CSR_ETHMAC_BASE