diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2024-03-13 16:42:17 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-03-15 08:11:11 +0100 |
commit | 183058a549faa2ce1c6a0d1a1674fe0b1f1fe863 (patch) | |
tree | e86b94ef55bab034b41e9bb438a385a3f6980fd1 | |
parent | e706d9f8de6572a0dd1d1b370a52fec45a435267 (diff) | |
download | barebox-183058a549faa2ce1c6a0d1a1674fe0b1f1fe863.tar.gz barebox-183058a549faa2ce1c6a0d1a1674fe0b1f1fe863.tar.xz |
ddr: imx8m: add deprecation warnings for ddrphy_trained_csr
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@pengutronix.de>
Link: https://lore.barebox.org/20240313154217.2747582-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/ddr/imx/helper.c | 7 | ||||
-rw-r--r-- | 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 674ca7e4ac..f9c25f7180 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 8553452ad8..0225ac0e03 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; |