All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add devicetree support for i.MX27 SoCs
@ 2012-02-29  8:20 Sascha Hauer
  2012-02-29  8:20 ` [PATCH 1/3] ARM i.MX27: Add devicetree support Sascha Hauer
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Sascha Hauer @ 2012-02-29  8:20 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,

I created the following mainly out of curiosity to find out what's
missing to support a new i.MX SoC in the devicetree. It turned out
it's not much thanks to the driver bindings which already exist for
the bigger i.MXes. So here it is.

Sascha

Sascha Hauer (3):
      ARM i.MX27: Add devicetree support
      ARM i.MX: Add phytec phycore-i.MX27 (aka pcm038) devicetree support
      devicetree-bindings: Add documentation for i.MX generic boards

 Documentation/devicetree/bindings/arm/fsl.txt |   22 +++
 arch/arm/boot/dts/imx27-phytec-phycore.dts    |   76 +++++++++
 arch/arm/boot/dts/imx27.dtsi                  |  217 +++++++++++++++++++++++++
 arch/arm/mach-imx/Kconfig                     |    8 +
 arch/arm/mach-imx/Makefile                    |    1 +
 arch/arm/mach-imx/clock-imx27.c               |   18 ++
 arch/arm/mach-imx/imx27-dt.c                  |   89 ++++++++++
 arch/arm/plat-mxc/include/mach/common.h       |    1 +
 8 files changed, 432 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/imx27-phytec-phycore.dts
 create mode 100644 arch/arm/boot/dts/imx27.dtsi
 create mode 100644 arch/arm/mach-imx/imx27-dt.c

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] ARM i.MX27: Add devicetree support
  2012-02-29  8:20 [PATCH] Add devicetree support for i.MX27 SoCs Sascha Hauer
@ 2012-02-29  8:20 ` Sascha Hauer
  2012-04-09  1:48   ` Chris Ball
  2012-02-29  8:20 ` [PATCH 2/3] ARM i.MX: Add phytec phycore-i.MX27 (aka pcm038) " Sascha Hauer
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Sascha Hauer @ 2012-02-29  8:20 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds basic devicetree support for i.MX27 based SoCs.
Only the bindings for which drivers exist are added here:

- UART
- fec
- CSPI
- I2C
- watchdog
- gpio

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boot/dts/imx27.dtsi            |  217 +++++++++++++++++++++++++++++++
 arch/arm/mach-imx/Kconfig               |    8 +
 arch/arm/mach-imx/Makefile              |    1 +
 arch/arm/mach-imx/clock-imx27.c         |   18 +++
 arch/arm/mach-imx/imx27-dt.c            |   89 +++++++++++++
 arch/arm/plat-mxc/include/mach/common.h |    1 +
 6 files changed, 334 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/imx27.dtsi
 create mode 100644 arch/arm/mach-imx/imx27-dt.c

diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi
new file mode 100644
index 0000000..bc5e7d5
--- /dev/null
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -0,0 +1,217 @@
+/*
+ * Copyright 2012 Sascha Hauer, Pengutronix
+ *
+ * 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 = &uart1;
+		serial1 = &uart2;
+		serial2 = &uart3;
+		serial3 = &uart4;
+		serial4 = &uart5;
+		serial5 = &uart6;
+	};
+
+	avic: avic-interrupt-controller at e0000000 {
+		compatible = "fsl,imx27-avic", "fsl,avic";
+		interrupt-controller;
+		#interrupt-cells = <1>;
+		reg = <0x10040000 0x1000>;
+	};
+
+	clocks {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		osc26m {
+			compatible = "fsl,imx-osc26m", "fixed-clock";
+			clock-frequency = <26000000>;
+		};
+	};
+
+	soc {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "simple-bus";
+		interrupt-parent = <&avic>;
+		ranges;
+
+		aipi at 10000000 { /* AIPI1 */
+			compatible = "fsl,aipi-bus", "simple-bus";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <0x10000000 0x10000000>;
+			ranges;
+
+			wdog at 10002000 {
+				compatible = "fsl,imx27-wdt", "fsl,imx21-wdt";
+				reg = <0x10002000 0x4000>;
+				interrupts = <27>;
+				status = "disabled";
+			};
+
+			uart1: uart at 1000a000 {
+				compatible = "fsl,imx27-uart", "fsl,imx21-uart";
+				reg = <0x1000a000 0x1000>;
+				interrupts = <20>;
+				status = "disabled";
+			};
+
+			uart2: uart at 1000b000 {
+				compatible = "fsl,imx27-uart", "fsl,imx21-uart";
+				reg = <0x1000b000 0x1000>;
+				interrupts = <19>;
+				status = "disabled";
+			};
+
+			uart3: uart at 1000c000 {
+				compatible = "fsl,imx27-uart", "fsl,imx21-uart";
+				reg = <0x1000c000 0x1000>;
+				interrupts = <18>;
+				status = "disabled";
+			};
+
+			uart4: uart at 1000d000 {
+				compatible = "fsl,imx27-uart", "fsl,imx21-uart";
+				reg = <0x1000d000 0x1000>;
+				interrupts = <17>;
+				status = "disabled";
+			};
+
+			cspi1: cspi at 1000e000 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				compatible = "fsl,imx27-cspi";
+				reg = <0x1000e000 0x1000>;
+				interrupts = <16>;
+				status = "disabled";
+			};
+
+			cspi2: cspi at 1000f000 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				compatible = "fsl,imx27-cspi";
+				reg = <0x1000f000 0x1000>;
+				interrupts = <15>;
+				status = "disabled";
+			};
+
+			i2c1: i2c at 10012000 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				compatible = "fsl,imx27-i2c", "fsl,imx1-i2c";
+				reg = <0x10012000 0x1000>;
+				interrupts = <12>;
+				status = "disabled";
+			};
+
+			gpio1: gpio at 10015000 {
+				compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
+				reg = <0x10015000 0x100>;
+				interrupts = <8>;
+				gpio-controller;
+				#gpio-cells = <2>;
+				interrupt-controller;
+				#interrupt-cells = <1>;
+			};
+
+			gpio2: gpio at 10015100 {
+				compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
+				reg = <0x10015100 0x100>;
+				interrupts = <8>;
+				gpio-controller;
+				#gpio-cells = <2>;
+				interrupt-controller;
+				#interrupt-cells = <1>;
+			};
+
+			gpio3: gpio at 10015200 {
+				compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
+				reg = <0x10015200 0x100>;
+				interrupts = <8>;
+				gpio-controller;
+				#gpio-cells = <2>;
+				interrupt-controller;
+				#interrupt-cells = <1>;
+			};
+
+			gpio4: gpio at 10015300 {
+				compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
+				reg = <0x10015300 0x100>;
+				interrupts = <8>;
+				gpio-controller;
+				#gpio-cells = <2>;
+				interrupt-controller;
+				#interrupt-cells = <1>;
+			};
+
+			gpio5: gpio at 10015400 {
+				compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
+				reg = <0x10015400 0x100>;
+				interrupts = <8>;
+				gpio-controller;
+				#gpio-cells = <2>;
+				interrupt-controller;
+				#interrupt-cells = <1>;
+			};
+
+			gpio6: gpio at 10015500 {
+				compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
+				reg = <0x10015500 0x100>;
+				interrupts = <8>;
+				gpio-controller;
+				#gpio-cells = <2>;
+				interrupt-controller;
+				#interrupt-cells = <1>;
+			};
+
+			cspi3: cspi at 10017000 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				compatible = "fsl,imx27-cspi";
+				reg = <0x10017000 0x1000>;
+				interrupts = <6>;
+				status = "disabled";
+			};
+
+			uart5: uart at 1001b000 {
+				compatible = "fsl,imx27-uart", "fsl,imx21-uart";
+				reg = <0x1001b000 0x1000>;
+				interrupts = <49>;
+				status = "disabled";
+			};
+
+			uart6: uart at 1001c000 {
+				compatible = "fsl,imx27-uart", "fsl,imx21-uart";
+				reg = <0x1001c000 0x1000>;
+				interrupts = <48>;
+				status = "disabled";
+			};
+
+			i2c2: i2c at 1001d000 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				compatible = "fsl,imx27-i2c", "fsl,imx1-i2c";
+				reg = <0x1001d000 0x1000>;
+				interrupts = <1>;
+				status = "disabled";
+			};
+
+			fec: fec at 1002b000 {
+				compatible = "fsl,imx27-fec";
+				reg = <0x1002b000 0x4000>;
+				interrupts = <50>;
+				status = "disabled";
+			};
+		};
+	};
+};
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 4defb97..85433b9 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -376,6 +376,14 @@ config MACH_IMX27IPCAM
 	  Include support for IMX27 IPCAM platform. This includes specific
 	  configurations for the board and its peripherals.
 
