ARM: MX3: fix CPU revision number detection
Subsystems (3)
PATCH 1/1 ARM: MX3: fix CPU revision number detection
The macro mx31_revision() used to take the global variable system_rev to determine the CPU revision number. However, this number is expected to be set by the bootloader and is usually zero (at least on my MX31 based boards here). More than that, it is usually taken to identify the board's revision, not the CPU's.
Fix that by reading the the CPU's SREV register instead.
Right now, mx31_read_cpu_rev() is called from mx31_clocks_init() which is admittedly not a good place for it. However, we need to enable the IIM clock first, and the clock code also has conditional code that depends on mx31_revision() returning the right thing.
Signed-off-by Daniel Mack <[email protected]>
--- arch/arm/mach-mx3/Makefile | 2 +- arch/arm/mach-mx3/clock.c | 2 + arch/arm/mach-mx3/cpu.c | 57 +++++++++++++++++++++++++++++++++ arch/arm/plat-mxc/include/mach/mx3x.h | 5 ++- 4 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 arch/arm/mach-mx3/cpu.c
arch/arm/mach-mx3/Makefile +1 -1
@@ -4,7 +4,7 @@ # Object file lists. -obj-y := mm.o devices.o +obj-y := mm.o devices.o cpu.o obj-$(CONFIG_MX3_SDMA) += sdma/ obj-$(CONFIG_ARCH_MX31) += clock.o iomux.o obj-$(CONFIG_ARCH_MX35) += clock-imx35.o
arch/arm/mach-mx3/clock.c +2 -0
@@ -616,6 +616,8 @@ int __init mx31_clocks_init(unsigned long fref)clk_enable (&serial_pll_clk); +mx31_read_cpu_rev (); +if (mx31_revision () >=CHIP_REV_2_0 ) { reg =__raw_readl (MXC_CCM_PMCR1 );/* No PLL restart on DVFS switch; enable auto EMI handshake */
arch/arm/mach-mx3/cpu.c new file +57 -0
57 lines not on this page · raw message
arch/arm/plat-mxc/include/mach/mx3x.h +3 -2
@@ -263,11 +263,12 @@#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) -extern unsigned int system_rev; +extern unsigned int mx31_cpu_rev; +extern void mx31_read_cpu_rev (void );static inline int mx31_revision (void ) { -return system_rev; +return mx31_cpu_rev; }#endif
Signature · 1 line
1.6.5.2