10 #include <libbdk-arch/bdk-warn.h>
11 #include <libbdk-arch/bdk-csrs-rst.h>
12 #include <libbdk-boot/bdk-watchdog.h>
13 #include <libbdk-dram/bdk-dram-config.h>
14 #include <libbdk-dram/bdk-dram-test.h>
15 #include <libbdk-hal/bdk-config.h>
16 #include <libbdk-hal/bdk-utils.h>
17 #include <libbdk-hal/bdk-l2c.h>
18 #include <libdram/libdram-config.h>
26 return bdk_dram_get_size_mbytes(0);
29 #define BDK_RNM_CTL_STATUS 0
30 #define BDK_RNM_RANDOM 0x100000
34 static void rnm_init(
void)
80 int mbytes = bdk_dram_config(0, 0);
82 bdk_error(
"N0: Failed DRAM init\n");
83 die(
"DRAM INIT FAILED !\n");
90 printf(
"N0: DRAM:%s\n", bdk_dram_get_info_string(0));
93 int test_dram = bdk_config_get_int(BDK_CONFIG_DRAM_BOOT_TEST, 0);
95 static const u8 tests[] = {13, 0, 1};
96 for (
size_t i = 0; i <
ARRAY_SIZE(tests); i++) {
98 if (bdk_dram_test(tests[i], 4 *
MiB,
100 BDK_DRAM_TEST_NO_STATS |
101 BDK_DRAM_TEST_NODE0)) {
109 if (bdk_dram_test(13, 4 *
MiB,
111 BDK_DRAM_TEST_NO_STATS |
112 BDK_DRAM_TEST_NODE0)) {
127 if (0 == bdk_numa_master()) {
128 uint64_t l2_size = bdk_l2c_get_cache_size_bytes(0);
129 BDK_TRACE(INIT,
"Unlocking L2\n");
130 bdk_l2c_unlock_mem_region(0, 0, l2_size);
void write64(void *addr, uint64_t val)
uint64_t read64(const void *addr)
void bdk_watchdog_poke(void)
#define BDK_RNM_CTL_STATUS
size_t sdram_size_mb(void)
#define printk(level,...)
void __noreturn die(const char *fmt,...)
uint64_t ecam0_get_bar_val(pci_devfn_t dev, u8 bar)
Get PCI BAR address from cavium specific extended capability.
#define BIOS_INFO
BIOS_INFO - Expected events.
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_CRIT
BIOS_CRIT - Recovery unlikely.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define BIOS_SPEW
BIOS_SPEW - Excessively verbose output.
void sdram_init(const struct sdram_params *param)
#define PCI_DEV(SEGBUS, DEV, FN)
unsigned long long uint64_t