summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2018-09-05 23:30:59 -0700
committerYe Li <ye.li@nxp.com>2018-09-05 23:54:08 -0700
commit8be98e9322040c655b9e5c9fb2c494e002e3fad9 (patch)
treeff5d15e43a0e46dd7a40a7f2d86d9e1d44906d89
parent8c61389c9d2b6e96af47080fbb71d706bc77afb9 (diff)
MLK-19465 imx8mq: Fix cpu rev issue on B0.1 chip
We read the ROM version to determine the CPU revision before B1 chip. The rom version is 4 bytes word, it has major version at low byte, minor version at second byte. On B0.1 chip, the value is 0x1020 not 0x20, if reading the word and comparing with 0x20, the result is wrong. Fix the issue by only reading the lowest byte for major version. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 8d0812e63155cca91ecb78c630a450e7d5e5fd00)
-rw-r--r--arch/arm/cpu/armv8/imx8m/soc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/cpu/armv8/imx8m/soc.c b/arch/arm/cpu/armv8/imx8m/soc.c
index 68cc01f3b1..45d19899e1 100644
--- a/arch/arm/cpu/armv8/imx8m/soc.c
+++ b/arch/arm/cpu/armv8/imx8m/soc.c
@@ -237,9 +237,9 @@ u32 get_cpu_rev(void)
reg = 0x21;
} else {
uint32_t rom_version;
- rom_version = readl((void __iomem *)0x800);
+ rom_version = readb((void __iomem *)0x800);
if (rom_version != 0x10) {
- rom_version = readl((void __iomem *)0x83c);
+ rom_version = readb((void __iomem *)0x83c);
if (rom_version == 0x20)
reg = 0x20;
}