[PATCH] ddr: imx8m: add deprecation warnings for ddrphy_trained_csr
Ahmad Fatoum
a.fatoum at pengutronix.de
Wed Mar 13 08:42:17 PDT 2024
ddrphy_trained_csr and ddrphy_trained_csr_num are generated by the
spreadsheet, but are unused. Instead a default array with fixed values
is unconditionally used. Add a deprecation warning to alert to this
fact.
It seems GCC doesn't print this deprecation when using C99
designated initializers, but clang(d) does, so it's useful to have for
those using clangd in their editors.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
drivers/ddr/imx/helper.c | 7 +++++++
include/soc/imx/ddr.h | 8 ++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/ddr/imx/helper.c b/drivers/ddr/imx/helper.c
index 674ca7e4ac38..f9c25f7180b8 100644
--- a/drivers/ddr/imx/helper.c
+++ b/drivers/ddr/imx/helper.c
@@ -10,6 +10,13 @@
#include <errno.h>
#include <soc/imx8m/ddr.h>
+/*
+ * We deprecate ddrphy_trained_csr(_num) for board code, so we can set it
+ * ourselves here
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
void ddrphy_trained_csr_save(struct dram_controller *dram, struct dram_cfg_param *ddrphy_csr,
unsigned int num)
{
diff --git a/include/soc/imx/ddr.h b/include/soc/imx/ddr.h
index 8553452ad8a9..0225ac0e033c 100644
--- a/include/soc/imx/ddr.h
+++ b/include/soc/imx/ddr.h
@@ -54,6 +54,10 @@ struct dram_fsp_msg {
unsigned int fsp_cfg_num;
};
+#define __deprecated_dram_timing_info \
+ __attribute__((deprecated("board-specific data here is ignored in favor of the defaults." \
+ " You can probably remove the array")))
+
struct dram_timing_info {
/* umctl2 config */
struct dram_cfg_param *ddrc_cfg;
@@ -68,8 +72,8 @@ struct dram_timing_info {
struct dram_fsp_msg *fsp_msg;
unsigned int fsp_msg_num;
/* ddr phy trained CSR */
- struct dram_cfg_param *ddrphy_trained_csr;
- unsigned int ddrphy_trained_csr_num;
+ struct dram_cfg_param *ddrphy_trained_csr __deprecated_dram_timing_info;
+ unsigned int ddrphy_trained_csr_num __deprecated_dram_timing_info;
/* ddr phy PIE */
struct dram_cfg_param *ddrphy_pie;
unsigned int ddrphy_pie_num;
--
2.39.2
More information about the barebox
mailing list