Skip to contentSkip to conversation

Add device tree support for i.mx51/53 boards

PATCH Superseded Shawn Guo 3 participants 5 messages Aug 2, 2011 – Aug 3, 2011

Subsystems (4)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

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

Changes since v3:
* Fix machine_desc table for ARD matching
* Turn the board setup that dt needs into callback

Changes since v2:
* Drop iomuxc device tree support patch

Changes since v1:
* Address comments on v1 given by Grant and Sascha
* Add i.mx51 Babbage support

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

 .../devicetree/bindings/arm/fsl/boards.txt         |   19 ++
 arch/arm/boot/dts/imx51-babbage.dts                |  141 +++++++++++
 arch/arm/boot/dts/imx51.dtsi                       |  203 ++++++++++++++++
 arch/arm/boot/dts/imx53-ard.dts                    |  158 +++++++++++++
 arch/arm/boot/dts/imx53-evk.dts                    |  144 ++++++++++++
 arch/arm/boot/dts/imx53-qsb.dts                    |  148 ++++++++++++
 arch/arm/boot/dts/imx53-smd.dts                    |  169 ++++++++++++++
 arch/arm/boot/dts/imx53.dtsi                       |  244 ++++++++++++++++++++
 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                       |  111 +++++++++
 arch/arm/mach-mx5/imx53-dt.c                       |  127 ++++++++++
 arch/arm/plat-mxc/include/mach/common.h            |    6 +
 18 files changed, 1530 insertions(+), 12 deletions(-)
author
#1 lore raw

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

From: Shawn Guo <[email protected]>

It adds device tree support for imx53 boards.

---
 .../devicetree/bindings/arm/fsl/boards.txt         |   15 ++
 arch/arm/boot/dts/imx53-ard.dts                    |  158 +++++++++++++
 arch/arm/boot/dts/imx53-evk.dts                    |  144 ++++++++++++
 arch/arm/boot/dts/imx53-qsb.dts                    |  148 ++++++++++++
 arch/arm/boot/dts/imx53-smd.dts                    |  169 ++++++++++++++
 arch/arm/boot/dts/imx53.dtsi                       |  244 ++++++++++++++++++++
 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                       |  127 ++++++++++
 arch/arm/plat-mxc/include/mach/common.h            |    5 +
 14 files changed, 1053 insertions(+), 10 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/fsl/boards.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/boards.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 +158 -0

158 lines not on this page · raw message

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

144 lines not on this page · raw message

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

148 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 +244 -0

244 lines not on this page · raw message

arch/arm/mach-mx5/Kconfig +12 -0
index b4e7c58..0ac676c 100644
@@ -172,6 +172,18 @@ endif # ARCH_MX51
 if ARCH_MX53_SUPPORTED
 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 76a67c4..9b4395d 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 1b417b0..7663905 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 4e1d51d..3922cd5 100644
@@ -257,12 +257,17 @@ static const struct gpio_led_platform_data mx53loco_leds_data __initconst = {
 	.num_leds	= ARRAY_SIZE(mx53loco_leds),
 };
 
+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)
 {
 	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 bc02894..b10c899 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 +127 -0

127 lines not on this page · raw message

arch/arm/plat-mxc/include/mach/common.h +5 -0
index 4e3d978..96fc04d 100644
@@ -72,4 +72,9 @@ 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);
+
 #endif
Signature · 1 line
1.7.4.1
author
#2 lore raw

PATCH v4 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.

---
 .../devicetree/bindings/arm/fsl/boards.txt         |    4 +
 arch/arm/boot/dts/imx51-babbage.dts                |  141 ++++++++++++++
 arch/arm/boot/dts/imx51.dtsi                       |  203 ++++++++++++++++++++
 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                       |  111 +++++++++++
 arch/arm/plat-mxc/include/mach/common.h            |    1 +
 8 files changed, 477 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/boards.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 +141 -0

141 lines not on this page · raw message

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

203 lines not on this page · raw message

arch/arm/mach-mx5/Kconfig +9 -0
index 0ac676c..bda12e8 100644
@@ -62,6 +62,15 @@ endif # ARCH_MX50_SUPPORTED
 if ARCH_MX51
 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 e400b09..fdde34b 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, &uart_pdata);
arch/arm/mach-mx5/imx51-dt.c new file +111 -0

111 lines not on this page · raw message

arch/arm/plat-mxc/include/mach/common.h +1 -0
index 96fc04d..125a3ea 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
#3 lore raw

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

In reply to Shawn Guo
Quoted 7 lines · Shawn Guo

Changes since v3:
* Fix machine_desc table for ARD matching
* Turn the board setup that dt needs into callback

Changes since v2:
* Drop iomuxc device tree support patch

Quoted 7 lines

Changes since v1:
* Address comments on v1 given by Grant and Sascha
* Add i.mx51 Babbage support

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

Looks good.

Sascha, assuming you're okay with it, I'd *really* like to ask Arnd to send this out to Linus immediately. It may not be perfect, and we may change the device disable/enable policy, but it is useful enough that having it in mainline will help developers who want to start hacking on DT support.

g.

Quoted 25 lines
 .../devicetree/bindings/arm/fsl/boards.txt         |   19 ++
 arch/arm/boot/dts/imx51-babbage.dts                |  141 +++++++++++
 arch/arm/boot/dts/imx51.dtsi                       |  203 ++++++++++++++++
 arch/arm/boot/dts/imx53-ard.dts                    |  158 +++++++++++++
 arch/arm/boot/dts/imx53-evk.dts                    |  144 ++++++++++++
 arch/arm/boot/dts/imx53-qsb.dts                    |  148 ++++++++++++
 arch/arm/boot/dts/imx53-smd.dts                    |  169 ++++++++++++++
 arch/arm/boot/dts/imx53.dtsi                       |  244 ++++++++++++++++++++
 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                       |  111 +++++++++
 arch/arm/mach-mx5/imx53-dt.c                       |  127 ++++++++++
 arch/arm/plat-mxc/include/mach/common.h            |    6 +
 18 files changed, 1530 insertions(+), 12 deletions(-)

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss at lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

maintainer
#4 lore raw

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

Quoted 16 lines · Grant Likely
Quoted 7 lines · Shawn Guo

Changes since v3:
* Fix machine_desc table for ARD matching
* Turn the board setup that dt needs into callback

Changes since v2:
* Drop iomuxc device tree support patch

Quoted 7 lines

Changes since v1:
* Address comments on v1 given by Grant and Sascha
* Add i.mx51 Babbage support

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

Quoted 7 lines

Looks good.

Sascha, assuming you're okay with it, I'd *really* like to ask Arnd to send this out to Linus immediately. It may not be perfect, and we may change the device disable/enable policy, but it is useful enough that having it in mainline will help developers who want to start hacking on DT support.

ups, /me is missing on Cc.

Go ahead, I'm fine with it.

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 |