mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Linn <john.linn@xilinx.com>
To: <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <linux@arm.linux.org.uk>,
	<catalin.marinas@arm.com>, <glikely@secretlab.ca>,
	<jamie@jamieiles.com>, <arnd@arndb.de>,
	<nicolas.pitre@linaro.org>
Cc: John Linn <john.linn@xilinx.com>
Subject: [PATCH V6 5/5] ARM: Xilinx: adding device tree support
Date: Tue, 5 Apr 2011 12:28:06 -0600	[thread overview]
Message-ID: <2d99b4c0-d756-4e85-8d10-aeece18b2711@VA3EHSMHS013.ehs.local> (raw)
In-Reply-To: <1302028086-17603-5-git-send-email-john.linn@xilinx.com>

This commit is dependent on the device tree for ARM
work that Grant Likely has been doing. Minimal changes
are needed to support device tree.

Signed-off-by: John Linn <john.linn@xilinx.com>
---

This is new patch in the series starting at V6. It is an optional 
patch for those not using device tree yet.

 Documentation/devicetree/bindings/arm/xilinx.txt |    7 +++
 arch/arm/boot/dts/zynq-ep107.dts                 |   52 ++++++++++++++++++++++
 arch/arm/mach-zynq/board_ep107.c                 |    8 +++-
 arch/arm/mach-zynq/common.c                      |   12 +++++
 4 files changed, 78 insertions(+), 1 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/xilinx.txt
 create mode 100755 arch/arm/boot/dts/zynq-ep107.dts

diff --git a/Documentation/devicetree/bindings/arm/xilinx.txt b/Documentation/devicetree/bindings/arm/xilinx.txt
new file mode 100644
index 0000000..6f1ed83
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/xilinx.txt
@@ -0,0 +1,7 @@
+Xilinx Zynq EP107 Emulation Platform board
+
+This board is an emulation platform for the Zynq product which is
+based on an ARM Cortex A9 processor.
+
+Required root node properties:
+    - compatible = "xlnx,zynq-ep107";
diff --git a/arch/arm/boot/dts/zynq-ep107.dts b/arch/arm/boot/dts/zynq-ep107.dts
new file mode 100755
index 0000000..fe2c0cc
--- /dev/null
+++ b/arch/arm/boot/dts/zynq-ep107.dts
@@ -0,0 +1,52 @@
+/*
+ *  Copyright (C) 2011 Xilinx
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+/dts-v1/;
+/ {
+	model = "Xilinx Zynq EP107";
+	compatible = "xlnx,zynq-ep107";
+	#address-cells = <1>;
+	#size-cells = <1>;
+	interrupt-parent = <&intc>;
+
+	memory {
+		device_type = "memory";
+		reg = <0x0 0x10000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyDF0,9600 root=/dev/ram rw initrd=0x800000,8M earlyprintk";
+		linux,stdout-path = &uart0;
+	};
+
+	amba: amba@0 {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		intc: intc@F8F01000 {
+			interrupt-controller;
+			compatible = "arm,gic";
+			reg = <0xF8F01000 0x1000>;
+			#interrupt-cells = <2>;
+		};
+
+		uart0: uart@E0000000 {
+			compatible = "xlnx,xuartpss";
+			reg = <0xE0000000 0x1000>;
+			interrupts = <59 0>;
+			clock = <50000000>;
+		};
+	};
+};
diff --git a/arch/arm/mach-zynq/board_ep107.c b/arch/arm/mach-zynq/board_ep107.c
index 3d576d0..5284dcc 100644
--- a/arch/arm/mach-zynq/board_ep107.c
+++ b/arch/arm/mach-zynq/board_ep107.c
@@ -76,10 +76,16 @@ static void __init board_ep107_init(void)
 	platform_add_devices(&xilinx_pdevices[0], ARRAY_SIZE(xilinx_pdevices));
 }
 
-MACHINE_START(XILINX_EP107, "Xilinx EP107")
+static const char *xilinx_ep107_board_compat[] = {
+	"xlnx,zynq-ep107",
+	NULL
+};
+
+MACHINE_START(XILINX_EP107, "Xilinx Zynq EP107")
 	.boot_params    = PLAT_PHYS_OFFSET + 0x00000100,
 	.map_io         = xilinx_map_io,
 	.init_irq       = xilinx_irq_init,
 	.init_machine   = board_ep107_init,
 	.timer          = &xttcpss_sys_timer,
+	.dt_compat	= xilinx_ep107_board_compat,
 MACHINE_END
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
index 9a626ba..4dd909b 100644
--- a/arch/arm/mach-zynq/common.c
+++ b/arch/arm/mach-zynq/common.c
@@ -20,6 +20,7 @@
 #include <linux/cpumask.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
+#include <linux/of_platform.h>
 
 #include <asm/mach/map.h>
 #include <asm/page.h>
@@ -30,6 +31,13 @@
 #include <mach/clkdev.h>
 #include "common.h"
 
+#ifdef CONFIG_OF
+static struct of_device_id zynq_of_bus_ids[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{}
+};
+#endif
+
 /*
  * Clock function infrastructure.
  */
@@ -60,6 +68,10 @@ void __init xilinx_system_init(void)
 	 */
 	l2x0_init(PL310_L2CC_BASE, 0x02060000, 0xF0F0FFFF);
 #endif
+
+#ifdef CONFIG_OF
+	of_platform_bus_probe(NULL, zynq_of_bus_ids, NULL);
+#endif
 }
 
 /**
-- 
1.5.4.7



This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.



      parent reply	other threads:[~2011-04-05 18:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1302028086-17603-1-git-send-email-john.linn@xilinx.com>
2011-04-05 18:28 ` [PATCH V6 1/5] ARM: Xilinx: Adding Xilinx board support John Linn
     [not found] ` <1302028086-17603-2-git-send-email-john.linn@xilinx.com>
2011-04-05 18:28   ` [PATCH V6 2/5] ARM: Xilinx: Adding timer support to the platform John Linn
     [not found]   ` <1302028086-17603-3-git-send-email-john.linn@xilinx.com>
2011-04-05 18:28     ` [PATCH V6 3/5] ARM: Xilinx: base header files and assembly macros John Linn
     [not found]     ` <1302028086-17603-4-git-send-email-john.linn@xilinx.com>
2011-04-05 18:28       ` [PATCH V6 4/5] ARM: Xilinx: Adding Xilinx platform infrastructure support John Linn
     [not found]       ` <1302028086-17603-5-git-send-email-john.linn@xilinx.com>
2011-04-05 18:28         ` John Linn [this message]

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=2d99b4c0-d756-4e85-8d10-aeece18b2711@VA3EHSMHS013.ehs.local \
    --to=john.linn@xilinx.com \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=glikely@secretlab.ca \
    --cc=jamie@jamieiles.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nicolas.pitre@linaro.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

all inboxes | Powered by JetHome®