7523e5ebf645a78b5d6df6281212ebaa977d230f
[openwrt/staging/pepe2k.git] /
1 From 8a00fc606312c68b98add8fe8e6f7a013ce29e78 Mon Sep 17 00:00:00 2001
2 From: Alexander Stein <alexander.stein@ew.tq-group.com>
3 Date: Sun, 11 Jun 2023 15:03:06 +0100
4 Subject: [PATCH] nvmem: imx-ocotp: Reverse MAC addresses on all i.MX derivates
5
6 Not just i.MX8M, but all i.MX6/7 (and subtypes) need to reverse the
7 MAC address read from fuses. Exceptions are i.MX6SLL and i.MX7ULP which
8 do not support ethernet at all.
9
10 Fixes: d0221a780cbc ("nvmem: imx-ocotp: add support for post processing")
11 Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
12 Tested-by: Richard Leitner <richard.leitner@skidata.com> # imx6q
13 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
14 Message-ID: <20230611140330.154222-3-srinivas.kandagatla@linaro.org>
15 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16 ---
17 drivers/nvmem/imx-ocotp.c | 8 +-------
18 1 file changed, 1 insertion(+), 7 deletions(-)
19
20 --- a/drivers/nvmem/imx-ocotp.c
21 +++ b/drivers/nvmem/imx-ocotp.c
22 @@ -97,7 +97,6 @@ struct ocotp_params {
23 unsigned int bank_address_words;
24 void (*set_timing)(struct ocotp_priv *priv);
25 struct ocotp_ctrl_reg ctrl;
26 - bool reverse_mac_address;
27 };
28
29 static int imx_ocotp_wait_for_busy(struct ocotp_priv *priv, u32 flags)
30 @@ -545,7 +544,6 @@ static const struct ocotp_params imx8mq_
31 .bank_address_words = 0,
32 .set_timing = imx_ocotp_set_imx6_timing,
33 .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT,
34 - .reverse_mac_address = true,
35 };
36
37 static const struct ocotp_params imx8mm_params = {
38 @@ -553,7 +551,6 @@ static const struct ocotp_params imx8mm_
39 .bank_address_words = 0,
40 .set_timing = imx_ocotp_set_imx6_timing,
41 .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT,
42 - .reverse_mac_address = true,
43 };
44
45 static const struct ocotp_params imx8mn_params = {
46 @@ -561,7 +558,6 @@ static const struct ocotp_params imx8mn_
47 .bank_address_words = 0,
48 .set_timing = imx_ocotp_set_imx6_timing,
49 .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT,
50 - .reverse_mac_address = true,
51 };
52
53 static const struct ocotp_params imx8mp_params = {
54 @@ -569,7 +565,6 @@ static const struct ocotp_params imx8mp_
55 .bank_address_words = 0,
56 .set_timing = imx_ocotp_set_imx6_timing,
57 .ctrl = IMX_OCOTP_BM_CTRL_8MP,
58 - .reverse_mac_address = true,
59 };
60
61 static const struct of_device_id imx_ocotp_dt_ids[] = {
62 @@ -624,8 +619,7 @@ static int imx_ocotp_probe(struct platfo
63 imx_ocotp_nvmem_config.size = 4 * priv->params->nregs;
64 imx_ocotp_nvmem_config.dev = dev;
65 imx_ocotp_nvmem_config.priv = priv;
66 - if (priv->params->reverse_mac_address)
67 - imx_ocotp_nvmem_config.layout = &imx_ocotp_layout;
68 + imx_ocotp_nvmem_config.layout = &imx_ocotp_layout;
69
70 priv->config = &imx_ocotp_nvmem_config;
71