bios/boot: add separators, update copyrights.

This commit is contained in:
Florent Kermarrec 2020-06-11 13:19:37 +02:00
parent f4abdd3f2c
commit 7b65a93ca5
1 changed files with 39 additions and 11 deletions

View File

@ -1,5 +1,5 @@
// This file is Copyright (c) 2014-2020 Florent Kermarrec <florent@enjoy-digital.fr>
// This file is Copyright (c) 2013-2014 Sebastien Bourdeauducq <sb@m-labs.hk> // This file is Copyright (c) 2013-2014 Sebastien Bourdeauducq <sb@m-labs.hk>
// This file is Copyright (c) 2014-2019 Florent Kermarrec <florent@enjoy-digital.fr>
// This file is Copyright (c) 2018 Ewen McNeill <ewen@naos.co.nz> // This file is Copyright (c) 2018 Ewen McNeill <ewen@naos.co.nz>
// This file is Copyright (c) 2018 Felix Held <felix-github@felixheld.de> // This file is Copyright (c) 2018 Felix Held <felix-github@felixheld.de>
// This file is Copyright (c) 2019 Gabriel L. Somlo <gsomlo@gmail.com> // This file is Copyright (c) 2019 Gabriel L. Somlo <gsomlo@gmail.com>
@ -35,9 +35,17 @@
#include <liblitesdcard/sdcard.h> #include <liblitesdcard/sdcard.h>
#include <liblitesdcard/fat/ff.h> #include <liblitesdcard/fat/ff.h>
/*-----------------------------------------------------------------------*/
/* Helpers */
/*-----------------------------------------------------------------------*/
#define max(x, y) (((x) > (y)) ? (x) : (y)) #define max(x, y) (((x) > (y)) ? (x) : (y))
#define min(x, y) (((x) < (y)) ? (x) : (y)) #define min(x, y) (((x) < (y)) ? (x) : (y))
/*-----------------------------------------------------------------------*/
/* Boot */
/*-----------------------------------------------------------------------*/
extern void boot_helper(unsigned long r1, unsigned long r2, unsigned long r3, unsigned long addr); extern void boot_helper(unsigned long r1, unsigned long r2, unsigned long r3, unsigned long addr);
static void __attribute__((noreturn)) boot(unsigned long r1, unsigned long r2, unsigned long r3, unsigned long addr) static void __attribute__((noreturn)) boot(unsigned long r1, unsigned long r2, unsigned long r3, unsigned long addr)
@ -73,6 +81,25 @@ enum {
ACK_OK ACK_OK
}; };
/*-----------------------------------------------------------------------*/
/* ROM Boot */
/*-----------------------------------------------------------------------*/
#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
/*-----------------------------------------------------------------------*/
/* Serial Boot */
/*-----------------------------------------------------------------------*/
static int check_ack(void) static int check_ack(void)
{ {
int recognized; int recognized;
@ -241,6 +268,10 @@ int serialboot(void)
return 1; return 1;
} }
/*-----------------------------------------------------------------------*/
/* Ethernet Boot */
/*-----------------------------------------------------------------------*/
#ifdef CSR_ETHMAC_BASE #ifdef CSR_ETHMAC_BASE
#ifndef LOCALIP1 #ifndef LOCALIP1
@ -355,6 +386,10 @@ void netboot(void)
#endif #endif
/*-----------------------------------------------------------------------*/
/* Flash Boot */
/*-----------------------------------------------------------------------*/
#ifdef FLASH_BOOT_ADDRESS #ifdef FLASH_BOOT_ADDRESS
/* On systems with external SDRAM we copy out of the SPI flash into the SDRAM /* On systems with external SDRAM we copy out of the SPI flash into the SDRAM
@ -498,16 +533,9 @@ void flashboot(void)
} }
#endif #endif
#ifdef ROM_BOOT_ADDRESS /*-----------------------------------------------------------------------*/
/* When firmware is small enough, it can be interesting to run code from an /* SDCard Boot */
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
#if defined(CSR_SPISDCARD_BASE) || defined(CSR_SDCORE_BASE) #if defined(CSR_SPISDCARD_BASE) || defined(CSR_SDCORE_BASE)