mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ddr: imx8m: add deprecation warnings for ddrphy_trained_csr
@ 2024-03-13 15:42 Ahmad Fatoum
  2024-03-15  7:11 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2024-03-13 15:42 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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>
---
 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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ddr: imx8m: add deprecation warnings for ddrphy_trained_csr
  2024-03-13 15:42 [PATCH] ddr: imx8m: add deprecation warnings for ddrphy_trained_csr Ahmad Fatoum
@ 2024-03-15  7:11 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-03-15  7:11 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Wed, 13 Mar 2024 16:42:17 +0100, Ahmad Fatoum wrote:
> 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.
> 
> [...]

Applied, thanks!

[1/1] ddr: imx8m: add deprecation warnings for ddrphy_trained_csr
      https://git.pengutronix.de/cgit/barebox/commit/?id=183058a549fa (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-15  7:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-13 15:42 [PATCH] ddr: imx8m: add deprecation warnings for ddrphy_trained_csr Ahmad Fatoum
2024-03-15  7:11 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox