Skip to contentSkip to conversation

Add device tree support for i.mx51/53 boards

PATCH Superseded Shawn Guo 7 participants 14 messages Sep 30, 2011 – Oct 14, 2011

Subsystems (4)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

v5 cover Add device tree support for i.mx51/53 boards

Hi Sascha,

This is an update of the patch series below, which had gone through the review and almost hit the v3.1 (it missed the last pull request Arnd sent to Linus just for one day or so).

[PATCH v4 0/2] Add device tree support for i.mx51/53 boards
http://thread.gmane.org/gmane.linux.drivers.devicetree/7048

I was planning to hold the series until we have a iomuxc binding to totally remove the dependency on non-dt board files. But as a cross platform topic, it needs to take more time to get it settled down, while I'm concerned by that people keep adding stuff into non-dt board files with ignoring DT support. I'm here to revisit the series and trying to get it merged in the coming merge window, so that we have a base to ask people to move to DT.

Changes since v4:
* Rebase onto imx-features branch
* Have devices in soc dtsi as "disabled" and explicitly enable the ones in board dts as "okay"
* Utilize of_irq_init() infrastructure added by Rob Herring recently

Shawn Guo (2):
arm/mx5: add device tree support for imx53 boards arm/mx5: add device tree support for imx51 babbage

 Documentation/devicetree/bindings/arm/fsl.txt |   19 ++
 arch/arm/boot/dts/imx51-babbage.dts           |  135 ++++++++++++
 arch/arm/boot/dts/imx51.dtsi                  |  221 ++++++++++++++++++++
 arch/arm/boot/dts/imx53-ard.dts               |  113 ++++++++++
 arch/arm/boot/dts/imx53-evk.dts               |  120 +++++++++++
 arch/arm/boot/dts/imx53-qsb.dts               |  125 +++++++++++
 arch/arm/boot/dts/imx53-smd.dts               |  169 +++++++++++++++
 arch/arm/boot/dts/imx53.dtsi                  |  276 +++++++++++++++++++++++++
 arch/arm/mach-mx5/Kconfig                     |   21 ++
 arch/arm/mach-mx5/Makefile                    |    3 +
 arch/arm/mach-mx5/board-mx51_babbage.c        |    9 +-
 arch/arm/mach-mx5/board-mx53_ard.c            |   12 +-
 arch/arm/mach-mx5/board-mx53_evk.c            |    9 +-
 arch/arm/mach-mx5/board-mx53_loco.c           |    9 +-
 arch/arm/mach-mx5/board-mx53_smd.c            |    9 +-
 arch/arm/mach-mx5/imx51-dt.c                  |  116 +++++++++++
 arch/arm/mach-mx5/imx53-dt.c                  |  126 +++++++++++
 arch/arm/plat-mxc/include/mach/common.h       |    5 +
 18 files changed, 1485 insertions(+), 12 deletions(-)
author
#1 lore raw

PATCH v5 1/2 arm/mx5: add device tree support for imx53 boards

From: Shawn Guo <[email protected]>

It adds device tree support for imx53 boards.

---
 Documentation/devicetree/bindings/arm/fsl.txt |   15 ++
 arch/arm/boot/dts/imx53-ard.dts               |  113 ++++++++++
 arch/arm/boot/dts/imx53-evk.dts               |  120 +++++++++++
 arch/arm/boot/dts/imx53-qsb.dts               |  125 +++++++++++
 arch/arm/boot/dts/imx53-smd.dts               |  169 +++++++++++++++
 arch/arm/boot/dts/imx53.dtsi                  |  276 +++++++++++++++++++++++++
 arch/arm/mach-mx5/Kconfig                     |   12 +
 arch/arm/mach-mx5/Makefile                    |    2 +
 arch/arm/mach-mx5/board-mx53_ard.c            |   12 +-
 arch/arm/mach-mx5/board-mx53_evk.c            |    9 +-
 arch/arm/mach-mx5/board-mx53_loco.c           |    9 +-
 arch/arm/mach-mx5/board-mx53_smd.c            |    9 +-
 arch/arm/mach-mx5/imx53-dt.c                  |  126 +++++++++++
 arch/arm/plat-mxc/include/mach/common.h       |    4 +
 14 files changed, 991 insertions(+), 10 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/fsl.txt
 create mode 100644 arch/arm/boot/dts/imx53-ard.dts
 create mode 100644 arch/arm/boot/dts/imx53-evk.dts
 create mode 100644 arch/arm/boot/dts/imx53-qsb.dts
 create mode 100644 arch/arm/boot/dts/imx53-smd.dts
 create mode 100644 arch/arm/boot/dts/imx53.dtsi
 create mode 100644 arch/arm/mach-mx5/imx53-dt.c
Documentation/devicetree/bindings/arm/fsl.txt new file +15 -0
new file mode 100644
index 0000000..d1e8d6f
@@ -0,0 +1,15 @@
+i.MX53 Automotive Reference Design Board
+Required root node properties:
+    - compatible = "fsl,imx53-ard", "fsl,imx53";
+
+i.MX53 Evaluation Kit
+Required root node properties:
+    - compatible = "fsl,imx53-evk", "fsl,imx53";
+
+i.MX53 Quick Start Board
+Required root node properties:
+    - compatible = "fsl,imx53-qsb", "fsl,imx53";
+
+i.MX53 Smart Mobile Reference Design Board
+Required root node properties:
+    - compatible = "fsl,imx53-smd", "fsl,imx53";
arch/arm/boot/dts/imx53-ard.dts new file +113 -0

113 lines not on this page · raw message

arch/arm/boot/dts/imx53-evk.dts new file +120 -0

120 lines not on this page · raw message

arch/arm/boot/dts/imx53-qsb.dts new file +125 -0

125 lines not on this page · raw message

arch/arm/boot/dts/imx53-smd.dts new file +169 -0

169 lines not on this page · raw message

arch/arm/boot/dts/imx53.dtsi new file +276 -0

276 lines not on this page · raw message

arch/arm/mach-mx5/Kconfig +12 -0
index fb4c503..6600742 100644
@@ -165,6 +165,18 @@ config MACH_MX51_EFIKASB
 
 comment "i.MX53 machines:"
 
+config MACH_IMX53_DT
+	bool "Support i.MX53 platforms from device tree"
+	select SOC_IMX53
+	select USE_OF
+	select MACH_MX53_ARD
+	select MACH_MX53_EVK
+	select MACH_MX53_LOCO
+	select MACH_MX53_SMD
+	help
+	  Include support for Freescale i.MX53 based platforms
+	  using the device tree for discovery
+
 config MACH_MX53_EVK
 	bool "Support MX53 EVK platforms"
 	select SOC_IMX53
arch/arm/mach-mx5/Makefile +2 -0
index 383e7cd..3dbe5e2 100644
@@ -22,3 +22,5 @@ obj-$(CONFIG_MX51_EFIKA_COMMON) += mx51_efika.o
 obj-$(CONFIG_MACH_MX51_EFIKAMX) += board-mx51_efikamx.o
 obj-$(CONFIG_MACH_MX51_EFIKASB) += board-mx51_efikasb.o
 obj-$(CONFIG_MACH_MX50_RDP) += board-mx50_rdp.o
+
+obj-$(CONFIG_MACH_IMX53_DT) += imx53-dt.o
arch/arm/mach-mx5/board-mx53_ard.c +8 -4
index f58ac83..63e2d02 100644
@@ -171,9 +171,6 @@ static struct imxi2c_platform_data mx53_ard_i2c3_data = {
 
 static void __init mx53_ard_io_init(void)
 {
-	mxc_iomux_v3_setup_multiple_pads(mx53_ard_pads,
-				ARRAY_SIZE(mx53_ard_pads));
-
 	gpio_request(ARD_ETHERNET_INT_B, "eth-int-b");
 	gpio_direction_input(ARD_ETHERNET_INT_B);
 
@@ -216,6 +213,13 @@ static int weim_cs_config(void)
 	return 0;
 }
 
+void __init imx53_ard_common_init(void)
+{
+	mxc_iomux_v3_setup_multiple_pads(mx53_ard_pads,
+					 ARRAY_SIZE(mx53_ard_pads));
+	weim_cs_config();
+}
+
 static struct platform_device *devices[] __initdata = {
 	&ard_smsc_lan9220_device,
 };
@@ -225,8 +229,8 @@ static void __init mx53_ard_board_init(void)
 	imx53_soc_init();
 	imx53_add_imx_uart(0, NULL);
 
+	imx53_ard_common_init();
 	mx53_ard_io_init();
-	weim_cs_config();
 	platform_add_devices(devices, ARRAY_SIZE(devices));
 
 	imx53_add_sdhci_esdhc_imx(0, &mx53_ard_sd1_data);
arch/arm/mach-mx5/board-mx53_evk.c +7 -2
index 6a3e616..6bea31a 100644
@@ -131,12 +131,17 @@ static const struct spi_imx_master mx53_evk_spi_data __initconst = {
 	.num_chipselect = ARRAY_SIZE(mx53_evk_spi_cs),
 };
 
+void __init imx53_evk_common_init(void)
+{
+	mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads,
+					 ARRAY_SIZE(mx53_evk_pads));
+}
+
 static void __init mx53_evk_board_init(void)
 {
 	imx53_soc_init();
+	imx53_evk_common_init();
 
-	mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads,
-					ARRAY_SIZE(mx53_evk_pads));
 	mx53_evk_init_uart();
 	mx53_evk_fec_reset();
 	imx53_add_fec(&mx53_evk_fec_pdata);
arch/arm/mach-mx5/board-mx53_loco.c +7 -2
index 7149416..7cbb0d5 100644
@@ -269,13 +269,18 @@ static struct i2c_board_info mx53loco_i2c_devices[] = {
 	},
 };
 
+void __init imx53_qsb_common_init(void)
+{
+	mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,
+					 ARRAY_SIZE(mx53_loco_pads));
+}
+
 static void __init mx53_loco_board_init(void)
 {
 	int ret;
 	imx53_soc_init();
+	imx53_qsb_common_init();
 
-	mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,
-					ARRAY_SIZE(mx53_loco_pads));
 	imx53_add_imx_uart(0, NULL);
 	mx53_loco_fec_reset();
 	imx53_add_fec(&mx53_loco_fec_data);
arch/arm/mach-mx5/board-mx53_smd.c +7 -2
index e64fd2c..9a895a2 100644
@@ -111,12 +111,17 @@ static const struct imxi2c_platform_data mx53_smd_i2c_data __initconst = {
 	.bitrate = 100000,
 };
 
+void __init imx53_smd_common_init(void)
+{
+	mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads,
+					 ARRAY_SIZE(mx53_smd_pads));
+}
+
 static void __init mx53_smd_board_init(void)
 {
 	imx53_soc_init();
+	imx53_smd_common_init();
 
-	mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads,
-					ARRAY_SIZE(mx53_smd_pads));
 	mx53_smd_init_uart();
 	mx53_smd_fec_reset();
 	imx53_add_fec(&mx53_smd_fec_data);
arch/arm/mach-mx5/imx53-dt.c new file +126 -0

126 lines not on this page · raw message

arch/arm/plat-mxc/include/mach/common.h +4 -0
index 5bee446..2bd8f84 100644
@@ -72,6 +72,10 @@ extern void mxc_arch_reset_init(void __iomem *);
 extern void mx51_efikamx_reset(void);
 extern int mx53_revision(void);
 extern int mx53_display_revision(void);
+extern void imx53_ard_common_init(void);
+extern void imx53_evk_common_init(void);
+extern void imx53_qsb_common_init(void);
+extern void imx53_smd_common_init(void);
 extern void imx_print_silicon_rev(const char *cpu, int srev);
 
 void avic_handle_irq(struct pt_regs *);
Signature · 1 line
1.7.4.1
reviewer
#2 lore raw

PATCH 1/2 arm/mx5: add device tree support for imx53 boards

Quoted 8 lines · Shawn Guo

From: Shawn Guo <[email protected]>

It adds device tree support for imx53 boards.

Quoted 5 lines

---

?Documentation/devicetree/bindings/arm/fsl.txt | ? 15 ++
?arch/arm/boot/dts/imx53-ard.dts ? ? ? ? ? ? ? | ?113 ++++++++++
?arch/arm/boot/dts/imx53-evk.dts ? ? ? ? ? ? ? | ?120 +++++++++++
?arch/arm/boot/dts/imx53-qsb.dts ? ? ? ? ? ? ? | ?125 +++++++++++

Can't you call it imx53-loco.dts instead so that it is consistent with mach-mx53_loco.c ?

#3 lore raw

PATCH 1/2 arm/mx5: add device tree support for imx53 boards

Quoted 15 lines · Fabio Estevam
Quoted 8 lines · Shawn Guo

From: Shawn Guo <[email protected]>

It adds device tree support for imx53 boards.

Quoted 5 lines

---

?Documentation/devicetree/bindings/arm/fsl.txt | ? 15 ++
?arch/arm/boot/dts/imx53-ard.dts ? ? ? ? ? ? ? | ?113 ++++++++++
?arch/arm/boot/dts/imx53-evk.dts ? ? ? ? ? ? ? | ?120 +++++++++++
?arch/arm/boot/dts/imx53-qsb.dts ? ? ? ? ? ? ? | ?125 +++++++++++
Quoted 3 lines

Can't you call it imx53-loco.dts instead so that it is consistent with mach-mx53_loco.c ?

No. I was taking this opportunity to fix the naming. "loco" is a bad name and is not recommended any more. Eventually, board-mx53_loco.c will be killed by imx53-dt.c, which means "loco" will be killed eventually.

Signature · 2 lines
Regards,
Shawn
#4 lore raw

PATCH 1/2 arm/mx5: add device tree support for imx53 boards

In reply to Shawn Guo
Quoted 1 line · Shawn Guo

From: Shawn Guo <[email protected]>

Hi Sascha,

This line was added by accident. If you plan to apply this patch, please help remove the line.

Regards,
Shawn

Quoted 7 lines

It adds device tree support for imx53 boards.

author
#5 lore raw

PATCH v5 2/2 arm/mx5: add device tree support for imx51 babbage

In reply to Shawn Guo

It adds device tree support for imx51 babbage board.

---
 Documentation/devicetree/bindings/arm/fsl.txt |    4 +
 arch/arm/boot/dts/imx51-babbage.dts           |  135 +++++++++++++++
 arch/arm/boot/dts/imx51.dtsi                  |  221 +++++++++++++++++++++++++
 arch/arm/mach-mx5/Kconfig                     |    9 +
 arch/arm/mach-mx5/Makefile                    |    1 +
 arch/arm/mach-mx5/board-mx51_babbage.c        |    9 +-
 arch/arm/mach-mx5/imx51-dt.c                  |  116 +++++++++++++
 arch/arm/plat-mxc/include/mach/common.h       |    1 +
 8 files changed, 494 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boot/dts/imx51-babbage.dts
 create mode 100644 arch/arm/boot/dts/imx51.dtsi
 create mode 100644 arch/arm/mach-mx5/imx51-dt.c
Documentation/devicetree/bindings/arm/fsl.txt +4 -0
index d1e8d6f..e2401cd 100644
@@ -1,3 +1,7 @@
+i.MX51 Babbage Board
+Required root node properties:
+    - compatible = "fsl,imx51-babbage", "fsl,imx51";
+
 i.MX53 Automotive Reference Design Board
 Required root node properties:
     - compatible = "fsl,imx53-ard", "fsl,imx53";
arch/arm/boot/dts/imx51-babbage.dts new file +135 -0

135 lines not on this page · raw message

arch/arm/boot/dts/imx51.dtsi new file +221 -0

221 lines not on this page · raw message

arch/arm/mach-mx5/Kconfig +9 -0
index 6600742..d48f78a 100644
@@ -57,6 +57,15 @@ config MACH_MX50_RDP
 
 comment "i.MX51 machines:"
 
+config MACH_IMX51_DT
+	bool "Support i.MX51 platforms from device tree"
+	select SOC_IMX51
+	select USE_OF
+	select MACH_MX51_BABBAGE
+	help
+	  Include support for Freescale i.MX51 based platforms
+	  using the device tree for discovery
+
 config MACH_MX51_BABBAGE
 	bool "Support MX51 BABBAGE platforms"
 	select SOC_IMX51
arch/arm/mach-mx5/Makefile +1 -0
index 3dbe5e2..a3c75f3 100644
@@ -23,4 +23,5 @@ obj-$(CONFIG_MACH_MX51_EFIKAMX) += board-mx51_efikamx.o
 obj-$(CONFIG_MACH_MX51_EFIKASB) += board-mx51_efikasb.o
 obj-$(CONFIG_MACH_MX50_RDP) += board-mx50_rdp.o
 
+obj-$(CONFIG_MACH_IMX51_DT) += imx51-dt.o
 obj-$(CONFIG_MACH_IMX53_DT) += imx53-dt.o
arch/arm/mach-mx5/board-mx51_babbage.c +7 -2
index 4bd5e87..df6f0f1 100644
@@ -351,6 +351,12 @@ static const struct esdhc_platform_data mx51_babbage_sd2_data __initconst = {
 	.wp_type = ESDHC_WP_GPIO,
 };
 
+void __init imx51_babbage_common_init(void)
+{
+	mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads,
+					 ARRAY_SIZE(mx51babbage_pads));
+}
+
 /*
  * Board specific initialization.
  */
@@ -365,8 +371,7 @@ static void __init mx51_babbage_init(void)
 #if defined(CONFIG_CPU_FREQ_IMX)
 	get_cpu_op = mx51_get_cpu_op;
 #endif
-	mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads,
-					ARRAY_SIZE(mx51babbage_pads));
+	imx51_babbage_common_init();
 
 	imx51_add_imx_uart(0, &uart_pdata);
 	imx51_add_imx_uart(1, NULL);
arch/arm/mach-mx5/imx51-dt.c new file +116 -0

116 lines not on this page · raw message

arch/arm/plat-mxc/include/mach/common.h +1 -0
index 2bd8f84..4a42d84 100644
@@ -72,6 +72,7 @@ extern void mxc_arch_reset_init(void __iomem *);
 extern void mx51_efikamx_reset(void);
 extern int mx53_revision(void);
 extern int mx53_display_revision(void);
+extern void imx51_babbage_common_init(void);
 extern void imx53_ard_common_init(void);
 extern void imx53_evk_common_init(void);
 extern void imx53_qsb_common_init(void);
Signature · 1 line
1.7.4.1
#6 lore raw

PATCH 2/2 arm/mx5: add device tree support for imx51 babbage

Quoted 2 lines · Shawn Guo

It adds device tree support for imx51 babbage board.

cut

Quoted 6 lines
arch/arm/mach-mx5/imx51-dt.c new file +0 -0
new file mode 100644
index 0000000..0878441
@@ -0,0 +1,116 @@

cut

Quoted 5 lines
arch/arm/mach-mx5/imx51-dt.c new file +5 -0
+
+static void __init imx51_timer_init(void)
+{
+	mx51_clocks_init(32768, 24000000, 22579200, 0);
+}
#7 lore raw

PATCH 2/2 arm/mx5: add device tree support for imx51 babbage

Quoted 11 lines · Julien Boibessot
Quoted 2 lines · Shawn Guo

It adds device tree support for imx51 babbage board.

cut

Quoted 6 lines
arch/arm/mach-mx5/imx51-dt.c new file +0 -0
new file mode 100644
index 0000000..0878441
@@ -0,0 +1,116 @@

cut

Quoted 8 lines

arch/arm/mach-mx5/imx51-dt.c line 97

Quoted 5 lines
arch/arm/mach-mx5/imx51-dt.c new file +5 -0
+
+static void __init imx51_timer_init(void)
+{
+	mx51_clocks_init(32768, 24000000, 22579200, 0);
+}

From my understanding, if put in arch/arm/mach-mx5/imx51-dt.c, this clock initialization will apply to all i.MX51 based platforms. Am I right ?

In the general case, from the above code fragment, I'd say you are. The timer init stuff is supposed to be for bringing up the timers.

We do have an early init callback which can be used for this - which gets things like the clk stuff up and running from immediately after the page tables have been setup and initial device mappings put in place - before any drivers or even IRQ controllers have been initialized.

#8 lore raw

PATCH 2/2 arm/mx5: add device tree support for imx51 babbage

Quoted 21 lines · Russell King - ARM Linux
Quoted 11 lines · Julien Boibessot
Quoted 2 lines · Shawn Guo

It adds device tree support for imx51 babbage board.

cut

Quoted 6 lines
arch/arm/mach-mx5/imx51-dt.c new file +0 -0
new file mode 100644
index 0000000..0878441
@@ -0,0 +1,116 @@

cut

Quoted 8 lines

arch/arm/mach-mx5/imx51-dt.c line 97

Quoted 5 lines
arch/arm/mach-mx5/imx51-dt.c new file +5 -0
+
+static void __init imx51_timer_init(void)
+{
+	mx51_clocks_init(32768, 24000000, 22579200, 0);
+}

From my understanding, if put in arch/arm/mach-mx5/imx51-dt.c, this clock initialization will apply to all i.MX51 based platforms. Am I right ?

Quoted 3 lines

In the general case, from the above code fragment, I'd say you are. The timer init stuff is supposed to be for bringing up the timers.

Inside mx51_clocks_init(), after necessary clock setup, it will call mxc_timer_init() to bring up the timer. I agree with the suggestion below, but I'm trying to reuse non-dt setup as much as possible with minimum changes and impact to non-dt case.

Regards,
Shawn

Quoted 6 lines

We do have an early init callback which can be used for this - which gets things like the clk stuff up and running from immediately after the page tables have been setup and initial device mappings put in place - before any drivers or even IRQ controllers have been initialized.

#9 lore raw

PATCH 2/2 arm/mx5: add device tree support for imx51 babbage

In reply to Julien Boibessot
Quoted 23 lines · Julien Boibessot
Quoted 2 lines · Shawn Guo

It adds device tree support for imx51 babbage board.

cut

Quoted 6 lines
arch/arm/mach-mx5/imx51-dt.c new file +0 -0
new file mode 100644
index 0000000..0878441
@@ -0,0 +1,116 @@

cut

arch/arm/mach-mx5/imx51-dt.c line 97

Quoted 5 lines
arch/arm/mach-mx5/imx51-dt.c new file +5 -0
+
+static void __init imx51_timer_init(void)
+{
+	mx51_clocks_init(32768, 24000000, 22579200, 0);
+}

From my understanding, if put in arch/arm/mach-mx5/imx51-dt.c, this clock initialization will apply to all i.MX51 based platforms. Am I right ?
If so, I think clock init shouldn't be done here because it's platform
dependant: one might for example choose to use 32k quartz instead of 24Mhz external oscillator as clock reference. i.MX51 supports this. For example on my board I do:

Quoted 2 lines
    mx51_clocks_init(32768, 32768*1024, 0, 0);

Yes, this is a problem and now it's the time to address it. For dt case, these clock frequencies should come from device tree. I was trying to keep it as it is until we finalize the clock bindings or the need of different frequency setup shows up. Now, the need shows up.

I will add a new function call mx51_clocks_init_dt() with zero parameter in clock-mx51-mx53.c parsing the clock frequencies from device tree and the calling into mx51_clocks_init(...) with these frequencies as the parameters. The updated patch will come soon.

Thanks for the input. Glad to see people are actually planning to move their board setup to DT.

Signature · 2 lines
Regards,
Shawn
#10 lore raw

PATCH 2/2 arm/mx5: add device tree support for imx51 babbage

In reply to Shawn Guo
Quoted 6 lines · Shawn Guo

It adds device tree support for imx51 babbage board.

looks good to me.

Quoted 589 lines

---

?Documentation/devicetree/bindings/arm/fsl.txt | ? ?4 +
?arch/arm/boot/dts/imx51-babbage.dts ? ? ? ? ? | ?135 +++++++++++++++
?arch/arm/boot/dts/imx51.dtsi ? ? ? ? ? ? ? ? ?| ?221 +++++++++++++++++++++++++
?arch/arm/mach-mx5/Kconfig ? ? ? ? ? ? ? ? ? ? | ? ?9 +
?arch/arm/mach-mx5/Makefile ? ? ? ? ? ? ? ? ? ?| ? ?1 +
?arch/arm/mach-mx5/board-mx51_babbage.c ? ? ? ?| ? ?9 +-
?arch/arm/mach-mx5/imx51-dt.c ? ? ? ? ? ? ? ? ?| ?116 +++++++++++++
?arch/arm/plat-mxc/include/mach/common.h ? ? ? | ? ?1 +

?8 files changed, 494 insertions(+), 2 deletions(-) ?create mode 100644 arch/arm/boot/dts/imx51-babbage.dts ?create mode 100644 arch/arm/boot/dts/imx51.dtsi ?create mode 100644 arch/arm/mach-mx5/imx51-dt.c

Documentation/devicetree/bindings/arm/fsl.txt +4 -0
index d1e8d6f..e2401cd 100644
@@ -1,3 +1,7 @@
+i.MX51 Babbage Board
+Required root node properties:
+ ? ?- compatible = "fsl,imx51-babbage", "fsl,imx51";
+

?i.MX53 Automotive Reference Design Board
?Required root node properties:
? ? - compatible = "fsl,imx53-ard", "fsl,imx53";

