From 7d48ac5c7dfb52fc470bbad1013b4d460bc6a1e0 Mon Sep 17 00:00:00 2001 From: David Hendricks Date: Fri, 9 Mar 2018 14:30:38 -0800 Subject: soc/cavium: Integrate BDK files into coreboot * Make it compile. * Fix whitespace errors. * Fix printf formats. * Add missing headers includes * Guard headers with ifdefs Compile DRAM init code in romstage. Compile QLM, PCIe, RNG, PHY, GPIO, MDIO init code in ramstage. Change-Id: I0a93219a14bfb6ebe41103a825d5032b11e7f2c6 Signed-off-by: David Hendricks Reviewed-on: https://review.coreboot.org/25089 Reviewed-by: Philipp Deppenwiese Tested-by: build bot (Jenkins) --- src/vendorcode/cavium/include/bdk/libbdk-dram/bdk-dram-config.h | 9 +++++++++ src/vendorcode/cavium/include/bdk/libbdk-dram/bdk-dram-test.h | 8 +++++++- src/vendorcode/cavium/include/bdk/libbdk-dram/bdk-dram.h | 5 +++++ 3 files changed, 21 insertions(+), 1 deletion(-) (limited to 'src/vendorcode/cavium/include/bdk/libbdk-dram') diff --git a/src/vendorcode/cavium/include/bdk/libbdk-dram/bdk-dram-config.h b/src/vendorcode/cavium/include/bdk/libbdk-dram/bdk-dram-config.h index 84488597b4..d50a76dd32 100644 --- a/src/vendorcode/cavium/include/bdk/libbdk-dram/bdk-dram-config.h +++ b/src/vendorcode/cavium/include/bdk/libbdk-dram/bdk-dram-config.h @@ -1,3 +1,6 @@ +#ifndef __CB_BDK_DRAM_CONFIG_H__ +#define __CB_BDK_DRAM_CONFIG_H__ + /***********************license start*********************************** * Copyright (c) 2003-2017 Cavium Inc. (support@cavium.com). All rights * reserved. @@ -47,7 +50,11 @@ * @defgroup dram DRAM related functions * @{ */ +#if 0 +/* FIXME(dhendrix): this was cavium's #include */ #include "../libdram/libdram.h" +#endif +#include /** * Lookup a DRAM configuration by name and intialize dram with it @@ -116,3 +123,5 @@ extern uint32_t __bdk_dram_get_col_mask(bdk_node_t node, int lmc); extern int __bdk_dram_get_num_bank_bits(bdk_node_t node, int lmc); /** @} */ + +#endif /* !__CB_BDK_DRAM_CONFIG_H__ */ diff --git a/src/vendorcode/cavium/include/bdk/libbdk-dram/bdk-dram-test.h b/src/vendorcode/cavium/include/bdk/libbdk-dram/bdk-dram-test.h index f6be005995..60f07fa0c5 100644 --- a/src/vendorcode/cavium/include/bdk/libbdk-dram/bdk-dram-test.h +++ b/src/vendorcode/cavium/include/bdk/libbdk-dram/bdk-dram-test.h @@ -1,3 +1,6 @@ +#ifndef __CB_BDK_DRAM_TEST_H__ +#define __CB_BDK_DRAM_TEST_H__ + /***********************license start*********************************** * Copyright (c) 2003-2017 Cavium Inc. (support@cavium.com). All rights * reserved. @@ -145,7 +148,8 @@ extern void bdk_dram_test_inject_error(uint64_t address, int bit); /* Keep the counts per memory channel (LMC) for more detail. */ #define BDK_MAX_MEM_CHANS 4 extern int64_t __bdk_dram_ecc_single_bit_errors[BDK_MAX_MEM_CHANS]; -extern int64_t __bdk_dram_ecc_double_bit_errors[BDK_MAX_MEM_CHANS]; +/* FIXME(dhendrix): redundant declaration in original BDK */ +//extern int64_t __bdk_dram_ecc_double_bit_errors[BDK_MAX_MEM_CHANS]; /* These are internal support functions */ extern void __bdk_dram_flush_to_mem(uint64_t address); @@ -196,3 +200,5 @@ extern int __bdk_dram_test_fast_scan(uint64_t area, uint64_t max_address, int bu /** @} */ + +#endif /* !__CB_BDK_DRAM_TEST_H__ */ diff --git a/src/vendorcode/cavium/include/bdk/libbdk-dram/bdk-dram.h b/src/vendorcode/cavium/include/bdk/libbdk-dram/bdk-dram.h index a4eb32805c..99393154e6 100644 --- a/src/vendorcode/cavium/include/bdk/libbdk-dram/bdk-dram.h +++ b/src/vendorcode/cavium/include/bdk/libbdk-dram/bdk-dram.h @@ -1,3 +1,6 @@ +#ifndef __CB_BDK_DRAM_H__ +#define __CB_BDK_DRAM_H__ + /***********************license start*********************************** * Copyright (c) 2003-2017 Cavium Inc. (support@cavium.com). All rights * reserved. @@ -52,3 +55,5 @@ #include "bdk-dram-test.h" /** @} */ + +#endif /* !__CB_BDK_DRAM_H__ */ -- cgit v1.2.3