]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: imx28: add basic dt support
authorDong Aisheng <dong.aisheng@linaro.org>
Sat, 31 Mar 2012 13:26:57 +0000 (21:26 +0800)
committerShawn Guo <shawn.guo@linaro.org>
Thu, 5 Apr 2012 01:29:20 +0000 (09:29 +0800)
This patch includes basic dt support which can boot via nfs rootfs.

Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Documentation/devicetree/bindings/arm/fsl.txt
arch/arm/boot/dts/imx28-evk.dts [new file with mode: 0644]
arch/arm/boot/dts/imx28.dtsi [new file with mode: 0644]
arch/arm/mach-mxs/Kconfig
arch/arm/mach-mxs/Makefile
arch/arm/mach-mxs/clock-mx28.c
arch/arm/mach-mxs/devices/Kconfig
arch/arm/mach-mxs/mach-mxs.c [new file with mode: 0644]

index bfbc771a65f8937124089c238fe6ac0dcaa96142..fecb580342d44a60c80355d1d8a0086a3dedd25c 100644 (file)
@@ -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";
diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts
new file mode 100644 (file)
index 0000000..57703ec
--- /dev/null
@@ -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@80080000 {
+               ethernet@800f0000 {
+                       phy-mode = "rmii";
+                       status = "okay";
+               };
+
+               ethernet@800f4000 {
+                       phy-mode = "rmii";
+                       status = "okay";
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
new file mode 100644 (file)
index 0000000..7060de9
--- /dev/null
@@ -0,0 +1,352 @@
+/*
+ * 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
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+       interrupt-parent = <&icoll>;
+
+       cpus {
+               cpu@0 {
+                       compatible = "arm,arm926ejs";
+               };
+       };
+
+       apb@80000000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               reg = <0x80000000 0x80000>;
+               ranges;
+
+               apbh@80000000 {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0x80000000 0x3c900>;
+                       ranges;
+
+                       icoll: interrupt-controller@80000000 {
+                               compatible = "fsl,imx28-icoll", "fsl,mxs-icoll";
+                               interrupt-controller;
+                               #interrupt-cells = <1>;
+                               reg = <0x80000000 0x2000>;
+                       };
+
+                       hsadc@80002000 {
+                               reg = <0x80002000 2000>;
+                               interrupts = <13 87>;
+                               status = "disabled";
+                       };
+
+                       dma-apbh@80004000 {
+                               reg = <0x80004000 2000>;
+                               status = "disabled";
+                       };
+
+                       perfmon@80006000 {
+                               reg = <0x80006000 800>;
+                               interrupts = <27>;
+                               status = "disabled";
+                       };
+
+                       bch@8000a000 {
+                               reg = <0x8000a000 2000>;
+                               interrupts = <41>;
+                               status = "disabled";
+                       };
+
+                       gpmi@8000c000 {
+                               reg = <0x8000c000 2000>;
+                               interrupts = <42 88>;
+                               status = "disabled";
+                       };
+
+                       ssp@80010000 {
+                               reg = <0x80010000 2000>;
+                               interrupts = <96 82>;
+                               status = "disabled";
+                       };
+
+                       ssp@80012000 {
+                               reg = <0x80012000 2000>;
+                               interrupts = <97 83>;
+                               status = "disabled";
+                       };
+
+                       ssp@80014000 {
+                               reg = <0x80014000 2000>;
+                               interrupts = <98 84>;
+                               status = "disabled";
+                       };
+
+                       ssp@80016000 {
+                               reg = <0x80016000 2000>;
+                               interrupts = <99 85>;
+                               status = "disabled";
+                       };
+
+                       pinctrl@80018000 {
+                               reg = <0x80018000 2000>;
+                               status = "disabled";
+                       };
+
+                       digctl@8001c000 {
+                               reg = <0x8001c000 2000>;
+                               interrupts = <89>;
+                               status = "disabled";
+                       };
+
+                       etm@80022000 {
+                               reg = <0x80022000 2000>;
+                               status = "disabled";
+                       };
+
+                       dma-apbx@80024000 {
+                               reg = <0x80024000 2000>;
+                               status = "disabled";
+                       };
+
+                       dcp@80028000 {
+                               reg = <0x80028000 2000>;
+                               interrupts = <52 53 54>;
+                               status = "disabled";
+                       };
+
+                       pxp@8002a000 {
+                               reg = <0x8002a000 2000>;
+                               interrupts = <39>;
+                               status = "disabled";
+                       };
+
+                       ocotp@8002c000 {
+                               reg = <0x8002c000 2000>;
+                               status = "disabled";
+                       };
+
+                       axi-ahb@8002e000 {
+                               reg = <0x8002e000 2000>;
+                               status = "disabled";
+                       };
+
+                       lcdif@80030000 {
+                               reg = <0x80030000 2000>;
+                               interrupts = <38 86>;
+                               status = "disabled";
+                       };
+
+                       can@80032000 {
+                               reg = <0x80032000 2000>;
+                               interrupts = <8>;
+                               status = "disabled";
+                       };
+
+                       can@80034000 {
+                               reg = <0x80034000 2000>;
+                               interrupts = <9>;
+                               status = "disabled";
+                       };
+
+                       simdbg@8003c000 {
+                               reg = <0x8003c000 200>;
+                               status = "disabled";
+                       };
+
+                       simgpmisel@8003c200 {
+                               reg = <0x8003c200 100>;
+                               status = "disabled";
+                       };
+
+                       simsspsel@8003c300 {
+                               reg = <0x8003c300 100>;
+                               status = "disabled";
+                       };
+
+                       simmemsel@8003c400 {
+                               reg = <0x8003c400 100>;
+                               status = "disabled";
+                       };
+
+                       gpiomon@8003c500 {
+                               reg = <0x8003c500 100>;
+                               status = "disabled";
+                       };
+
+                       simenet@8003c700 {
+                               reg = <0x8003c700 100>;
+                               status = "disabled";
+                       };
+
+                       armjtag@8003c800 {
+                               reg = <0x8003c800 100>;
+                               status = "disabled";
+                       };
+                };
+
+               apbx@80040000 {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0x80040000 0x40000>;
+                       ranges;
+
+                       clkctl@80040000 {
+                               reg = <0x80040000 2000>;
+                               status = "disabled";
+                       };
+
+                       saif@80042000 {
+                               reg = <0x80042000 2000>;
+                               interrupts = <59 80>;
+                               status = "disabled";
+                       };
+
+                       power@80044000 {
+                               reg = <0x80044000 2000>;
+                               status = "disabled";
+                       };
+
+                       saif@80046000 {
+                               reg = <0x80046000 2000>;
+                               interrupts = <58 81>;
+                               status = "disabled";
+                       };
+
+                       lradc@80050000 {
+                               reg = <0x80050000 2000>;
+                               status = "disabled";
+                       };
+
+                       spdif@80054000 {
+                               reg = <0x80054000 2000>;
+                               interrupts = <45 66>;
+                               status = "disabled";
+                       };
+
+                       rtc@80056000 {
+                               reg = <0x80056000 2000>;
+                               interrupts = <28 29>;
+                               status = "disabled";
+                       };
+
+                       i2c@80058000 {
+                               reg = <0x80058000 2000>;
+                               interrupts = <111 68>;
+                               status = "disabled";
+                       };
+
+                       i2c@8005a000 {
+                               reg = <0x8005a000 2000>;
+                               interrupts = <110 69>;
+                               status = "disabled";
+                       };
+
+                       pwm@80064000 {
+                               reg = <0x80064000 2000>;
+                               status = "disabled";
+                       };
+
+                       timrot@80068000 {
+                               reg = <0x80068000 2000>;
+                               status = "disabled";
+                       };
+
+                       serial@8006a000 {
+                               reg = <0x8006a000 0x2000>;
+                               interrupts = <112 70 71>;
+                               status = "disabled";
+                       };
+
+                       serial@8006c000 {
+                               reg = <0x8006c000 0x2000>;
+                               interrupts = <113 72 73>;
+                               status = "disabled";
+                       };
+
+                       serial@8006e000 {
+                               reg = <0x8006e000 0x2000>;
+                               interrupts = <114 74 75>;
+                               status = "disabled";
+                       };
+
+                       serial@80070000 {
+                               reg = <0x80070000 0x2000>;
+                               interrupts = <115 76 77>;
+                               status = "disabled";
+                       };
+
+                       serial@80072000 {
+                               reg = <0x80072000 0x2000>;
+                               interrupts = <116 78 79>;
+                               status = "disabled";
+                       };
+
+                       duart: serial@80074000 {
+                               compatible = "arm,pl011", "arm,primecell";
+                               reg = <0x80074000 0x1000>;
+                               interrupts = <47>;
+                       };
+
+                       usbphy@8007c000 {
+                               reg = <0x8007c000 0x2000>;
+                               status = "disabled";
+                       };
+
+                       usbphy@8007e000 {
+                               reg = <0x8007e000 0x2000>;
+                               status = "disabled";
+                       };
+               };
+       };
+
+       ahb@80080000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               reg = <0x80080000 0x80000>;
+               ranges;
+
+               usbctrl@80080000 {
+                       reg = <0x80080000 0x10000>;
+                       status = "disabled";
+               };
+
+               usbctrl@80090000 {
+                       reg = <0x80090000 0x10000>;
+                       status = "disabled";
+               };
+
+               dflpt@800c0000 {
+                       reg = <0x800c0000 0x10000>;
+                       status = "disabled";
+               };
+
+               ethernet@800f0000 {
+                       compatible = "fsl,imx28-fec";
+                       reg = <0x800f0000 0x4000>;
+                       interrupts = <101>;
+                       status = "disabled";
+               };
+
+               ethernet@800f4000 {
+                       compatible = "fsl,imx28-fec";
+                       reg = <0x800f4000 0x4000>;
+                       interrupts = <102>;
+                       status = "disabled";
+               };
+
+               switch@800f8000 {
+                       reg = <0x800f8000 0x8000>;
+                       status = "disabled";
+               };
+
+       };
+};
index c57f9964a713677ac0a5d93fdc0c89d0e16fe048..09fe0fb6df2114a8410b63c1b6d8e5bbc86d4677 100644 (file)
@@ -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
index 908bf9a567f18f490a81c708be9ddb9c4744fc40..8328c45c24a5ed65b51471339fd1149874002213 100644 (file)
@@ -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
index cea29c99e2143c05d8ce878a9226604d16b346a8..1867a17ff5dc98a643cf251a602eafeeaf31a676 100644 (file)
@@ -648,6 +648,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)
index b8913df4cfa209402affd945457517f1b1ef8677..19659de1c4e86c131958d50a73c0c7e11c3f5f9e 100644 (file)
@@ -1,6 +1,5 @@
 config MXS_HAVE_AMBA_DUART
        bool
-       select ARM_AMBA
 
 config MXS_HAVE_PLATFORM_AUART
        bool
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
new file mode 100644 (file)
index 0000000..5c5cba2
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2012 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/init.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>
+
+static int __init mxs_icoll_add_irq_domain(struct device_node *np,
+                               struct device_node *interrupt_parent)
+{
+       irq_domain_add_legacy(np, 128, 0, 0, &irq_domain_simple_ops, NULL);
+
+       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)
+{
+       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,
+                               NULL, NULL);
+}
+
+static const char *imx28_dt_compat[] __initdata = {
+       "fsl,imx28-evk",
+       "fsl,imx28",
+       NULL,
+};
+
+DT_MACHINE_START(IMX28, "Freescale i.MX28 (Device Tree)")
+       .map_io         = mx28_map_io,
+       .init_irq       = mxs_dt_init_irq,
+       .timer          = &imx28_timer,
+       .init_machine   = mxs_machine_init,
+       .dt_compat      = imx28_dt_compat,
+       .restart        = mxs_restart,
+MACHINE_END