arch/arm/boot/dts/imx51-babbage.dts new file +135 -0
new file mode 100644
index 0000000..f8766af
@@ -0,0 +1,135 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "imx51.dtsi"
+
+/ {
+ ? ? ? model = "Freescale i.MX51 Babbage Board";
+ ? ? ? compatible = "fsl,imx51-babbage", "fsl,imx51";
+
+ ? ? ? chosen {
+ ? ? ? ? ? ? ? bootargs = "console=ttymxc0,115200 root=/dev/mmcblk0p3 rootwait";
+ ? ? ? };
+
+ ? ? ? memory {
+ ? ? ? ? ? ? ? reg = <0x90000000 0x20000000>;
+ ? ? ? };
+
+ ? ? ? soc {
+ ? ? ? ? ? ? ? aips at 70000000 { /* aips-1 */
+ ? ? ? ? ? ? ? ? ? ? ? spba at 70000000 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? esdhc at 70004000 { /* ESDHC1 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? fsl,cd-internal;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? fsl,wp-internal;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "okay";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? esdhc at 70008000 { /* ESDHC2 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cd-gpios = <&gpio0 6 0>; /* GPIO1_6 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? wp-gpios = <&gpio0 5 0>; /* GPIO1_5 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "okay";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? uart2: uart at 7000c000 { /* UART3 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? fsl,uart-has-rtscts;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "okay";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ecspi at 70010000 { /* ECSPI1 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? fsl,spi-num-chipselects = <2>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs-gpios = <&gpio3 24 0>, /* GPIO4_24 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<&gpio3 25 0>; /* GPIO4_25 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "okay";
+
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pmic: mc13892 at 0 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #address-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #size-cells = <0>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,mc13892";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? spi-max-frequency = <6000000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mc13xxx-irq-gpios = <&gpio0 8 0>; /* GPIO1_8 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? fsl,mc13xxx-uses-regulator;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? flash: at45db321d at 1 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #address-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #size-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "atmel,at45db321d", "atmel,at45", "atmel,dataflash";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? spi-max-frequency = <25000000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <1>;
+
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? partition at 0 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? label = "U-Boot";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x0 0x40000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? read-only;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? partition at 40000 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? label = "Kernel";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x40000 0x3c0000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? };
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? };
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? };
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? wdog at 73f98000 { /* WDOG1 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "okay";
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? iomuxc at 73fa8000 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-iomuxc-babbage";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x73fa8000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? uart0: uart at 73fbc000 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? fsl,uart-has-rtscts;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "okay";
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? uart1: uart at 73fc0000 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "okay";
+ ? ? ? ? ? ? ? ? ? ? ? };
+ ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? aips at 80000000 { /* aips-2 */
+ ? ? ? ? ? ? ? ? ? ? ? sdma at 83fb0000 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? fsl,sdma-ram-script-name = "imx/sdma/sdma-imx51.bin";
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? i2c at 83fc4000 { /* I2C2 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "okay";
+
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? codec: sgtl5000 at 0a {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,sgtl5000";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x0a>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? };
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? fec at 83fec000 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? phy-mode = "mii";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "okay";
+ ? ? ? ? ? ? ? ? ? ? ? };
+ ? ? ? ? ? ? ? };
+ ? ? ? };
+
+ ? ? ? gpio-keys {
+ ? ? ? ? ? ? ? compatible = "gpio-keys";
+
+ ? ? ? ? ? ? ? power {
+ ? ? ? ? ? ? ? ? ? ? ? label = "Power Button";
+ ? ? ? ? ? ? ? ? ? ? ? gpios = <&gpio1 21 0>;
+ ? ? ? ? ? ? ? ? ? ? ? linux,code = <116>; /* KEY_POWER */
+ ? ? ? ? ? ? ? ? ? ? ? gpio-key,wakeup;
+ ? ? ? ? ? ? ? };
+ ? ? ? };
+};
arch/arm/boot/dts/imx51.dtsi new file +221 -0
new file mode 100644
index 0000000..dfef00f
@@ -0,0 +1,221 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+ ? ? ? aliases {
+ ? ? ? ? ? ? ? serial0 = &uart0;
+ ? ? ? ? ? ? ? serial1 = &uart1;
+ ? ? ? ? ? ? ? serial2 = &uart2;
+ ? ? ? };
+
+ ? ? ? tzic: tz-interrupt-controller at e0000000 {
+ ? ? ? ? ? ? ? compatible = "fsl,imx51-tzic", "fsl,tzic";
+ ? ? ? ? ? ? ? interrupt-controller;
+ ? ? ? ? ? ? ? #interrupt-cells = <1>;
+ ? ? ? ? ? ? ? reg = <0xe0000000 0x4000>;
+ ? ? ? };
+
+ ? ? ? soc {
+ ? ? ? ? ? ? ? #address-cells = <1>;
+ ? ? ? ? ? ? ? #size-cells = <1>;
+ ? ? ? ? ? ? ? compatible = "simple-bus";
+ ? ? ? ? ? ? ? interrupt-parent = <&tzic>;
+ ? ? ? ? ? ? ? ranges;
+
+ ? ? ? ? ? ? ? aips at 70000000 { /* AIPS1 */
+ ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,aips-bus", "simple-bus";
+ ? ? ? ? ? ? ? ? ? ? ? #address-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? #size-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? reg = <0x70000000 0x10000000>;
+ ? ? ? ? ? ? ? ? ? ? ? ranges;
+
+ ? ? ? ? ? ? ? ? ? ? ? spba at 70000000 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,spba-bus", "simple-bus";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #address-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #size-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x70000000 0x40000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ranges;
+
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? esdhc at 70004000 { /* ESDHC1 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-esdhc";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x70004000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "disabled";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? esdhc at 70008000 { /* ESDHC2 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-esdhc";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x70008000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <2>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "disabled";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? uart2: uart at 7000c000 { /* UART3 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-uart", "fsl,imx21-uart";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x7000c000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <33>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "disabled";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ecspi at 70010000 { /* ECSPI1 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #address-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #size-cells = <0>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-ecspi";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x70010000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <36>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "disabled";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? esdhc at 70020000 { /* ESDHC3 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-esdhc";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x70020000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <3>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "disabled";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? esdhc at 70024000 { /* ESDHC4 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-esdhc";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x70024000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <4>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "disabled";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? };
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? gpio0: gpio at 73f84000 { /* GPIO1 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-gpio", "fsl,imx31-gpio";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x73f84000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <50 51>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? gpio-controller;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #gpio-cells = <2>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupt-controller;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #interrupt-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? gpio1: gpio at 73f88000 { /* GPIO2 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-gpio", "fsl,imx31-gpio";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x73f88000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <52 53>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? gpio-controller;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #gpio-cells = <2>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupt-controller;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #interrupt-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? gpio2: gpio at 73f8c000 { /* GPIO3 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-gpio", "fsl,imx31-gpio";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x73f8c000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <54 55>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? gpio-controller;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #gpio-cells = <2>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupt-controller;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #interrupt-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? gpio3: gpio at 73f90000 { /* GPIO4 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-gpio", "fsl,imx31-gpio";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x73f90000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <56 57>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? gpio-controller;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #gpio-cells = <2>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupt-controller;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #interrupt-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? wdog at 73f98000 { /* WDOG1 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-wdt", "fsl,imx21-wdt";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x73f98000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <58>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "disabled";
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? wdog at 73f9c000 { /* WDOG2 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-wdt", "fsl,imx21-wdt";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x73f9c000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <59>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "disabled";
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? uart0: uart at 73fbc000 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-uart", "fsl,imx21-uart";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x73fbc000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <31>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "disabled";
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? uart1: uart at 73fc0000 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-uart", "fsl,imx21-uart";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x73fc0000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <32>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "disabled";
+ ? ? ? ? ? ? ? ? ? ? ? };
+ ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? aips at 80000000 { /* AIPS2 */
+ ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,aips-bus", "simple-bus";
+ ? ? ? ? ? ? ? ? ? ? ? #address-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? #size-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? reg = <0x80000000 0x10000000>;
+ ? ? ? ? ? ? ? ? ? ? ? ranges;
+
+ ? ? ? ? ? ? ? ? ? ? ? ecspi at 83fac000 { /* ECSPI2 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #address-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #size-cells = <0>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-ecspi";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x83fac000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <37>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "disabled";
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? sdma at 83fb0000 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-sdma", "fsl,imx35-sdma";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x83fb0000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <6>;
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? cspi at 83fc0000 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #address-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #size-cells = <0>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-cspi", "fsl,imx35-cspi";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x83fc0000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <38>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "disabled";
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? i2c at 83fc4000 { /* I2C2 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #address-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #size-cells = <0>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-i2c", "fsl,imx1-i2c";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x83fc4000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <63>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "disabled";
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? i2c at 83fc8000 { /* I2C1 */
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #address-cells = <1>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #size-cells = <0>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-i2c", "fsl,imx1-i2c";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x83fc8000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <62>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "disabled";
+ ? ? ? ? ? ? ? ? ? ? ? };
+
+ ? ? ? ? ? ? ? ? ? ? ? fec at 83fec000 {
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "fsl,imx51-fec", "fsl,imx27-fec";
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg = <0x83fec000 0x4000>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <87>;
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status = "disabled";
+ ? ? ? ? ? ? ? ? ? ? ? };
+ ? ? ? ? ? ? ? };
+ ? ? ? };
+};
arch/arm/mach-mx5/Kconfig +0 -0
index 6600742..d48f78a 100644
@@ -57,6 +57,15 @@ config MACH_MX50_RDP
 

?comment "i.MX51 machines:"

arch/arm/mach-mx5/Kconfig +9 -0
+config MACH_IMX51_DT
+ ? ? ? bool "Support i.MX51 platforms from device tree"
+ ? ? ? select SOC_IMX51
+ ? ? ? select USE_OF
+ ? ? ? select MACH_MX51_BABBAGE
+ ? ? ? help
+ ? ? ? ? Include support for Freescale i.MX51 based platforms
+ ? ? ? ? using the device tree for discovery
+

?config MACH_MX51_BABBAGE
? ? ? ?bool "Support MX51 BABBAGE platforms"
? ? ? ?select SOC_IMX51

arch/arm/mach-mx5/Makefile +0 -0
index 3dbe5e2..a3c75f3 100644
@@ -23,4 +23,5 @@ obj-$(CONFIG_MACH_MX51_EFIKAMX) += board-mx51_efikamx.o

?obj-$(CONFIG_MACH_MX51_EFIKASB) += board-mx51_efikasb.o ?obj-$(CONFIG_MACH_MX50_RDP) += board-mx50_rdp.o

+obj-$(CONFIG_MACH_IMX51_DT) += imx51-dt.o
?obj-$(CONFIG_MACH_IMX53_DT) += imx53-dt.o

arch/arm/mach-mx5/board-mx51_babbage.c +6 -0
index 4bd5e87..df6f0f1 100644
@@ -351,6 +351,12 @@ static const struct esdhc_platform_data mx51_babbage_sd2_data __initconst = {
 ? ? ? ?.wp_type = ESDHC_WP_GPIO,
 ?};
 
+void __init imx51_babbage_common_init(void)
+{
+ ? ? ? mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads,
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ARRAY_SIZE(mx51babbage_pads));
+}
+

?/*
?* Board specific initialization.
?*/

arch/arm/mach-mx5/board-mx51_babbage.c +0 -0
@@ -365,8 +371,7 @@ static void __init mx51_babbage_init(void)
 ?#if defined(CONFIG_CPU_FREQ_IMX)
 ? ? ? ?get_cpu_op = mx51_get_cpu_op;

?#endif
- ? ? ? mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads,
- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ARRAY_SIZE(mx51babbage_pads));
+ ? ? ? imx51_babbage_common_init();

