diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-07-11 06:46:23 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-07-12 11:36:50 -0400 |
commit | e95f2e790e98c61eb88caa5ee31a04e1dc7a8c59 (patch) | |
tree | 931a803464fae8dde65b502be3da59c77bd1692d /arch/arm/mach-imx | |
parent | 6de7351cb5a628101eb5931302f9dd73c335ef22 (diff) | |
parent | 0767211bea2f2062b1d5620eed6a279fa2b4330e (diff) |
Merge tag 'imx-dt' of git://git.pengutronix.de/git/imx/linux-2.6 into next/dt
From Sascha Hauer <s.hauer@pengutronix.de>:
ARM i.MX dt updates for v3.6
* tag 'imx-dt' of git://git.pengutronix.de/git/imx/linux-2.6:
arm/dts: Add support for i.MX31 bug 1.x board from buglabs.
ARM i.MX31: Add devicetree support
ARM: dts: Add basic support for mx27_3ds board
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/mach-imx/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-imx31.c | 19 | ||||
-rw-r--r-- | arch/arm/mach-imx/imx31-dt.c | 63 |
4 files changed, 91 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index c296851233e8..92d0ddd5f8d4 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig | |||
@@ -560,6 +560,14 @@ config MACH_BUG | |||
560 | Include support for BUGBase 1.3 platform. This includes specific | 560 | Include support for BUGBase 1.3 platform. This includes specific |
561 | configurations for the board and its peripherals. | 561 | configurations for the board and its peripherals. |
562 | 562 | ||
563 | config MACH_IMX31_DT | ||
564 | bool "Support i.MX31 platforms from device tree" | ||
565 | select SOC_IMX31 | ||
566 | select USE_OF | ||
567 | help | ||
568 | Include support for Freescale i.MX31 based platforms | ||
569 | using the device tree for discovery. | ||
570 | |||
563 | comment "MX35 platforms:" | 571 | comment "MX35 platforms:" |
564 | 572 | ||
565 | config MACH_PCM043 | 573 | config MACH_PCM043 |
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index ff29421414f2..07f7c226e4cf 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile | |||
@@ -57,6 +57,7 @@ obj-$(CONFIG_MACH_QONG) += mach-qong.o | |||
57 | obj-$(CONFIG_MACH_ARMADILLO5X0) += mach-armadillo5x0.o | 57 | obj-$(CONFIG_MACH_ARMADILLO5X0) += mach-armadillo5x0.o |
58 | obj-$(CONFIG_MACH_KZM_ARM11_01) += mach-kzm_arm11_01.o | 58 | obj-$(CONFIG_MACH_KZM_ARM11_01) += mach-kzm_arm11_01.o |
59 | obj-$(CONFIG_MACH_BUG) += mach-bug.o | 59 | obj-$(CONFIG_MACH_BUG) += mach-bug.o |
60 | obj-$(CONFIG_MACH_IMX31_DT) += imx31-dt.o | ||
60 | 61 | ||
61 | # i.MX35 based machines | 62 | # i.MX35 based machines |
62 | obj-$(CONFIG_MACH_PCM043) += mach-pcm043.o | 63 | obj-$(CONFIG_MACH_PCM043) += mach-pcm043.o |
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c index c9a06d800f8e..f87a48fc74e1 100644 --- a/arch/arm/mach-imx/clk-imx31.c +++ b/arch/arm/mach-imx/clk-imx31.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/clkdev.h> | 20 | #include <linux/clkdev.h> |
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/err.h> | 22 | #include <linux/err.h> |
23 | #include <linux/of.h> | ||
23 | 24 | ||
24 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
25 | #include <mach/mx31.h> | 26 | #include <mach/mx31.h> |
@@ -179,3 +180,21 @@ int __init mx31_clocks_init(unsigned long fref) | |||
179 | 180 | ||
180 | return 0; | 181 | return 0; |
181 | } | 182 | } |
183 | |||
184 | #ifdef CONFIG_OF | ||
185 | int __init mx31_clocks_init_dt(void) | ||
186 | { | ||
187 | struct device_node *np; | ||
188 | u32 fref = 26000000; /* default */ | ||
189 | |||
190 | for_each_compatible_node(np, NULL, "fixed-clock") { | ||
191 | if (!of_device_is_compatible(np, "fsl,imx-osc26m")) | ||
192 | continue; | ||
193 | |||
194 | if (!of_property_read_u32(np, "clock-frequency", &fref)) | ||
195 | break; | ||
196 | } | ||
197 | |||
198 | return mx31_clocks_init(fref); | ||
199 | } | ||
200 | #endif | ||
diff --git a/arch/arm/mach-imx/imx31-dt.c b/arch/arm/mach-imx/imx31-dt.c new file mode 100644 index 000000000000..a68ba207b2b7 --- /dev/null +++ b/arch/arm/mach-imx/imx31-dt.c | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | * Copyright 2012 Sascha Hauer, Pengutronix | ||
3 | * | ||
4 | * The code contained herein is licensed under the GNU General Public | ||
5 | * License. You may obtain a copy of the GNU General Public License | ||
6 | * Version 2 or later at the following locations: | ||
7 | * | ||
8 | * http://www.opensource.org/licenses/gpl-license.html | ||
9 | * http://www.gnu.org/copyleft/gpl.html | ||
10 | */ | ||
11 | |||
12 | #include <linux/irq.h> | ||
13 | #include <linux/of_irq.h> | ||
14 | #include <linux/of_platform.h> | ||
15 | #include <asm/mach/arch.h> | ||
16 | #include <asm/mach/time.h> | ||
17 | #include <mach/common.h> | ||
18 | #include <mach/mx31.h> | ||
19 | |||
20 | static const struct of_dev_auxdata imx31_auxdata_lookup[] __initconst = { | ||
21 | OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART1_BASE_ADDR, | ||
22 | "imx21-uart.0", NULL), | ||
23 | OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART2_BASE_ADDR, | ||
24 | "imx21-uart.1", NULL), | ||
25 | OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART3_BASE_ADDR, | ||
26 | "imx21-uart.2", NULL), | ||
27 | OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART4_BASE_ADDR, | ||
28 | "imx21-uart.3", NULL), | ||
29 | OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART5_BASE_ADDR, | ||
30 | "imx21-uart.4", NULL), | ||
31 | { /* sentinel */ } | ||
32 | }; | ||
33 | |||
34 | static void __init imx31_dt_init(void) | ||
35 | { | ||
36 | of_platform_populate(NULL, of_default_bus_match_table, | ||
37 | imx31_auxdata_lookup, NULL); | ||
38 | } | ||
39 | |||
40 | static void __init imx31_timer_init(void) | ||
41 | { | ||
42 | mx31_clocks_init_dt(); | ||
43 | } | ||
44 | |||
45 | static struct sys_timer imx31_timer = { | ||
46 | .init = imx31_timer_init, | ||
47 | }; | ||
48 | |||
49 | static const char *imx31_dt_board_compat[] __initdata = { | ||
50 | "fsl,imx31", | ||
51 | NULL | ||
52 | }; | ||
53 | |||
54 | DT_MACHINE_START(IMX31_DT, "Freescale i.MX31 (Device Tree Support)") | ||
55 | .map_io = mx31_map_io, | ||
56 | .init_early = imx31_init_early, | ||
57 | .init_irq = mx31_init_irq, | ||
58 | .handle_irq = imx31_handle_irq, | ||
59 | .timer = &imx31_timer, | ||
60 | .init_machine = imx31_dt_init, | ||
61 | .dt_compat = imx31_dt_board_compat, | ||
62 | .restart = mxc_restart, | ||
63 | MACHINE_END | ||