+config MACH_IMX27_DT
+	bool "Support i.MX27 platforms from device tree"
+	select SOC_IMX27
+	select USE_OF
+	help
+	  Include support for Freescale i.MX27 based platforms
+	  using the device tree for discovery
+
 endif
 
 if ARCH_IMX_V6_V7
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 55db9c4..4ffeca7 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -41,6 +41,7 @@ obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o
 obj-$(CONFIG_MACH_PCA100) += mach-pca100.o
 obj-$(CONFIG_MACH_MXT_TD60) += mach-mxt_td60.o
 obj-$(CONFIG_MACH_IMX27IPCAM) += mach-imx27ipcam.o
+obj-$(CONFIG_MACH_IMX27_DT) += imx27-dt.o
 
 # i.MX31 based machines
 obj-$(CONFIG_MACH_MX31ADS) += mach-mx31ads.o
diff --git a/arch/arm/mach-imx/clock-imx27.c b/arch/arm/mach-imx/clock-imx27.c
index 88fe00a..01ae3a4 100644
--- a/arch/arm/mach-imx/clock-imx27.c
+++ b/arch/arm/mach-imx/clock-imx27.c
@@ -22,6 +22,7 @@
 #include <linux/io.h>
 #include <linux/module.h>
 #include <linux/clkdev.h>
+#include <linux/of.h>
 
 #include <asm/div64.h>
 
