Skip to content

Commit c95c969

Browse files
Anson-HuangShawn Guo
authored andcommitted
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: fc40200 ("soc: imx: increase build coverage for imx8m soc driver") Fixes: 18f662a ("soc: imx: Add i.MX8MP SoC driver support") Signed-off-by: Anson Huang <[email protected]> Reviewed-by: Iuliana Prodan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent d22a16c commit c95c969

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/soc/imx/soc-imx8m.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#define OCOTP_UID_LOW 0x410
2323
#define OCOTP_UID_HIGH 0x420
2424

25+
#define IMX8MP_OCOTP_UID_OFFSET 0x10
26+
2527
/* Same as ANADIG_DIGPROG_IMX7D */
2628
#define ANADIG_DIGPROG_IMX8MM 0x800
2729

@@ -87,6 +89,8 @@ static void __init imx8mm_soc_uid(void)
8789
{
8890
void __iomem *ocotp_base;
8991
struct device_node *np;
92+
u32 offset = of_machine_is_compatible("fsl,imx8mp") ?
93+
IMX8MP_OCOTP_UID_OFFSET : 0;
9094

9195
np = of_find_compatible_node(NULL, NULL, "fsl,imx8mm-ocotp");
9296
if (!np)
@@ -95,9 +99,9 @@ static void __init imx8mm_soc_uid(void)
9599
ocotp_base = of_iomap(np, 0);
96100
WARN_ON(!ocotp_base);
97101

98-
soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH);
102+
soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH + offset);
99103
soc_uid <<= 32;
100-
soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW);
104+
soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW + offset);
101105

102106
iounmap(ocotp_base);
103107
of_node_put(np);

0 commit comments

Comments
 (0)