|
@@ -21,6 +21,7 @@
|
|
|
static int cpu_silicon_rev = -1;
|
|
|
|
|
|
#define IIM_SREV 0x24
|
|
|
+#define MX50_HW_ADADIG_DIGPROG 0xB0
|
|
|
|
|
|
static int get_mx51_srev(void)
|
|
|
{
|
|
@@ -127,6 +128,44 @@ int mx53_revision(void)
|
|
|
}
|
|
|
EXPORT_SYMBOL(mx53_revision);
|
|
|
|
|
|
+static int get_mx50_srev(void)
|
|
|
+{
|
|
|
+ void __iomem *anatop = ioremap(MX50_ANATOP_BASE_ADDR, SZ_8K);
|
|
|
+ u32 rev;
|
|
|
+
|
|
|
+ if (!anatop) {
|
|
|
+ cpu_silicon_rev = -EINVAL;
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ rev = readl(anatop + MX50_HW_ADADIG_DIGPROG);
|
|
|
+ rev &= 0xff;
|
|
|
+
|
|
|
+ iounmap(anatop);
|
|
|
+ if (rev == 0x0)
|
|
|
+ return IMX_CHIP_REVISION_1_0;
|
|
|
+ else if (rev == 0x1)
|
|
|
+ return IMX_CHIP_REVISION_1_1;
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ * Returns:
|
|
|
+ * the silicon revision of the cpu
|
|
|
+ * -EINVAL - not a mx50
|
|
|
+ */
|
|
|
+int mx50_revision(void)
|
|
|
+{
|
|
|
+ if (!cpu_is_mx50())
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
+ if (cpu_silicon_rev == -1)
|
|
|
+ cpu_silicon_rev = get_mx50_srev();
|
|
|
+
|
|
|
+ return cpu_silicon_rev;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(mx50_revision);
|
|
|
+
|
|
|
static int __init post_cpu_init(void)
|
|
|
{
|
|
|
unsigned int reg;
|