imx: mx6 correct get_cpu_rev

The DIGPROG register map:
23 ------- 16 | 15 ------ 8 | 7 --- 0 |
 Major upper  | Major Lower |  Minor  |

We also need to account for Major Lower.

Signed-off-by: Ye.Li <B37916@freescale.com>
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
This commit is contained in:
Peng Fan 2015-06-11 18:30:36 +08:00 committed by Stefano Babic
parent b65d9d868e
commit dfd4861c22

View file

@ -62,6 +62,7 @@ u32 get_cpu_rev(void)
struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
u32 reg = readl(&anatop->digprog_sololite);
u32 type = ((reg >> 16) & 0xff);
u32 major;
if (type != MXC_CPU_MX6SL) {
reg = readl(&anatop->digprog);
@ -79,8 +80,9 @@ u32 get_cpu_rev(void)
}
}
major = ((reg >> 8) & 0xff);
reg &= 0xff; /* mx6 silicon revision */
return (type << 12) | (reg + 0x10);
return (type << 12) | (reg + (0x10 * (major + 1)));
}
/*