linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Add DT support for AT91RM9200
@ 2012-10-14 21:46 Joachim Eastwood
  2012-10-14 21:46 ` [PATCH 1/5] ARM: AT91: Fix build failure on board-dt Joachim Eastwood
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Joachim Eastwood @ 2012-10-14 21:46 UTC (permalink / raw)
  To: linux-arm-kernel

Hi

This patch series add support for devicetree on AT91RM9200. Series is dependent upon at91-pinctrl.

There isn't support for any boards yet, but I am working on one now. I will submit it once I have a couple of more bindings in place.

Patch 1 is a fix for a build failure which can happen if board-dt is enabled when no AT91SAM machines are enabled.

regards
Joachim Eastwood


Joachim Eastwood (5):
  ARM: AT91: Fix build failure on board-dt
  ARM: AT91: Add DT support to AT91RM9200 System Timer
  ARM: AT91: Add usart/tc/pio DT clock lookup to AT91RM9200
  ARM: AT91: Add AT91RM9200 DT board
  ARM: AT91: Add AT91RM9200 device tree

 .../devicetree/bindings/arm/atmel-at91.txt         |   6 +
 arch/arm/boot/dts/at91rm9200.dtsi                  | 333 +++++++++++++++++++++
 arch/arm/mach-at91/Kconfig                         |   9 +
 arch/arm/mach-at91/Makefile                        |   1 +
 arch/arm/mach-at91/at91rm9200.c                    |  17 ++
 arch/arm/mach-at91/at91rm9200_time.c               |  63 +++-
 arch/arm/mach-at91/board-rm9200-dt.c               |  59 ++++
 arch/arm/mach-at91/generic.h                       |   1 +
 arch/arm/mach-at91/setup.c                         |  14 +
 9 files changed, 501 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boot/dts/at91rm9200.dtsi
 create mode 100644 arch/arm/mach-at91/board-rm9200-dt.c

-- 
1.7.12.3

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

* [PATCH 1/5] ARM: AT91: Fix build failure on board-dt
  2012-10-14 21:46 [PATCH 0/5] Add DT support for AT91RM9200 Joachim Eastwood
@ 2012-10-14 21:46 ` Joachim Eastwood
  2012-10-15  5:59   ` Jean-Christophe PLAGNIOL-VILLARD
  2012-10-14 21:46 ` [PATCH 2/5] ARM: AT91: Add DT support to AT91RM9200 System Timer Joachim Eastwood
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Joachim Eastwood @ 2012-10-14 21:46 UTC (permalink / raw)
  To: linux-arm-kernel

We need CONFIG_SOC_AT91SAM9 to get the at91sam926x_timer
symbol used in board-dt.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
 arch/arm/mach-at91/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 0fafb6a..d9b0546 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -507,6 +507,7 @@ comment "Generic Board Type"
 
 config MACH_AT91SAM_DT
 	bool "Atmel AT91SAM Evaluation Kits with device-tree support"
+	select SOC_AT91SAM9
 	select USE_OF
 	help
 	  Select this if you want to experiment device-tree with
-- 
1.7.12.3

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

