Skip to contentSkip to conversation

soc: imx8m: Correct i.MX8MP UID fuse offset

PATCH Superseded Anson Huang 3 participants 5 messages Jun 9, 2020 – Jun 10, 2020 Arm i.MX and Layerscape

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 soc: imx8m: Correct i.MX8MP UID fuse offset

Correct i.MX8MP UID fuse offset according to fuse map:

UID_LOW: 0x420
UID_HIGH: 0x430

Fixes fc40200ebf82 ("soc: imx: increase build coverage for imx8m soc driver")

---
Changes since V1:
- add fix tag.

---
 drivers/soc/imx/soc-imx8m.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/soc/imx/soc-imx8m.c +6 -2
index 7b0759a..0bc8314 100644
@@ -22,6 +22,8 @@
 #define OCOTP_UID_LOW			0x410
 #define OCOTP_UID_HIGH			0x420
 
+#define IMX8MP_OCOTP_UID_OFFSET		0x10
+
 /* Same as ANADIG_DIGPROG_IMX7D */
 #define ANADIG_DIGPROG_IMX8MM	0x800
 
@@ -87,6 +89,8 @@ static void __init imx8mm_soc_uid(void)
 {
 	void __iomem *ocotp_base;
 	struct device_node *np;
+	u32 offset = of_machine_is_compatible("fsl,imx8mp") ?
+		     IMX8MP_OCOTP_UID_OFFSET : 0;
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx8mm-ocotp");
 	if (!np)
@@ -95,9 +99,9 @@ static void __init imx8mm_soc_uid(void)
 	ocotp_base = of_iomap(np, 0);
 	WARN_ON(!ocotp_base);
 
-	soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH);
+	soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH + offset);
 	soc_uid <<= 32;
-	soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW);
+	soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW + offset);
 
 	iounmap(ocotp_base);
 	of_node_put(np);
Signature · 1 line
2.7.4
#1 lore raw
Quoted 9 lines

From: Anson Huang <[email protected]>
Sent: Wednesday, June 10, 2020 6:42 AM

Correct i.MX8MP UID fuse offset according to fuse map:

UID_LOW: 0x420
UID_HIGH: 0x430

Fixes fc40200ebf82 ("soc: imx: increase build coverage for imx8m soc driver")

AFAIK "Fixes:" should point to the original patch which introduced the issue. Not the one changing file name.

Quoted 22 lines

---
Changes since V1:
- add fix tag.

---
 drivers/soc/imx/soc-imx8m.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/soc/imx/soc-imx8m.c index renamed from drivers/soc/imx/soc-imx8m.c +0 -0

7b0759a..0bc8314 100644

drivers/soc/imx/soc-imx8m.c +2 -0
@@ -22,6 +22,8 @@
 #define OCOTP_UID_LOW			0x410
 #define OCOTP_UID_HIGH			0x420
 
+#define IMX8MP_OCOTP_UID_OFFSET		0x10
+
 /* Same as ANADIG_DIGPROG_IMX7D */
 #define ANADIG_DIGPROG_IMX8MM	0x800
 

drivers/soc/imx/soc-imx8m.c static void __init imx8mm_soc_uid(void) { · line 93

Quoted 5 lines
drivers/soc/imx/soc-imx8m.c +2 -0
@@ -87,6 +89,8 @@ static void __init imx8mm_soc_uid(void)  {
 	void __iomem *ocotp_base;
 	struct device_node *np;
+	u32 offset = of_machine_is_compatible("fsl,imx8mp") ?
+		     IMX8MP_OCOTP_UID_OFFSET : 0;
 
	If (of_machine_is_compatible("fsl,imx8mp"))
		Octop_base += IMX8MP_OCOTP_UID_OFFSET;

Then you may not need the extra changes.

Regards
Aisheng

Quoted 16 lines
drivers/soc/imx/soc-imx8m.c +2 -3
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx8mm-ocotp");
 	if (!np)
@@ -95,9 +99,9 @@ static void __init imx8mm_soc_uid(void)
 	ocotp_base = of_iomap(np, 0);
 	WARN_ON(!ocotp_base);
 
-	soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH);
+	soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH + offset);
 	soc_uid <<= 32;
-	soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW);
+	soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW + offset);
 
 	iounmap(ocotp_base);
 	of_node_put(np);
--

2.7.4

#2 lore raw
Quoted 8 lines

Subject: RE: [PATCH V2] soc: imx8m: Correct i.MX8MP UID fuse offset

Quoted 5 lines

From: Anson Huang <[email protected]>
Sent: Wednesday, June 10, 2020 6:42 AM

Correct i.MX8MP UID fuse offset according to fuse map:

Quoted 8 lines
Quoted 5 lines

UID_LOW: 0x420
UID_HIGH: 0x430

Fixes fc40200ebf82 ("soc: imx: increase build coverage for imx8m soc

driver")

AFAIK "Fixes:" should point to the original patch which introduced the issue. Not the one changing file name.

But the patch can NOT be applied to the kernel version with original file, how to fix it?

Anson

#3 lore raw
Quoted 11 lines · Anson Huang
Quoted 11 lines

Subject: RE: [PATCH V2] soc: imx8m: Correct i.MX8MP UID fuse offset

Quoted 8 lines

From: Anson Huang <[email protected]>
Sent: Wednesday, June 10, 2020 6:42 AM

Correct i.MX8MP UID fuse offset according to fuse map:

UID_LOW: 0x420
UID_HIGH: 0x430

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
Fixes fc40200ebf82 ("soc: imx: increase build coverage for imx8m soc

driver")

AFAIK "Fixes:" should point to the original patch which introduced the issue. Not the one changing file name.

But the patch can NOT be applied to the kernel version with original file, how to fix it?

I believe you can add two "Fixes:" with the two commits: the one introducing the issue and the one changing the file name.

Iulia

#4 lore raw

Hi, Luliana

Quoted 20 lines

Subject: Re: [PATCH V2] soc: imx8m: Correct i.MX8MP UID fuse offset

Quoted 15 lines · Anson Huang
Quoted 15 lines

Subject: RE: [PATCH V2] soc: imx8m: Correct i.MX8MP UID fuse offset

Quoted 11 lines

From: Anson Huang <[email protected]>
Sent: Wednesday, June 10, 2020 6:42 AM

Correct i.MX8MP UID fuse offset according to fuse map:

UID_LOW: 0x420
UID_HIGH: 0x430

Fixes fc40200ebf82 ("soc: imx: increase build coverage for imx8m

soc
driver")

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

AFAIK "Fixes:" should point to the original patch which introduced the issue. Not the one changing file name.

But the patch can NOT be applied to the kernel version with original file, how to fix it?

I believe you can add two "Fixes:" with the two commits: the one introducing the issue and the one changing the file name.

Thanks, will add once more fix tag, please help review V3.

Anson