summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Kconfig9
-rw-r--r--src/include/device/device.h18
-rw-r--r--src/soc/intel/xeon_sp/include/soc/util.h11
3 files changed, 27 insertions, 11 deletions
diff --git a/src/Kconfig b/src/Kconfig
index d265da7797..eda11c331e 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -915,6 +915,15 @@ config DEBUG_MALLOC
If unsure, say N.
+# Only visible if DEBUG_SPEW (8) is set.
+config DEBUG_RESOURCES
+ bool "Output verbose PCI MEM and IO resource debug messages" if DEFAULT_CONSOLE_LOGLEVEL_8
+ default n
+ help
+ This option enables additional PCI memory and IO debug messages.
+ Note: This option will increase the size of the coreboot image.
+ If unsure, say N.
+
config DEBUG_CONSOLE_INIT
bool "Debug console initialisation code"
default n
diff --git a/src/include/device/device.h b/src/include/device/device.h
index 3a0795e526..eb9ef42eef 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -261,6 +261,24 @@ void show_one_resource(int debug_level, struct device *dev,
struct resource *resource, const char *comment);
void show_all_devs_resources(int debug_level, const char *msg);
+/* Debug macros */
+#if CONFIG(DEBUG_RESOURCES)
+#include <console/console.h>
+#define LOG_MEM_RESOURCE(type, dev, index, base_kb, size_kb) \
+ printk(BIOS_SPEW, "%s:%d res: %s, dev: %s, index: 0x%x, base: 0x%llx, " \
+ "end: 0x%llx, size_kb: 0x%llx\n", \
+ __func__, __LINE__, type, dev_path(dev), index, (base_kb << 10), \
+ (base_kb << 10) + (size_kb << 10) - 1, size_kb)
+
+#define LOG_IO_RESOURCE(type, dev, index, base, size) \
+ printk(BIOS_SPEW, "%s:%d res: %s, dev: %s, index: 0x%x, base: 0x%llx, " \
+ "end: 0x%llx, size: 0x%llx\n", \
+ __func__, __LINE__, type, dev_path(dev), index, base, base + size - 1, size)
+#else /* DEBUG_RESOURCES*/
+#define LOG_MEM_RESOURCE(type, dev, index, base_kb, size_kb)
+#define LOG_IO_RESOURCE(type, dev, index, base, size)
+#endif /* DEBUG_RESOURCES*/
+
/* Rounding for boundaries.
* Due to some chip bugs, go ahead and round IO to 16
*/
diff --git a/src/soc/intel/xeon_sp/include/soc/util.h b/src/soc/intel/xeon_sp/include/soc/util.h
index 159efeba2c..f223efafe0 100644
--- a/src/soc/intel/xeon_sp/include/soc/util.h
+++ b/src/soc/intel/xeon_sp/include/soc/util.h
@@ -10,17 +10,6 @@ void get_cpubusnos(uint32_t *bus0, uint32_t *bus1, uint32_t *bus2, uint32_t *bus
void unlock_pam_regions(void);
void get_stack_busnos(uint32_t *bus);
-#define LOG_MEM_RESOURCE(type, dev, index, base_kb, size_kb) \
- printk(BIOS_SPEW, "%s:%d res: %s, dev: %s, index: 0x%x, base: 0x%llx, " \
- "end: 0x%llx, size_kb: 0x%llx\n", \
- __func__, __LINE__, type, dev_path(dev), index, (base_kb << 10), \
- (base_kb << 10) + (size_kb << 10) - 1, size_kb)
-
-#define LOG_IO_RESOURCE(type, dev, index, base, size) \
- printk(BIOS_SPEW, "%s:%d res: %s, dev: %s, index: 0x%x, base: 0x%llx, " \
- "end: 0x%llx, size: 0x%llx\n", \
- __func__, __LINE__, type, dev_path(dev), index, base, base + size - 1, size)
-
#define DEV_FUNC_ENTER(dev) \
printk(BIOS_SPEW, "%s:%s:%d: ENTER (dev: %s)\n", \
__FILE__, __func__, __LINE__, dev_path(dev))