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) --- .../cavium/bdk/libbdk-dram/bdk-dram-config.c | 24 ++++++---------------- 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'src/vendorcode/cavium/bdk/libbdk-dram/bdk-dram-config.c') diff --git a/src/vendorcode/cavium/bdk/libbdk-dram/bdk-dram-config.c b/src/vendorcode/cavium/bdk/libbdk-dram/bdk-dram-config.c index 3465c5d98b..5c104231dc 100644 --- a/src/vendorcode/cavium/bdk/libbdk-dram/bdk-dram-config.c +++ b/src/vendorcode/cavium/bdk/libbdk-dram/bdk-dram-config.c @@ -37,7 +37,9 @@ * ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU. ***********************license end**************************************/ #include -#include +#include +#include +#include BDK_REQUIRE_DEFINE(DRAM_CONFIG); @@ -72,22 +74,6 @@ int bdk_dram_config(int node, int ddr_clock_override) return mbytes; } -/** - * Do DRAM configuration tuning - * - * @param node Node to tune - * - * @return Success or Fail - */ -int bdk_dram_tune(int node) -{ - int ret; - BDK_TRACE(DRAM, "N%d: Starting DRAM tuning\n", node); - ret = libdram_tune(node); - BDK_TRACE(DRAM, "N%d: DRAM tuning returned %d\n", node, ret); - return ret; -} - /** * Do all the DRAM Margin tests * @@ -144,7 +130,9 @@ uint64_t bdk_dram_get_top_of_bdk(void) * the address to make it a physical offset. Doing this simplifies the * address checks and calculations which only work with physical offsets. */ - uint64_t top_of_bdk = (bdk_ptr_to_phys(sbrk(0)) & bdk_build_mask(40)); + /* FIXME(dhendrix): we only care about node 0 */ +// uint64_t top_of_bdk = (bdk_ptr_to_phys(sbrk(0)) & bdk_build_mask(40)); + uint64_t top_of_bdk = 0; uint64_t l2_size = bdk_l2c_get_cache_size_bytes(bdk_numa_master()); if (top_of_bdk <= l2_size) { -- cgit v1.2.3