summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRobert Karszniewicz <r.karszniewicz@phytec.de>2020-12-03 16:40:50 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-12-07 08:37:36 +0100
commitb68c3dddf74e89d88a7f4a8b30b45f547368ec0f (patch)
tree900d948cbcce4d1d5d069b1ecd10aa4033d71bf6 /arch
parentccb459abb1f0e36e7d465c065c7076073550ecec (diff)
downloadbarebox-b68c3dddf74e89d88a7f4a8b30b45f547368ec0f.tar.gz
barebox-b68c3dddf74e89d88a7f4a8b30b45f547368ec0f.tar.xz
ARM: i.MX: OCOTP: read serial number with correct endianness
The serial number is stored with the low bytes first, as can be seen in Linux commit 8267ff89b713 ("ARM: imx: Add serial number support for i.MX6/7 SoCs"). The same goes for i.MX8M. Also renamed the macro to the more descriptive name from Linux. Fixes: c4d9463d969b ("i.MX: Introduce imx_ocotp_read_uid()") Signed-off-by: Robert Karszniewicz <r.karszniewicz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/include/mach/ocotp.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/arm/mach-imx/include/mach/ocotp.h b/arch/arm/mach-imx/include/mach/ocotp.h
index 7ba5da156b..20205c5da7 100644
--- a/arch/arm/mach-imx/include/mach/ocotp.h
+++ b/arch/arm/mach-imx/include/mach/ocotp.h
@@ -26,8 +26,8 @@
#define OCOTP_BIT(n) FIELD_PREP(OCOTP_BIT_MASK, n)
#define OCOTP_WIDTH(n) FIELD_PREP(OCOTP_WIDTH_MASK, (n) - 1)
-#define OCOTP_OFFSET_CFG0 0x410
-#define OCOTP_OFFSET_CFG1 0x420
+#define OCOTP_UID_L 0x410
+#define OCOTP_UID_H 0x420
int imx_ocotp_read_field(uint32_t field, unsigned *value);
@@ -39,9 +39,9 @@ static inline u64 imx_ocotp_read_uid(void __iomem *ocotp)
{
u64 uid;
- uid = readl(ocotp + OCOTP_OFFSET_CFG0);
+ uid = readl(ocotp + OCOTP_UID_H);
uid <<= 32;
- uid |= readl(ocotp + OCOTP_OFFSET_CFG1);
+ uid |= readl(ocotp + OCOTP_UID_L);
return uid;
}