From: Stefan Roese <sr-ynQEQJNshbs@public.gmane.org>
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: Viresh Kumar <viresh.kumar-qxv4g6HH51o@public.gmane.org>,
devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org,
spear-devel-nkJGhpqTU55BDgjK7y7TUQ@public.gmane.org
Subject: [PATCH] ARM: SPEAr600: Add device-tree support to SPEAr600 boards
Date: Tue, 13 Mar 2012 15:47:12 +0100 [thread overview]
Message-ID: <1331650032-15274-1-git-send-email-sr@denx.de> (raw)
This patch adds a generic target for SPEAr600 board that can be
configured via the device-tree. Currently only interrupts are
configured via device-tree. Other peripheral devices (e.g.
ethernet, I2C, SMI flash, FSMC NAND flash etc) will follow in
later patches.
Only the spear600-evb is currently supported. Other SPEAr600
based boards will follow later.
Signed-off-by: Stefan Roese <sr-ynQEQJNshbs@public.gmane.org>
Cc: Viresh Kumar <viresh.kumar-qxv4g6HH51o@public.gmane.org>
---
Documentation/devicetree/bindings/arm/spear.txt | 6 ++
arch/arm/boot/dts/spear600-evb.dts | 23 +++++++
arch/arm/boot/dts/spear600.dtsi | 49 +++++++++++++++
arch/arm/mach-spear6xx/Kconfig | 7 +++
arch/arm/mach-spear6xx/Makefile | 1 +
arch/arm/mach-spear6xx/board-dt.c | 75 +++++++++++++++++++++++
6 files changed, 161 insertions(+)
create mode 100644 Documentation/devicetree/bindings/arm/spear.txt
create mode 100644 arch/arm/boot/dts/spear600-evb.dts
create mode 100644 arch/arm/boot/dts/spear600.dtsi
create mode 100644 arch/arm/mach-spear6xx/board-dt.c
diff --git a/Documentation/devicetree/bindings/arm/spear.txt b/Documentation/devicetree/bindings/arm/spear.txt
new file mode 100644
index 0000000..8e9f83e
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/spear.txt
@@ -0,0 +1,6 @@
+ST SPEAr Platforms Device Tree Bindings
+---------------------------------------
+
+SPEAr600 EVB (Evaluation Board)
+Required root node properties:
+ - compatible = "st,spear600-evb";
diff --git a/arch/arm/boot/dts/spear600-evb.dts b/arch/arm/boot/dts/spear600-evb.dts
new file mode 100644
index 0000000..f92d099
--- /dev/null
+++ b/arch/arm/boot/dts/spear600-evb.dts
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * Copyright 2012 Stefan Roese <sr-ynQEQJNshbs@public.gmane.org>
+ *
+ * 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/ "spear600.dtsi"
+
+/ {
+ model = "ST SPEAr600 Evaluation Board";
+ compatible = "st,spear600-evb";
+ #address-cells = <1>;
+ #size-cells = <1>;
+};
diff --git a/arch/arm/boot/dts/spear600.dtsi b/arch/arm/boot/dts/spear600.dtsi
new file mode 100644
index 0000000..82b086d
--- /dev/null
+++ b/arch/arm/boot/dts/spear600.dtsi
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * Copyright 2012 Stefan Roese <sr-ynQEQJNshbs@public.gmane.org>
+ *
+ * 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"
+
+/ {
+ cpus {
+ cpu@0 {
+ compatible = "arm,arm926ejs";
+ };
+ };
+
+ memory {
+ device_type = "memory";
+ reg = <0 0>; /* Filled by U-Boot */
+ };
+
+ soc {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "simple-bus";
+ ranges;
+
+ vic0: interrupt-controller@f1100000 {
+ compatible = "arm,pl190-vic";
+ interrupt-controller;
+ reg = <0xf1100000 0x1000>;
+ #interrupt-cells = <1>;
+ };
+
+ vic1: interrupt-controller@f1000000 {
+ compatible = "arm,pl190-vic";
+ interrupt-controller;
+ reg = <0xf1000000 0x1000>;
+ #interrupt-cells = <1>;
+ };
+ };
+};
diff --git a/arch/arm/mach-spear6xx/Kconfig b/arch/arm/mach-spear6xx/Kconfig
index ff4ae5b..7777f72 100644
--- a/arch/arm/mach-spear6xx/Kconfig
+++ b/arch/arm/mach-spear6xx/Kconfig
@@ -11,6 +11,13 @@ config BOARD_SPEAR600_EVB
help
Supports ST SPEAr600 Evaluation Board
+config BOARD_SPEAR600_DT
+ bool "SPEAr600 generic board configured via device-tree"
+ select MACH_SPEAR600
+ select USE_OF
+ help
+ Supports ST SPEAr600 boards configured via the device-tree
+
endmenu
config MACH_SPEAR600
diff --git a/arch/arm/mach-spear6xx/Makefile b/arch/arm/mach-spear6xx/Makefile
index cc1a4d8..e2d79b8 100644
--- a/arch/arm/mach-spear6xx/Makefile
+++ b/arch/arm/mach-spear6xx/Makefile
@@ -10,3 +10,4 @@ obj-$(CONFIG_MACH_SPEAR600) += spear600.o
# spear600 boards files
obj-$(CONFIG_BOARD_SPEAR600_EVB) += spear600_evb.o
+obj-$(CONFIG_BOARD_SPEAR600_DT) += board-dt.o
diff --git a/arch/arm/mach-spear6xx/board-dt.c b/arch/arm/mach-spear6xx/board-dt.c
new file mode 100644
index 0000000..ee4ff33
--- /dev/null
+++ b/arch/arm/mach-spear6xx/board-dt.c
@@ -0,0 +1,75 @@
+/*
+ * arch/arm/mach-spear6xx/board-dt.c
+ *
+ * Generic SPEAr600 platform support
+ *
+ * Copyright (C) 2009 ST Microelectronics
+ * Viresh Kumar<viresh.kumar-qxv4g6HH51o@public.gmane.org>
+ *
+ * Copyright 2012 Stefan Roese <sr-ynQEQJNshbs@public.gmane.org>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/of.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/of_address.h>
+#include <asm/hardware/vic.h>
+#include <asm/mach/arch.h>
+#include <asm/mach-types.h>
+#include <mach/generic.h>
+#include <mach/hardware.h>
+
+static struct amba_device *amba_devs[] __initdata = {
+ &gpio_device[0],
+ &gpio_device[1],
+ &gpio_device[2],
+ &uart_device[0],
+ &uart_device[1],
+};
+
+static struct platform_device *plat_devs[] __initdata = {
+};
+
+static void __init spear600_dt_init(void)
+{
+ unsigned int i;
+
+ /* call spear600 machine init function */
+ spear600_init();
+
+ /* Add Platform Devices */
+ platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
+
+ /* Add Amba Devices */
+ for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
+ amba_device_register(amba_devs[i], &iomem_resource);
+}
+
+static const char *spear600_dt_board_compat[] = {
+ "st,spear600-evb",
+ NULL
+};
+
+static const struct of_device_id vic_of_match[] __initconst = {
+ { .compatible = "arm,pl190-vic", .data = vic_of_init, },
+ { /* Sentinel */ }
+};
+
+static void __init spear6xx_dt_init_irq(void)
+{
+ of_irq_init(vic_of_match);
+}
+
+DT_MACHINE_START(SPEAR600_DT, "ST-SPEAR600-DT")
+ .map_io = spear6xx_map_io,
+ .init_irq = spear6xx_dt_init_irq,
+ .handle_irq = vic_handle_irq,
+ .timer = &spear6xx_timer,
+ .init_machine = spear600_dt_init,
+ .restart = spear_restart,
+ .dt_compat = spear600_dt_board_compat,
+MACHINE_END
--
1.7.9.2
next reply other threads:[~2012-03-13 14:47 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-13 14:47 Stefan Roese [this message]
2012-03-13 16:44 ` [PATCH] ARM: SPEAr600: Add device-tree support to SPEAr600 boards Arnd Bergmann
[not found] ` <201203131644.12048.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-14 7:08 ` Viresh Kumar
[not found] ` <4F604400.1040805-qxv4g6HH51o@public.gmane.org>
2012-03-14 9:58 ` Arnd Bergmann
[not found] ` <201203140958.27289.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-14 10:02 ` Viresh Kumar
2012-03-14 7:40 ` Stefan Roese
2012-03-14 9:48 ` Arnd Bergmann
[not found] ` <201203140948.44823.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-14 10:36 ` Stefan Roese
[not found] ` <201203141136.48513.sr-ynQEQJNshbs@public.gmane.org>
2012-03-14 13:27 ` Arnd Bergmann
[not found] ` <201203141327.01038.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-14 13:43 ` Stefan Roese
[not found] ` <201203141443.57221.sr-ynQEQJNshbs@public.gmane.org>
2012-03-14 14:09 ` Arnd Bergmann
2012-03-14 13:44 ` Rob Herring
[not found] ` <1331650032-15274-1-git-send-email-sr-ynQEQJNshbs@public.gmane.org>
2012-03-14 7:05 ` Viresh Kumar
2012-03-14 7:20 ` Stefan Roese
[not found] ` <4F604321.9000204-qxv4g6HH51o@public.gmane.org>
2012-03-15 8:48 ` Stefan Roese
[not found] ` <201203150948.27918.sr-ynQEQJNshbs@public.gmane.org>
2012-03-15 9:00 ` Viresh Kumar
[not found] ` <4F61AFAB.6080301-qxv4g6HH51o@public.gmane.org>
2012-03-15 10:38 ` Stefan Roese
[not found] ` <201203151138.51508.sr-ynQEQJNshbs@public.gmane.org>
2012-03-15 10:40 ` Viresh Kumar
2012-03-15 13:39 ` Arnd Bergmann
[not found] ` <201203151339.36173.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-21 11:32 ` Viresh Kumar
[not found] ` <4F69BC35.4010400-qxv4g6HH51o@public.gmane.org>
2012-03-21 12:36 ` Arnd Bergmann
2012-03-21 13:28 ` viresh kumar
2012-03-21 14:04 ` Arnd Bergmann
2012-03-21 14:18 ` viresh kumar
[not found] ` <CAOh2x=mtjvitkhz=BXOZPAaKZ2i3QQuKrYA3HcHNERHhF5xFoA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-21 14:42 ` Arnd Bergmann
[not found] ` <201203211404.35847.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-21 18:26 ` Arnd Bergmann
2012-03-22 0:45 ` viresh kumar
[not found] ` <CAOh2x=nZUobbRJo7kdAwmEG+s51BabxPwUVz=S3oNJyTpuRpCQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-22 8:10 ` Arnd Bergmann
[not found] ` <201203220810.00628.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-22 8:51 ` viresh kumar
[not found] ` <201203211236.37891.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-22 13:46 ` viresh kumar
[not found] ` <CAOh2x=k6ZfamB8DnPgVPjxZ7E1gTuHOQYg6s1Nd1ybA+TSquWA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-22 14:20 ` Arnd Bergmann
[not found] ` <201203221420.10127.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-22 14:53 ` viresh kumar
2012-03-27 10:27 ` Viresh Kumar
[not found] ` <4F71961E.2080208-qxv4g6HH51o@public.gmane.org>
2012-03-27 11:15 ` Arnd Bergmann
[not found] ` <201203271115.07805.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-27 11:27 ` Viresh Kumar
[not found] ` <4F71A42C.3090108-qxv4g6HH51o@public.gmane.org>
2012-03-27 11:45 ` Viresh Kumar
2012-03-27 11:59 ` Arnd Bergmann
[not found] ` <201203271159.35306.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-27 13:44 ` viresh kumar
2012-03-27 13:59 ` Arnd Bergmann
2012-03-28 5:03 ` Viresh Kumar
[not found] ` <4F729B99.4020909-qxv4g6HH51o@public.gmane.org>
2012-03-28 8:13 ` Arnd Bergmann
2012-03-14 8:48 ` Jean-Christophe PLAGNIOL-VILLARD
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1331650032-15274-1-git-send-email-sr@denx.de \
--to=sr-ynqeqjnshbs@public.gmane.org \
--cc=devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=spear-devel-nkJGhpqTU55BDgjK7y7TUQ@public.gmane.org \
--cc=viresh.kumar-qxv4g6HH51o@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).