mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Rouven Czerwinski <r.czerwinski@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Subject: [PATCH 2/5] nvmem: ocotp: retrieve set_timing from structure
Date: Wed, 15 Jul 2020 07:56:05 +0200	[thread overview]
Message-ID: <20200715055608.20993-2-r.czerwinski@pengutronix.de> (raw)
In-Reply-To: <20200715055608.20993-1-r.czerwinski@pengutronix.de>

i.MX7S/D use a different timing setup, prepare for a new different
timing function.

Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
 drivers/nvmem/ocotp.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/nvmem/ocotp.c b/drivers/nvmem/ocotp.c
index 34e33dee82..3f475e5b1f 100644
--- a/drivers/nvmem/ocotp.c
+++ b/drivers/nvmem/ocotp.c
@@ -86,11 +86,14 @@ enum imx_ocotp_format_mac_direction {
 	OCOTP_MAC_TO_HW,
 };
 
+struct ocotp_priv;
+
 struct imx_ocotp_data {
 	int num_regs;
 	u32 (*addr_to_offset)(u32 addr);
 	void (*format_mac)(u8 *dst, const u8 *src,
 			   enum imx_ocotp_format_mac_direction dir);
+	int (*set_timing)(struct ocotp_priv *priv);
 	u8  mac_offsets[MAX_MAC_OFFSETS];
 	u8  mac_offsets_num;
 };
@@ -183,7 +186,7 @@ static int imx6_ocotp_prepare(struct ocotp_priv *priv)
 {
 	int ret;
 
-	ret = imx6_ocotp_set_timing(priv);
+	ret = priv->data->set_timing(priv);
 	if (ret)
 		return ret;
 
@@ -694,6 +697,7 @@ static struct imx_ocotp_data imx6q_ocotp_data = {
 	.mac_offsets_num = 1,
 	.mac_offsets = { MAC_OFFSET_0 },
 	.format_mac = imx_ocotp_format_mac,
+	.set_timing = imx6_ocotp_set_timing,
 };
 
 static struct imx_ocotp_data imx6sl_ocotp_data = {
@@ -702,6 +706,7 @@ static struct imx_ocotp_data imx6sl_ocotp_data = {
 	.mac_offsets_num = 1,
 	.mac_offsets = { MAC_OFFSET_0 },
 	.format_mac = imx_ocotp_format_mac,
+	.set_timing = imx6_ocotp_set_timing,
 };
 
 static struct imx_ocotp_data imx6ul_ocotp_data = {
@@ -710,6 +715,7 @@ static struct imx_ocotp_data imx6ul_ocotp_data = {
 	.mac_offsets_num = 2,
 	.mac_offsets = { MAC_OFFSET_0, IMX6UL_MAC_OFFSET_1 },
 	.format_mac = imx_ocotp_format_mac,
+	.set_timing = imx6_ocotp_set_timing,
 };
 
 static struct imx_ocotp_data imx6ull_ocotp_data = {
@@ -718,6 +724,7 @@ static struct imx_ocotp_data imx6ull_ocotp_data = {
 	.mac_offsets_num = 2,
 	.mac_offsets = { MAC_OFFSET_0, IMX6UL_MAC_OFFSET_1 },
 	.format_mac = imx_ocotp_format_mac,
+	.set_timing = imx6_ocotp_set_timing,
 };
 
 static struct imx_ocotp_data vf610_ocotp_data = {
@@ -726,6 +733,7 @@ static struct imx_ocotp_data vf610_ocotp_data = {
 	.mac_offsets_num = 2,
 	.mac_offsets = { MAC_OFFSET_0, MAC_OFFSET_1 },
 	.format_mac = vf610_ocotp_format_mac,
+	.set_timing = imx6_ocotp_set_timing,
 };
 
 static struct imx_ocotp_data imx8mq_ocotp_data = {
@@ -734,6 +742,7 @@ static struct imx_ocotp_data imx8mq_ocotp_data = {
 	.mac_offsets_num = 1,
 	.mac_offsets = { 0x90 },
 	.format_mac = imx_ocotp_format_mac,
+	.set_timing = imx6_ocotp_set_timing,
 };
 
 static __maybe_unused struct of_device_id imx_ocotp_dt_ids[] = {
-- 
2.27.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2020-07-15  5:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15  5:56 [PATCH 1/5] clk: imx7: add IMX7D_OCOTP_CLK Rouven Czerwinski
2020-07-15  5:56 ` Rouven Czerwinski [this message]
2020-07-15  5:56 ` [PATCH 3/5] nvmem: ocotp: add new timing function for i.MX7 Rouven Czerwinski
2020-07-15  5:56 ` [PATCH 4/5] nvmem: ocotp: read/write i.MX7 support Rouven Czerwinski
2020-07-15  5:56 ` [PATCH 5/5] nvmem: enable OCOTP for i.MX7 Rouven Czerwinski
2020-08-10 19:54 ` [PATCH 1/5] clk: imx7: add IMX7D_OCOTP_CLK 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=20200715055608.20993-2-r.czerwinski@pengutronix.de \
    --to=r.czerwinski@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