ARM: ux500: Initial Device Tree support for Snowball
authorArnd Bergmann <arnd@arndb.de>
Wed, 7 Mar 2012 15:04:07 +0000 (15:04 +0000)
committerArnd Bergmann <arnd@arndb.de>
Fri, 16 Mar 2012 19:46:12 +0000 (19:46 +0000)
This provides very basic Device Tree support for ST-Ericsson's
low-cost development platform, Snowball. If Device Tree for
ux500 is enabled and the correct board is configured within the
Device Tree blob, the correct *_init_machine() will be called.

This patch is based on some original work completed by:
  Niklas Hernaeus <niklas.hernaeus@linaro.org>

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Niklas Hernaeus <niklas.hernaeus@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/boot/dts/snowball.dts [new file with mode: 0644]
arch/arm/mach-ux500/Makefile.boot
arch/arm/mach-ux500/board-mop500.c

diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts
new file mode 100644 (file)
index 0000000..ebcff9a
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2011 ST-Ericsson AB
+ *
+ * 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/;
+
+/ {
+       model = "Calao Systems Snowball platform with device tree";
+       compatible = "calaosystems,snowball-a9500";
+
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       memory {
+               reg = <0x00000000 0x20000000>;
+       };
+
+       soc-u9500 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "simple-bus";
+               ranges;
+       };
+};
index ff0a4b5b0a82b5873a119ec072b3db781651ab86..dd5cd00e2554193483e15a7a34ec1f406295f2dd 100644 (file)
@@ -2,3 +2,4 @@
 params_phys-y  := 0x00000100
 initrd_phys-y  := 0x00800000
 
+dtb-$(CONFIG_MACH_SNOWBALL) += snowball.dtb
index 04afcdf8b0cf82e9b3f63e5c981d3cea514ce5aa..0fb5dfd2ce54ebab477b77c9810fc520a41e5ee5 100644 (file)
@@ -30,6 +30,9 @@
 #include <linux/gpio_keys.h>
 #include <linux/delay.h>
 
+#include <linux/of.h>
+#include <linux/of_platform.h>
+
 #include <linux/leds.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -738,3 +741,34 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
        .handle_irq     = gic_handle_irq,
        .init_machine   = snowball_init_machine,
 MACHINE_END
+
+#ifdef CONFIG_MACH_UX500_DT
+static void __init u8500_init_machine(void)
+{
+       if (of_machine_is_compatible("calaosystems,snowball-a9500"))
+               return snowball_init_machine();
+       else if (of_machine_is_compatible("st-ericsson,hrefv60+"))
+               return hrefv60_init_machine();
+       else if (of_machine_is_compatible("st-ericsson,mop500"))
+               return mop500_init_machine();
+}
+
+static const char * u8500_dt_board_compat[] = {
+       "calaosystems,snowball-a9500",
+       "st-ericsson,hrefv60+",
+       "st-ericsson,u8500",
+       "st-ericsson,mop500",
+       NULL,
+};
+
+
+DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)")
+       .map_io         = u8500_map_io,
+       .init_irq       = ux500_init_irq,
+       /* we re-use nomadik timer here */
+       .timer          = &ux500_timer,
+       .handle_irq     = gic_handle_irq,
+       .init_machine   = u8500_init_machine,
+       .dt_compat      = u8500_dt_board_compat,
+MACHINE_END
+#endif