mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
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.
This commit is contained in:
parent
6c13879fb6
commit
35250f5b11
3 changed files with 21 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -4,5 +4,6 @@
|
|||
void serialboot(void);
|
||||
void netboot(void);
|
||||
void flashboot(void);
|
||||
void romboot(void);
|
||||
|
||||
#endif /* __BOOT_H */
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue