diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2013-04-01 10:13:32 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2013-04-12 07:28:15 -0400 |
commit | 3c03a2fed63881abf5ecb5596625157ecfc9e4eb (patch) | |
tree | 778ca5a06bce20eb35f4c459505a3c5bf46a0c0a | |
parent | 9a37ac481aab63c61488562c03125ba279ad57c6 (diff) |
ARM: imx: add initial imx6dl support
The i.MX6 DualLite/Solo is another i.MX6 family SoC, which is highly
compatible with i.MX6 Quad/Dual. And that's why we choose to support
it using imx6q code with cpu_is_imx6dl() check when necessary.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
-rw-r--r-- | arch/arm/Kconfig.debug | 4 | ||||
-rw-r--r-- | arch/arm/mach-imx/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-imx6q.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-imx6q.c | 30 | ||||
-rw-r--r-- | arch/arm/mach-imx/mxc.h | 11 |
5 files changed, 36 insertions, 13 deletions
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 9b31f4311ea2..7e911fd4dd89 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
@@ -234,11 +234,11 @@ choice | |||
234 | on i.MX53. | 234 | on i.MX53. |
235 | 235 | ||
236 | config DEBUG_IMX6Q_UART | 236 | config DEBUG_IMX6Q_UART |
237 | bool "i.MX6Q Debug UART" | 237 | bool "i.MX6Q/DL Debug UART" |
238 | depends on SOC_IMX6Q | 238 | depends on SOC_IMX6Q |
239 | help | 239 | help |
240 | Say Y here if you want kernel low-level debugging support | 240 | Say Y here if you want kernel low-level debugging support |
241 | on i.MX6Q. | 241 | on i.MX6Q/DL. |
242 | 242 | ||
243 | config DEBUG_MMP_UART2 | 243 | config DEBUG_MMP_UART2 |
244 | bool "Kernel low-level debugging message via MMP UART2" | 244 | bool "Kernel low-level debugging message via MMP UART2" |
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 5b676d425bab..2b09a0471d7b 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig | |||
@@ -790,7 +790,7 @@ config SOC_IMX53 | |||
790 | This enables support for Freescale i.MX53 processor. | 790 | This enables support for Freescale i.MX53 processor. |
791 | 791 | ||
792 | config SOC_IMX6Q | 792 | config SOC_IMX6Q |
793 | bool "i.MX6 Quad support" | 793 | bool "i.MX6 Quad/DualLite support" |
794 | select ARCH_HAS_CPUFREQ | 794 | select ARCH_HAS_CPUFREQ |
795 | select ARCH_HAS_OPP | 795 | select ARCH_HAS_OPP |
796 | select ARM_CPU_SUSPEND if PM | 796 | select ARM_CPU_SUSPEND if PM |
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index 43dbcd618be3..151259003086 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c | |||
@@ -296,7 +296,7 @@ int __init mx6q_clocks_init(void) | |||
296 | WARN_ON(!base); | 296 | WARN_ON(!base); |
297 | 297 | ||
298 | /* Audio/video PLL post dividers do not work on i.MX6q revision 1.0 */ | 298 | /* Audio/video PLL post dividers do not work on i.MX6q revision 1.0 */ |
299 | if (imx6q_revision() == IMX_CHIP_REVISION_1_0) { | 299 | if (cpu_is_imx6q() && imx6q_revision() == IMX_CHIP_REVISION_1_0) { |
300 | post_div_table[1].div = 1; | 300 | post_div_table[1].div = 1; |
301 | post_div_table[2].div = 1; | 301 | post_div_table[2].div = 1; |
302 | video_div_table[1].div = 1; | 302 | video_div_table[1].div = 1; |
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 221f31991939..8aa9d9065e8e 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -39,23 +39,32 @@ | |||
39 | #include "cpuidle.h" | 39 | #include "cpuidle.h" |
40 | #include "hardware.h" | 40 | #include "hardware.h" |
41 | 41 | ||
42 | static u32 chip_revision; | ||
43 | |||
42 | int imx6q_revision(void) | 44 | int imx6q_revision(void) |
43 | { | 45 | { |
44 | static u32 rev; | 46 | return chip_revision; |
47 | } | ||
45 | 48 | ||
46 | if (!rev) | 49 | static void __init imx6q_init_revision(void) |
47 | rev = imx_anatop_get_digprog(); | 50 | { |
51 | u32 rev = imx_anatop_get_digprog(); | ||
48 | 52 | ||
49 | switch (rev & 0xff) { | 53 | switch (rev & 0xff) { |
50 | case 0: | 54 | case 0: |
51 | return IMX_CHIP_REVISION_1_0; | 55 | chip_revision = IMX_CHIP_REVISION_1_0; |
56 | break; | ||
52 | case 1: | 57 | case 1: |
53 | return IMX_CHIP_REVISION_1_1; | 58 | chip_revision = IMX_CHIP_REVISION_1_1; |
59 | break; | ||
54 | case 2: | 60 | case 2: |
55 | return IMX_CHIP_REVISION_1_2; | 61 | chip_revision = IMX_CHIP_REVISION_1_2; |
62 | break; | ||
56 | default: | 63 | default: |
57 | return IMX_CHIP_REVISION_UNKNOWN; | 64 | chip_revision = IMX_CHIP_REVISION_UNKNOWN; |
58 | } | 65 | } |
66 | |||
67 | mxc_set_cpu_type(rev >> 16 & 0xff); | ||
59 | } | 68 | } |
60 | 69 | ||
61 | void imx6q_restart(char mode, const char *cmd) | 70 | void imx6q_restart(char mode, const char *cmd) |
@@ -247,6 +256,7 @@ static void __init imx6q_map_io(void) | |||
247 | 256 | ||
248 | static void __init imx6q_init_irq(void) | 257 | static void __init imx6q_init_irq(void) |
249 | { | 258 | { |
259 | imx6q_init_revision(); | ||
250 | l2x0_of_init(0, ~0UL); | 260 | l2x0_of_init(0, ~0UL); |
251 | imx_src_init(); | 261 | imx_src_init(); |
252 | imx_gpc_init(); | 262 | imx_gpc_init(); |
@@ -257,15 +267,17 @@ static void __init imx6q_timer_init(void) | |||
257 | { | 267 | { |
258 | mx6q_clocks_init(); | 268 | mx6q_clocks_init(); |
259 | twd_local_timer_of_register(); | 269 | twd_local_timer_of_register(); |
260 | imx_print_silicon_rev("i.MX6Q", imx6q_revision()); | 270 | imx_print_silicon_rev(cpu_is_imx6dl() ? "i.MX6DL" : "i.MX6Q", |
271 | imx6q_revision()); | ||
261 | } | 272 | } |
262 | 273 | ||
263 | static const char *imx6q_dt_compat[] __initdata = { | 274 | static const char *imx6q_dt_compat[] __initdata = { |
275 | "fsl,imx6dl", | ||
264 | "fsl,imx6q", | 276 | "fsl,imx6q", |
265 | NULL, | 277 | NULL, |
266 | }; | 278 | }; |
267 | 279 | ||
268 | DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)") | 280 | DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad/DualLite (Device Tree)") |
269 | .smp = smp_ops(imx_smp_ops), | 281 | .smp = smp_ops(imx_smp_ops), |
270 | .map_io = imx6q_map_io, | 282 | .map_io = imx6q_map_io, |
271 | .init_irq = imx6q_init_irq, | 283 | .init_irq = imx6q_init_irq, |
diff --git a/arch/arm/mach-imx/mxc.h b/arch/arm/mach-imx/mxc.h index 7dce17a9fe6c..8629e5be7ecd 100644 --- a/arch/arm/mach-imx/mxc.h +++ b/arch/arm/mach-imx/mxc.h | |||
@@ -34,6 +34,8 @@ | |||
34 | #define MXC_CPU_MX35 35 | 34 | #define MXC_CPU_MX35 35 |
35 | #define MXC_CPU_MX51 51 | 35 | #define MXC_CPU_MX51 51 |
36 | #define MXC_CPU_MX53 53 | 36 | #define MXC_CPU_MX53 53 |
37 | #define MXC_CPU_IMX6DL 0x61 | ||
38 | #define MXC_CPU_IMX6Q 0x63 | ||
37 | 39 | ||
38 | #define IMX_CHIP_REVISION_1_0 0x10 | 40 | #define IMX_CHIP_REVISION_1_0 0x10 |
39 | #define IMX_CHIP_REVISION_1_1 0x11 | 41 | #define IMX_CHIP_REVISION_1_1 0x11 |
@@ -150,6 +152,15 @@ extern unsigned int __mxc_cpu_type; | |||
150 | #endif | 152 | #endif |
151 | 153 | ||
152 | #ifndef __ASSEMBLY__ | 154 | #ifndef __ASSEMBLY__ |
155 | static inline bool cpu_is_imx6dl(void) | ||
156 | { | ||
157 | return __mxc_cpu_type == MXC_CPU_IMX6DL; | ||
158 | } | ||
159 | |||
160 | static inline bool cpu_is_imx6q(void) | ||
161 | { | ||
162 | return __mxc_cpu_type == MXC_CPU_IMX6Q; | ||
163 | } | ||
153 | 164 | ||
154 | struct cpu_op { | 165 | struct cpu_op { |
155 | u32 cpu_rate; | 166 | u32 cpu_rate; |