software/bios/libbase: Always do memtest/memspeed when main_ram is present.
- Enable memtest/memspeed on design with HyperRAM. - Allow comparisons between SDRAM/HyperRAM and integrated RAM.
This commit is contained in:
parent
4acbafbc19
commit
82daa48e09
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
#include <libbase/console.h>
|
#include <libbase/console.h>
|
||||||
#include <libbase/crc.h>
|
#include <libbase/crc.h>
|
||||||
|
#include <libbase/memtest.h>
|
||||||
|
|
||||||
#include <libbase/spiflash.h>
|
#include <libbase/spiflash.h>
|
||||||
#include <libbase/uart.h>
|
#include <libbase/uart.h>
|
||||||
|
@ -153,7 +154,7 @@ __attribute__((__used__)) int main(int i, char **c)
|
||||||
|
|
||||||
sdr_ok = 1;
|
sdr_ok = 1;
|
||||||
|
|
||||||
#if defined(CSR_ETHMAC_BASE) || defined(CSR_SDRAM_BASE) || defined(CSR_SPIFLASH_CORE_BASE)
|
#if defined(CSR_ETHMAC_BASE) || defined(MAIN_RAM_BASE) || defined(CSR_SPIFLASH_CORE_BASE)
|
||||||
printf("--========== \e[1mInitialization\e[0m ============--\n");
|
printf("--========== \e[1mInitialization\e[0m ============--\n");
|
||||||
#ifdef CSR_ETHMAC_BASE
|
#ifdef CSR_ETHMAC_BASE
|
||||||
eth_init();
|
eth_init();
|
||||||
|
@ -161,8 +162,9 @@ __attribute__((__used__)) int main(int i, char **c)
|
||||||
#ifdef CSR_SDRAM_BASE
|
#ifdef CSR_SDRAM_BASE
|
||||||
sdr_ok = sdram_init();
|
sdr_ok = sdram_init();
|
||||||
#else
|
#else
|
||||||
#ifdef MAIN_RAM_TEST
|
#ifdef MAIN_RAM_BASE
|
||||||
sdr_ok = memtest();
|
sdr_ok = memtest((unsigned int *) MAIN_RAM_BASE, min(MAIN_RAM_SIZE, MEMTEST_DATA_SIZE));
|
||||||
|
memspeed((unsigned int *) MAIN_RAM_BASE, min(MAIN_RAM_SIZE, MEMTEST_DATA_SIZE), false, 0);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if (sdr_ok != 1)
|
if (sdr_ok != 1)
|
||||||
|
|
|
@ -3,6 +3,16 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#include <generated/csr.h>
|
||||||
|
#include <generated/soc.h>
|
||||||
|
|
||||||
|
#define max(x, y) (((x) > (y)) ? (x) : (y))
|
||||||
|
#define min(x, y) (((x) < (y)) ? (x) : (y))
|
||||||
|
|
||||||
|
#ifndef MEMTEST_DATA_SIZE
|
||||||
|
#define MEMTEST_DATA_SIZE (2*1024*1024)
|
||||||
|
#endif
|
||||||
|
|
||||||
// Called when an error is encountered. Can return non-zero to stop the memtest.
|
// Called when an error is encountered. Can return non-zero to stop the memtest.
|
||||||
// `arg` can be used to pass arbitrary data to the callback via `memtest_config.arg`.
|
// `arg` can be used to pass arbitrary data to the callback via `memtest_config.arg`.
|
||||||
typedef int (*on_error_callback)(unsigned int addr, unsigned int rdata, unsigned int refdata, void *arg);
|
typedef int (*on_error_callback)(unsigned int addr, unsigned int rdata, unsigned int refdata, void *arg);
|
||||||
|
|
|
@ -55,10 +55,6 @@ __attribute__((unused)) void cdelay(int i)
|
||||||
/* Constants */
|
/* Constants */
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef MEMTEST_DATA_SIZE
|
|
||||||
#define MEMTEST_DATA_SIZE (2*1024*1024)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define DFII_PIX_DATA_BYTES SDRAM_PHY_DFI_DATABITS/8
|
#define DFII_PIX_DATA_BYTES SDRAM_PHY_DFI_DATABITS/8
|
||||||
|
|
||||||
int sdram_get_databits(void) {
|
int sdram_get_databits(void) {
|
||||||
|
|
Loading…
Reference in New Issue