mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] ddr: imx8m: add deprecation warnings for ddrphy_trained_csr
Date: Wed, 13 Mar 2024 16:42:17 +0100	[thread overview]
Message-ID: <20240313154217.2747582-1-a.fatoum@pengutronix.de> (raw)

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




             reply	other threads:[~2024-03-13 15:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 15:42 Ahmad Fatoum [this message]
2024-03-15  7:11 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240313154217.2747582-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox