summaryrefslogtreecommitdiff
path: root/drivers/ddr/marvell/a38x/ddr3_debug.c
diff options
context:
space:
mode:
authorMarek BehĂșn <kabel@kernel.org>2024-06-18 17:34:28 +0200
committerStefan Roese <sr@denx.de>2024-07-08 08:20:58 +0200
commit259556e5aa173fab679256606db494448d30418c (patch)
tree055d9b8d454d68cc7ca4c253fa06d65bf94646ae /drivers/ddr/marvell/a38x/ddr3_debug.c
parent411e71f7df830a896069dd96f63f8872a7231d6e (diff)
ddr: marvell: a38x: debug: Allow compiling with immutable debug settings to reduce binary size
Allow compiling with immutable debug settings: - DEBUG_LEVEL is always set to DEBUG_LEVEL_ERROR - register dumps are disabled This can save around 10 KiB of space in the resulting binary, which is a lot in U-Boot SPL. Signed-off-by: Marek BehĂșn <kabel@kernel.org>
Diffstat (limited to 'drivers/ddr/marvell/a38x/ddr3_debug.c')
-rw-r--r--drivers/ddr/marvell/a38x/ddr3_debug.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/ddr/marvell/a38x/ddr3_debug.c b/drivers/ddr/marvell/a38x/ddr3_debug.c
index d32d42c408f..0b65168d82a 100644
--- a/drivers/ddr/marvell/a38x/ddr3_debug.c
+++ b/drivers/ddr/marvell/a38x/ddr3_debug.c
@@ -7,18 +7,21 @@
#include "mv_ddr_training_db.h"
#include "mv_ddr_regs.h"
+#if !defined(CONFIG_DDR_IMMUTABLE_DEBUG_SETTINGS)
u8 is_reg_dump = 0;
u8 debug_pbs = DEBUG_LEVEL_ERROR;
+#endif
/*
* API to change flags outside of the lib
*/
-#if defined(SILENT_LIB)
+#if defined(SILENT_LIB) || defined(CONFIG_DDR_IMMUTABLE_DEBUG_SETTINGS)
void ddr3_hws_set_log_level(enum ddr_lib_debug_block block, u8 level)
{
/* do nothing */
}
-#else /* SILENT_LIB */
+#else /* !SILENT_LIB && !CONFIG_DDR_IMMUTABLE_DEBUG_SETTINGS */
+
/* Debug flags for other Training modules */
u8 debug_training_static = DEBUG_LEVEL_ERROR;
u8 debug_training = DEBUG_LEVEL_ERROR;
@@ -104,7 +107,7 @@ void ddr3_hws_set_log_level(enum ddr_lib_debug_block block, u8 level)
#endif /* CONFIG_DDR4 */
}
}
-#endif /* SILENT_LIB */
+#endif /* !SILENT_LIB && !CONFIG_DDR_IMMUTABLE_DEBUG_SETTINGS */
#if defined(DDR_VIEWER_TOOL)
static char *convert_freq(enum mv_ddr_freq freq);