@@ -764,3 +765,20 @@ int __init mx27_clocks_init(unsigned long fref)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+int __init mx27_clocks_init_dt(void)
+{
+	struct device_node *np;
+	u32 fref = 26000000; /* default */
+
+	for_each_compatible_node(np, NULL, "fixed-clock") {
+		if (!of_device_is_compatible(np, "fsl,imx-osc26m"))
+			continue;
+
+		if (!of_property_read_u32(np, "clock-frequency", &fref))
+			break;
+	}
+
+	return mx27_clocks_init(fref);
+}
+#endif
diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c
new file mode 100644
index 0000000..861ceb8
--- /dev/null
+++ b/arch/arm/mach-imx/imx27-dt.c
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2012 Sascha Hauer, Pengutronix
+ *
+ * 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/mx27.h>
+
+static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = {
+	OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART1_BASE_ADDR, "imx21-uart.0", NULL),
+	OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART2_BASE_ADDR, "imx21-uart.1", NULL),
+	OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART3_BASE_ADDR, "imx21-uart.2", NULL),
+	OF_DEV_AUXDATA("fsl,imx27-fec", MX27_FEC_BASE_ADDR, "imx27-fec.0", NULL),
+	OF_DEV_AUXDATA("fsl,imx27-i2c", MX27_I2C1_BASE_ADDR, "imx-i2c.0", NULL),
+	OF_DEV_AUXDATA("fsl,imx27-i2c", MX27_I2C2_BASE_ADDR, "imx-i2c.1", NULL),
+	OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI1_BASE_ADDR, "imx27-cspi.0", NULL),
+	OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI2_BASE_ADDR, "imx27-cspi.1", NULL),
+	OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI3_BASE_ADDR, "imx27-cspi.2", NULL),
+	OF_DEV_AUXDATA("fsl,imx27-wdt", MX27_WDOG_BASE_ADDR, "imx2-wdt.0", NULL),
+	{ /* sentinel */ }
+};
+
+static int __init imx27_avic_add_irq_domain(struct device_node *np,
+				struct device_node *interrupt_parent)
+{
+	irq_domain_add_simple(np, 0);
+	return 0;
+}
+
+static int __init imx27_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;
+
+	irq_domain_add_simple(np, gpio_irq_base);
+
+	return 0;
+}
+
+static const struct of_device_id imx27_irq_match[] __initconst = {
+	{ .compatible = "fsl,imx27-avic", .data = imx27_avic_add_irq_domain, },
+	{ .compatible = "fsl,imx27-gpio", .data = imx27_gpio_add_irq_domain, },
+	{ /* sentinel */ }
+};
+
+static void __init imx27_dt_init(void)
+{
+	of_irq_init(imx27_irq_match);
+
+	of_platform_populate(NULL, of_default_bus_match_table,
+			     imx27_auxdata_lookup, NULL);
+}
+
+static void __init imx27_timer_init(void)
+{
+	mx27_clocks_init_dt();
+}
+
+static struct sys_timer imx27_timer = {
+	.init = imx27_timer_init,
+};
+
+static const char *imx27_dt_board_compat[] __initdata = {
+	"fsl,imx27",
+	NULL
+};
+
+DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)")
+	.map_io		= mx27_map_io,
+	.init_early	= imx27_init_early,
+	.init_irq	= mx27_init_irq,
+	.handle_irq	= imx27_handle_irq,
+	.timer		= &imx27_timer,
+	.init_machine	= imx27_dt_init,
+	.dt_compat	= imx27_dt_board_compat,
+	.restart	= mxc_restart,
+MACHINE_END
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h
index 1bf0df8..16d10a8 100644
--- a/arch/arm/plat-mxc/include/mach/common.h
+++ b/arch/arm/plat-mxc/include/mach/common.h
@@ -65,6 +65,7 @@ extern int mx51_clocks_init(unsigned long ckil, unsigned long osc,
 			unsigned long ckih1, unsigned long ckih2);
 extern int mx53_clocks_init(unsigned long ckil, unsigned long osc,
 			unsigned long ckih1, unsigned long ckih2);
+extern int mx27_clocks_init_dt(void);
 extern int mx51_clocks_init_dt(void);
 extern int mx53_clocks_init_dt(void);
 extern int mx6q_clocks_init(void);
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] ARM i.MX: Add phytec phycore-i.MX27 (aka pcm038) devicetree support
  2012-02-29  8:20 [PATCH] Add devicetree support for i.MX27 SoCs Sascha Hauer
  2012-02-29  8:20 ` [PATCH 1/3] ARM i.MX27: Add devicetree support Sascha Hauer
@ 2012-02-29  8:20 ` Sascha Hauer
  2012-02-29  8:20 ` [PATCH 3/3] devicetree-bindings: Add documentation for i.MX generic boards Sascha Hauer
  2012-03-01  7:00 ` [PATCH] Add devicetree support for i.MX27 SoCs Shawn Guo
  3 siblings, 0 replies; 9+ messages in thread
From: Sascha Hauer @ 2012-02-29  8:20 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boot/dts/imx27-phytec-phycore.dts |   76 ++++++++++++++++++++++++++++
 1 files changed, 76 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/imx27-phytec-phycore.dts

diff --git a/arch/arm/boot/dts/imx27-phytec-phycore.dts b/arch/arm/boot/dts/imx27-phytec-phycore.dts
new file mode 100644
index 0000000..a51a08f
--- /dev/null
+++ b/arch/arm/boot/dts/imx27-phytec-phycore.dts
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2012 Sascha Hauer, Pengutronix
+ *
+ * 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/ "imx27.dtsi"
+
+/ {
+	model = "Phytec pcm038";
+	compatible = "phytec,imx27-pcm038", "fsl,imx27";
+
+	memory {
+		reg = <0x0 0x0>;
+	};
+
+	soc {
+		aipi at 10000000 { /* aipi */
+
+			wdog at 10002000 {
+				status = "okay";
+			};
+
+			uart at 1000a000 {
+				fsl,uart-has-rtscts;
+				status = "okay";
+			};
+
+			uart at 1000b000 {
+				fsl,uart-has-rtscts;
+				status = "okay";
+			};
+
+			uart at 1000c000 {
+				fsl,uart-has-rtscts;
+				status = "okay";
+			};
+
+			fec at 1002b000 {
+				status = "okay";
+			};
+
+			i2c at 1001d000 {
+				clock-frequency = <400000>;
+				status = "okay";
+				at24 at 4c {
+					compatible = "at,24c32";
+					pagesize = <32>;
+					reg = <0x52>;
+				};
+				pcf8563 at 51 {
+					compatible = "nxp,pcf8563";
+					reg = <0x51>;
+				};
+				lm75 at 4a {
+					compatible = "national,lm75";
+					reg = <0x4a>;
+				};
+			};
+		};
+	};
+
+	nor_flash at c0000000 {
+		compatible = "cfi-flash";
+		bank-width = <2>;
+		reg = <0xc0000000 0x02000000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+	};
+};
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] devicetree-bindings: Add documentation for i.MX generic boards
  2012-02-29  8:20 [PATCH] Add devicetree support for i.MX27 SoCs Sascha Hauer
  2012-02-29  8:20 ` [PATCH 1/3] ARM i.MX27: Add devicetree support Sascha Hauer
  2012-02-29  8:20 ` [PATCH 2/3] ARM i.MX: Add phytec phycore-i.MX27 (aka pcm038) " Sascha Hauer
@ 2012-02-29  8:20 ` Sascha Hauer
  2012-03-01  7:00 ` [PATCH] Add devicetree support for i.MX27 SoCs Shawn Guo
  3 siblings, 0 replies; 9+ messages in thread
From: Sascha Hauer @ 2012-02-29  8:20 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 Documentation/devicetree/bindings/arm/fsl.txt |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/fsl.txt b/Documentation/devicetree/bindings/arm/fsl.txt
index 54bddda..bfbc771 100644
--- a/Documentation/devicetree/bindings/arm/fsl.txt
+++ b/Documentation/devicetree/bindings/arm/fsl.txt
@@ -28,3 +28,25 @@ Required root node properties:
 i.MX6 Quad SABRE Lite Board
 Required root node properties:
     - compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
+
+Generic i.MX boards
+-------------------
+
+No iomux setup is done for these boards, so this must have been configured
+by the bootloader for boards to work with the generic bindings.
+
+i.MX27 generic board
+Required root node properties:
+    - compatible = "fsl,imx27";
+
+i.MX51 generic board
+Required root node properties:
+    - compatible = "fsl,imx51";
+
+i.MX53 generic board
+Required root node properties:
+    - compatible = "fsl,imx53";
+
+i.MX6q generic board
+Required root node properties:
+    - compatible = "fsl,imx6q";
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] Add devicetree support for i.MX27 SoCs
  2012-02-29  8:20 [PATCH] Add devicetree support for i.MX27 SoCs Sascha Hauer
                   ` (2 preceding siblings ...)
  2012-02-29  8:20 ` [PATCH 3/3] devicetree-bindings: Add documentation for i.MX generic boards Sascha Hauer
@ 2012-03-01  7:00 ` Shawn Guo
  3 siblings, 0 replies; 9+ messages in thread
From: Shawn Guo @ 2012-03-01  7:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Feb 29, 2012 at 09:20:51AM +0100, Sascha Hauer wrote:
> Hi all,
> 
> I created the following mainly out of curiosity to find out what's
> missing to support a new i.MX SoC in the devicetree. It turned out
> it's not much thanks to the driver bindings which already exist for
> the bigger i.MXes. So here it is.
> 
> Sascha
> 
> Sascha Hauer (3):
>       ARM i.MX27: Add devicetree support
>       ARM i.MX: Add phytec phycore-i.MX27 (aka pcm038) devicetree support
>       devicetree-bindings: Add documentation for i.MX generic boards

For the series,

Acked-by: Shawn Guo <shawn.guo@linaro.org>

Regards,
Shawn

> 
>  Documentation/devicetree/bindings/arm/fsl.txt |   22 +++
>  arch/arm/boot/dts/imx27-phytec-phycore.dts    |   76 +++++++++
>  arch/arm/boot/dts/imx27.dtsi                  |  217 +++++++++++++++++++++++++
>  arch/arm/mach-imx/Kconfig                     |    8 +
>  arch/arm/mach-imx/Makefile                    |    1 +
>  arch/arm/mach-imx/clock-imx27.c               |   18 ++
>  arch/arm/mach-imx/imx27-dt.c                  |   89 ++++++++++
>  arch/arm/plat-mxc/include/mach/common.h       |    1 +
>  8 files changed, 432 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/boot/dts/imx27-phytec-phycore.dts
>  create mode 100644 arch/arm/boot/dts/imx27.dtsi
>  create mode 100644 arch/arm/mach-imx/imx27-dt.c

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] ARM i.MX27: Add devicetree support
  2012-02-29  8:20 ` [PATCH 1/3] ARM i.MX27: Add devicetree support Sascha Hauer
@ 2012-04-09  1:48   ` Chris Ball
  2012-04-10  9:17     ` Sascha Hauer
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Ball @ 2012-04-09  1:48 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sascha,

On Wed, Feb 29 2012, Sascha Hauer wrote:
> This patch adds basic devicetree support for i.MX27 based SoCs.
> Only the bindings for which drivers exist are added here:
>
> - UART
> - fec
> - CSPI
> - I2C
> - watchdog
> - gpio
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/boot/dts/imx27.dtsi            |  217 +++++++++++++++++++++++++++++++
>  arch/arm/mach-imx/Kconfig               |    8 +
>  arch/arm/mach-imx/Makefile              |    1 +
>  arch/arm/mach-imx/clock-imx27.c         |   18 +++
>  arch/arm/mach-imx/imx27-dt.c            |   89 +++++++++++++
>  arch/arm/plat-mxc/include/mach/common.h |    1 +
>  6 files changed, 334 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/boot/dts/imx27.dtsi
>  create mode 100644 arch/arm/mach-imx/imx27-dt.c
>
> [...]
> diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c
> new file mode 100644
> index 0000000..861ceb8
> --- /dev/null
> +++ b/arch/arm/mach-imx/imx27-dt.c
>
> [...]
> +static int __init imx27_avic_add_irq_domain(struct device_node *np,
> +				struct device_node *interrupt_parent)
> +{
> +	irq_domain_add_simple(np, 0);
> +	return 0;
> +}
> +
> +static int __init imx27_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;
> +
> +	irq_domain_add_simple(np, gpio_irq_base);
> +
> +	return 0;
> +}

This patch was merged for 3.4-rc1, but it fails to compile because Grant
removed irq_domain_add_simple() in 3.4-rc1.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] ARM i.MX27: Add devicetree support
  2012-04-09  1:48   ` Chris Ball
@ 2012-04-10  9:17     ` Sascha Hauer
  2012-04-10 14:12       ` Chris Ball
  0 siblings, 1 reply; 9+ messages in thread
From: Sascha Hauer @ 2012-04-10  9:17 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Chris,

On Sun, Apr 08, 2012 at 09:48:02PM -0400, Chris Ball wrote:
> >
> > [...]
> > +static int __init imx27_avic_add_irq_domain(struct device_node *np,
> > +				struct device_node *interrupt_parent)
> > +{
> > +	irq_domain_add_simple(np, 0);
> > +	return 0;
> > +}
> > +
> > +static int __init imx27_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;
> > +
> > +	irq_domain_add_simple(np, gpio_irq_base);
> > +
> > +	return 0;
> > +}
> 
> This patch was merged for 3.4-rc1, but it fails to compile because Grant
> removed irq_domain_add_simple() in 3.4-rc1.

Thanks for noting. I assume that irq_domain_add_legacy is the right
approach here, just like the other i.MX boards do, right?

Sascha

-- 
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 |

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] ARM i.MX27: Add devicetree support
  2012-04-10  9:17     ` Sascha Hauer
@ 2012-04-10 14:12       ` Chris Ball
  2012-04-12  0:13         ` Fabio Estevam
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Ball @ 2012-04-10 14:12 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Tue, Apr 10 2012, Sascha Hauer wrote:
> On Sun, Apr 08, 2012 at 09:48:02PM -0400, Chris Ball wrote:
>> >
>> > [...]
>> > +static int __init imx27_avic_add_irq_domain(struct device_node *np,
>> > +				struct device_node *interrupt_parent)
>> > +{
>> > +	irq_domain_add_simple(np, 0);
>> > +	return 0;
>> > +}
>> > +
>> > +static int __init imx27_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;
>> > +
>> > +	irq_domain_add_simple(np, gpio_irq_base);
>> > +
>> > +	return 0;
>> > +}
>> 
>> This patch was merged for 3.4-rc1, but it fails to compile because Grant
>> removed irq_domain_add_simple() in 3.4-rc1.
>
> Thanks for noting. I assume that irq_domain_add_legacy is the right
> approach here, just like the other i.MX boards do, right?

Yeah, if you look at Grant's removal patch:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=6b783f7c5dde2648fa0bbe7fc8ac80d78699e67f

.. he converted all of the in-tree uses to irq_domain_add_legacy()
at the time of removal, so that looks right.

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] ARM i.MX27: Add devicetree support
  2012-04-10 14:12       ` Chris Ball
@ 2012-04-12  0:13         ` Fabio Estevam
  0 siblings, 0 replies; 9+ messages in thread
From: Fabio Estevam @ 2012-04-12  0:13 UTC (permalink / raw)
  To: linux-arm-kernel

Sascha,

On Tue, Apr 10, 2012 at 11:12 AM, Chris Ball <cjb@laptop.org> wrote:

>> Thanks for noting. I assume that irq_domain_add_legacy is the right
>> approach here, just like the other i.MX boards do, right?
>
> Yeah, if you look at Grant's removal patch:
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=6b783f7c5dde2648fa0bbe7fc8ac80d78699e67f
>
> .. he converted all of the in-tree uses to irq_domain_add_legacy()
> at the time of removal, so that looks right.

I managed to get mx27pdk booting from dt (thanks Shawn for the tips!)
and I fixed this problem.

Will send the fix soon.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-04-12  0:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-29  8:20 [PATCH] Add devicetree support for i.MX27 SoCs Sascha Hauer
2012-02-29  8:20 ` [PATCH 1/3] ARM i.MX27: Add devicetree support Sascha Hauer
2012-04-09  1:48   ` Chris Ball
2012-04-10  9:17     ` Sascha Hauer
2012-04-10 14:12       ` Chris Ball
2012-04-12  0:13         ` Fabio Estevam
2012-02-29  8:20 ` [PATCH 2/3] ARM i.MX: Add phytec phycore-i.MX27 (aka pcm038) " Sascha Hauer
2012-02-29  8:20 ` [PATCH 3/3] devicetree-bindings: Add documentation for i.MX generic boards Sascha Hauer
2012-03-01  7:00 ` [PATCH] Add devicetree support for i.MX27 SoCs Shawn Guo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.