Skip to contentSkip to conversation

ARM: imx28: add basic dt support

PATCH Superseded Dong Aisheng 3 participants 3 messages Mar 30, 2012

Subsystems (4)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 ARM: imx28: add basic dt support

From: Dong Aisheng <[email protected]>

This patch includes basic dt support which can boot via nfs rootfs.

---
ChangeLog v2->v3:
* Some minor fixes suggested by Shawn Guo
ChangeLog v1->v2:
* Some fixes addressed Rob's review comments.
Remove using of OF_DEV_AUXDATA.
* Remove mac address from dts file
Currently we use the mac address got from uboot to work. Will submit a p separate atch using prom_update_property to fix this issue for driver based on suggestions from Grant and Lothar.
* rename mxs-dt.c to mach-mxs.c which is supposed to support mx23 dt too in the future.
* add compatible string "fsl,imx28" per Sascha's suggestion
* add more devices in dtsi file
For those devices still not in use, set the state to "disabled" by default.

---
 Documentation/devicetree/bindings/arm/fsl.txt |    4 +
 arch/arm/boot/dts/imx28-evk.dts               |   34 +++
 arch/arm/boot/dts/imx28.dtsi                  |  356 +++++++++++++++++++++++++
 arch/arm/mach-mxs/Kconfig                     |   10 +
 arch/arm/mach-mxs/Makefile                    |    1 +
 arch/arm/mach-mxs/clock-mx28.c                |    4 +
 arch/arm/mach-mxs/devices/Kconfig             |    1 -
 arch/arm/mach-mxs/mach-mxs.c                  |   68 +++++
 8 files changed, 477 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/boot/dts/imx28-evk.dts
 create mode 100644 arch/arm/boot/dts/imx28.dtsi
 create mode 100644 arch/arm/mach-mxs/mach-mxs.c
Documentation/devicetree/bindings/arm/fsl.txt +4 -0
index 54bddda..9f21faf 100644
@@ -1,6 +1,10 @@
 Freescale i.MX Platforms Device Tree Bindings
 -----------------------------------------------
 
+i.MX28 Evaluation Kit
+Required root node properties:
+    - compatible = "fsl,imx28-evk", "fsl,imx28";
+
 i.MX51 Babbage Board
 Required root node properties:
     - compatible = "fsl,imx51-babbage", "fsl,imx51";
arch/arm/boot/dts/imx28-evk.dts new file +34 -0
new file mode 100644
index 0000000..57703ec
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ *
+ * 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/ "imx28.dtsi"
+
+/ {
+	model = "Freescale i.MX28 Evaluation Kit";
+	compatible = "fsl,imx28-evk", "fsl,imx28";
+
+	memory {
+		reg = <0x40000000 0x08000000>;
+	};
+
+	ahb at 80080000 {
+		ethernet at 800f0000 {
+			phy-mode = "rmii";
+			status = "okay";
+		};
+
+		ethernet at 800f4000 {
+			phy-mode = "rmii";
+			status = "okay";
+		};
+	};
+};
arch/arm/boot/dts/imx28.dtsi new file +356 -0

356 lines not on this page · raw message

arch/arm/mach-mxs/Kconfig +10 -0
index c57f996..09fe0fb 100644
@@ -7,16 +7,26 @@ config MXS_OCOTP
 
 config SOC_IMX23
 	bool
+	select ARM_AMBA
 	select CPU_ARM926T
 	select HAVE_PWM
 
 config SOC_IMX28
 	bool
+	select ARM_AMBA
 	select CPU_ARM926T
 	select HAVE_PWM
 
 comment "MXS platforms:"
 
+config MACH_MXS_DT
+	bool "Support MXS platforms from device tree"
+	select SOC_IMX28
+	select USE_OF
+	help
+	  Include support for Freescale MXS platforms(i.MX23 and i.MX28)
+	  using the device tree for discovery
+
 config MACH_STMP378X_DEVB
 	bool "Support STMP378x_devb Platform"
 	select SOC_IMX23
arch/arm/mach-mxs/Makefile +1 -0
index 908bf9a..8328c45 100644
@@ -7,6 +7,7 @@ obj-$(CONFIG_PM) += pm.o
 obj-$(CONFIG_SOC_IMX23) += clock-mx23.o
 obj-$(CONFIG_SOC_IMX28) += clock-mx28.o
 
+obj-$(CONFIG_MACH_MXS_DT) += mach-mxs.o
 obj-$(CONFIG_MACH_STMP378X_DEVB) += mach-stmp378x_devb.o
 obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o
 obj-$(CONFIG_MACH_MX28EVK) += mach-mx28evk.o
arch/arm/mach-mxs/clock-mx28.c +4 -0
index 5d68e41..88ed30c 100644
@@ -671,6 +671,10 @@ static struct clk_lookup lookups[] = {
 	_REGISTER_CLOCK("imx28-fb", NULL, lcdif_clk)
 	_REGISTER_CLOCK("mxs-saif.0", NULL, saif0_clk)
 	_REGISTER_CLOCK("mxs-saif.1", NULL, saif1_clk)
+	/* for DT */
+	_REGISTER_CLOCK("80074000.serial", NULL, uart_clk)
+	_REGISTER_CLOCK("800f0000.ethernet", NULL, fec_clk)
+	_REGISTER_CLOCK("800f4000.ethernet", NULL, fec_clk)
 };
 
 static int clk_misc_init(void)
arch/arm/mach-mxs/devices/Kconfig +0 -1
index 18b6bf5..2febd62 100644
@@ -1,6 +1,5 @@
 config MXS_HAVE_AMBA_DUART
 	bool
-	select ARM_AMBA
 
 config MXS_HAVE_PLATFORM_AUART
 	bool
arch/arm/mach-mxs/mach-mxs.c new file +68 -0

68 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#1 lore raw

PATCH v3 1/1 ARM: imx28: add basic dt support

I tried to apply the patch, but ...

On Fri, Mar 30, 2012 at 02:32:10PM +0800, Dong Aisheng wrote:
...

arch/arm/mach-mxs/mach-mxs.c line 24

Quoted 4 lines
arch/arm/mach-mxs/mach-mxs.c new file +4 -0
+static int __init mxs_icoll_add_irq_domain(struct device_node *np,
+				struct device_node *interrupt_parent)
+{
+	irq_domain_add_simple(np, 0);

The irq_domain_add_simple() has been removed from mainline. You need a rebase against Linus' tree.

Quoted 17 lines
arch/arm/mach-mxs/mach-mxs.c new file +17 -0
+
+	return 0;
+}
+
+static const struct of_device_id mxs_irq_match[] __initconst = {
+	{ .compatible = "fsl,mxs-icoll", .data = mxs_icoll_add_irq_domain, },
+	{ /* sentinel */ }
+};
+
+static void __init mxs_dt_init_irq(void)
+{
+	icoll_init_irq();
+	of_irq_init(mxs_irq_match);
+}
+
+static void __init imx28_timer_init(void)
+{

arch/arm/mach-mxs/mach-mxs.c line 51

Quoted 10 lines
arch/arm/mach-mxs/mach-mxs.c new file +10 -0
+	mx28_clocks_init();
+}
+
+static struct sys_timer imx28_timer = {
+	.init = imx28_timer_init,
+};
+
+static void __init mxs_machine_init(void)
+{
+       of_platform_populate(NULL, of_default_bus_match_table,

Given by checkpatch:

WARNING: please, no spaces at the start of a line
#565: FILE: arch/arm/mach-mxs/mach-mxs.c:51:
+ of_platform_populate(NULL, of_default_bus_match_table,$

Quoted 2 lines
arch/arm/mach-mxs/mach-mxs.c new file +2 -0
+				NULL, NULL);
+}
Signature · 2 lines
Regards,
Shawn
#2 lore raw

PATCH v3 1/1 ARM: imx28: add basic dt support

Quoted 4 lines · Shawn Guo

I tried to apply the patch, but ...

On Fri, Mar 30, 2012 at 02:32:10PM +0800, Dong Aisheng wrote:
...

Quoted 8 lines

arch/arm/mach-mxs/mach-mxs.c line 24

Quoted 4 lines
arch/arm/mach-mxs/mach-mxs.c new file +4 -0
+static int __init mxs_icoll_add_irq_domain(struct device_node *np,
+				struct device_node *interrupt_parent)
+{
+	irq_domain_add_simple(np, 0);

The irq_domain_add_simple() has been removed from mainline. You need a rebase against Linus' tree.

Will rebase.

Quoted 10 lines

arch/arm/mach-mxs/mach-mxs.c line 51

Quoted 7 lines
arch/arm/mach-mxs/mach-mxs.c new file +7 -0
+static struct sys_timer imx28_timer = {
+	.init = imx28_timer_init,
+};
+
+static void __init mxs_machine_init(void)
+{
+       of_platform_populate(NULL, of_default_bus_match_table,

Given by checkpatch:

Quoted 4 lines

WARNING: please, no spaces at the start of a line
#565: FILE: arch/arm/mach-mxs/mach-mxs.c:51:
+ of_platform_populate(NULL, of_default_bus_match_table,$

Hmm, it seems my checkpatch is out of date.
With new checkpatch i found it.

Regards
Dong Aisheng