aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/boot/dts/imx27-3ds.dts41
-rw-r--r--arch/arm/boot/dts/imx31-bug.dts31
-rw-r--r--arch/arm/boot/dts/imx31.dtsi88
-rw-r--r--arch/arm/mach-imx/Kconfig8
-rw-r--r--arch/arm/mach-imx/Makefile1
-rw-r--r--arch/arm/mach-imx/clk-imx31.c19
-rw-r--r--arch/arm/mach-imx/imx31-dt.c63
-rw-r--r--arch/arm/plat-mxc/include/mach/common.h1
8 files changed, 252 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/imx27-3ds.dts b/arch/arm/boot/dts/imx27-3ds.dts
new file mode 100644
index 000000000000..d3f8296e19e0
--- /dev/null
+++ b/arch/arm/boot/dts/imx27-3ds.dts
@@ -0,0 +1,41 @@
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/dts-v1/;
13/include/ "imx27.dtsi"
14
15/ {
16 model = "mx27_3ds";
17 compatible = "freescale,imx27-3ds", "fsl,imx27";
18
19 memory {
20 reg = <0x0 0x0>;
21 };
22
23 soc {
24 aipi@10000000 { /* aipi */
25
26 wdog@10002000 {
27 status = "okay";
28 };
29
30 uart@1000a000 {
31 fsl,uart-has-rtscts;
32 status = "okay";
33 };
34
35 fec@1002b000 {
36 status = "okay";
37 };
38 };
39 };
40
41};
diff --git a/arch/arm/boot/dts/imx31-bug.dts b/arch/arm/boot/dts/imx31-bug.dts
new file mode 100644
index 000000000000..24731cb78e8e
--- /dev/null
+++ b/arch/arm/boot/dts/imx31-bug.dts
@@ -0,0 +1,31 @@
1/*
2 * Copyright 2012 Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
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/dts-v1/;
13/include/ "imx31.dtsi"
14
15/ {
16 model = "Buglabs i.MX31 Bug 1.x";
17 compatible = "fsl,imx31-bug", "fsl,imx31";
18
19 memory {
20 reg = <0x80000000 0x8000000>; /* 128M */
21 };
22
23 soc {
24 aips@43f00000 { /* AIPS1 */
25 uart5: serial@43fb4000 {
26 fsl,uart-has-rtscts;
27 status = "okay";
28 };
29 };
30 };
31};
diff --git a/arch/arm/boot/dts/imx31.dtsi b/arch/arm/boot/dts/imx31.dtsi
new file mode 100644
index 000000000000..eef7099f3e3c
--- /dev/null
+++ b/arch/arm/boot/dts/imx31.dtsi
@@ -0,0 +1,88 @@
1/*
2 * Copyright 2012 Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
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/ "skeleton.dtsi"
13
14/ {
15 aliases {
16 serial0 = &uart1;
17 serial1 = &uart2;
18 serial2 = &uart3;
19 serial3 = &uart4;
20 serial4 = &uart5;
21 };
22
23 avic: avic-interrupt-controller@60000000 {
24 compatible = "fsl,imx31-avic", "fsl,avic";
25 interrupt-controller;
26 #interrupt-cells = <1>;
27 reg = <0x60000000 0x100000>;
28 };
29
30 soc {
31 #address-cells = <1>;
32 #size-cells = <1>;
33 compatible = "simple-bus";
34 interrupt-parent = <&avic>;
35 ranges;
36
37 aips@43f00000 { /* AIPS1 */
38 compatible = "fsl,aips-bus", "simple-bus";
39 #address-cells = <1>;
40 #size-cells = <1>;
41 reg = <0x43f00000 0x100000>;
42 ranges;
43
44 uart1: serial@43f90000 {
45 compatible = "fsl,imx31-uart", "fsl,imx21-uart";
46 reg = <0x43f90000 0x4000>;
47 interrupts = <45>;
48 status = "disabled";
49 };
50
51 uart2: serial@43f94000 {
52 compatible = "fsl,imx31-uart", "fsl,imx21-uart";
53 reg = <0x43f94000 0x4000>;
54 interrupts = <32>;
55 status = "disabled";
56 };
57
58 uart4: serial@43fb0000 {
59 compatible = "fsl,imx31-uart", "fsl,imx21-uart";
60 reg = <0x43fb0000 0x4000>;
61 interrupts = <46>;
62 status = "disabled";
63 };
64
65 uart5: serial@43fb4000 {
66 compatible = "fsl,imx31-uart", "fsl,imx21-uart";
67 reg = <0x43fb4000 0x4000>;
68 interrupts = <47>;
69 status = "disabled";
70 };
71 };
72
73 spba@50000000 {
74 compatible = "fsl,spba-bus", "simple-bus";
75 #address-cells = <1>;
76 #size-cells = <1>;
77 reg = <0x50000000 0x100000>;
78 ranges;
79
80 uart3: serial@5000c000 {
81 compatible = "fsl,imx31-uart", "fsl,imx21-uart";
82 reg = <0x5000c000 0x4000>;
83 interrupts = <18>;
84 status = "disabled";
85 };
86 };
87 };
88};
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
563config 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
563comment "MX35 platforms:" 571comment "MX35 platforms:"
564 572
565config MACH_PCM043 573config 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
57obj-$(CONFIG_MACH_ARMADILLO5X0) += mach-armadillo5x0.o 57obj-$(CONFIG_MACH_ARMADILLO5X0) += mach-armadillo5x0.o
58obj-$(CONFIG_MACH_KZM_ARM11_01) += mach-kzm_arm11_01.o 58obj-$(CONFIG_MACH_KZM_ARM11_01) += mach-kzm_arm11_01.o
59obj-$(CONFIG_MACH_BUG) += mach-bug.o 59obj-$(CONFIG_MACH_BUG) += mach-bug.o
60obj-$(CONFIG_MACH_IMX31_DT) += imx31-dt.o
60 61
61# i.MX35 based machines 62# i.MX35 based machines
62obj-$(CONFIG_MACH_PCM043) += mach-pcm043.o 63obj-$(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
185int __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
20static 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
34static void __init imx31_dt_init(void)
35{
36 of_platform_populate(NULL, of_default_bus_match_table,
37 imx31_auxdata_lookup, NULL);
38}
39
40static void __init imx31_timer_init(void)
41{
42 mx31_clocks_init_dt();
43}
44
45static struct sys_timer imx31_timer = {
46 .init = imx31_timer_init,
47};
48
49static const char *imx31_dt_board_compat[] __initdata = {
50 "fsl,imx31",
51 NULL
52};
53
54DT_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,
63MACHINE_END
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h
index e429ca1b814a..7cfcc44537f0 100644
--- a/arch/arm/plat-mxc/include/mach/common.h
+++ b/arch/arm/plat-mxc/include/mach/common.h
@@ -67,6 +67,7 @@ extern int mx51_clocks_init(unsigned long ckil, unsigned long osc,
67extern int mx53_clocks_init(unsigned long ckil, unsigned long osc, 67extern int mx53_clocks_init(unsigned long ckil, unsigned long osc,
68 unsigned long ckih1, unsigned long ckih2); 68 unsigned long ckih1, unsigned long ckih2);
69extern int mx27_clocks_init_dt(void); 69extern int mx27_clocks_init_dt(void);
70extern int mx31_clocks_init_dt(void);
70extern int mx51_clocks_init_dt(void); 71extern int mx51_clocks_init_dt(void);
71extern int mx53_clocks_init_dt(void); 72extern int mx53_clocks_init_dt(void);
72extern int mx6q_clocks_init(void); 73extern int mx6q_clocks_init(void);