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/bdk/libdram/dram-print.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/vendorcode/cavium/bdk/libdram/dram-print.h') diff --git a/src/vendorcode/cavium/bdk/libdram/dram-print.h b/src/vendorcode/cavium/bdk/libdram/dram-print.h index 94cdf92fbf..a29ba6bc4c 100644 --- a/src/vendorcode/cavium/bdk/libdram/dram-print.h +++ b/src/vendorcode/cavium/bdk/libdram/dram-print.h @@ -69,6 +69,8 @@ extern dram_verbosity_t dram_verbosity; #define is_verbosity_special(level) (((int)(dram_verbosity & 0xf0) & (level)) != 0) #define dram_is_verbose(level) (((level) & VBL_SPECIAL) ? is_verbosity_special(level) : is_verbosity_level(level)) +/* FIXME(dhendrix): printf... */ +#if 0 #define VB_PRT(level, format, ...) \ do { \ if (dram_is_verbose(level)) \ @@ -84,3 +86,20 @@ extern dram_verbosity_t dram_verbosity; #else #define debug_print(format, ...) do {} while (0) #endif +#endif +#include +#define VB_PRT(level, format, ...) \ + do { \ + if (dram_is_verbose(level)) \ + printk(BIOS_DEBUG, format, ##__VA_ARGS__); \ + } while (0) + +#define ddr_print(format, ...) VB_PRT(VBL_NORM, format, ##__VA_ARGS__) + +#define error_print(format, ...) printk(BIOS_ERR, format, ##__VA_ARGS__) + +#ifdef DEBUG_DEBUG_PRINT + #define debug_print(format, ...) printk(BIOS_DEBUG, format, ##__VA_ARGS__) +#else + #define debug_print(format, ...) do {} while (0) +#endif -- cgit v1.2.3