mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
soc: imx8m: Correct i.MX8MP UID fuse offset
[ Upstream commitc95c9693b1] Correct i.MX8MP UID fuse offset according to fuse map: UID_LOW: 0x420 UID_HIGH: 0x430 Fixes:fc40200ebf("soc: imx: increase build coverage for imx8m soc driver") Fixes:18f662a738("soc: imx: Add i.MX8MP SoC driver support") Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
@@ -22,6 +22,8 @@
|
|||||||
#define OCOTP_UID_LOW 0x410
|
#define OCOTP_UID_LOW 0x410
|
||||||
#define OCOTP_UID_HIGH 0x420
|
#define OCOTP_UID_HIGH 0x420
|
||||||
|
|
||||||
|
#define IMX8MP_OCOTP_UID_OFFSET 0x10
|
||||||
|
|
||||||
/* Same as ANADIG_DIGPROG_IMX7D */
|
/* Same as ANADIG_DIGPROG_IMX7D */
|
||||||
#define ANADIG_DIGPROG_IMX8MM 0x800
|
#define ANADIG_DIGPROG_IMX8MM 0x800
|
||||||
|
|
||||||
@@ -88,6 +90,8 @@ static void __init imx8mm_soc_uid(void)
|
|||||||
{
|
{
|
||||||
void __iomem *ocotp_base;
|
void __iomem *ocotp_base;
|
||||||
struct device_node *np;
|
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");
|
np = of_find_compatible_node(NULL, NULL, "fsl,imx8mm-ocotp");
|
||||||
if (!np)
|
if (!np)
|
||||||
@@ -96,9 +100,9 @@ static void __init imx8mm_soc_uid(void)
|
|||||||
ocotp_base = of_iomap(np, 0);
|
ocotp_base = of_iomap(np, 0);
|
||||||
WARN_ON(!ocotp_base);
|
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 <<= 32;
|
||||||
soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW);
|
soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW + offset);
|
||||||
|
|
||||||
iounmap(ocotp_base);
|
iounmap(ocotp_base);
|
||||||
of_node_put(np);
|
of_node_put(np);
|
||||||
|
|||||||
Reference in New Issue
Block a user