? ? ? ?imx51_add_imx_uart(0, &uart_pdata);
? ? ? ?imx51_add_imx_uart(1, NULL);

arch/arm/mach-mx5/imx51-dt.c new file +116 -0
new file mode 100644
index 0000000..0878441
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/irq.h>
+#include <linux/irqdomain.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/time.h>
+#include <mach/common.h>
+#include <mach/mx51.h>
+
+/*
+ * Lookup table for attaching a specific name and platform_data pointer to
+ * devices as they get created by of_platform_populate(). ?Ideally this table
+ * would not exist, but the current clock implementation depends on some devices
+ * having a specific name.
+ */
+static const struct of_dev_auxdata imx51_auxdata_lookup[] __initconst = {
+ ? ? ? OF_DEV_AUXDATA("fsl,imx51-uart", MX51_UART1_BASE_ADDR, "imx21-uart.0", NULL),
+ ? ? ? OF_DEV_AUXDATA("fsl,imx51-uart", MX51_UART2_BASE_ADDR, "imx21-uart.1", NULL),
+ ? ? ? OF_DEV_AUXDATA("fsl,imx51-uart", MX51_UART3_BASE_ADDR, "imx21-uart.2", NULL),
+ ? ? ? OF_DEV_AUXDATA("fsl,imx51-fec", MX51_FEC_BASE_ADDR, "imx27-fec.0", NULL),
+ ? ? ? OF_DEV_AUXDATA("fsl,imx51-esdhc", MX51_ESDHC1_BASE_ADDR, "sdhci-esdhc-imx51.0", NULL),
+ ? ? ? OF_DEV_AUXDATA("fsl,imx51-esdhc", MX51_ESDHC2_BASE_ADDR, "sdhci-esdhc-imx51.1", NULL),
+ ? ? ? OF_DEV_AUXDATA("fsl,imx51-esdhc", MX51_ESDHC3_BASE_ADDR, "sdhci-esdhc-imx51.2", NULL),
+ ? ? ? OF_DEV_AUXDATA("fsl,imx51-esdhc", MX51_ESDHC4_BASE_ADDR, "sdhci-esdhc-imx51.3", NULL),
+ ? ? ? OF_DEV_AUXDATA("fsl,imx51-ecspi", MX51_ECSPI1_BASE_ADDR, "imx51-ecspi.0", NULL),
+ ? ? ? OF_DEV_AUXDATA("fsl,imx51-ecspi", MX51_ECSPI2_BASE_ADDR, "imx51-ecspi.1", NULL),
+ ? ? ? OF_DEV_AUXDATA("fsl,imx51-cspi", MX51_CSPI_BASE_ADDR, "imx35-cspi.0", NULL),
+ ? ? ? OF_DEV_AUXDATA("fsl,imx51-i2c", MX51_I2C1_BASE_ADDR, "imx-i2c.0", NULL),
+ ? ? ? OF_DEV_AUXDATA("fsl,imx51-i2c", MX51_I2C2_BASE_ADDR, "imx-i2c.1", NULL),
+ ? ? ? OF_DEV_AUXDATA("fsl,imx51-sdma", MX51_SDMA_BASE_ADDR, "imx35-sdma", NULL),
+ ? ? ? OF_DEV_AUXDATA("fsl,imx51-wdt", MX51_WDOG1_BASE_ADDR, "imx2-wdt.0", NULL),
+ ? ? ? { /* sentinel */ }
+};
+
+static void __init imx51_tzic_add_irq_domain(struct device_node *np,
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? struct device_node *interrupt_parent)
+{
+ ? ? ? irq_domain_add_simple(np, 0);
+}
+
+static void __init imx51_gpio_add_irq_domain(struct device_node *np,
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? struct device_node *interrupt_parent)
+{
+ ? ? ? static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS -
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?32 * 4; /* imx51 gets 4 gpio ports */
+
+ ? ? ? irq_domain_add_simple(np, gpio_irq_base);
+ ? ? ? gpio_irq_base += 32;
+}
+
+static const struct of_device_id imx51_irq_match[] __initconst = {
+ ? ? ? { .compatible = "fsl,imx51-tzic", .data = imx51_tzic_add_irq_domain, },
+ ? ? ? { .compatible = "fsl,imx51-gpio", .data = imx51_gpio_add_irq_domain, },
+ ? ? ? { /* sentinel */ }
+};
+
+static const struct of_device_id imx51_iomuxc_of_match[] __initconst = {
+ ? ? ? { .compatible = "fsl,imx51-iomuxc-babbage", .data = imx51_babbage_common_init, },
+ ? ? ? { /* sentinel */ }
+};
+
+static void __init imx51_dt_init(void)
+{
+ ? ? ? struct device_node *node;
+ ? ? ? const struct of_device_id *of_id;
+ ? ? ? void (*func)(void);
+
+ ? ? ? of_irq_init(imx51_irq_match);
+
+ ? ? ? node = of_find_matching_node(NULL, imx51_iomuxc_of_match);
+ ? ? ? if (node) {
+ ? ? ? ? ? ? ? of_id = of_match_node(imx51_iomuxc_of_match, node);
+ ? ? ? ? ? ? ? func = of_id->data;
+ ? ? ? ? ? ? ? func();
+ ? ? ? ? ? ? ? of_node_put(node);
+ ? ? ? }
+
+ ? ? ? of_platform_populate(NULL, of_default_bus_match_table,
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ?imx51_auxdata_lookup, NULL);
+}
+
+static void __init imx51_timer_init(void)
+{
+ ? ? ? mx51_clocks_init(32768, 24000000, 22579200, 0);
+}
+
+static struct sys_timer imx51_timer = {
+ ? ? ? .init = imx51_timer_init,
+};
+
+static const char *imx51_dt_board_compat[] __initdata = {
+ ? ? ? "fsl,imx51-babbage",
+ ? ? ? NULL
+};
+
+DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)")
+ ? ? ? .map_io ? ? ? ? = mx51_map_io,
+ ? ? ? .init_early ? ? = imx51_init_early,
+ ? ? ? .init_irq ? ? ? = mx51_init_irq,
+ ? ? ? .handle_irq ? ? = imx51_handle_irq,
+ ? ? ? .timer ? ? ? ? ?= &imx51_timer,
+ ? ? ? .init_machine ? = imx51_dt_init,
+ ? ? ? .dt_compat ? ? ?= imx51_dt_board_compat,
+MACHINE_END
arch/arm/plat-mxc/include/mach/common.h +1 -1
index 2bd8f84..4a42d84 100644
@@ -72,6 +72,7 @@ extern void mxc_arch_reset_init(void __iomem *);
 ?extern void mx51_efikamx_reset(void);
 ?extern int mx53_revision(void);
 ?extern int mx53_display_revision(void);
