diff options
-rw-r--r-- | arch/arm/mach-imx/clock-imx27.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-imx/cpu-imx27.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-mx3/clock-imx31.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-mx3/cpu.c | 31 | ||||
-rw-r--r-- | arch/arm/mach-mx5/clock-mx51-mx53.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-mx5/cpu.c | 55 | ||||
-rw-r--r-- | arch/arm/mach-mx5/mm.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mx27.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mx31.h | 16 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mx35.h | 3 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mx3x.h | 16 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mx51.h | 13 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mxc.h | 14 |
13 files changed, 98 insertions, 110 deletions
diff --git a/arch/arm/mach-imx/clock-imx27.c b/arch/arm/mach-imx/clock-imx27.c index 98a25bada783..2202b88667b5 100644 --- a/arch/arm/mach-imx/clock-imx27.c +++ b/arch/arm/mach-imx/clock-imx27.c | |||
@@ -125,7 +125,7 @@ static int clk_cpu_set_parent(struct clk *clk, struct clk *parent) | |||
125 | if (clk->parent == parent) | 125 | if (clk->parent == parent) |
126 | return 0; | 126 | return 0; |
127 | 127 | ||
128 | if (mx27_revision() >= CHIP_REV_2_0) { | 128 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) { |
129 | if (parent == &mpll_main1_clk) { | 129 | if (parent == &mpll_main1_clk) { |
130 | cscr |= CCM_CSCR_ARM_SRC; | 130 | cscr |= CCM_CSCR_ARM_SRC; |
131 | } else { | 131 | } else { |
@@ -174,7 +174,7 @@ static int set_rate_cpu(struct clk *clk, unsigned long rate) | |||
174 | div--; | 174 | div--; |
175 | 175 | ||
176 | reg = __raw_readl(CCM_CSCR); | 176 | reg = __raw_readl(CCM_CSCR); |
177 | if (mx27_revision() >= CHIP_REV_2_0) { | 177 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) { |
178 | reg &= ~(3 << 12); | 178 | reg &= ~(3 << 12); |
179 | reg |= div << 12; | 179 | reg |= div << 12; |
180 | reg &= ~(CCM_CSCR_FPM | CCM_CSCR_SPEN); | 180 | reg &= ~(CCM_CSCR_FPM | CCM_CSCR_SPEN); |
@@ -244,7 +244,7 @@ static unsigned long get_rate_ssix(struct clk *clk, unsigned long pdf) | |||
244 | 244 | ||
245 | parent_rate = clk_get_rate(clk->parent); | 245 | parent_rate = clk_get_rate(clk->parent); |
246 | 246 | ||
247 | if (mx27_revision() >= CHIP_REV_2_0) | 247 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) |
248 | pdf += 4; /* MX27 TO2+ */ | 248 | pdf += 4; /* MX27 TO2+ */ |
249 | else | 249 | else |
250 | pdf = (pdf < 2) ? 124UL : pdf; /* MX21 & MX27 TO1 */ | 250 | pdf = (pdf < 2) ? 124UL : pdf; /* MX21 & MX27 TO1 */ |
@@ -269,7 +269,7 @@ static unsigned long get_rate_nfc(struct clk *clk) | |||
269 | 269 | ||
270 | parent_rate = clk_get_rate(clk->parent); | 270 | parent_rate = clk_get_rate(clk->parent); |
271 | 271 | ||
272 | if (mx27_revision() >= CHIP_REV_2_0) | 272 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) |
273 | nfc_pdf = (__raw_readl(CCM_PCDR0) >> 6) & 0xf; | 273 | nfc_pdf = (__raw_readl(CCM_PCDR0) >> 6) & 0xf; |
274 | else | 274 | else |
275 | nfc_pdf = (__raw_readl(CCM_PCDR0) >> 12) & 0xf; | 275 | nfc_pdf = (__raw_readl(CCM_PCDR0) >> 12) & 0xf; |
@@ -284,7 +284,7 @@ static unsigned long get_rate_vpu(struct clk *clk) | |||
284 | 284 | ||
285 | parent_rate = clk_get_rate(clk->parent); | 285 | parent_rate = clk_get_rate(clk->parent); |
286 | 286 | ||
287 | if (mx27_revision() >= CHIP_REV_2_0) { | 287 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) { |
288 | vpu_pdf = (__raw_readl(CCM_PCDR0) >> 10) & 0x3f; | 288 | vpu_pdf = (__raw_readl(CCM_PCDR0) >> 10) & 0x3f; |
289 | vpu_pdf += 4; | 289 | vpu_pdf += 4; |
290 | } else { | 290 | } else { |
@@ -347,7 +347,7 @@ static unsigned long get_rate_mpll_main(struct clk *clk) | |||
347 | * clk->id == 0: arm clock source path 1 which is from 2 * MPLL / 2 | 347 | * clk->id == 0: arm clock source path 1 which is from 2 * MPLL / 2 |
348 | * clk->id == 1: arm clock source path 2 which is from 2 * MPLL / 3 | 348 | * clk->id == 1: arm clock source path 2 which is from 2 * MPLL / 3 |
349 | */ | 349 | */ |
350 | if (mx27_revision() >= CHIP_REV_2_0 && clk->id == 1) | 350 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0 && clk->id == 1) |
351 | return 2UL * parent_rate / 3UL; | 351 | return 2UL * parent_rate / 3UL; |
352 | 352 | ||
353 | return parent_rate; | 353 | return parent_rate; |
@@ -365,7 +365,7 @@ static unsigned long get_rate_spll(struct clk *clk) | |||
365 | /* On TO2 we have to write the value back. Otherwise we | 365 | /* On TO2 we have to write the value back. Otherwise we |
366 | * read 0 from this register the next time. | 366 | * read 0 from this register the next time. |
367 | */ | 367 | */ |
368 | if (mx27_revision() >= CHIP_REV_2_0) | 368 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) |
369 | __raw_writel(reg, CCM_SPCTL0); | 369 | __raw_writel(reg, CCM_SPCTL0); |
370 | 370 | ||
371 | return mxc_decode_pll(reg, rate); | 371 | return mxc_decode_pll(reg, rate); |
@@ -376,7 +376,7 @@ static unsigned long get_rate_cpu(struct clk *clk) | |||
376 | u32 div; | 376 | u32 div; |
377 | unsigned long rate; | 377 | unsigned long rate; |
378 | 378 | ||
379 | if (mx27_revision() >= CHIP_REV_2_0) | 379 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) |
380 | div = (__raw_readl(CCM_CSCR) >> 12) & 0x3; | 380 | div = (__raw_readl(CCM_CSCR) >> 12) & 0x3; |
381 | else | 381 | else |
382 | div = (__raw_readl(CCM_CSCR) >> 13) & 0x7; | 382 | div = (__raw_readl(CCM_CSCR) >> 13) & 0x7; |
@@ -389,7 +389,7 @@ static unsigned long get_rate_ahb(struct clk *clk) | |||
389 | { | 389 | { |
390 | unsigned long rate, bclk_pdf; | 390 | unsigned long rate, bclk_pdf; |
391 | 391 | ||
392 | if (mx27_revision() >= CHIP_REV_2_0) | 392 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) |
393 | bclk_pdf = (__raw_readl(CCM_CSCR) >> 8) & 0x3; | 393 | bclk_pdf = (__raw_readl(CCM_CSCR) >> 8) & 0x3; |
394 | else | 394 | else |
395 | bclk_pdf = (__raw_readl(CCM_CSCR) >> 9) & 0xf; | 395 | bclk_pdf = (__raw_readl(CCM_CSCR) >> 9) & 0xf; |
@@ -402,7 +402,7 @@ static unsigned long get_rate_ipg(struct clk *clk) | |||
402 | { | 402 | { |
403 | unsigned long rate, ipg_pdf; | 403 | unsigned long rate, ipg_pdf; |
404 | 404 | ||
405 | if (mx27_revision() >= CHIP_REV_2_0) | 405 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) |
406 | return clk_get_rate(clk->parent); | 406 | return clk_get_rate(clk->parent); |
407 | else | 407 | else |
408 | ipg_pdf = (__raw_readl(CCM_CSCR) >> 8) & 1; | 408 | ipg_pdf = (__raw_readl(CCM_CSCR) >> 8) & 1; |
@@ -683,7 +683,7 @@ static void __init to2_adjust_clocks(void) | |||
683 | { | 683 | { |
684 | unsigned long cscr = __raw_readl(CCM_CSCR); | 684 | unsigned long cscr = __raw_readl(CCM_CSCR); |
685 | 685 | ||
686 | if (mx27_revision() >= CHIP_REV_2_0) { | 686 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) { |
687 | if (cscr & CCM_CSCR_ARM_SRC) | 687 | if (cscr & CCM_CSCR_ARM_SRC) |
688 | cpu_clk.parent = &mpll_main1_clk; | 688 | cpu_clk.parent = &mpll_main1_clk; |
689 | 689 | ||
diff --git a/arch/arm/mach-imx/cpu-imx27.c b/arch/arm/mach-imx/cpu-imx27.c index d8d3b2d84dc5..3b117be37bd2 100644 --- a/arch/arm/mach-imx/cpu-imx27.c +++ b/arch/arm/mach-imx/cpu-imx27.c | |||
@@ -42,7 +42,19 @@ static void query_silicon_parameter(void) | |||
42 | val = __raw_readl(MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR | 42 | val = __raw_readl(MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR |
43 | + SYS_CHIP_ID)); | 43 | + SYS_CHIP_ID)); |
44 | 44 | ||
45 | cpu_silicon_rev = (int)(val >> 28); | 45 | switch (val >> 28) { |
46 | case 0: | ||
47 | cpu_silicon_rev = IMX_CHIP_REVISION_1_0; | ||
48 | break; | ||
49 | case 1: | ||
50 | cpu_silicon_rev = IMX_CHIP_REVISION_2_0; | ||
51 | break; | ||
52 | case 2: | ||
53 | cpu_silicon_rev = IMX_CHIP_REVISION_2_1; | ||
54 | break; | ||
55 | default: | ||
56 | cpu_silicon_rev = IMX_CHIP_REVISION_UNKNOWN; | ||
57 | } | ||
46 | cpu_partnumber = (int)((val >> 12) & 0xFFFF); | 58 | cpu_partnumber = (int)((val >> 12) & 0xFFFF); |
47 | } | 59 | } |
48 | 60 | ||
diff --git a/arch/arm/mach-mx3/clock-imx31.c b/arch/arm/mach-mx3/clock-imx31.c index 109e98f323e0..7cf6d29f376b 100644 --- a/arch/arm/mach-mx3/clock-imx31.c +++ b/arch/arm/mach-mx3/clock-imx31.c | |||
@@ -615,7 +615,7 @@ int __init mx31_clocks_init(unsigned long fref) | |||
615 | 615 | ||
616 | mx31_read_cpu_rev(); | 616 | mx31_read_cpu_rev(); |
617 | 617 | ||
618 | if (mx31_revision() >= MX31_CHIP_REV_2_0) { | 618 | if (mx31_revision() >= IMX_CHIP_REVISION_2_0) { |
619 | reg = __raw_readl(MXC_CCM_PMCR1); | 619 | reg = __raw_readl(MXC_CCM_PMCR1); |
620 | /* No PLL restart on DVFS switch; enable auto EMI handshake */ | 620 | /* No PLL restart on DVFS switch; enable auto EMI handshake */ |
621 | reg |= MXC_CCM_PMCR1_PLLRDIS | MXC_CCM_PMCR1_EMIRQ_EN; | 621 | reg |= MXC_CCM_PMCR1_PLLRDIS | MXC_CCM_PMCR1_EMIRQ_EN; |
diff --git a/arch/arm/mach-mx3/cpu.c b/arch/arm/mach-mx3/cpu.c index d00a75457812..d1d339576fdf 100644 --- a/arch/arm/mach-mx3/cpu.c +++ b/arch/arm/mach-mx3/cpu.c | |||
@@ -25,15 +25,15 @@ struct mx3_cpu_type { | |||
25 | }; | 25 | }; |
26 | 26 | ||
27 | static struct mx3_cpu_type mx31_cpu_type[] __initdata = { | 27 | static struct mx3_cpu_type mx31_cpu_type[] __initdata = { |
28 | { .srev = 0x00, .name = "i.MX31(L)", .v = "1.0", .rev = MX3x_CHIP_REV_1_0 }, | 28 | { .srev = 0x00, .name = "i.MX31(L)", .v = "1.0", .rev = IMX_CHIP_REVISION_1_0 }, |
29 | { .srev = 0x10, .name = "i.MX31", .v = "1.1", .rev = MX3x_CHIP_REV_1_1 }, | 29 | { .srev = 0x10, .name = "i.MX31", .v = "1.1", .rev = IMX_CHIP_REVISION_1_1 }, |
30 | { .srev = 0x11, .name = "i.MX31L", .v = "1.1", .rev = MX3x_CHIP_REV_1_1 }, | 30 | { .srev = 0x11, .name = "i.MX31L", .v = "1.1", .rev = IMX_CHIP_REVISION_1_1 }, |
31 | { .srev = 0x12, .name = "i.MX31", .v = "1.15", .rev = MX3x_CHIP_REV_1_1 }, | 31 | { .srev = 0x12, .name = "i.MX31", .v = "1.15", .rev = IMX_CHIP_REVISION_1_1 }, |
32 | { .srev = 0x13, .name = "i.MX31L", .v = "1.15", .rev = MX3x_CHIP_REV_1_1 }, | 32 | { .srev = 0x13, .name = "i.MX31L", .v = "1.15", .rev = IMX_CHIP_REVISION_1_1 }, |
33 | { .srev = 0x14, .name = "i.MX31", .v = "1.2", .rev = MX3x_CHIP_REV_1_2 }, | 33 | { .srev = 0x14, .name = "i.MX31", .v = "1.2", .rev = IMX_CHIP_REVISION_1_2 }, |
34 | { .srev = 0x15, .name = "i.MX31L", .v = "1.2", .rev = MX3x_CHIP_REV_1_2 }, | 34 | { .srev = 0x15, .name = "i.MX31L", .v = "1.2", .rev = IMX_CHIP_REVISION_1_2 }, |
35 | { .srev = 0x28, .name = "i.MX31", .v = "2.0", .rev = MX3x_CHIP_REV_2_0 }, | 35 | { .srev = 0x28, .name = "i.MX31", .v = "2.0", .rev = IMX_CHIP_REVISION_2_0 }, |
36 | { .srev = 0x29, .name = "i.MX31L", .v = "2.0", .rev = MX3x_CHIP_REV_2_0 }, | 36 | { .srev = 0x29, .name = "i.MX31L", .v = "2.0", .rev = IMX_CHIP_REVISION_2_0 }, |
37 | }; | 37 | }; |
38 | 38 | ||
39 | void __init mx31_read_cpu_rev(void) | 39 | void __init mx31_read_cpu_rev(void) |
@@ -53,6 +53,8 @@ void __init mx31_read_cpu_rev(void) | |||
53 | return; | 53 | return; |
54 | } | 54 | } |
55 | 55 | ||
56 | mx31_cpu_rev = IMX_CHIP_REVISION_UNKNOWN; | ||
57 | |||
56 | printk(KERN_WARNING "Unknown CPU identifier. srev = %02x\n", srev); | 58 | printk(KERN_WARNING "Unknown CPU identifier. srev = %02x\n", srev); |
57 | } | 59 | } |
58 | 60 | ||
@@ -62,22 +64,25 @@ EXPORT_SYMBOL(mx35_cpu_rev); | |||
62 | void __init mx35_read_cpu_rev(void) | 64 | void __init mx35_read_cpu_rev(void) |
63 | { | 65 | { |
64 | u32 rev; | 66 | u32 rev; |
65 | char *srev = "unknown"; | 67 | char *srev; |
66 | 68 | ||
67 | rev = __raw_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV)); | 69 | rev = __raw_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV)); |
68 | switch (rev) { | 70 | switch (rev) { |
69 | case 0x00: | 71 | case 0x00: |
70 | mx35_cpu_rev = MX3x_CHIP_REV_1_0; | 72 | mx35_cpu_rev = IMX_CHIP_REVISION_1_0; |
71 | srev = "1.0"; | 73 | srev = "1.0"; |
72 | break; | 74 | break; |
73 | case 0x10: | 75 | case 0x10: |
74 | mx35_cpu_rev = MX3x_CHIP_REV_2_0; | 76 | mx35_cpu_rev = IMX_CHIP_REVISION_2_0; |
75 | srev = "2.0"; | 77 | srev = "2.0"; |
76 | break; | 78 | break; |
77 | case 0x11: | 79 | case 0x11: |
78 | mx35_cpu_rev = MX3x_CHIP_REV_2_1; | 80 | mx35_cpu_rev = IMX_CHIP_REVISION_2_1; |
79 | srev = "2.1"; | 81 | srev = "2.1"; |
80 | break; | 82 | break; |
83 | default: | ||
84 | mx35_cpu_rev = IMX_CHIP_REVISION_UNKNOWN; | ||
85 | srev = "unknown"; | ||
81 | } | 86 | } |
82 | 87 | ||
83 | printk(KERN_INFO "CPU identified as i.MX35, silicon rev %s\n", srev); | 88 | printk(KERN_INFO "CPU identified as i.MX35, silicon rev %s\n", srev); |
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c index ca4f9d58cfeb..344ee8ef1eef 100644 --- a/arch/arm/mach-mx5/clock-mx51-mx53.c +++ b/arch/arm/mach-mx5/clock-mx51-mx53.c | |||
@@ -780,6 +780,12 @@ static struct clk ahb_clk = { | |||
780 | .round_rate = _clk_ahb_round_rate, | 780 | .round_rate = _clk_ahb_round_rate, |
781 | }; | 781 | }; |
782 | 782 | ||
783 | static struct clk iim_clk = { | ||
784 | .parent = &ipg_clk, | ||
785 | .enable_reg = MXC_CCM_CCGR0, | ||
786 | .enable_shift = MXC_CCM_CCGRx_CG15_OFFSET, | ||
787 | }; | ||
788 | |||
783 | /* Main IP interface clock for access to registers */ | 789 | /* Main IP interface clock for access to registers */ |
784 | static struct clk ipg_clk = { | 790 | static struct clk ipg_clk = { |
785 | .parent = &ahb_clk, | 791 | .parent = &ahb_clk, |
@@ -1099,6 +1105,7 @@ static struct clk_lookup mx51_lookups[] = { | |||
1099 | _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) | 1105 | _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) |
1100 | _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk) | 1106 | _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk) |
1101 | _REGISTER_CLOCK(NULL, "cpu_clk", cpu_clk) | 1107 | _REGISTER_CLOCK(NULL, "cpu_clk", cpu_clk) |
1108 | _REGISTER_CLOCK(NULL, "iim_clk", iim_clk) | ||
1102 | }; | 1109 | }; |
1103 | 1110 | ||
1104 | static struct clk_lookup mx53_lookups[] = { | 1111 | static struct clk_lookup mx53_lookups[] = { |
@@ -1107,6 +1114,7 @@ static struct clk_lookup mx53_lookups[] = { | |||
1107 | _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) | 1114 | _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) |
1108 | _REGISTER_CLOCK(NULL, "gpt", gpt_clk) | 1115 | _REGISTER_CLOCK(NULL, "gpt", gpt_clk) |
1109 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) | 1116 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) |
1117 | _REGISTER_CLOCK(NULL, "iim_clk", iim_clk) | ||
1110 | }; | 1118 | }; |
1111 | 1119 | ||
1112 | static void clk_tree_init(void) | 1120 | static void clk_tree_init(void) |
@@ -1147,6 +1155,10 @@ int __init mx51_clocks_init(unsigned long ckil, unsigned long osc, | |||
1147 | clk_enable(&cpu_clk); | 1155 | clk_enable(&cpu_clk); |
1148 | clk_enable(&main_bus_clk); | 1156 | clk_enable(&main_bus_clk); |
1149 | 1157 | ||
1158 | clk_enable(&iim_clk); | ||
1159 | mx51_revision(); | ||
1160 | clk_disable(&iim_clk); | ||
1161 | |||
1150 | /* set the usboh3_clk parent to pll2_sw_clk */ | 1162 | /* set the usboh3_clk parent to pll2_sw_clk */ |
1151 | clk_set_parent(&usboh3_clk, &pll2_sw_clk); | 1163 | clk_set_parent(&usboh3_clk, &pll2_sw_clk); |
1152 | 1164 | ||
@@ -1182,6 +1194,10 @@ int __init mx53_clocks_init(unsigned long ckil, unsigned long osc, | |||
1182 | clk_enable(&cpu_clk); | 1194 | clk_enable(&cpu_clk); |
1183 | clk_enable(&main_bus_clk); | 1195 | clk_enable(&main_bus_clk); |
1184 | 1196 | ||
1197 | clk_enable(&iim_clk); | ||
1198 | mx53_revision(); | ||
1199 | clk_disable(&iim_clk); | ||
1200 | |||
1185 | /* System timer */ | 1201 | /* System timer */ |
1186 | mxc_timer_init(&gpt_clk, MX53_IO_ADDRESS(MX53_GPT1_BASE_ADDR), | 1202 | mxc_timer_init(&gpt_clk, MX53_IO_ADDRESS(MX53_GPT1_BASE_ADDR), |
1187 | MX53_INT_GPT); | 1203 | MX53_INT_GPT); |
diff --git a/arch/arm/mach-mx5/cpu.c b/arch/arm/mach-mx5/cpu.c index a00d2bc7246a..d40671da4372 100644 --- a/arch/arm/mach-mx5/cpu.c +++ b/arch/arm/mach-mx5/cpu.c | |||
@@ -20,37 +20,18 @@ | |||
20 | 20 | ||
21 | static int cpu_silicon_rev = -1; | 21 | static int cpu_silicon_rev = -1; |
22 | 22 | ||
23 | #define SI_REV 0x48 | 23 | #define IIM_SREV 0x24 |
24 | 24 | ||
25 | static void query_silicon_parameter(void) | 25 | static int get_mx51_srev(void) |
26 | { | 26 | { |
27 | void __iomem *rom = ioremap(MX51_IROM_BASE_ADDR, MX51_IROM_SIZE); | 27 | void __iomem *iim_base = MX51_IO_ADDRESS(MX51_IIM_BASE_ADDR); |
28 | u32 rev; | 28 | u32 rev = readl(iim_base + IIM_SREV) & 0xff; |
29 | 29 | ||
30 | if (!rom) { | 30 | if (rev == 0x0) |
31 | cpu_silicon_rev = -EINVAL; | 31 | return IMX_CHIP_REVISION_2_0; |
32 | return; | 32 | else if (rev == 0x10) |
33 | } | 33 | return IMX_CHIP_REVISION_3_0; |
34 | 34 | return 0; | |
35 | rev = readl(rom + SI_REV); | ||
36 | switch (rev) { | ||
37 | case 0x1: | ||
38 | cpu_silicon_rev = MX51_CHIP_REV_1_0; | ||
39 | break; | ||
40 | case 0x2: | ||
41 | cpu_silicon_rev = MX51_CHIP_REV_1_1; | ||
42 | break; | ||
43 | case 0x10: | ||
44 | cpu_silicon_rev = MX51_CHIP_REV_2_0; | ||
45 | break; | ||
46 | case 0x20: | ||
47 | cpu_silicon_rev = MX51_CHIP_REV_3_0; | ||
48 | break; | ||
49 | default: | ||
50 | cpu_silicon_rev = 0; | ||
51 | } | ||
52 | |||
53 | iounmap(rom); | ||
54 | } | 35 | } |
55 | 36 | ||
56 | /* | 37 | /* |
@@ -64,7 +45,7 @@ int mx51_revision(void) | |||
64 | return -EINVAL; | 45 | return -EINVAL; |
65 | 46 | ||
66 | if (cpu_silicon_rev == -1) | 47 | if (cpu_silicon_rev == -1) |
67 | query_silicon_parameter(); | 48 | cpu_silicon_rev = get_mx51_srev(); |
68 | 49 | ||
69 | return cpu_silicon_rev; | 50 | return cpu_silicon_rev; |
70 | } | 51 | } |
@@ -82,7 +63,7 @@ static int __init mx51_neon_fixup(void) | |||
82 | if (!cpu_is_mx51()) | 63 | if (!cpu_is_mx51()) |
83 | return 0; | 64 | return 0; |
84 | 65 | ||
85 | if (mx51_revision() < MX51_CHIP_REV_3_0 && (elf_hwcap & HWCAP_NEON)) { | 66 | if (mx51_revision() < IMX_CHIP_REVISION_3_0 && (elf_hwcap & HWCAP_NEON)) { |
86 | elf_hwcap &= ~HWCAP_NEON; | 67 | elf_hwcap &= ~HWCAP_NEON; |
87 | pr_info("Turning off NEON support, detected broken NEON implementation\n"); | 68 | pr_info("Turning off NEON support, detected broken NEON implementation\n"); |
88 | } | 69 | } |
@@ -92,6 +73,18 @@ static int __init mx51_neon_fixup(void) | |||
92 | late_initcall(mx51_neon_fixup); | 73 | late_initcall(mx51_neon_fixup); |
93 | #endif | 74 | #endif |
94 | 75 | ||
76 | static int get_mx53_srev(void) | ||
77 | { | ||
78 | void __iomem *iim_base = MX51_IO_ADDRESS(MX53_IIM_BASE_ADDR); | ||
79 | u32 rev = readl(iim_base + IIM_SREV) & 0xff; | ||
80 | |||
81 | if (rev == 0x0) | ||
82 | return IMX_CHIP_REVISION_1_0; | ||
83 | else if (rev == 0x10) | ||
84 | return IMX_CHIP_REVISION_2_0; | ||
85 | return 0; | ||
86 | } | ||
87 | |||
95 | /* | 88 | /* |
96 | * Returns: | 89 | * Returns: |
97 | * the silicon revision of the cpu | 90 | * the silicon revision of the cpu |
@@ -103,7 +96,7 @@ int mx53_revision(void) | |||
103 | return -EINVAL; | 96 | return -EINVAL; |
104 | 97 | ||
105 | if (cpu_silicon_rev == -1) | 98 | if (cpu_silicon_rev == -1) |
106 | query_silicon_parameter(); | 99 | cpu_silicon_rev = get_mx53_srev(); |
107 | 100 | ||
108 | return cpu_silicon_rev; | 101 | return cpu_silicon_rev; |
109 | } | 102 | } |
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c index cbaf282fb818..e57f96858f0d 100644 --- a/arch/arm/mach-mx5/mm.c +++ b/arch/arm/mach-mx5/mm.c | |||
@@ -68,7 +68,7 @@ void __init mx51_init_irq(void) | |||
68 | unsigned long tzic_addr; | 68 | unsigned long tzic_addr; |
69 | void __iomem *tzic_virt; | 69 | void __iomem *tzic_virt; |
70 | 70 | ||
71 | if (mx51_revision() < MX51_CHIP_REV_2_0) | 71 | if (mx51_revision() < IMX_CHIP_REVISION_2_0) |
72 | tzic_addr = MX51_TZIC_BASE_ADDR_TO1; | 72 | tzic_addr = MX51_TZIC_BASE_ADDR_TO1; |
73 | else | 73 | else |
74 | tzic_addr = MX51_TZIC_BASE_ADDR; | 74 | tzic_addr = MX51_TZIC_BASE_ADDR; |
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h index eb09ec09dbe5..cbc43ad5ef48 100644 --- a/arch/arm/plat-mxc/include/mach/mx27.h +++ b/arch/arm/plat-mxc/include/mach/mx27.h | |||
@@ -244,10 +244,6 @@ static inline void mx27_setup_weimcs(size_t cs, | |||
244 | #define MX27_DMA_REQ_SDHC3 36 | 244 | #define MX27_DMA_REQ_SDHC3 36 |
245 | #define MX27_DMA_REQ_NFC 37 | 245 | #define MX27_DMA_REQ_NFC 37 |
246 | 246 | ||
247 | /* silicon revisions specific to i.MX27 */ | ||
248 | #define CHIP_REV_1_0 0x00 | ||
249 | #define CHIP_REV_2_0 0x01 | ||
250 | |||
251 | #ifndef __ASSEMBLY__ | 247 | #ifndef __ASSEMBLY__ |
252 | extern int mx27_revision(void); | 248 | extern int mx27_revision(void); |
253 | #endif | 249 | #endif |
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h index 092323144e2b..79e7fc01bb59 100644 --- a/arch/arm/plat-mxc/include/mach/mx31.h +++ b/arch/arm/plat-mxc/include/mach/mx31.h | |||
@@ -203,20 +203,4 @@ static inline void mx31_setup_weimcs(size_t cs, | |||
203 | 203 | ||
204 | #define MX31_PROD_SIGNATURE 0x1 /* For MX31 */ | 204 | #define MX31_PROD_SIGNATURE 0x1 /* For MX31 */ |
205 | 205 | ||
206 | /* silicon revisions specific to i.MX31 */ | ||
207 | #define MX31_CHIP_REV_1_0 0x10 | ||
208 | #define MX31_CHIP_REV_1_1 0x11 | ||
209 | #define MX31_CHIP_REV_1_2 0x12 | ||
210 | #define MX31_CHIP_REV_1_3 0x13 | ||
211 | #define MX31_CHIP_REV_2_0 0x20 | ||
212 | #define MX31_CHIP_REV_2_1 0x21 | ||
213 | #define MX31_CHIP_REV_2_2 0x22 | ||
214 | #define MX31_CHIP_REV_2_3 0x23 | ||
215 | #define MX31_CHIP_REV_3_0 0x30 | ||
216 | #define MX31_CHIP_REV_3_1 0x31 | ||
217 | #define MX31_CHIP_REV_3_2 0x32 | ||
218 | |||
219 | #define MX31_SYSTEM_REV_MIN MX31_CHIP_REV_1_0 | ||
220 | #define MX31_SYSTEM_REV_NUM 3 | ||
221 | |||
222 | #endif /* ifndef __MACH_MX31_H__ */ | 206 | #endif /* ifndef __MACH_MX31_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/mx35.h b/arch/arm/plat-mxc/include/mach/mx35.h index 0fa3f6855349..d13dbfeef08a 100644 --- a/arch/arm/plat-mxc/include/mach/mx35.h +++ b/arch/arm/plat-mxc/include/mach/mx35.h | |||
@@ -186,7 +186,4 @@ | |||
186 | 186 | ||
187 | #define MX35_PROD_SIGNATURE 0x1 /* For MX31 */ | 187 | #define MX35_PROD_SIGNATURE 0x1 /* For MX31 */ |
188 | 188 | ||
189 | #define MX35_SYSTEM_REV_MIN MX3x_CHIP_REV_1_0 | ||
190 | #define MX35_SYSTEM_REV_NUM 3 | ||
191 | |||
192 | #endif /* ifndef __MACH_MX35_H__ */ | 189 | #endif /* ifndef __MACH_MX35_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/mx3x.h b/arch/arm/plat-mxc/include/mach/mx3x.h index 8c7f34e737d0..388a407d72d6 100644 --- a/arch/arm/plat-mxc/include/mach/mx3x.h +++ b/arch/arm/plat-mxc/include/mach/mx3x.h | |||
@@ -184,22 +184,6 @@ | |||
184 | 184 | ||
185 | #define MX3x_PROD_SIGNATURE 0x1 /* For MX31 */ | 185 | #define MX3x_PROD_SIGNATURE 0x1 /* For MX31 */ |
186 | 186 | ||
187 | /* silicon revisions specific to i.MX31 and i.MX35 */ | ||
188 | #define MX3x_CHIP_REV_1_0 0x10 | ||
189 | #define MX3x_CHIP_REV_1_1 0x11 | ||
190 | #define MX3x_CHIP_REV_1_2 0x12 | ||
191 | #define MX3x_CHIP_REV_1_3 0x13 | ||
192 | #define MX3x_CHIP_REV_2_0 0x20 | ||
193 | #define MX3x_CHIP_REV_2_1 0x21 | ||
194 | #define MX3x_CHIP_REV_2_2 0x22 | ||
195 | #define MX3x_CHIP_REV_2_3 0x23 | ||
196 | #define MX3x_CHIP_REV_3_0 0x30 | ||
197 | #define MX3x_CHIP_REV_3_1 0x31 | ||
198 | #define MX3x_CHIP_REV_3_2 0x32 | ||
199 | |||
200 | #define MX3x_SYSTEM_REV_MIN MX3x_CHIP_REV_1_0 | ||
201 | #define MX3x_SYSTEM_REV_NUM 3 | ||
202 | |||
203 | /* Mandatory defines used globally */ | 187 | /* Mandatory defines used globally */ |
204 | 188 | ||
205 | #if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) | 189 | #if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) |
diff --git a/arch/arm/plat-mxc/include/mach/mx51.h b/arch/arm/plat-mxc/include/mach/mx51.h index 636347c3fa88..8fddfef9b4e8 100644 --- a/arch/arm/plat-mxc/include/mach/mx51.h +++ b/arch/arm/plat-mxc/include/mach/mx51.h | |||
@@ -345,19 +345,6 @@ | |||
345 | #define MX51_MXC_INT_EMI_NFC 101 | 345 | #define MX51_MXC_INT_EMI_NFC 101 |
346 | #define MX51_MXC_INT_GPU_IDLE 102 | 346 | #define MX51_MXC_INT_GPU_IDLE 102 |
347 | 347 | ||
348 | /* silicon revisions specific to i.MX51 */ | ||
349 | #define MX51_CHIP_REV_1_0 0x10 | ||
350 | #define MX51_CHIP_REV_1_1 0x11 | ||
351 | #define MX51_CHIP_REV_1_2 0x12 | ||
352 | #define MX51_CHIP_REV_1_3 0x13 | ||
353 | #define MX51_CHIP_REV_2_0 0x20 | ||
354 | #define MX51_CHIP_REV_2_1 0x21 | ||
355 | #define MX51_CHIP_REV_2_2 0x22 | ||
356 | #define MX51_CHIP_REV_2_3 0x23 | ||
357 | #define MX51_CHIP_REV_3_0 0x30 | ||
358 | #define MX51_CHIP_REV_3_1 0x31 | ||
359 | #define MX51_CHIP_REV_3_2 0x32 | ||
360 | |||
361 | #if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) | 348 | #if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) |
362 | extern int mx51_revision(void); | 349 | extern int mx51_revision(void); |
363 | #endif | 350 | #endif |
diff --git a/arch/arm/plat-mxc/include/mach/mxc.h b/arch/arm/plat-mxc/include/mach/mxc.h index 4c17515650b8..4abbdd11d5c6 100644 --- a/arch/arm/plat-mxc/include/mach/mxc.h +++ b/arch/arm/plat-mxc/include/mach/mxc.h | |||
@@ -36,6 +36,20 @@ | |||
36 | #define MXC_CPU_MX53 53 | 36 | #define MXC_CPU_MX53 53 |
37 | #define MXC_CPU_MXC91231 91231 | 37 | #define MXC_CPU_MXC91231 91231 |
38 | 38 | ||
39 | #define IMX_CHIP_REVISION_1_0 0x10 | ||
40 | #define IMX_CHIP_REVISION_1_1 0x11 | ||
41 | #define IMX_CHIP_REVISION_1_2 0x12 | ||
42 | #define IMX_CHIP_REVISION_1_3 0x13 | ||
43 | #define IMX_CHIP_REVISION_2_0 0x20 | ||
44 | #define IMX_CHIP_REVISION_2_1 0x21 | ||
45 | #define IMX_CHIP_REVISION_2_2 0x22 | ||
46 | #define IMX_CHIP_REVISION_2_3 0x23 | ||
47 | #define IMX_CHIP_REVISION_3_0 0x30 | ||
48 | #define IMX_CHIP_REVISION_3_1 0x31 | ||
49 | #define IMX_CHIP_REVISION_3_2 0x32 | ||
50 | #define IMX_CHIP_REVISION_3_3 0x33 | ||
51 | #define IMX_CHIP_REVISION_UNKNOWN 0xff | ||
52 | |||
39 | #ifndef __ASSEMBLY__ | 53 | #ifndef __ASSEMBLY__ |
40 | extern unsigned int __mxc_cpu_type; | 54 | extern unsigned int __mxc_cpu_type; |
41 | #endif | 55 | #endif |