* [PATCH 2/5] ARM: AT91: Add DT support to AT91RM9200 System Timer
  2012-10-14 21:46 [PATCH 0/5] Add DT support for AT91RM9200 Joachim Eastwood
  2012-10-14 21:46 ` [PATCH 1/5] ARM: AT91: Fix build failure on board-dt Joachim Eastwood
@ 2012-10-14 21:46 ` Joachim Eastwood
  2012-10-14 21:46 ` [PATCH 3/5] ARM: AT91: Add usart/tc/pio DT clock lookup to AT91RM9200 Joachim Eastwood
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Joachim Eastwood @ 2012-10-14 21:46 UTC (permalink / raw)
  To: linux-arm-kernel

Based on AT91 PIT DT patch from Jean-Christophe PLAGNIOL-VILLARD.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
 .../devicetree/bindings/arm/atmel-at91.txt         |  6 +++
 arch/arm/mach-at91/at91rm9200_time.c               | 63 +++++++++++++++++++++-
 2 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/atmel-at91.txt b/Documentation/devicetree/bindings/arm/atmel-at91.txt
index ecc81e3..8adc9a8 100644
--- a/Documentation/devicetree/bindings/arm/atmel-at91.txt
+++ b/Documentation/devicetree/bindings/arm/atmel-at91.txt
@@ -7,6 +7,12 @@ PIT Timer required properties:
 - interrupts: Should contain interrupt for the PIT which is the IRQ line
   shared across all System Controller members.
 
+System Timer (ST) required properties:
+- compatible: Should be "atmel,at91rm9200-st"
+- reg: Should contain registers location and length
+- interrupts: Should contain interrupt for the ST which is the IRQ line
+  shared across all System Controller members.
+
 TC/TCLIB Timer required properties:
 - compatible: Should be "atmel,<chip>-pit".
   <chip> can be "at91rm9200" or "at91sam9x5"
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index aaa443b..cafe988 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -24,6 +24,9 @@
 #include <linux/irq.h>
 #include <linux/clockchips.h>
 #include <linux/export.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #include <asm/mach/time.h>
 
@@ -91,7 +94,8 @@ static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id)
 static struct irqaction at91rm9200_timer_irq = {
 	.name		= "at91_tick",
 	.flags		= IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
-	.handler	= at91rm9200_timer_interrupt
+	.handler	= at91rm9200_timer_interrupt,
+	.irq		= NR_IRQS_LEGACY + AT91_ID_SYS,
 };
 
 static cycle_t read_clk32k(struct clocksource *cs)
@@ -179,8 +183,60 @@ static struct clock_event_device clkevt = {
 void __iomem *at91_st_base;
 EXPORT_SYMBOL_GPL(at91_st_base);
 
+#ifdef CONFIG_OF
+static struct of_device_id at91rm9200_st_timer_ids[] = {
+	{ .compatible = "atmel,at91rm9200-st" },
+	{ /* sentinel */ }
+};
+
+static int __init of_at91rm9200_st_init(void)
+{
+	struct device_node *np;
+	int ret;
+
+	np = of_find_matching_node(NULL, at91rm9200_st_timer_ids);
+	if (!np)
+		goto err;
+
+	at91_st_base = of_iomap(np, 0);
+	if (!at91_st_base)
+		goto node_err;
+
+	/* Get the interrupts property */
+	ret = irq_of_parse_and_map(np, 0);
+	if (!ret)
+		goto ioremap_err;
+	at91rm9200_timer_irq.irq = ret;
+
+	of_node_put(np);
+
+	return 0;
+
+ioremap_err:
+	iounmap(at91_st_base);
+node_err:
+	of_node_put(np);
+err:
+	return -EINVAL;
+}
+#else
+static int __init of_at91rm9200_st_init(void)
+{
+	return -EINVAL;
+}
+#endif
+
 void __init at91rm9200_ioremap_st(u32 addr)
 {
+#ifdef CONFIG_OF
+	struct device_node *np;
+
+	np = of_find_matching_node(NULL, at91rm9200_st_timer_ids);
+	if (np) {
+		of_node_put(np);
+		return;
+	}
+#endif
 	at91_st_base = ioremap(addr, 256);
 	if (!at91_st_base)
 		panic("Impossible to ioremap ST\n");
@@ -191,13 +247,16 @@ void __init at91rm9200_ioremap_st(u32 addr)
  */
 void __init at91rm9200_timer_init(void)
 {
+	/* For device tree enabled device: initialize here */
+	of_at91rm9200_st_init();
+
 	/* Disable all timer interrupts, and clear any pending ones */
 	at91_st_write(AT91_ST_IDR,
 		AT91_ST_PITS | AT91_ST_WDOVF | AT91_ST_RTTINC | AT91_ST_ALMS);
 	at91_st_read(AT91_ST_SR);
 
 	/* Make IRQs happen for the system timer */
-	setup_irq(NR_IRQS_LEGACY + AT91_ID_SYS, &at91rm9200_timer_irq);
+	setup_irq(at91rm9200_timer_irq.irq, &at91rm9200_timer_irq);
 
 	/* The 32KiHz "Slow Clock" (tick every 30517.58 nanoseconds) is used
 	 * directly for the clocksource and all clockevents, after adjusting
-- 
1.7.12.3

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

* [PATCH 3/5] ARM: AT91: Add usart/tc/pio DT clock lookup to AT91RM9200
  2012-10-14 21:46 [PATCH 0/5] Add DT support for AT91RM9200 Joachim Eastwood
  2012-10-14 21:46 ` [PATCH 1/5] ARM: AT91: Fix build failure on board-dt Joachim Eastwood
  2012-10-14 21:46 ` [PATCH 2/5] ARM: AT91: Add DT support to AT91RM9200 System Timer Joachim Eastwood
@ 2012-10-14 21:46 ` Joachim Eastwood
  2012-10-14 21:46 ` [PATCH 4/5] ARM: AT91: Add AT91RM9200 DT board Joachim Eastwood
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Joachim Eastwood @ 2012-10-14 21:46 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
 arch/arm/mach-at91/at91rm9200.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index a454734..f68533b 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -188,12 +188,29 @@ static struct clk_lookup periph_clocks_lookups[] = {
 	CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
 	CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
 	CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200", &twi_clk),
+	/* usart lookup table for DT entries */
+	CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck),
+	CLKDEV_CON_DEV_ID("usart", "fffc0000.serial", &usart0_clk),
+	CLKDEV_CON_DEV_ID("usart", "fffc4000.serial", &usart1_clk),
+	CLKDEV_CON_DEV_ID("usart", "fffc8000.serial", &usart2_clk),
+	CLKDEV_CON_DEV_ID("usart", "fffcc000.serial", &usart3_clk),
+	/* tc lookup table for DT entries */
+	CLKDEV_CON_DEV_ID("t0_clk", "fffa0000.timer", &tc0_clk),
+	CLKDEV_CON_DEV_ID("t1_clk", "fffa0000.timer", &tc1_clk),
+	CLKDEV_CON_DEV_ID("t2_clk", "fffa0000.timer", &tc2_clk),
+	CLKDEV_CON_DEV_ID("t0_clk", "fffa4000.timer", &tc3_clk),
+	CLKDEV_CON_DEV_ID("t1_clk", "fffa4000.timer", &tc4_clk),
+	CLKDEV_CON_DEV_ID("t2_clk", "fffa4000.timer", &tc5_clk),
 	/* fake hclk clock */
 	CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
 	CLKDEV_CON_ID("pioA", &pioA_clk),
 	CLKDEV_CON_ID("pioB", &pioB_clk),
 	CLKDEV_CON_ID("pioC", &pioC_clk),
 	CLKDEV_CON_ID("pioD", &pioD_clk),
+	CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioA_clk),
+	CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioB_clk),
+	CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioC_clk),
+	CLKDEV_CON_DEV_ID(NULL, "fffffa00.gpio", &pioD_clk),
 };
 
 static struct clk_lookup usart_clocks_lookups[] = {
-- 
1.7.12.3

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

* [PATCH 4/5] ARM: AT91: Add AT91RM9200 DT board
  2012-10-14 21:46 [PATCH 0/5] Add DT support for AT91RM9200 Joachim Eastwood
                   ` (2 preceding siblings ...)
  2012-10-14 21:46 ` [PATCH 3/5] ARM: AT91: Add usart/tc/pio DT clock lookup to AT91RM9200 Joachim Eastwood
@ 2012-10-14 21:46 ` Joachim Eastwood
  2012-10-15  6:08   ` Jean-Christophe PLAGNIOL-VILLARD
  2012-10-14 21:46 ` [PATCH 5/5] ARM: AT91: Add AT91RM9200 device tree Joachim Eastwood
  2012-10-15  5:58 ` [PATCH 0/5] Add DT support for AT91RM9200 Jean-Christophe PLAGNIOL-VILLARD
  5 siblings, 1 reply; 12+ messages in thread
From: Joachim Eastwood @ 2012-10-14 21:46 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
 arch/arm/mach-at91/Kconfig           |  8 +++++
 arch/arm/mach-at91/Makefile          |  1 +
 arch/arm/mach-at91/board-rm9200-dt.c | 59 ++++++++++++++++++++++++++++++++++++
 arch/arm/mach-at91/generic.h         |  1 +
 arch/arm/mach-at91/setup.c           | 14 +++++++++
 5 files changed, 83 insertions(+)
 create mode 100644 arch/arm/mach-at91/board-rm9200-dt.c

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index d9b0546..3f45906 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -505,6 +505,14 @@ endif
 
 comment "Generic Board Type"
 
+config MACH_AT91RM9200_DT
+	bool "Atmel AT91RM9200 Evaluation Kits with device-tree support"
+	select SOC_AT91RM9200
+	select USE_OF
+	help
+	  Select this if you want to experiment device-tree with
+	  an Atmel RM9200 Evaluation Kit.
+
 config MACH_AT91SAM_DT
 	bool "Atmel AT91SAM Evaluation Kits with device-tree support"
 	select SOC_AT91SAM9
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index d6e0d21..75dee683 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -89,6 +89,7 @@ obj-$(CONFIG_MACH_SNAPPER_9260)	+= board-snapper9260.o
 obj-$(CONFIG_MACH_AT91SAM9M10G45EK) += board-sam9m10g45ek.o
 
 # AT91SAM board with device-tree
+obj-$(CONFIG_MACH_AT91RM9200_DT) += board-rm9200-dt.o
 obj-$(CONFIG_MACH_AT91SAM_DT) += board-dt.o
 
 # AT91X40 board-specific support
diff --git a/arch/arm/mach-at91/board-rm9200-dt.c b/arch/arm/mach-at91/board-rm9200-dt.c
new file mode 100644
index 0000000..47e91d9
--- /dev/null
+++ b/arch/arm/mach-at91/board-rm9200-dt.c
@@ -0,0 +1,59 @@
+/*
+ *  Setup code for AT91RM9200 Evaluation Kits with Device Tree support
+ *
+ *  Copyright (C) 2011 Atmel,
+ *                2011 Nicolas Ferre <nicolas.ferre@atmel.com>
+ *                2012 Joachim Eastwood <manabian@gmail.com>
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/gpio.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+
+#include <mach/board.h>
+#include <mach/at91_aic.h>
+
+#include <asm/setup.h>
+#include <asm/irq.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include "generic.h"
+
+
+static const struct of_device_id irq_of_match[] __initconst = {
+	{ .compatible = "atmel,at91rm9200-aic", .data = at91_aic_of_init },
+	{ /*sentinel*/ }
+};
+
+static void __init at91rm9200_dt_init_irq(void)
+{
+	of_irq_init(irq_of_match);
+}
+
+static void __init at91rm9200_dt_device_init(void)
+{
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char *at91rm9200_dt_board_compat[] __initdata = {
+	"atmel,at91rm9200",
+	NULL
+};
+
+DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
+	.timer		= &at91rm9200_timer,
+	.map_io		= at91_map_io,
+	.handle_irq	= at91_aic_handle_irq,
+	.init_early	= at91rm9200_dt_initialize,
+	.init_irq	= at91rm9200_dt_init_irq,
+	.init_machine	= at91rm9200_dt_device_init,
+	.dt_compat	= at91rm9200_dt_board_compat,
+MACHINE_END
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index f496506..9bb5ce5 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -20,6 +20,7 @@ extern void __init at91_init_sram(int bank, unsigned long base,
 extern void __init at91rm9200_set_type(int type);
 extern void __init at91_initialize(unsigned long main_clock);
 extern void __init at91x40_initialize(unsigned long main_clock);
+extern void __init at91rm9200_dt_initialize(void);
 extern void __init at91_dt_initialize(void);
 
  /* Interrupts */
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 523daa9..e3f1ea4 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -339,6 +339,7 @@ static void at91_dt_rstc(void)
 }
 
 static struct of_device_id ramc_ids[] = {
+	{ .compatible = "atmel,at91rm9200-sdramc" },
 	{ .compatible = "atmel,at91sam9260-sdramc" },
 	{ .compatible = "atmel,at91sam9g45-ddramc" },
 	{ /*sentinel*/ }
@@ -437,6 +438,19 @@ end:
 	of_node_put(np);
 }
 
+void __init at91rm9200_dt_initialize(void)
+{
+	at91_dt_ramc();
+
+	/* Init clock subsystem */
+	at91_dt_clock_init();
+
+	/* Register the processor-specific clocks */
+	at91_boot_soc.register_clocks();
+
+	at91_boot_soc.init();
+}
+
 void __init at91_dt_initialize(void)
 {
 	at91_dt_rstc();
-- 
1.7.12.3

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

* [PATCH 5/5] ARM: AT91: Add AT91RM9200 device tree
  2012-10-14 21:46 [PATCH 0/5] Add DT support for AT91RM9200 Joachim Eastwood
                   ` (3 preceding siblings ...)
  2012-10-14 21:46 ` [PATCH 4/5] ARM: AT91: Add AT91RM9200 DT board Joachim Eastwood
@ 2012-10-14 21:46 ` Joachim Eastwood
  2012-10-15  6:03   ` Jean-Christophe PLAGNIOL-VILLARD
  2012-10-15  5:58 ` [PATCH 0/5] Add DT support for AT91RM9200 Jean-Christophe PLAGNIOL-VILLARD
  5 siblings, 1 reply; 12+ messages in thread
From: Joachim Eastwood @ 2012-10-14 21:46 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
 arch/arm/boot/dts/at91rm9200.dtsi | 333 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 333 insertions(+)
 create mode 100644 arch/arm/boot/dts/at91rm9200.dtsi

diff --git a/arch/arm/boot/dts/at91rm9200.dtsi b/arch/arm/boot/dts/at91rm9200.dtsi
new file mode 100644
index 0000000..5c4f91d
--- /dev/null
+++ b/arch/arm/boot/dts/at91rm9200.dtsi
@@ -0,0 +1,333 @@
+/*
+ * at91rm9200.dtsi - Device Tree Include file for AT91RM9200 family SoC
+ *
+ *  Copyright (C) 2011 Atmel,
+ *                2011 Nicolas Ferre <nicolas.ferre@atmel.com>,
+ *                2012 Joachim Eastwood <manabian@gmail.com>
+ *
+ * Based on at91sam9260.dtsi
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	model = "Atmel AT91RM9200 family SoC";
+	compatible = "atmel,at91rm9200";
+	interrupt-parent = <&aic>;
+
+	aliases {
+		serial0 = &dbgu;
+		serial1 = &usart0;
+		serial2 = &usart1;
+		serial3 = &usart2;
+		serial4 = &usart3;
+		gpio0 = &pioA;
+		gpio1 = &pioB;
+		gpio2 = &pioC;
+		gpio3 = &pioD;
+		tcb0 = &tcb0;
+		tcb1 = &tcb1;
+	};
+	cpus {
+		cpu at 0 {
+			compatible = "arm,arm920t";
+		};
+	};
+
+	memory {
+		reg = <0x20000000 0x04000000>;
+	};
+
+	ahb {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		apb {
+			compatible = "simple-bus";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges;
+
+			aic: interrupt-controller at fffff000 {
+				#interrupt-cells = <3>;
+				compatible = "atmel,at91rm9200-aic";
+				interrupt-controller;
+				reg = <0xfffff000 0x200>;
+				atmel,external-irqs = <25 26 27 28 29 30 31>;
+			};
+
+			ramc0: ramc at ffffff00 {
+				compatible = "atmel,at91rm9200-sdramc";
+				reg = <0xffffff00 0x100>;
+			};
+
+			pmc: pmc at fffffc00 {
+				compatible = "atmel,at91rm9200-pmc";
+				reg = <0xfffffc00 0x100>;
+			};
+
+			st: timer at fffffd00 {
+				compatible = "atmel,at91rm9200-st";
+				reg = <0xfffffd00 0x100>;
+				interrupts = <1 4 7>;
+			};
+
+			tcb0: timer at fffa0000 {
+				compatible = "atmel,at91rm9200-tcb";
+				reg = <0xfffa0000 0x100>;
+				interrupts = <17 4 0 18 4 0 19 4 0>;
+			};
+
+			tcb1: timer at fffa4000 {
+				compatible = "atmel,at91rm9200-tcb";
+				reg = <0xfffa4000 0x100>;
+				interrupts = <20 4 0 21 4 0 22 4 0>;
+			};
+
+			pinctrl at fffff400 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "atmel,at91rm9200-pinctrl", "simple-bus";
+				ranges = <0xfffff400 0xfffff400 0x800>;
+
+				atmel,mux-mask = <
+					/*    A         B     */
+					 0xffffffff 0xffffffff  /* pioA */
+					 0xffffffff 0x083fffff  /* pioB */
+					 0xffff3fff 0x00000000  /* pioC */
+					 0x03ff87ff 0x0fffff80  /* pioD */
+					>;
+
+				/* shared pinctrl settings */
+				dbgu {
+					pinctrl_dbgu: dbgu-0 {
+						atmel,pins =
+							<0 30 0x1 0x0	/* PA30 periph A */
+							 0 31 0x1 0x1>;	/* PA31 periph with pullup */
+					};
+				};
+
+				uart0 {
+					pinctrl_uart0: uart0-0 {
+						atmel,pins =
+							<0 17 0x1 0x0	/* PA17 periph A */
+							 0 18 0x1 0x0>;	/* PA18 periph A */
+					};
+
+					pinctrl_uart0_rts_cts: uart0_rts_cts-0 {
+						atmel,pins =
+							<0 20 0x1 0x0	/* PA20 periph A */
+							 0 21 0x1 0x0>;	/* PA21 periph A */
+					};
+				};
+
+				uart1 {
+					pinctrl_uart1: uart1-0 {
+						atmel,pins =
+							<1 20 0x1 0x1	/* PB20 periph A with pullup */
+							 1 21 0x1 0x0>;	/* PB21 periph A */
+					};
+
+					pinctrl_uart1_rts_cts: uart1_rts_cts-0 {
+						atmel,pins =
+							<1 24 0x1 0x0	/* PB24 periph A */
+							 1 26 0x1 0x0>;	/* PB26 periph A */
+					};
+
+					pinctrl_uart1_dtr_dsr: uart1_dtr_dsr-0 {
+						atmel,pins =
+							<1 19 0x1 0x0	/* PB19 periph A */
+							 1 25 0x1 0x0>;	/* PB25 periph A */
+					};
+
+					pinctrl_uart1_dcd: uart1_dcd-0 {
+						atmel,pins =
+							<1 23 0x1 0x0>;	/* PB23 periph A */
+					};
+
+					pinctrl_uart1_ri: uart1_ri-0 {
+						atmel,pins =
+							<1 18 0x1 0x0>;	/* PB18 periph A */
+					};
+				};
+
+				uart2 {
+					pinctrl_uart2: uart2-0 {
+						atmel,pins =
+							<0 22 0x1 0x0	/* PA22 periph A */
+							 0 23 0x1 0x1>;	/* PA23 periph A with pullup */
+					};
+
+					pinctrl_uart2_rts_cts: uart2_rts_cts-0 {
+						atmel,pins =
+							<0 30 0x2 0x0	/* PA30 periph B */
+							 0 31 0x2 0x0>;	/* PA31 periph B */
+					};
+				};
+
+				uart3 {
+					pinctrl_uart3: uart3-0 {
+						atmel,pins =
+							<0 5 0x2 0x1	/* PA5 periph B with pullup */
+							 0 6 0x2 0x0>;	/* PA6 periph B */
+					};
+
+					pinctrl_uart3_rts_cts: uart3_rts_cts-0 {
+						atmel,pins =
+							<1 0 0x2 0x0	/* PB0 periph B */
+							 1 1 0x2 0x0>;	/* PB1 periph B */
+					};
+				};
+
+				nand {
+					pinctrl_nand: nand-0 {
+						atmel,pins =
+							<2 2 0x0 0x1	/* PC2 gpio RDY pin pull_up */
+							 1 1 0x0 0x1>;	/* PB1 gpio CD pin pull_up */
+					};
+				};
+
+				pioA: gpio at fffff400 {
+					compatible = "atmel,at91rm9200-gpio";
+					reg = <0xfffff400 0x200>;
+					interrupts = <2 4 1>;
+					#gpio-cells = <2>;
+					gpio-controller;
+					interrupt-controller;
+					#interrupt-cells = <2>;
+				};
+
+				pioB: gpio at fffff600 {
+					compatible = "atmel,at91rm9200-gpio";
+					reg = <0xfffff600 0x200>;
+					interrupts = <3 4 1>;
+					#gpio-cells = <2>;
+					gpio-controller;
+					interrupt-controller;
+					#interrupt-cells = <2>;
+				};
+
+				pioC: gpio at fffff800 {
+					compatible = "atmel,at91rm9200-gpio";
+					reg = <0xfffff800 0x200>;
+					interrupts = <4 4 1>;
+					#gpio-cells = <2>;
+					gpio-controller;
+					interrupt-controller;
+					#interrupt-cells = <2>;
+				};
+
+				pioD: gpio at fffffa00 {
+					compatible = "atmel,at91rm9200-gpio";
+					reg = <0xfffffa00 0x200>;
+					interrupts = <5 4 1>;
+					#gpio-cells = <2>;
+					gpio-controller;
+					interrupt-controller;
+					#interrupt-cells = <2>;
+				};
+			};
+
+			dbgu: serial at fffff200 {
+				compatible = "atmel,at91rm9200-usart";
+				reg = <0xfffff200 0x200>;
+				interrupts = <1 4 7>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_dbgu>;
+				status = "disabled";
+			};
+
+			usart0: serial at fffc0000 {
+				compatible = "atmel,at91rm9200-usart";
+				reg = <0xfffc0000 0x200>;
+				interrupts = <6 4 5>;
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_uart0>;
+				status = "disabled";
+			};
+
+			usart1: serial at fffc4000 {
+				compatible = "atmel,at91rm9200-usart";
+				reg = <0xfffc4000 0x200>;
+				interrupts = <7 4 5>;
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_uart1>;
+				status = "disabled";
+			};
+
+			usart2: serial at fffc8000 {
+				compatible = "atmel,at91rm9200-usart";
+				reg = <0xfffc8000 0x200>;
+				interrupts = <8 4 5>;
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_uart2>;
+				status = "disabled";
+			};
+
+			usart3: serial at fffcc000 {
+				compatible = "atmel,at91rm9200-usart";
+				reg = <0xfffcc000 0x200>;
+				interrupts = <23 4 5>;
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_uart3>;
+				status = "disabled";
+			};
+
+			usb1: gadget at fffb0000 {
+				compatible = "atmel,at91rm9200-udc";
+				reg = <0xfffb0000 0x4000>;
+				interrupts = <11 4 2>;
+				status = "disabled";
+			};
+		};
+
+		nand0: nand at 40000000 {
+			compatible = "atmel,at91rm9200-nand";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <0x40000000 0x10000000>;
+			atmel,nand-addr-offset = <21>;
+			atmel,nand-cmd-offset = <22>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_nand>;
+			nand-ecc-mode = "soft";
+			gpios = <&pioC 2 0
+				 0
+				 &pioB 1 0
+				>;
+			status = "disabled";
+		};
+
+		usb0: ohci at 00300000 {
+			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
+			reg = <0x00300000 0x100000>;
+			interrupts = <23 4 2>;
+			status = "disabled";
+		};
+	};
+
+	i2c at 0 {
+		compatible = "i2c-gpio";
+		gpios = <&pioA 23 0 /* sda */
+			 &pioA 24 0 /* scl */
+			>;
+		i2c-gpio,sda-open-drain;
+		i2c-gpio,scl-open-drain;
+		i2c-gpio,delay-us = <2>;	/* ~100 kHz */
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+	};
+};
-- 
1.7.12.3

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

* [PATCH 0/5] Add DT support for AT91RM9200
  2012-10-14 21:46 [PATCH 0/5] Add DT support for AT91RM9200 Joachim Eastwood
                   ` (4 preceding siblings ...)
  2012-10-14 21:46 ` [PATCH 5/5] ARM: AT91: Add AT91RM9200 device tree Joachim Eastwood
@ 2012-10-15  5:58 ` Jean-Christophe PLAGNIOL-VILLARD
  5 siblings, 0 replies; 12+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-15  5:58 UTC (permalink / raw)
  To: linux-arm-kernel

On 23:46 Sun 14 Oct     , Joachim Eastwood wrote:
> Hi
> 
> This patch series add support for devicetree on AT91RM9200. Series is dependent upon at91-pinctrl.
> 
> There isn't support for any boards yet, but I am working on one now. I will submit it once I have a couple of more bindings in place.
> 
> Patch 1 is a fixfor a build failure which can happen if board-dt is enabled when no AT91SAM machines are enabled.
> 

next time put the version number in subject

Best Regards,
J.

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

* [PATCH 1/5] ARM: AT91: Fix build failure on board-dt
  2012-10-14 21:46 ` [PATCH 1/5] ARM: AT91: Fix build failure on board-dt Joachim Eastwood
@ 2012-10-15  5:59   ` Jean-Christophe PLAGNIOL-VILLARD
  2012-10-15  7:12     ` Joachim Eastwood
  0 siblings, 1 reply; 12+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-15  5:59 UTC (permalink / raw)
  To: linux-arm-kernel

On 23:46 Sun 14 Oct     , Joachim Eastwood wrote:
> We need CONFIG_SOC_AT91SAM9 to get the at91sam926x_timer
> symbol used in board-dt.
as I said before you can not do a select you need to do a depends

as you will have no clock as you select no SoC

Best Regards,
J.
> 
> Signed-off-by: Joachim Eastwood <manabian@gmail.com>
> ---
>  arch/arm/mach-at91/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> index 0fafb6a..d9b0546 100644
> --- a/arch/arm/mach-at91/Kconfig
> +++ b/arch/arm/mach-at91/Kconfig
> @@ -507,6 +507,7 @@ comment "Generic Board Type"
>  
>  config MACH_AT91SAM_DT
>  	bool "Atmel AT91SAM Evaluation Kits with device-tree support"
> +	select SOC_AT91SAM9
>  	select USE_OF
>  	help
>  	  Select this if you want to experiment device-tree with
> -- 
> 1.7.12.3
> 

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

* [PATCH 5/5] ARM: AT91: Add AT91RM9200 device tree
  2012-10-14 21:46 ` [PATCH 5/5] ARM: AT91: Add AT91RM9200 device tree Joachim Eastwood
@ 2012-10-15  6:03   ` Jean-Christophe PLAGNIOL-VILLARD
  2012-10-15  7:01     ` Joachim Eastwood
  0 siblings, 1 reply; 12+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-15  6:03 UTC (permalink / raw)
  To: linux-arm-kernel

 +
> +			pinctrl at fffff400 {
> +				#address-cells = <1>;
> +				#size-cells = <1>;
> +				compatible = "atmel,at91rm9200-pinctrl", "simple-bus";
> +				ranges = <0xfffff400 0xfffff400 0x800>;
> +
> +				atmel,mux-mask = <
> +					/*    A         B     */
> +					 0xffffffff 0xffffffff  /* pioA */
> +					 0xffffffff 0x083fffff  /* pioB */
> +					 0xffff3fff 0x00000000  /* pioC */
> +					 0x03ff87ff 0x0fffff80  /* pioD */
> +					>;
> +
> +				/* shared pinctrl settings */
> +				dbgu {
> +					pinctrl_dbgu: dbgu-0 {
> +						atmel,pins =
> +							<0 30 0x1 0x0	/* PA30 periph A */
> +							 0 31 0x1 0x1>;	/* PA31 periph with pullup */
> +					};
> +				};
> +
> +				uart0 {
> +					pinctrl_uart0: uart0-0 {
> +						atmel,pins =
> +							<0 17 0x1 0x0	/* PA17 periph A */
> +							 0 18 0x1 0x0>;	/* PA18 periph A */
> +					};
> +
> +					pinctrl_uart0_rts_cts: uart0_rts_cts-0 {
> +						atmel,pins =
> +							<0 20 0x1 0x0	/* PA20 periph A */
> +							 0 21 0x1 0x0>;	/* PA21 periph A */
> +					};
> +				};
> +
> +				uart1 {
> +					pinctrl_uart1: uart1-0 {
> +						atmel,pins =
> +							<1 20 0x1 0x1	/* PB20 periph A with pullup */
> +							 1 21 0x1 0x0>;	/* PB21 periph A */
> +					};
> +
> +					pinctrl_uart1_rts_cts: uart1_rts_cts-0 {
> +						atmel,pins =
> +							<1 24 0x1 0x0	/* PB24 periph A */
> +							 1 26 0x1 0x0>;	/* PB26 periph A */
> +					};
> +
> +					pinctrl_uart1_dtr_dsr: uart1_dtr_dsr-0 {
> +						atmel,pins =
> +							<1 19 0x1 0x0	/* PB19 periph A */
> +							 1 25 0x1 0x0>;	/* PB25 periph A */
> +					};
> +
> +					pinctrl_uart1_dcd: uart1_dcd-0 {
> +						atmel,pins =
> +							<1 23 0x1 0x0>;	/* PB23 periph A */
> +					};
> +
> +					pinctrl_uart1_ri: uart1_ri-0 {
> +						atmel,pins =
> +							<1 18 0x1 0x0>;	/* PB18 periph A */
> +					};
> +				};
> +
> +				uart2 {
> +					pinctrl_uart2: uart2-0 {
> +						atmel,pins =
> +							<0 22 0x1 0x0	/* PA22 periph A */
> +							 0 23 0x1 0x1>;	/* PA23 periph A with pullup */
> +					};
> +
> +					pinctrl_uart2_rts_cts: uart2_rts_cts-0 {
> +						atmel,pins =
> +							<0 30 0x2 0x0	/* PA30 periph B */
> +							 0 31 0x2 0x0>;	/* PA31 periph B */
> +					};
> +				};
> +
> +				uart3 {
> +					pinctrl_uart3: uart3-0 {
> +						atmel,pins =
> +							<0 5 0x2 0x1	/* PA5 periph B with pullup */
> +							 0 6 0x2 0x0>;	/* PA6 periph B */
> +					};
> +
> +					pinctrl_uart3_rts_cts: uart3_rts_cts-0 {
> +						atmel,pins =
> +							<1 0 0x2 0x0	/* PB0 periph B */
> +							 1 1 0x2 0x0>;	/* PB1 periph B */
> +					};
> +				};
> +
> +				nand {
> +					pinctrl_nand: nand-0 {
> +						atmel,pins =
> +							<2 2 0x0 0x1	/* PC2 gpio RDY pin pull_up */
> +							 1 1 0x0 0x1>;	/* PB1 gpio CD pin pull_up */
> +					};
I do not yet check the pin I'll do it later

but look ok

please a board so we can test it the rm9200ek at least

Best Regards,
J.

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

* [PATCH 4/5] ARM: AT91: Add AT91RM9200 DT board
  2012-10-14 21:46 ` [PATCH 4/5] ARM: AT91: Add AT91RM9200 DT board Joachim Eastwood
@ 2012-10-15  6:08   ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 12+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-15  6:08 UTC (permalink / raw)
  To: linux-arm-kernel

On 23:46 Sun 14 Oct     , Joachim Eastwood wrote:
> Signed-off-by: Joachim Eastwood <manabian@gmail.com>
> ---
>  arch/arm/mach-at91/Kconfig           |  8 +++++
>  arch/arm/mach-at91/Makefile          |  1 +
>  arch/arm/mach-at91/board-rm9200-dt.c | 59 ++++++++++++++++++++++++++++++++++++
>  arch/arm/mach-at91/generic.h         |  1 +
>  arch/arm/mach-at91/setup.c           | 14 +++++++++
>  5 files changed, 83 insertions(+)
>  create mode 100644 arch/arm/mach-at91/board-rm9200-dt.c
> 
> diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> index d9b0546..3f45906 100644
> --- a/arch/arm/mach-at91/Kconfig
> +++ b/arch/arm/mach-at91/Kconfig
> @@ -505,6 +505,14 @@ endif
>  
>  comment "Generic Board Type"
>  
> +config MACH_AT91RM9200_DT
> +	bool "Atmel AT91RM9200 Evaluation Kits with device-tree support"
> +	select SOC_AT91RM9200
depends on
> +	select USE_OF
> +	help
> +	  Select this if you want to experiment device-tree with
> +	  an Atmel RM9200 Evaluation Kit.
> +

Best Regards,
J.

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

* [PATCH 5/5] ARM: AT91: Add AT91RM9200 device tree
  2012-10-15  6:03   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-15  7:01     ` Joachim Eastwood
  0 siblings, 0 replies; 12+ messages in thread
From: Joachim Eastwood @ 2012-10-15  7:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 15, 2012 at 8:03 AM, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
<snip patch>
> I do not yet check the pin I'll do it later
>
> but look ok
>
> please a board so we can test it the rm9200ek at least

I can add it, but I don't have any of the Atmel RM9200 dev kits so I
can't test it.

The testing I have done so far has been with a custom board which I'll
add later as noted in the series description.

regards
Joachim Eastwood

> Best Regards,
> J.

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

* [PATCH 1/5] ARM: AT91: Fix build failure on board-dt
  2012-10-15  5:59   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-15  7:12     ` Joachim Eastwood
  0 siblings, 0 replies; 12+ messages in thread
From: Joachim Eastwood @ 2012-10-15  7:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 15, 2012 at 7:59 AM, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 23:46 Sun 14 Oct     , Joachim Eastwood wrote:
>> We need CONFIG_SOC_AT91SAM9 to get the at91sam926x_timer
>> symbol used in board-dt.
> as I said before you can not do a select you need to do a depends
>
> as you will have no clock as you select no SoC

Yes, the board-dt will not boot without a SoC.

Changing it to depend will hide board-dt until you choose a SoC I
assume this is the behavior we want then.

I'll change both patches to use depend in Kconfig.

regards
Joachim Eastwood


> Best Regards,
> J.

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

end of thread, other threads:[~2012-10-15  7:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-14 21:46 [PATCH 0/5] Add DT support for AT91RM9200 Joachim Eastwood
2012-10-14 21:46 ` [PATCH 1/5] ARM: AT91: Fix build failure on board-dt Joachim Eastwood
2012-10-15  5:59   ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-15  7:12     ` Joachim Eastwood
2012-10-14 21:46 ` [PATCH 2/5] ARM: AT91: Add DT support to AT91RM9200 System Timer Joachim Eastwood
2012-10-14 21:46 ` [PATCH 3/5] ARM: AT91: Add usart/tc/pio DT clock lookup to AT91RM9200 Joachim Eastwood
2012-10-14 21:46 ` [PATCH 4/5] ARM: AT91: Add AT91RM9200 DT board Joachim Eastwood
2012-10-15  6:08   ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-14 21:46 ` [PATCH 5/5] ARM: AT91: Add AT91RM9200 device tree Joachim Eastwood
2012-10-15  6:03   ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-15  7:01     ` Joachim Eastwood
2012-10-15  5:58 ` [PATCH 0/5] Add DT support for AT91RM9200 Jean-Christophe PLAGNIOL-VILLARD

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