+extern void imx51_babbage_common_init(void);
 ?extern void imx53_ard_common_init(void);
 ?extern void imx53_evk_common_init(void);
 ?extern void imx53_qsb_common_init(void);
--

1.7.4.1

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
maintainer
#11 lore raw

PATCH 2/2 arm/mx5: add device tree support for imx51 babbage

Quoted 9 lines · Grant Likely
Quoted 6 lines · Shawn Guo

It adds device tree support for imx51 babbage board.

looks good to me.

to me aswell. To merge it a patch from Rob Herring is missing:

of/irq: introduce of_irq_init

It currently does not show up in next.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#12 lore raw

PATCH 2/2 arm/mx5: add device tree support for imx51 babbage

Quoted 4 lines · Sascha Hauer
Quoted 3 lines · Grant Likely
Quoted 2 lines · Shawn Guo

It adds device tree support for imx51 babbage board.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

looks good to me.

to me aswell.

I take this as your ack tag. Otherwise, please let me know.

Quoted 6 lines

To merge it a patch from Rob Herring is missing:

of/irq: introduce of_irq_init

It currently does not show up in next.

Rob just sent a pull request to Arnd with this patch included. If you do not mind, I will send this series to Arnd based on proper branch in arm-soc.

Signature · 2 lines
Regards,
Shawn
maintainer
#13 lore raw

PATCH 2/2 arm/mx5: add device tree support for imx51 babbage

Quoted 10 lines · Shawn Guo
Quoted 9 lines · Sascha Hauer
Quoted 8 lines · Grant Likely
Quoted 6 lines · Shawn Guo

It adds device tree support for imx51 babbage board.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

looks good to me.

to me aswell.

I take this as your ack tag. Otherwise, please let me know.

Yes, Acked-by: Sascha Hauer <[email protected]>

Quoted 10 lines
Quoted 7 lines

To merge it a patch from Rob Herring is missing:

of/irq: introduce of_irq_init

It currently does not show up in next.

Rob just sent a pull request to Arnd with this patch included. If you do not mind, I will send this series to Arnd based on proper branch in arm-soc.

ok.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |