All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/16] Orion DT conversions and fixes.
@ 2012-07-20 17:35 Andrew Lunn
  2012-07-20 17:35 ` [PATCH 1/16] ARM: Orion: DT support for IRQ and GPIO Controllers Andrew Lunn
                   ` (15 more replies)
  0 siblings, 16 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

This is a collection of patches converting more drivers used by orion
to DT. Then, where possible, convert platform code to use DT. Also
a few fixes are mixed in.

- IRQ/GPIO/SPI/WDT/SATA have all been seen before and no changes made.
- I2C has been split in two, with the driver parts now going via
  i2c-embedded/for-next
- gpio-key and gpio-led converted to DT equivalents.
- Ensure runit clock always ticks is a rework of an earlier patch, now
  including comments from Marvell engineers.
- Replace mrvl with marvell implements the decision made here:
  http://www.spinics.net/lists/arm-kernel/msg176524.html

These patches, plus the I2C driver change and all the patches i've
collected from others ready for submission to arm-soc/for-next can be
found in:

git://github.com/lunn/linux.git v3.5-rc7-for-next-v5 

Andrew Lunn (16):
  ARM: Orion: DT support for IRQ and GPIO Controllers
  SPI: Refactor spi-orion to use SPI framework queue.
  ARM: Kirkwood: Ensure runit clock always ticks.
  ARM: Orion: Add arch support needed for I2C via DT.
  Kirkwood: Add basic device tree support for QNAP TS219.
  ARM: Orion: DTify the watchdog timer.
  ATA: sata_mv: Add device tree support
  ARM: Kirkwood: Use DT to configure SATA device.
  ARM: Kirkwood: Describe DNS325 temperature sensor in DT.
  ARM: Kirkwood: Describe IB62x0 gpio-keys in DT.
  ARM: Kirkwood: Describe iConnects temperature sensor in DT.
  ARM: Kirkwood: Describe Dreamplug LEDs in DT.
  ARM: Kirkwood: Describe GoFlex Net LEDs and SATA in DT.
  ARM: Kirkwood: Describe ib62x0 LEDs in DT.
  ARM: Kirkwood: Describe iConnect LEDs in DT.
  ARM: Kirkwood: Replace mrvl with marvell

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

* [PATCH 1/16] ARM: Orion: DT support for IRQ and GPIO Controllers
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  2012-07-20 17:35 ` [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue Andrew Lunn
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Both IRQ and GPIO controllers can now be represented in DT.  The IRQ
controllers are setup first, and then the GPIO controllers. Interrupts
for GPIO lines are placed directly after the main interrupts in the
interrupt space.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Josh Coombs <josh.coombs@gmail.com>
Tested-by: Simon Baatz <gmbnomis@gmail.com>
---
 .../devicetree/bindings/arm/mrvl/intc.txt          |   20 +++
 .../devicetree/bindings/gpio/mrvl-gpio.txt         |   23 +++
 arch/arm/Kconfig                                   |    1 +
 arch/arm/boot/dts/kirkwood.dtsi                    |   27 ++++
 arch/arm/mach-dove/irq.c                           |   58 +++----
 arch/arm/mach-kirkwood/board-dt.c                  |    3 +-
 arch/arm/mach-kirkwood/irq.c                       |   38 ++---
 arch/arm/mach-mv78xx0/irq.c                        |   22 +--
 arch/arm/mach-orion5x/irq.c                        |   22 +--
 arch/arm/plat-orion/gpio.c                         |  166 +++++++++++++++-----
 arch/arm/plat-orion/include/plat/gpio.h            |   16 +-
 arch/arm/plat-orion/include/plat/irq.h             |    3 +-
 arch/arm/plat-orion/irq.c                          |   40 +++++
 13 files changed, 307 insertions(+), 132 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/mrvl/intc.txt b/Documentation/devicetree/bindings/arm/mrvl/intc.txt
index 80b9a94..8b53273 100644
--- a/Documentation/devicetree/bindings/arm/mrvl/intc.txt
+++ b/Documentation/devicetree/bindings/arm/mrvl/intc.txt
@@ -38,3 +38,23 @@ Example:
 		reg-names = "mux status", "mux mask";
 		mrvl,intc-nr-irqs = <2>;
 	};
+
+* Marvell Orion Interrupt controller
+
+Required properties
+- compatible :  Should be "marvell,orion-intc".
+- #interrupt-cells: Specifies the number of cells needed to encode an
+  interrupt source. Supported value is <1>.
+- interrupt-controller : Declare this node to be an interrupt controller.
+- reg : Interrupt mask address. A list of 4 byte ranges, one per controller.
+        One entry in the list represents 32 interrupts.
+
+Example:
+
+	intc: interrupt-controller {
+        	compatible = "marvell,orion-intc", "marvell,intc";
+		interrupt-controller;
+		#interrupt-cells = <1>;
+                reg = <0xfed20204 0x04>,
+		      <0xfed20214 0x04>;
+        };
diff --git a/Documentation/devicetree/bindings/gpio/mrvl-gpio.txt b/Documentation/devicetree/bindings/gpio/mrvl-gpio.txt
index 05428f3..e137874 100644
--- a/Documentation/devicetree/bindings/gpio/mrvl-gpio.txt
+++ b/Documentation/devicetree/bindings/gpio/mrvl-gpio.txt
@@ -27,3 +27,26 @@ Example:
 		interrupt-controller;
 		#interrupt-cells = <1>;
       };
+
+* Marvell Orion GPIO Controller
+
+Required properties:
+- compatible         : Should be "marvell,orion-gpio"
+- reg                : Address and length of the register set for controller.
+- gpio-controller    : So we know this is a gpio controller.
+- ngpio              : How many gpios this controller has.
+- interrupts	     : Up to 4 Interrupts for the controller.
+
+Optional properties:
+- mask-offset        : For SMP Orions, offset for Nth CPU
+
+Example:
+
+		gpio0: gpio at 10100 {
+			compatible = "marvell,orion-gpio";
+			#gpio-cells = <2>;
+			gpio-controller;
+			reg = <0x10100 0x40>;
+			ngpio = <32>;
+			interrupts = <35>, <36>, <37>, <38>;
+		};
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a91009c..39bb941 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1105,6 +1105,7 @@ config PLAT_ORION
 	bool
 	select CLKSRC_MMIO
 	select GENERIC_IRQ_CHIP
+	select IRQ_DOMAIN
 	select COMMON_CLK
 
 config PLAT_PXA
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 926528b..66544d7 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -2,6 +2,15 @@
 
 / {
 	compatible = "mrvl,kirkwood";
+	interrupt-parent = <&intc>;
+
+	intc: interrupt-controller {
+		compatible = "marvell,orion-intc", "marvell,intc";
+		interrupt-controller;
+		#interrupt-cells = <1>;
+		reg = <0xf1020204 0x04>,
+		      <0xf1020214 0x04>;
+	};
 
 	ocp at f1000000 {
 		compatible = "simple-bus";
@@ -9,6 +18,24 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 
+		gpio0: gpio at 10100 {
+			compatible = "marvell,orion-gpio";
+			#gpio-cells = <2>;
+			gpio-controller;
+			reg = <0x10100 0x40>;
+			ngpio = <32>;
+			interrupts = <35>, <36>, <37>, <38>;
+		};
+
+		gpio1: gpio at 10140 {
+			compatible = "marvell,orion-gpio";
+			#gpio-cells = <2>;
+			gpio-controller;
+			reg = <0x10140 0x40>;
+			ngpio = <18>;
+			interrupts = <39>, <40>, <41>;
+		};
+
 		serial at 12000 {
 			compatible = "ns16550a";
 			reg = <0x12000 0x100>;
diff --git a/arch/arm/mach-dove/irq.c b/arch/arm/mach-dove/irq.c
index f07fd16..9bc97a5 100644
--- a/arch/arm/mach-dove/irq.c
+++ b/arch/arm/mach-dove/irq.c
@@ -20,22 +20,6 @@
 #include <mach/bridge-regs.h>
 #include "common.h"
 
-static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
-{
-	int irqoff;
-	BUG_ON(irq < IRQ_DOVE_GPIO_0_7 || irq > IRQ_DOVE_HIGH_GPIO);
-
-	irqoff = irq <= IRQ_DOVE_GPIO_16_23 ? irq - IRQ_DOVE_GPIO_0_7 :
-		3 + irq - IRQ_DOVE_GPIO_24_31;
-
-	orion_gpio_irq_handler(irqoff << 3);
-	if (irq == IRQ_DOVE_HIGH_GPIO) {
-		orion_gpio_irq_handler(40);
-		orion_gpio_irq_handler(48);
-		orion_gpio_irq_handler(56);
-	}
-}
-
 static void pmu_irq_mask(struct irq_data *d)
 {
 	int pin = irq_to_pmu(d->irq);
@@ -90,6 +74,27 @@ static void pmu_irq_handler(unsigned int irq, struct irq_desc *desc)
 	}
 }
 
+static int __initdata gpio0_irqs[4] = {
+	IRQ_DOVE_GPIO_0_7,
+	IRQ_DOVE_GPIO_8_15,
+	IRQ_DOVE_GPIO_16_23,
+	IRQ_DOVE_GPIO_24_31,
+};
+
+static int __initdata gpio1_irqs[4] = {
+	IRQ_DOVE_HIGH_GPIO,
+	0,
+	0,
+	0,
+};
+
+static int __initdata gpio2_irqs[4] = {
+	0,
+	0,
+	0,
+	0,
+};
+
 void __init dove_init_irq(void)
 {
 	int i;
@@ -100,19 +105,14 @@ void __init dove_init_irq(void)
 	/*
 	 * Initialize gpiolib for GPIOs 0-71.
 	 */
-	orion_gpio_init(0, 32, DOVE_GPIO_LO_VIRT_BASE, 0,
-			IRQ_DOVE_GPIO_START);
-	irq_set_chained_handler(IRQ_DOVE_GPIO_0_7, gpio_irq_handler);
-	irq_set_chained_handler(IRQ_DOVE_GPIO_8_15, gpio_irq_handler);
-	irq_set_chained_handler(IRQ_DOVE_GPIO_16_23, gpio_irq_handler);
-	irq_set_chained_handler(IRQ_DOVE_GPIO_24_31, gpio_irq_handler);
-
-	orion_gpio_init(32, 32, DOVE_GPIO_HI_VIRT_BASE, 0,
-			IRQ_DOVE_GPIO_START + 32);
-	irq_set_chained_handler(IRQ_DOVE_HIGH_GPIO, gpio_irq_handler);
-
-	orion_gpio_init(64, 8, DOVE_GPIO2_VIRT_BASE, 0,
-			IRQ_DOVE_GPIO_START + 64);
+	orion_gpio_init(NULL, 0, 32, (void __iomem *)DOVE_GPIO_LO_VIRT_BASE, 0,
+			IRQ_DOVE_GPIO_START, gpio0_irqs);
+
+	orion_gpio_init(NULL, 32, 32, (void __iomem *)DOVE_GPIO_HI_VIRT_BASE, 0,
+			IRQ_DOVE_GPIO_START + 32, gpio1_irqs);
+
+	orion_gpio_init(NULL, 64, 8, (void __iomem *)DOVE_GPIO2_VIRT_BASE, 0,
+			IRQ_DOVE_GPIO_START + 64, gpio2_irqs);
 
 	/*
 	 * Mask and clear PMU interrupts
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index edc3f8a..27ac3d8 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -18,6 +18,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <mach/bridge-regs.h>
+#include <plat/irq.h>
 #include "common.h"
 
 static struct of_device_id kirkwood_dt_match_table[] __initdata = {
@@ -84,7 +85,7 @@ DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
 	/* Maintainer: Jason Cooper <jason@lakedaemon.net> */
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
-	.init_irq	= kirkwood_init_irq,
+	.init_irq	= orion_dt_init_irq,
 	.timer		= &kirkwood_timer,
 	.init_machine	= kirkwood_dt_init,
 	.restart	= kirkwood_restart,
diff --git a/arch/arm/mach-kirkwood/irq.c b/arch/arm/mach-kirkwood/irq.c
index c4c68e5..720063f 100644
--- a/arch/arm/mach-kirkwood/irq.c
+++ b/arch/arm/mach-kirkwood/irq.c
@@ -9,20 +9,23 @@
  */
 #include <linux/gpio.h>
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/irq.h>
-#include <linux/io.h>
 #include <mach/bridge-regs.h>
 #include <plat/irq.h>
-#include "common.h"
 
-static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
-{
-	BUG_ON(irq < IRQ_KIRKWOOD_GPIO_LOW_0_7);
-	BUG_ON(irq > IRQ_KIRKWOOD_GPIO_HIGH_16_23);
+static int __initdata gpio0_irqs[4] = {
+	IRQ_KIRKWOOD_GPIO_LOW_0_7,
+	IRQ_KIRKWOOD_GPIO_LOW_8_15,
+	IRQ_KIRKWOOD_GPIO_LOW_16_23,
+	IRQ_KIRKWOOD_GPIO_LOW_24_31,
+};
 
-	orion_gpio_irq_handler((irq - IRQ_KIRKWOOD_GPIO_LOW_0_7) << 3);
-}
+static int __initdata gpio1_irqs[4] = {
+	IRQ_KIRKWOOD_GPIO_HIGH_0_7,
+	IRQ_KIRKWOOD_GPIO_HIGH_8_15,
+	IRQ_KIRKWOOD_GPIO_HIGH_16_23,
+	0,
+};
 
 void __init kirkwood_init_irq(void)
 {
@@ -32,17 +35,8 @@ void __init kirkwood_init_irq(void)
 	/*
 	 * Initialize gpiolib for GPIOs 0-49.
 	 */
-	orion_gpio_init(0, 32, GPIO_LOW_VIRT_BASE, 0,
-			IRQ_KIRKWOOD_GPIO_START);
-	irq_set_chained_handler(IRQ_KIRKWOOD_GPIO_LOW_0_7, gpio_irq_handler);
-	irq_set_chained_handler(IRQ_KIRKWOOD_GPIO_LOW_8_15, gpio_irq_handler);
-	irq_set_chained_handler(IRQ_KIRKWOOD_GPIO_LOW_16_23, gpio_irq_handler);
-	irq_set_chained_handler(IRQ_KIRKWOOD_GPIO_LOW_24_31, gpio_irq_handler);
-
-	orion_gpio_init(32, 18, GPIO_HIGH_VIRT_BASE, 0,
-			IRQ_KIRKWOOD_GPIO_START + 32);
-	irq_set_chained_handler(IRQ_KIRKWOOD_GPIO_HIGH_0_7, gpio_irq_handler);
-	irq_set_chained_handler(IRQ_KIRKWOOD_GPIO_HIGH_8_15, gpio_irq_handler);
-	irq_set_chained_handler(IRQ_KIRKWOOD_GPIO_HIGH_16_23,
-				gpio_irq_handler);
+	orion_gpio_init(NULL, 0, 32, (void __iomem *)GPIO_LOW_VIRT_BASE, 0,
+			IRQ_KIRKWOOD_GPIO_START, gpio0_irqs);
+	orion_gpio_init(NULL, 32, 18, (void __iomem *)GPIO_HIGH_VIRT_BASE, 0,
+			IRQ_KIRKWOOD_GPIO_START + 32, gpio1_irqs);
 }
diff --git a/arch/arm/mach-mv78xx0/irq.c b/arch/arm/mach-mv78xx0/irq.c
index e421b70..eff9a75 100644
--- a/arch/arm/mach-mv78xx0/irq.c
+++ b/arch/arm/mach-mv78xx0/irq.c
@@ -9,19 +9,17 @@
  */
 #include <linux/gpio.h>
 #include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/pci.h>
 #include <linux/irq.h>
 #include <mach/bridge-regs.h>
 #include <plat/irq.h>
 #include "common.h"
 
-static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
-{
-	BUG_ON(irq < IRQ_MV78XX0_GPIO_0_7 || irq > IRQ_MV78XX0_GPIO_24_31);
-
-	orion_gpio_irq_handler((irq - IRQ_MV78XX0_GPIO_0_7) << 3);
-}
+static int __initdata gpio0_irqs[4] = {
+	IRQ_MV78XX0_GPIO_0_7,
+	IRQ_MV78XX0_GPIO_8_15,
+	IRQ_MV78XX0_GPIO_16_23,
+	IRQ_MV78XX0_GPIO_24_31,
+};
 
 void __init mv78xx0_init_irq(void)
 {
@@ -34,11 +32,7 @@ void __init mv78xx0_init_irq(void)
 	 * registers for core #1 are@an offset of 0x18 from those of
 	 * core #0.)
 	 */
-	orion_gpio_init(0, 32, GPIO_VIRT_BASE,
+	orion_gpio_init(NULL, 0, 32, (void __iomem *)GPIO_VIRT_BASE,
 			mv78xx0_core_index() ? 0x18 : 0,
-			IRQ_MV78XX0_GPIO_START);
-	irq_set_chained_handler(IRQ_MV78XX0_GPIO_0_7, gpio_irq_handler);
-	irq_set_chained_handler(IRQ_MV78XX0_GPIO_8_15, gpio_irq_handler);
-	irq_set_chained_handler(IRQ_MV78XX0_GPIO_16_23, gpio_irq_handler);
-	irq_set_chained_handler(IRQ_MV78XX0_GPIO_24_31, gpio_irq_handler);
+			IRQ_MV78XX0_GPIO_START, gpio0_irqs);
 }
diff --git a/arch/arm/mach-orion5x/irq.c b/arch/arm/mach-orion5x/irq.c
index b1b45ff..17da709 100644
--- a/arch/arm/mach-orion5x/irq.c
+++ b/arch/arm/mach-orion5x/irq.c
@@ -11,19 +11,16 @@
  */
 #include <linux/gpio.h>
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/irq.h>
-#include <linux/io.h>
 #include <mach/bridge-regs.h>
 #include <plat/irq.h>
-#include "common.h"
 
-static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
-{
-	BUG_ON(irq < IRQ_ORION5X_GPIO_0_7 || irq > IRQ_ORION5X_GPIO_24_31);
-
-	orion_gpio_irq_handler((irq - IRQ_ORION5X_GPIO_0_7) << 3);
-}
+static int __initdata gpio0_irqs[4] = {
+	IRQ_ORION5X_GPIO_0_7,
+	IRQ_ORION5X_GPIO_8_15,
+	IRQ_ORION5X_GPIO_16_23,
+	IRQ_ORION5X_GPIO_24_31,
+};
 
 void __init orion5x_init_irq(void)
 {
@@ -32,9 +29,6 @@ void __init orion5x_init_irq(void)
 	/*
 	 * Initialize gpiolib for GPIOs 0-31.
 	 */
-	orion_gpio_init(0, 32, GPIO_VIRT_BASE, 0, IRQ_ORION5X_GPIO_START);
-	irq_set_chained_handler(IRQ_ORION5X_GPIO_0_7, gpio_irq_handler);
-	irq_set_chained_handler(IRQ_ORION5X_GPIO_8_15, gpio_irq_handler);
-	irq_set_chained_handler(IRQ_ORION5X_GPIO_16_23, gpio_irq_handler);
-	irq_set_chained_handler(IRQ_ORION5X_GPIO_24_31, gpio_irq_handler);
+	orion_gpio_init(NULL, 0, 32, (void __iomem *)GPIO_VIRT_BASE, 0,
+			IRQ_ORION5X_GPIO_START, gpio0_irqs);
 }
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index af95af2..dfda74f 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -8,15 +8,22 @@
  * warranty of any kind, whether express or implied.
  */
 
+#define DEBUG
+
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/irq.h>
+#include <linux/irqdomain.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/bitops.h>
 #include <linux/io.h>
 #include <linux/gpio.h>
 #include <linux/leds.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
+#include <linux/of_address.h>
+#include <plat/gpio.h>
 
 /*
  * GPIO unit register offsets.
@@ -38,6 +45,7 @@ struct orion_gpio_chip {
 	unsigned long		valid_output;
 	int			mask_offset;
 	int			secondary_irq_base;
+	struct irq_domain       *domain;
 };
 
 static void __iomem *GPIO_OUT(struct orion_gpio_chip *ochip)
@@ -222,10 +230,10 @@ static int orion_gpio_to_irq(struct gpio_chip *chip, unsigned pin)
 	struct orion_gpio_chip *ochip =
 		container_of(chip, struct orion_gpio_chip, chip);
 
-	return ochip->secondary_irq_base + pin;
+	return irq_create_mapping(ochip->domain,
+				  ochip->secondary_irq_base + pin);
 }
 
-
 /*
  * Orion-specific GPIO API extensions.
  */
@@ -353,12 +361,10 @@ static int gpio_irq_set_type(struct irq_data *d, u32 type)
 	int pin;
 	u32 u;
 
-	pin = d->irq - gc->irq_base;
+	pin = d->hwirq - ochip->secondary_irq_base;
 
 	u = readl(GPIO_IO_CONF(ochip)) & (1 << pin);
 	if (!u) {
-		printk(KERN_ERR "orion gpio_irq_set_type failed "
-				"(irq %d, pin %d).\n", d->irq, pin);
 		return -EINVAL;
 	}
 
@@ -397,17 +403,53 @@ static int gpio_irq_set_type(struct irq_data *d, u32 type)
 			u &= ~(1 << pin);	/* rising */
 		writel(u, GPIO_IN_POL(ochip));
 	}
-
 	return 0;
 }
 
-void __init orion_gpio_init(int gpio_base, int ngpio,
-			    u32 base, int mask_offset, int secondary_irq_base)
+static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+{
+	struct orion_gpio_chip *ochip = irq_get_handler_data(irq);
+	u32 cause, type;
+	int i;
+
+	if (ochip == NULL)
+		return;
+
+	cause = readl(GPIO_DATA_IN(ochip)) & readl(GPIO_LEVEL_MASK(ochip));
+	cause |= readl(GPIO_EDGE_CAUSE(ochip)) & readl(GPIO_EDGE_MASK(ochip));
+
+	for (i = 0; i < ochip->chip.ngpio; i++) {
+		int irq;
+
+		irq = ochip->secondary_irq_base + i;
+
+		if (!(cause & (1 << i)))
+			continue;
+
+		type = irqd_get_trigger_type(irq_get_irq_data(irq));
+		if ((type & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
+			/* Swap polarity (race with GPIO line) */
+			u32 polarity;
+
+			polarity = readl(GPIO_IN_POL(ochip));
+			polarity ^= 1 << i;
+			writel(polarity, GPIO_IN_POL(ochip));
+		}
+		generic_handle_irq(irq);
+	}
+}
+
+void __init orion_gpio_init(struct device_node *np,
+			    int gpio_base, int ngpio,
+			    void __iomem *base, int mask_offset,
+			    int secondary_irq_base,
+			    int irqs[4])
 {
 	struct orion_gpio_chip *ochip;
 	struct irq_chip_generic *gc;
 	struct irq_chip_type *ct;
 	char gc_label[16];
+	int i;
 
 	if (orion_gpio_chip_count == ARRAY_SIZE(orion_gpio_chips))
 		return;
@@ -426,6 +468,10 @@ void __init orion_gpio_init(int gpio_base, int ngpio,
 	ochip->chip.base = gpio_base;
 	ochip->chip.ngpio = ngpio;
 	ochip->chip.can_sleep = 0;
+#ifdef CONFIG_OF
+	ochip->chip.of_node = np;
+#endif
+
 	spin_lock_init(&ochip->lock);
 	ochip->base = (void __iomem *)base;
 	ochip->valid_input = 0;
@@ -435,8 +481,6 @@ void __init orion_gpio_init(int gpio_base, int ngpio,
 
 	gpiochip_add(&ochip->chip);
 
-	orion_gpio_chip_count++;
-
 	/*
 	 * Mask and clear GPIO interrupts.
 	 */
@@ -444,16 +488,28 @@ void __init orion_gpio_init(int gpio_base, int ngpio,
 	writel(0, GPIO_EDGE_MASK(ochip));
 	writel(0, GPIO_LEVEL_MASK(ochip));
 
-	gc = irq_alloc_generic_chip("orion_gpio_irq", 2, secondary_irq_base,
+	/* Setup the interrupt handlers. Each chip can have up to 4
+	 * interrupt handlers, with each handler dealing with 8 GPIO
+	 * pins. */
+
+	for (i = 0; i < 4; i++) {
+		if (irqs[i]) {
+			irq_set_handler_data(irqs[i], ochip);
+			irq_set_chained_handler(irqs[i], gpio_irq_handler);
+		}
+	}
+
+	gc = irq_alloc_generic_chip("orion_gpio_irq", 2,
+				    secondary_irq_base,
 				    ochip->base, handle_level_irq);
 	gc->private = ochip;
-
 	ct = gc->chip_types;
 	ct->regs.mask = ochip->mask_offset + GPIO_LEVEL_MASK_OFF;
 	ct->type = IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW;
 	ct->chip.irq_mask = irq_gc_mask_clr_bit;
 	ct->chip.irq_unmask = irq_gc_mask_set_bit;
 	ct->chip.irq_set_type = gpio_irq_set_type;
+	ct->chip.name = ochip->chip.label;
 
 	ct++;
 	ct->regs.mask = ochip->mask_offset + GPIO_EDGE_MASK_OFF;
@@ -464,41 +520,69 @@ void __init orion_gpio_init(int gpio_base, int ngpio,
 	ct->chip.irq_unmask = irq_gc_mask_set_bit;
 	ct->chip.irq_set_type = gpio_irq_set_type;
 	ct->handler = handle_edge_irq;
+	ct->chip.name = ochip->chip.label;
 
 	irq_setup_generic_chip(gc, IRQ_MSK(ngpio), IRQ_GC_INIT_MASK_CACHE,
 			       IRQ_NOREQUEST, IRQ_LEVEL | IRQ_NOPROBE);
-}
 
-void orion_gpio_irq_handler(int pinoff)
-{
-	struct orion_gpio_chip *ochip;
-	u32 cause, type;
-	int i;
-
-	ochip = orion_gpio_chip_find(pinoff);
-	if (ochip == NULL)
-		return;
-
-	cause = readl(GPIO_DATA_IN(ochip)) & readl(GPIO_LEVEL_MASK(ochip));
-	cause |= readl(GPIO_EDGE_CAUSE(ochip)) & readl(GPIO_EDGE_MASK(ochip));
-
-	for (i = 0; i < ochip->chip.ngpio; i++) {
-		int irq;
+	/* Setup irq domain on top of the generic chip. */
+	ochip->domain = irq_domain_add_legacy(np,
+					      ochip->chip.ngpio,
+					      ochip->secondary_irq_base,
+					      ochip->secondary_irq_base,
+					      &irq_domain_simple_ops,
+					      ochip);
+	if (!ochip->domain)
+		panic("%s: couldn't allocate irq domain (DT).\n",
+		      ochip->chip.label);
 
-		irq = ochip->secondary_irq_base + i;
+	orion_gpio_chip_count++;
+}
 
-		if (!(cause & (1 << i)))
-			continue;
+#ifdef CONFIG_OF
+static void __init orion_gpio_of_init_one(struct device_node *np,
+					  int irq_gpio_base)
+{
+	int ngpio, gpio_base, mask_offset;
+	void __iomem *base;
+	int ret, i;
+	int irqs[4];
+	int secondary_irq_base;
+
+	ret = of_property_read_u32(np, "ngpio", &ngpio);
+	if (ret)
+		goto out;
+	ret = of_property_read_u32(np, "mask-offset", &mask_offset);
+	if (ret == -EINVAL)
+		mask_offset = 0;
+	else
+		goto out;
+	base = of_iomap(np, 0);
+	if (!base)
+		goto out;
+
+	secondary_irq_base = irq_gpio_base + (32 * orion_gpio_chip_count);
+	gpio_base = 32 * orion_gpio_chip_count;
+
+	/* Get the interrupt numbers. Each chip can have up to 4
+	 * interrupt handlers, with each handler dealing with 8 GPIO
+	 * pins. */
+
+	for (i = 0; i < 4; i++)
+		irqs[i] = irq_of_parse_and_map(np, i);
+
+	orion_gpio_init(np, gpio_base, ngpio, base, mask_offset,
+			secondary_irq_base, irqs);
+	return;
+out:
+	pr_err("%s: %s: missing mandatory property\n", __func__, np->name);
+}
 
-		type = irqd_get_trigger_type(irq_get_irq_data(irq));
-		if ((type & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
-			/* Swap polarity (race with GPIO line) */
-			u32 polarity;
+void __init orion_gpio_of_init(int irq_gpio_base)
+{
+	struct device_node *np;
 
-			polarity = readl(GPIO_IN_POL(ochip));
-			polarity ^= 1 << i;
-			writel(polarity, GPIO_IN_POL(ochip));
-		}
-		generic_handle_irq(irq);
-	}
+	for_each_compatible_node(np, NULL, "marvell,orion-gpio")
+		orion_gpio_of_init_one(np, irq_gpio_base);
 }
+#endif
diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h
index bec0c98..81c6fc8 100644
--- a/arch/arm/plat-orion/include/plat/gpio.h
+++ b/arch/arm/plat-orion/include/plat/gpio.h
@@ -13,7 +13,7 @@
 
 #include <linux/init.h>
 #include <linux/types.h>
-
+#include <linux/irqdomain.h>
 /*
  * Orion-specific GPIO API extensions.
  */
@@ -27,13 +27,11 @@ int orion_gpio_led_blink_set(unsigned gpio, int state,
 void orion_gpio_set_valid(unsigned pin, int mode);
 
 /* Initialize gpiolib. */
-void __init orion_gpio_init(int gpio_base, int ngpio,
-			    u32 base, int mask_offset, int secondary_irq_base);
-
-/*
- * GPIO interrupt handling.
- */
-void orion_gpio_irq_handler(int irqoff);
-
+void __init orion_gpio_init(struct device_node *np,
+			    int gpio_base, int ngpio,
+			    void __iomem *base, int mask_offset,
+			    int secondary_irq_base,
+			    int irq[4]);
 
+void __init orion_gpio_of_init(int irq_gpio_base);
 #endif
diff --git a/arch/arm/plat-orion/include/plat/irq.h b/arch/arm/plat-orion/include/plat/irq.h
index f05eeab..50547e4 100644
--- a/arch/arm/plat-orion/include/plat/irq.h
+++ b/arch/arm/plat-orion/include/plat/irq.h
@@ -12,6 +12,5 @@
 #define __PLAT_IRQ_H
 
 void orion_irq_init(unsigned int irq_start, void __iomem *maskaddr);
-
-
+void __init orion_dt_init_irq(void);
 #endif
diff --git a/arch/arm/plat-orion/irq.c b/arch/arm/plat-orion/irq.c
index 2d5b9c1..d751964 100644
--- a/arch/arm/plat-orion/irq.c
+++ b/arch/arm/plat-orion/irq.c
@@ -11,8 +11,12 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/irq.h>
+#include <linux/irqdomain.h>
 #include <linux/io.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <plat/irq.h>
+#include <plat/gpio.h>
 
 void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr)
 {
@@ -32,3 +36,39 @@ void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr)
 	irq_setup_generic_chip(gc, IRQ_MSK(32), IRQ_GC_INIT_MASK_CACHE,
 			       IRQ_NOREQUEST, IRQ_LEVEL | IRQ_NOPROBE);
 }
+
+#ifdef CONFIG_OF
+static int __init orion_add_irq_domain(struct device_node *np,
+				       struct device_node *interrupt_parent)
+{
+	int i = 0, irq_gpio;
+	void __iomem *base;
+
+	do {
+		base = of_iomap(np, i);
+		if (base) {
+			orion_irq_init(i * 32, base);
+			i++;
+		}
+	} while (base);
+
+	irq_domain_add_legacy(np, i * 32, 0, 0,
+			      &irq_domain_simple_ops, NULL);
+
+	irq_gpio = i * 32;
+	orion_gpio_of_init(irq_gpio);
+
+	return 0;
+}
+
+static const struct of_device_id orion_irq_match[] = {
+	{ .compatible = "marvell,orion-intc",
+	  .data = orion_add_irq_domain, },
+	{},
+};
+
+void __init orion_dt_init_irq(void)
+{
+	of_irq_init(orion_irq_match);
+}
+#endif
-- 
1.7.10

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

* [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue.
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
  2012-07-20 17:35 ` [PATCH 1/16] ARM: Orion: DT support for IRQ and GPIO Controllers Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  2012-07-22  7:22   ` Linus Walleij
  2012-07-20 17:35 ` [PATCH 3/16] ARM: Kirkwood: Ensure runit clock always ticks Andrew Lunn
                   ` (13 subsequent siblings)
  15 siblings, 1 reply; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Replace the deprecated master->transfer with transfer_one_message()
and allow the SPI subsystem handle all the queuing of messages.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com>
---
 drivers/spi/spi-orion.c |  209 ++++++++++++++---------------------------------
 1 file changed, 61 insertions(+), 148 deletions(-)

diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index dfd04e9..547d983 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -35,12 +35,6 @@
 #define ORION_SPI_CLK_PRESCALE_MASK	0x1F
 
 struct orion_spi {
-	struct work_struct	work;
-
-	/* Lock access to transfer list.	*/
-	spinlock_t		lock;
-
-	struct list_head	msg_queue;
 	struct spi_master	*master;
 	void __iomem		*base;
 	unsigned int		max_speed;
@@ -49,8 +43,6 @@ struct orion_spi {
 	struct clk              *clk;
 };
 
-static struct workqueue_struct *orion_spi_wq;
-
 static inline void __iomem *spi_reg(struct orion_spi *orion_spi, u32 reg)
 {
 	return orion_spi->base + reg;
@@ -277,73 +269,78 @@ out:
 }
 
 
-static void orion_spi_work(struct work_struct *work)
+static int orion_spi_transfer_one_message(struct spi_master *master,
+					   struct spi_message *m)
 {
-	struct orion_spi *orion_spi =
-		container_of(work, struct orion_spi, work);
-
-	spin_lock_irq(&orion_spi->lock);
-	while (!list_empty(&orion_spi->msg_queue)) {
-		struct spi_message *m;
-		struct spi_device *spi;
-		struct spi_transfer *t = NULL;
-		int par_override = 0;
-		int status = 0;
-		int cs_active = 0;
-
-		m = container_of(orion_spi->msg_queue.next, struct spi_message,
-				 queue);
+	struct orion_spi *orion_spi = spi_master_get_devdata(master);
+	struct spi_device *spi = m->spi;
+	struct spi_transfer *t = NULL;
+	int par_override = 0;
+	int status = 0;
+	int cs_active = 0;
 
-		list_del_init(&m->queue);
-		spin_unlock_irq(&orion_spi->lock);
+	/* Load defaults */
+	status = orion_spi_setup_transfer(spi, NULL);
 
-		spi = m->spi;
+	if (status < 0)
+		goto msg_done;
 
-		/* Load defaults */
-		status = orion_spi_setup_transfer(spi, NULL);
+	list_for_each_entry(t, &m->transfers, transfer_list) {
+		/* make sure buffer length is even when working in 16
+		 * bit mode*/
+		if ((t->bits_per_word == 16) && (t->len & 1)) {
+			dev_err(&spi->dev,
+				"message rejected : "
+				"odd data length %d while in 16 bit mode\n",
+				t->len);
+			status = -EIO;
+			goto msg_done;
+		}
 
-		if (status < 0)
+		if (t->speed_hz && t->speed_hz < orion_spi->min_speed) {
+			dev_err(&spi->dev,
+				"message rejected : "
+				"device min speed (%d Hz) exceeds "
+				"required transfer speed (%d Hz)\n",
+				orion_spi->min_speed, t->speed_hz);
+			status = -EIO;
 			goto msg_done;
+		}
 
-		list_for_each_entry(t, &m->transfers, transfer_list) {
-			if (par_override || t->speed_hz || t->bits_per_word) {
-				par_override = 1;
-				status = orion_spi_setup_transfer(spi, t);
-				if (status < 0)
-					break;
-				if (!t->speed_hz && !t->bits_per_word)
-					par_override = 0;
-			}
-
-			if (!cs_active) {
-				orion_spi_set_cs(orion_spi, 1);
-				cs_active = 1;
-			}
-
-			if (t->len)
-				m->actual_length +=
-					orion_spi_write_read(spi, t);
-
-			if (t->delay_usecs)
-				udelay(t->delay_usecs);
-
-			if (t->cs_change) {
-				orion_spi_set_cs(orion_spi, 0);
-				cs_active = 0;
-			}
+		if (par_override || t->speed_hz || t->bits_per_word) {
+			par_override = 1;
+			status = orion_spi_setup_transfer(spi, t);
+			if (status < 0)
+				break;
+			if (!t->speed_hz && !t->bits_per_word)
+				par_override = 0;
 		}
 
-msg_done:
-		if (cs_active)
-			orion_spi_set_cs(orion_spi, 0);
+		if (!cs_active) {
+			orion_spi_set_cs(orion_spi, 1);
+			cs_active = 1;
+		}
 
-		m->status = status;
-		m->complete(m->context);
+		if (t->len)
+			m->actual_length += orion_spi_write_read(spi, t);
 
-		spin_lock_irq(&orion_spi->lock);
+		if (t->delay_usecs)
+			udelay(t->delay_usecs);
+
+		if (t->cs_change) {
+			orion_spi_set_cs(orion_spi, 0);
+			cs_active = 0;
+		}
 	}
 
-	spin_unlock_irq(&orion_spi->lock);
+msg_done:
+	if (cs_active)
+		orion_spi_set_cs(orion_spi, 0);
+
+	m->status = status;
+	spi_finalize_current_message(master);
+
+	return 0;
 }
 
 static int __init orion_spi_reset(struct orion_spi *orion_spi)
@@ -376,75 +373,6 @@ static int orion_spi_setup(struct spi_device *spi)
 	return 0;
 }
 
-static int orion_spi_transfer(struct spi_device *spi, struct spi_message *m)
-{
-	struct orion_spi *orion_spi;
-	struct spi_transfer *t = NULL;
-	unsigned long flags;
-
-	m->actual_length = 0;
-	m->status = 0;
-
-	/* reject invalid messages and transfers */
-	if (list_empty(&m->transfers) || !m->complete)
-		return -EINVAL;
-
-	orion_spi = spi_master_get_devdata(spi->master);
-
-	list_for_each_entry(t, &m->transfers, transfer_list) {
-		unsigned int bits_per_word = spi->bits_per_word;
-
-		if (t->tx_buf == NULL && t->rx_buf == NULL && t->len) {
-			dev_err(&spi->dev,
-				"message rejected : "
-				"invalid transfer data buffers\n");
-			goto msg_rejected;
-		}
-
-		if (t->bits_per_word)
-			bits_per_word = t->bits_per_word;
-
-		if ((bits_per_word != 8) && (bits_per_word != 16)) {
-			dev_err(&spi->dev,
-				"message rejected : "
-				"invalid transfer bits_per_word (%d bits)\n",
-				bits_per_word);
-			goto msg_rejected;
-		}
-		/*make sure buffer length is even when working in 16 bit mode*/
-		if ((t->bits_per_word == 16) && (t->len & 1)) {
-			dev_err(&spi->dev,
-				"message rejected : "
-				"odd data length (%d) while in 16 bit mode\n",
-				t->len);
-			goto msg_rejected;
-		}
-
-		if (t->speed_hz && t->speed_hz < orion_spi->min_speed) {
-			dev_err(&spi->dev,
-				"message rejected : "
-				"device min speed (%d Hz) exceeds "
-				"required transfer speed (%d Hz)\n",
-				orion_spi->min_speed, t->speed_hz);
-			goto msg_rejected;
-		}
-	}
-
-
-	spin_lock_irqsave(&orion_spi->lock, flags);
-	list_add_tail(&m->queue, &orion_spi->msg_queue);
-	queue_work(orion_spi_wq, &orion_spi->work);
-	spin_unlock_irqrestore(&orion_spi->lock, flags);
-
-	return 0;
-msg_rejected:
-	/* Message rejected and not queued */
-	m->status = -EINVAL;
-	if (m->complete)
-		m->complete(m->context);
-	return -EINVAL;
-}
-
 static int __init orion_spi_probe(struct platform_device *pdev)
 {
 	struct spi_master *master;
@@ -469,7 +397,7 @@ static int __init orion_spi_probe(struct platform_device *pdev)
 	master->mode_bits = 0;
 
 	master->setup = orion_spi_setup;
-	master->transfer = orion_spi_transfer;
+	master->transfer_one_message = orion_spi_transfer_one_message;
 	master->num_chipselect = ORION_NUM_CHIPSELECTS;
 
 	dev_set_drvdata(&pdev->dev, master);
@@ -503,11 +431,6 @@ static int __init orion_spi_probe(struct platform_device *pdev)
 	}
 	spi->base = ioremap(r->start, SZ_1K);
 
-	INIT_WORK(&spi->work, orion_spi_work);
-
-	spin_lock_init(&spi->lock);
-	INIT_LIST_HEAD(&spi->msg_queue);
-
 	if (orion_spi_reset(spi) < 0)
 		goto out_rel_mem;
 
@@ -531,14 +454,12 @@ out:
 static int __exit orion_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master;
-	struct orion_spi *spi;
 	struct resource *r;
+	struct orion_spi *spi;
 
 	master = dev_get_drvdata(&pdev->dev);
 	spi = spi_master_get_devdata(master);
 
-	cancel_work_sync(&spi->work);
-
 	clk_disable_unprepare(spi->clk);
 	clk_put(spi->clk);
 
@@ -562,21 +483,13 @@ static struct platform_driver orion_spi_driver = {
 
 static int __init orion_spi_init(void)
 {
-	orion_spi_wq = create_singlethread_workqueue(
-				orion_spi_driver.driver.name);
-	if (orion_spi_wq == NULL)
-		return -ENOMEM;
-
 	return platform_driver_probe(&orion_spi_driver, orion_spi_probe);
 }
 module_init(orion_spi_init);
 
 static void __exit orion_spi_exit(void)
 {
-	flush_workqueue(orion_spi_wq);
 	platform_driver_unregister(&orion_spi_driver);
-
-	destroy_workqueue(orion_spi_wq);
 }
 module_exit(orion_spi_exit);
 
-- 
1.7.10

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

* [PATCH 3/16] ARM: Kirkwood: Ensure runit clock always ticks.
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
  2012-07-20 17:35 ` [PATCH 1/16] ARM: Orion: DT support for IRQ and GPIO Controllers Andrew Lunn
  2012-07-20 17:35 ` [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  2012-07-20 17:35 ` [PATCH 4/16] ARM: Orion: Add arch support needed for I2C via DT Andrew Lunn
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Marvell engineers tell us:

	It seems that many units use the RUNIT clock.
	SPI, UART, NAND, TWSI, ...
	So it's not possible to clock gate it.

Currently the SPI, NAND and TWSI driver will clk_prepaure_enable()
this clk, but since we have no idea what ... is, and turning this clk
off results in a hard lock, unconditionally enable runit.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Simon Baatz <gmbnomis@gmail.com>
---
 arch/arm/mach-kirkwood/common.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index f261cd2..3de2d6d 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -241,6 +241,11 @@ void __init kirkwood_clk_init(void)
 	orion_clkdev_add("0", "pcie", pex0);
 	orion_clkdev_add("1", "pcie", pex1);
 	orion_clkdev_add(NULL, "kirkwood-i2s", audio);
+
+	/* Marvell says runit is used by SPI, UART, NAND, TWSI, ...,
+	 * so should never be gated.
+	 */
+	clk_prepare_enable(runit);
 }
 
 /*****************************************************************************
-- 
1.7.10

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

* [PATCH 4/16] ARM: Orion: Add arch support needed for I2C via DT.
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
                   ` (2 preceding siblings ...)
  2012-07-20 17:35 ` [PATCH 3/16] ARM: Kirkwood: Ensure runit clock always ticks Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  2012-07-20 17:35 ` [PATCH 5/16] Kirkwood: Add basic device tree support for QNAP TS219 Andrew Lunn
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

The MV64XXX I2C driver needs a clock in order to calculate the baud
rate factors. So add an clk to the clk tree. Also add the base DT
properties for kirkwood devices.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 arch/arm/boot/dts/kirkwood.dtsi   |   10 ++++++++++
 arch/arm/mach-kirkwood/board-dt.c |    2 ++
 arch/arm/mach-kirkwood/common.c   |    2 ++
 arch/arm/plat-orion/common.c      |    1 +
 4 files changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index a3350fd..e13d746 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -82,5 +82,15 @@
 			/* set partition map and/or chip-delay in board dts */
 			status = "disabled";
 		};
+
+		i2c at 11000 {
+			compatible = "marvell,mv64xxx-i2c";
+			reg = <0x11000 0x20>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			interrupts = <29>;
+			clock-frequency = <100000>;
+			status = "disabled";
+		};
 	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 8f8da5d..24c8fdd 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -28,6 +28,8 @@ static struct of_device_id kirkwood_dt_match_table[] __initdata = {
 
 struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL),
+	OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0",
+		       NULL),
 	{},
 };
 
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 3de2d6d..df8079e 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -17,6 +17,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/clk-provider.h>
 #include <linux/spinlock.h>
+#include <linux/mv643xx_i2c.h>
 #include <net/dsa.h>
 #include <asm/page.h>
 #include <asm/timex.h>
@@ -241,6 +242,7 @@ void __init kirkwood_clk_init(void)
 	orion_clkdev_add("0", "pcie", pex0);
 	orion_clkdev_add("1", "pcie", pex1);
 	orion_clkdev_add(NULL, "kirkwood-i2s", audio);
+	orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".0", runit);
 
 	/* Marvell says runit is used by SPI, UART, NAND, TWSI, ...,
 	 * so should never be gated.
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index c179378..d245a87 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -47,6 +47,7 @@ void __init orion_clkdev_init(struct clk *tclk)
 	orion_clkdev_add(NULL, MV643XX_ETH_NAME ".2", tclk);
 	orion_clkdev_add(NULL, MV643XX_ETH_NAME ".3", tclk);
 	orion_clkdev_add(NULL, "orion_wdt", tclk);
+	orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".0", tclk);
 }
 
 /* Fill in the resources structure and link it into the platform
-- 
1.7.10

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

* [PATCH 5/16] Kirkwood: Add basic device tree support for QNAP TS219.
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
                   ` (3 preceding siblings ...)
  2012-07-20 17:35 ` [PATCH 4/16] ARM: Orion: Add arch support needed for I2C via DT Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  2012-07-20 17:35 ` [PATCH 6/16] ARM: Orion: DTify the watchdog timer Andrew Lunn
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

The two different variants of QNAP TS devices, varying by SoC, put the
GPIO keys on different GPIO lines. Hence we need two different DT
board descriptions, which share the same board-ts219.c file.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-ts219-6281.dts |   21 +++++++
 arch/arm/boot/dts/kirkwood-ts219-6282.dts |   21 +++++++
 arch/arm/boot/dts/kirkwood-ts219.dtsi     |   74 ++++++++++++++++++++++++
 arch/arm/mach-kirkwood/Kconfig            |   14 +++++
 arch/arm/mach-kirkwood/Makefile           |    1 +
 arch/arm/mach-kirkwood/Makefile.boot      |    1 +
 arch/arm/mach-kirkwood/board-dt.c         |    4 ++
 arch/arm/mach-kirkwood/board-ts219.c      |   87 +++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/common.h           |    5 ++
 9 files changed, 228 insertions(+)
 create mode 100644 arch/arm/boot/dts/kirkwood-ts219-6281.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-ts219-6282.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-ts219.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-ts219.c

diff --git a/arch/arm/boot/dts/kirkwood-ts219-6281.dts b/arch/arm/boot/dts/kirkwood-ts219-6281.dts
new file mode 100644
index 0000000..ccbf327
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ts219-6281.dts
@@ -0,0 +1,21 @@
+/dts-v1/;
+
+/include/ "kirkwood-ts219.dtsi"
+
+/ {
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		button at 1 {
+			label = "USB Copy";
+			linux,code = <133>;
+			gpios = <&gpio0 15 1>;
+		};
+		button at 2 {
+			label = "Reset";
+			linux,code = <0x198>;
+			gpios = <&gpio0 16 1>;
+		};
+	};
+};
\ No newline at end of file
diff --git a/arch/arm/boot/dts/kirkwood-ts219-6282.dts b/arch/arm/boot/dts/kirkwood-ts219-6282.dts
new file mode 100644
index 0000000..fbe9932
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ts219-6282.dts
@@ -0,0 +1,21 @@
+/dts-v1/;
+
+/include/ "kirkwood-ts219.dtsi"
+
+/ {
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		button at 1 {
+			label = "USB Copy";
+			linux,code = <133>;
+			gpios = <&gpio1 11 1>;
+		};
+		button at 2 {
+			label = "Reset";
+			linux,code = <0x198>;
+			gpios = <&gpio1 5 1>;
+		};
+	};
+};
\ No newline at end of file
diff --git a/arch/arm/boot/dts/kirkwood-ts219.dtsi b/arch/arm/boot/dts/kirkwood-ts219.dtsi
new file mode 100644
index 0000000..7b3f961
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ts219.dtsi
@@ -0,0 +1,74 @@
+/include/ "kirkwood.dtsi"
+
+/ {
+	model = "QNAP TS219 family";
+	compatible = "qnap,ts219", "mrvl,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8";
+	};
+
+	ocp at f1000000 {
+		i2c at 11000 {
+			status = "okay";
+			clock-frequency = <400000>;
+
+			s35390a: s35390a at 30 {
+				compatible = "s35390a";
+				reg = <0x30>;
+			};
+		};
+		serial at 12000 {
+			clock-frequency = <200000000>;
+			status = "okay";
+		};
+		serial at 12100 {
+			clock-frequency = <200000000>;
+			status = "okay";
+		};
+		spi at 10600 {
+			status = "okay";
+
+			m25p128 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "m25p128";
+				reg = <0>;
+				spi-max-frequency = <20000000>;
+				mode = <0>;
+
+				partition at 0000000 {
+					reg = <0x00000000 0x00080000>;
+					label = "U-Boot";
+				};
+
+				partition at 00200000 {
+					reg = <0x00200000 0x00200000>;
+					label = "Kernel";
+				};
+
+				partition at 00400000 {
+					reg = <0x00400000 0x00900000>;
+					label = "RootFS1";
+				};
+				partition at 00d00000 {
+					reg = <0x00d00000 0x00300000>;
+					label = "RootFS2";
+				};
+				partition at 00040000 {
+					reg = <0x00080000 0x00040000>;
+					label = "U-Boot Config";
+				};
+				partition at 000c0000 {
+					reg = <0x000c0000 0x00140000>;
+					label = "NAS Config";
+				};
+			};
+		};
+	};
+};
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 199764f..8e62fa7 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -80,6 +80,20 @@ config MACH_IB62X0_DT
 	  RaidSonic IB-NAS6210 & IB-NAS6220 devices, using
 	  Flattened Device Tree.
 
+config MACH_TS219_DT
+	bool "Device Tree for QNAP TS-11X, TS-21X NAS"
+	select ARCH_KIRKWOOD_DT
+	select ARM_APPENDED_DTB
+	select ARM_ATAG_DTB_COMPAT
+	help
+	  Say 'Y' here if you want your kernel to support the QNAP
+	  TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and
+	  TS-219P+ Turbo NAS devices using Fattened Device Tree.
+	  There are two different Device Tree descriptions, depending
+	  on if the device is based on an if the board uses the MV6281
+	  or MV6282. If you have the wrong one, the buttons will not
+	  work.
+
 config MACH_TS219
 	bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
 	help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index d2b0590..8b02328 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -25,3 +25,4 @@ obj-$(CONFIG_MACH_DREAMPLUG_DT)		+= board-dreamplug.o
 obj-$(CONFIG_MACH_ICONNECT_DT)		+= board-iconnect.o
 obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
 obj-$(CONFIG_MACH_IB62X0_DT)		+= board-ib62x0.o
+obj-$(CONFIG_MACH_TS219_DT)		+= board-ts219.o tsx1x-common.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 02edbdf..4a1f66a 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -7,3 +7,4 @@ dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns320.dtb
 dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns325.dtb
 dtb-$(CONFIG_MACH_ICONNECT_DT) += kirkwood-iconnect.dtb
 dtb-$(CONFIG_MACH_IB62X0_DT) += kirkwood-ib62x0.dtb
+dtb-$(CONFIG_MACH_TS219_DT)	+= kirkwood-qnap-ts219.dtb
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 24c8fdd..b7cd6d2 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -76,6 +76,9 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
 		ib62x0_init();
 
+	if (of_machine_is_compatible("qnap,ts219"))
+		qnap_dt_ts219_init();
+
 	of_platform_populate(NULL, kirkwood_dt_match_table,
 			     kirkwood_auxdata_lookup, NULL);
 }
@@ -86,6 +89,7 @@ static const char *kirkwood_dt_board_compat[] = {
 	"dlink,dns-325",
 	"iom,iconnect",
 	"raidsonic,ib-nas62x0",
+	"qnap,ts219",
 	NULL
 };
 
diff --git a/arch/arm/mach-kirkwood/board-ts219.c b/arch/arm/mach-kirkwood/board-ts219.c
new file mode 100644
index 0000000..00b79ea
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-ts219.c
@@ -0,0 +1,87 @@
+/*
+ *
+ * QNAP TS-11x/TS-21x Turbo NAS Board Setup via DT
+ *
+ * Copyright (C) 2012 Andrew Lunn <andrew@lunn.ch>
+ *
+ * Based on the board file ts219-setup.c:
+ *
+ * Copyright (C) 2009  Martin Michlmayr <tbm@cyrius.com>
+ * Copyright (C) 2008  Byron Bradley <byron.bbradley@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/ata_platform.h>
+#include <linux/gpio_keys.h>
+#include <linux/input.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include "common.h"
+#include "mpp.h"
+#include "tsx1x-common.h"
+
+static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
+};
+
+static struct mv_sata_platform_data qnap_ts219_sata_data = {
+	.n_ports	= 2,
+};
+
+static unsigned int qnap_ts219_mpp_config[] __initdata = {
+	MPP0_SPI_SCn,
+	MPP1_SPI_MOSI,
+	MPP2_SPI_SCK,
+	MPP3_SPI_MISO,
+	MPP4_SATA1_ACTn,
+	MPP5_SATA0_ACTn,
+	MPP8_TW0_SDA,
+	MPP9_TW0_SCK,
+	MPP10_UART0_TXD,
+	MPP11_UART0_RXD,
+	MPP13_UART1_TXD,	/* PIC controller */
+	MPP14_UART1_RXD,	/* PIC controller */
+	MPP15_GPIO,		/* USB Copy button (on devices with 88F6281) */
+	MPP16_GPIO,		/* Reset button (on devices with 88F6281) */
+	MPP36_GPIO,		/* RAM: 0: 256 MB, 1: 512 MB */
+	MPP37_GPIO,		/* Reset button (on devices with 88F6282) */
+	MPP43_GPIO,		/* USB Copy button (on devices with 88F6282) */
+	MPP44_GPIO,		/* Board ID: 0: TS-11x, 1: TS-21x */
+	0
+};
+
+void __init qnap_dt_ts219_init(void)
+{
+	u32 dev, rev;
+
+	kirkwood_mpp_conf(qnap_ts219_mpp_config);
+
+	kirkwood_pcie_id(&dev, &rev);
+	if (dev == MV88F6282_DEV_ID)
+		qnap_ts219_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
+
+	kirkwood_ge00_init(&qnap_ts219_ge00_data);
+	kirkwood_sata_init(&qnap_ts219_sata_data);
+	kirkwood_ehci_init();
+
+	pm_power_off = qnap_tsx1x_power_off;
+}
+
+/* FIXME: Will not work with DT. Maybe use MPP40_GPIO? */
+static int __init ts219_pci_init(void)
+{
+	if (machine_is_ts219())
+		kirkwood_pcie_init(KW_PCIE0);
+
+	return 0;
+}
+subsys_initcall(ts219_pci_init);
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 9248fa2..e0c2324 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -58,6 +58,11 @@ void dreamplug_init(void);
 #else
 static inline void dreamplug_init(void) {};
 #endif
+#ifdef CONFIG_MACH_TS219_DT
+void qnap_dt_ts219_init(void);
+#else
+static inline void qnap_dt_ts219_init(void) {};
+#endif
 
 #ifdef CONFIG_MACH_DLINK_KIRKWOOD_DT
 void dnskw_init(void);
-- 
1.7.10

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

* [PATCH 6/16] ARM: Orion: DTify the watchdog timer.
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
                   ` (4 preceding siblings ...)
  2012-07-20 17:35 ` [PATCH 5/16] Kirkwood: Add basic device tree support for QNAP TS219 Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  2012-07-20 17:35 ` [PATCH 7/16] ATA: sata_mv: Add device tree support Andrew Lunn
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Add device tree support to the Orion watchdog timer, and enable its
use in the kirkwood devices using device tree.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com>
Tested-by: Simon Baatz <gmbnomis@gmail.com>
---
 Documentation/devicetree/bindings/watchdog/marvel.txt |   14 ++++++++++++++
 arch/arm/boot/dts/kirkwood.dtsi                       |    6 ++++++
 arch/arm/mach-kirkwood/board-dt.c                     |    2 +-
 drivers/watchdog/orion_wdt.c                          |    8 ++++++++
 4 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/watchdog/marvel.txt

diff --git a/Documentation/devicetree/bindings/watchdog/marvel.txt b/Documentation/devicetree/bindings/watchdog/marvel.txt
new file mode 100644
index 0000000..0b2503a
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/marvel.txt
@@ -0,0 +1,14 @@
+* Marvell Orion Watchdog Time
+
+Required Properties:
+
+- Compatibility : "marvell,orion-wdt"
+- reg		: Address of the timer registers
+
+Example:
+
+	wdt at 20300 {
+		compatible = "marvell,orion-wdt";
+		reg = <0x20300 0x28>;
+		status = "okay";
+	};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index e13d746..3e0e9b9 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -70,6 +70,12 @@
 			status = "disabled";
 		};
 
+		wdt at 20300 {
+			compatible = "marvell,orion-wdt";
+			reg = <0x20300 0x28>;
+			status = "okay";
+		};
+
 		nand at 3000000 {
 			#address-cells = <1>;
 			#size-cells = <1>;
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index b7cd6d2..73e75cf 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -30,6 +30,7 @@ struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL),
 	OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0",
 		       NULL),
+	OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
 	{},
 };
 
@@ -55,7 +56,6 @@ static void __init kirkwood_dt_init(void)
 	kirkwood_clk_init();
 
 	/* internal devices that every board has */
-	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
 	kirkwood_crypto_init();
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 0f57369..1531e02 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -25,6 +25,7 @@
 #include <linux/io.h>
 #include <linux/spinlock.h>
 #include <linux/clk.h>
+#include <linux/of.h>
 #include <mach/bridge-regs.h>
 
 /*
@@ -295,6 +296,12 @@ static void orion_wdt_shutdown(struct platform_device *pdev)
 		orion_wdt_disable();
 }
 
+static const struct of_device_id orion_wdt_of_match_table[] __devinitdata = {
+	{ .compatible = "marvell,orion-wdt", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, orion_wdt_of_match_table);
+
 static struct platform_driver orion_wdt_driver = {
 	.probe		= orion_wdt_probe,
 	.remove		= __devexit_p(orion_wdt_remove),
@@ -302,6 +309,7 @@ static struct platform_driver orion_wdt_driver = {
 	.driver		= {
 		.owner	= THIS_MODULE,
 		.name	= "orion_wdt",
+		.of_match_table = of_match_ptr(orion_wdt_of_match_table),
 	},
 };
 
-- 
1.7.10

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

* [PATCH 7/16] ATA: sata_mv: Add device tree support
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
                   ` (5 preceding siblings ...)
  2012-07-20 17:35 ` [PATCH 6/16] ARM: Orion: DTify the watchdog timer Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  2012-07-20 17:35 ` [PATCH 8/16] ARM: Kirkwood: Use DT to configure SATA device Andrew Lunn
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Add support for instantiating this driver from device tree, and add
the necassary DT information to the kirkwood.dtsi file.

This is based on previous work by Michael Walle and Jason Cooper.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Josh Coombs <josh.coombs@gmail.com>
---
 Documentation/devicetree/bindings/ata/marvell.txt |   16 ++++++++
 arch/arm/boot/dts/kirkwood.dtsi                   |    7 ++++
 arch/arm/mach-kirkwood/board-dt.c                 |    1 +
 drivers/ata/sata_mv.c                             |   42 ++++++++++++++-------
 4 files changed, 53 insertions(+), 13 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/ata/marvell.txt

diff --git a/Documentation/devicetree/bindings/ata/marvell.txt b/Documentation/devicetree/bindings/ata/marvell.txt
new file mode 100644
index 0000000..b5cdd20
--- /dev/null
+++ b/Documentation/devicetree/bindings/ata/marvell.txt
@@ -0,0 +1,16 @@
+* Marvell Orion SATA
+
+Required Properties:
+- compatibility : "marvell,orion-sata"
+- reg           : Address range of controller
+- interrupts    : Interrupt controller is using
+- nr-ports      : Number of SATA ports in use.
+
+Example:
+
+	sata at 80000 {
+		compatible = "marvell,orion-sata";
+		reg = <0x80000 0x5000>;
+		interrupts = <21>;
+		nr-ports = <2>;
+	}
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 3e0e9b9..fbb96ce 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -76,6 +76,13 @@
 			status = "okay";
 		};
 
+		sata at 80000 {
+			compatible = "marvell,orion-sata";
+			reg = <0x80000 0x5000>;
+			interrupts = <21>;
+			status = "disabled";
+		};
+
 		nand at 3000000 {
 			#address-cells = <1>;
 			#size-cells = <1>;
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 73e75cf..d0ad250 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -31,6 +31,7 @@ struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0",
 		       NULL),
 	OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
+	OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL),
 	{},
 };
 
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 24712ad..311be18 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -65,6 +65,8 @@
 #include <linux/mbus.h>
 #include <linux/bitops.h>
 #include <linux/gfp.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_device.h>
@@ -4026,7 +4028,7 @@ static int mv_platform_probe(struct platform_device *pdev)
 	struct ata_host *host;
 	struct mv_host_priv *hpriv;
 	struct resource *res;
-	int n_ports = 0;
+	int n_ports = 0, irq = 0;
 	int rc;
 #if defined(CONFIG_HAVE_CLK)
 	int port;
@@ -4050,8 +4052,14 @@ static int mv_platform_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	/* allocate host */
-	mv_platform_data = pdev->dev.platform_data;
-	n_ports = mv_platform_data->n_ports;
+	if (pdev->dev.of_node) {
+		of_property_read_u32(pdev->dev.of_node, "nr-ports", &n_ports);
+		irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
+	} else {
+		mv_platform_data = pdev->dev.platform_data;
+		n_ports = mv_platform_data->n_ports;
+		irq = platform_get_irq(pdev, 0);
+	}
 
 	host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports);
 	hpriv = devm_kzalloc(&pdev->dev, sizeof(*hpriv), GFP_KERNEL);
@@ -4109,8 +4117,7 @@ static int mv_platform_probe(struct platform_device *pdev)
 	dev_info(&pdev->dev, "slots %u ports %d\n",
 		 (unsigned)MV_MAX_Q_DEPTH, host->n_ports);
 
-	rc = ata_host_activate(host, platform_get_irq(pdev, 0), mv_interrupt,
-			       IRQF_SHARED, &mv6_sht);
+	rc = ata_host_activate(host, irq, mv_interrupt, IRQF_SHARED, &mv6_sht);
 	if (!rc)
 		return 0;
 
@@ -4205,15 +4212,24 @@ static int mv_platform_resume(struct platform_device *pdev)
 #define mv_platform_resume NULL
 #endif
 
+#ifdef CONFIG_OF
+static struct of_device_id mv_sata_dt_ids[] __devinitdata = {
+	{ .compatible = "marvell,orion-sata", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, mv_sata_dt_ids);
+#endif
+
 static struct platform_driver mv_platform_driver = {
-	.probe			= mv_platform_probe,
-	.remove			= __devexit_p(mv_platform_remove),
-	.suspend		= mv_platform_suspend,
-	.resume			= mv_platform_resume,
-	.driver			= {
-				   .name = DRV_NAME,
-				   .owner = THIS_MODULE,
-				  },
+	.probe		= mv_platform_probe,
+	.remove		= __devexit_p(mv_platform_remove),
+	.suspend	= mv_platform_suspend,
+	.resume		= mv_platform_resume,
+	.driver		= {
+		.name = DRV_NAME,
+		.owner = THIS_MODULE,
+		.of_match_table = of_match_ptr(mv_sata_dt_ids),
+	},
 };
 
 
-- 
1.7.10

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

* [PATCH 8/16] ARM: Kirkwood: Use DT to configure SATA device.
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
                   ` (6 preceding siblings ...)
  2012-07-20 17:35 ` [PATCH 7/16] ATA: sata_mv: Add device tree support Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  2012-07-20 17:35 ` [PATCH 9/16] ARM: Kirkwood: Describe DNS325 temperature sensor in DT Andrew Lunn
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Convert boards using DT, but the old way of configuring SATA to now
use properties in there DT file.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Simon Baatz <gmbnomis@gmail.com>
---
 arch/arm/boot/dts/kirkwood-dns320.dts    |    5 +++++
 arch/arm/boot/dts/kirkwood-dns325.dts    |    5 +++++
 arch/arm/boot/dts/kirkwood-dreamplug.dts |    5 +++++
 arch/arm/boot/dts/kirkwood-ib62x0.dts    |    5 +++++
 arch/arm/boot/dts/kirkwood-ts219.dtsi    |    4 ++++
 arch/arm/mach-kirkwood/board-dnskw.c     |    5 -----
 arch/arm/mach-kirkwood/board-dreamplug.c |    5 -----
 arch/arm/mach-kirkwood/board-ib62x0.c    |    5 -----
 arch/arm/mach-kirkwood/board-ts219.c     |    5 -----
 9 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dns320.dts b/arch/arm/boot/dts/kirkwood-dns320.dts
index dc09a73..f2a9808 100644
--- a/arch/arm/boot/dts/kirkwood-dns320.dts
+++ b/arch/arm/boot/dts/kirkwood-dns320.dts
@@ -26,6 +26,11 @@
 			status = "okay";
 		};
 
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
+
 		nand at 3000000 {
 			status = "okay";
 
diff --git a/arch/arm/boot/dts/kirkwood-dns325.dts b/arch/arm/boot/dts/kirkwood-dns325.dts
index c2a5562..10bc819 100644
--- a/arch/arm/boot/dts/kirkwood-dns325.dts
+++ b/arch/arm/boot/dts/kirkwood-dns325.dts
@@ -21,6 +21,11 @@
 			status = "okay";
 		};
 
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
+
 		nand at 3000000 {
 			status = "okay";
 
diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index d74d1ae..24de2b5 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -48,6 +48,11 @@
 				};
 			};
 		};
+
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <1>;
+		};
 	};
 
 };
diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts
index ada0f0c..f8e2bc6 100644
--- a/arch/arm/boot/dts/kirkwood-ib62x0.dts
+++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts
@@ -21,6 +21,11 @@
 			status = "okay";
 		};
 
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
+
 		nand at 3000000 {
 			status = "okay";
 
diff --git a/arch/arm/boot/dts/kirkwood-ts219.dtsi b/arch/arm/boot/dts/kirkwood-ts219.dtsi
index 7b3f961..b4a789a 100644
--- a/arch/arm/boot/dts/kirkwood-ts219.dtsi
+++ b/arch/arm/boot/dts/kirkwood-ts219.dtsi
@@ -70,5 +70,9 @@
 				};
 			};
 		};
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
 	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
index 58c2d68..179f4b3 100644
--- a/arch/arm/mach-kirkwood/board-dnskw.c
+++ b/arch/arm/mach-kirkwood/board-dnskw.c
@@ -35,10 +35,6 @@ static struct mv643xx_eth_platform_data dnskw_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
 };
 
-static struct mv_sata_platform_data dnskw_sata_data = {
-	.n_ports	= 2,
-};
-
 static unsigned int dnskw_mpp_config[] __initdata = {
 	MPP13_UART1_TXD,	/* Custom ... */
 	MPP14_UART1_RXD,	/* ... Controller (DNS-320 only) */
@@ -245,7 +241,6 @@ void __init dnskw_init(void)
 
 	kirkwood_ehci_init();
 	kirkwood_ge00_init(&dnskw_ge00_data);
-	kirkwood_sata_init(&dnskw_sata_data);
 	kirkwood_i2c_init();
 
 	platform_device_register(&dnskw_button_device);
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
index eb0e4d5..e494393 100644
--- a/arch/arm/mach-kirkwood/board-dreamplug.c
+++ b/arch/arm/mach-kirkwood/board-dreamplug.c
@@ -43,10 +43,6 @@ static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
 };
 
-static struct mv_sata_platform_data dreamplug_sata_data = {
-	.n_ports	= 1,
-};
-
 static struct mvsdio_platform_data dreamplug_mvsdio_data = {
 	/* unfortunately the CD signal has not been connected */
 };
@@ -103,7 +99,6 @@ void __init dreamplug_init(void)
 	kirkwood_ehci_init();
 	kirkwood_ge00_init(&dreamplug_ge00_data);
 	kirkwood_ge01_init(&dreamplug_ge01_data);
-	kirkwood_sata_init(&dreamplug_sata_data);
 	kirkwood_sdio_init(&dreamplug_mvsdio_data);
 
 	platform_device_register(&dreamplug_leds);
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c
index eddf1df..56d198e 100644
--- a/arch/arm/mach-kirkwood/board-ib62x0.c
+++ b/arch/arm/mach-kirkwood/board-ib62x0.c
@@ -33,10 +33,6 @@ static struct mv643xx_eth_platform_data ib62x0_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
 };
 
-static struct mv_sata_platform_data ib62x0_sata_data = {
-	.n_ports	= 2,
-};
-
 static unsigned int ib62x0_mpp_config[] __initdata = {
 	MPP0_NF_IO2,
 	MPP1_NF_IO3,
@@ -132,7 +128,6 @@ void __init ib62x0_init(void)
 
 	kirkwood_ehci_init();
 	kirkwood_ge00_init(&ib62x0_ge00_data);
-	kirkwood_sata_init(&ib62x0_sata_data);
 	platform_device_register(&ib62x0_led_device);
 	platform_device_register(&ib62x0_button_device);
 	if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 &&
diff --git a/arch/arm/mach-kirkwood/board-ts219.c b/arch/arm/mach-kirkwood/board-ts219.c
index 00b79ea..1750e68 100644
--- a/arch/arm/mach-kirkwood/board-ts219.c
+++ b/arch/arm/mach-kirkwood/board-ts219.c
@@ -33,10 +33,6 @@ static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
 };
 
-static struct mv_sata_platform_data qnap_ts219_sata_data = {
-	.n_ports	= 2,
-};
-
 static unsigned int qnap_ts219_mpp_config[] __initdata = {
 	MPP0_SPI_SCn,
 	MPP1_SPI_MOSI,
@@ -70,7 +66,6 @@ void __init qnap_dt_ts219_init(void)
 		qnap_ts219_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
 
 	kirkwood_ge00_init(&qnap_ts219_ge00_data);
-	kirkwood_sata_init(&qnap_ts219_sata_data);
 	kirkwood_ehci_init();
 
 	pm_power_off = qnap_tsx1x_power_off;
-- 
1.7.10

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

* [PATCH 9/16] ARM: Kirkwood: Describe DNS325 temperature sensor in DT.
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
                   ` (7 preceding siblings ...)
  2012-07-20 17:35 ` [PATCH 8/16] ARM: Kirkwood: Use DT to configure SATA device Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  2012-07-20 17:35 ` [PATCH 10/16] ARM: Kirkwood: Describe IB62x0 gpio-keys " Andrew Lunn
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Now that we have I2C support in DT, describe the LM75 in
the DT file for the DNS325.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
---
 arch/arm/boot/dts/kirkwood-dns325.dts |    8 ++++++++
 arch/arm/mach-kirkwood/board-dnskw.c  |   15 ++-------------
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dns325.dts b/arch/arm/boot/dts/kirkwood-dns325.dts
index 10bc819..e040d6c 100644
--- a/arch/arm/boot/dts/kirkwood-dns325.dts
+++ b/arch/arm/boot/dts/kirkwood-dns325.dts
@@ -16,6 +16,14 @@
 	};
 
 	ocp at f1000000 {
+		i2c at 11000 {
+			status = "okay";
+
+			lm75: lm75 at 48 {
+				compatible = "national,lm75";
+				reg = <0x48>;
+			};
+		};
 		serial at 12000 {
 			clock-frequency = <200000000>;
 			status = "okay";
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
index 179f4b3..1c97efa 100644
--- a/arch/arm/mach-kirkwood/board-dnskw.c
+++ b/arch/arm/mach-kirkwood/board-dnskw.c
@@ -14,7 +14,6 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/i2c.h>
 #include <linux/ata_platform.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/of.h>
@@ -153,13 +152,6 @@ static struct platform_device dns320_led_device = {
 	},
 };
 
-static struct i2c_board_info dns325_i2c_board_info[] __initdata = {
-	{
-		I2C_BOARD_INFO("lm75", 0x48),
-	},
-	/* Something at 0x0c also */
-};
-
 static struct gpio_keys_button dnskw_button_pins[] = {
 	{
 		.code		= KEY_POWER,
@@ -241,17 +233,14 @@ void __init dnskw_init(void)
 
 	kirkwood_ehci_init();
 	kirkwood_ge00_init(&dnskw_ge00_data);
-	kirkwood_i2c_init();
 
 	platform_device_register(&dnskw_button_device);
 	platform_device_register(&dnskw_fan_device);
 
-	if (of_machine_is_compatible("dlink,dns-325")) {
-		i2c_register_board_info(0, dns325_i2c_board_info,
-					ARRAY_SIZE(dns325_i2c_board_info));
+	if (of_machine_is_compatible("dlink,dns-325"))
 		platform_device_register(&dns325_led_device);
 
-	} else if (of_machine_is_compatible("dlink,dns-320"))
+	else if (of_machine_is_compatible("dlink,dns-320"))
 		platform_device_register(&dns320_led_device);
 
 	/* Register power-off GPIO. */
-- 
1.7.10

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

* [PATCH 10/16] ARM: Kirkwood: Describe IB62x0 gpio-keys in DT.
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
                   ` (8 preceding siblings ...)
  2012-07-20 17:35 ` [PATCH 9/16] ARM: Kirkwood: Describe DNS325 temperature sensor in DT Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  2012-07-20 17:35 ` [PATCH 11/16] ARM: Kirkwood: Describe iConnects temperature sensor " Andrew Lunn
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Now that the GPIO controllers have been converted over to DT,
described the gpio-keys in DT.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Simon Baatz <gmbnomis@gmail.com>
---
 arch/arm/boot/dts/kirkwood-ib62x0.dts |   16 ++++++++++++++++
 arch/arm/mach-kirkwood/board-ib62x0.c |   31 -------------------------------
 2 files changed, 16 insertions(+), 31 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts
index f8e2bc6..6726aa9 100644
--- a/arch/arm/boot/dts/kirkwood-ib62x0.dts
+++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts
@@ -46,4 +46,20 @@
 
 		};
 	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		button at 1 {
+			label = "USB Copy";
+			linux,code = <133>;
+			gpios = <&gpio0 29 1>;
+		};
+		button at 2 {
+			label = "Reset";
+			linux,code = <0x198>;
+			gpios = <&gpio0 28 1>;
+		};
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c
index 56d198e..f30065e 100644
--- a/arch/arm/mach-kirkwood/board-ib62x0.c
+++ b/arch/arm/mach-kirkwood/board-ib62x0.c
@@ -18,7 +18,6 @@
 #include <linux/ata_platform.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
-#include <linux/gpio_keys.h>
 #include <linux/input.h>
 #include <linux/leds.h>
 #include <asm/mach-types.h>
@@ -85,35 +84,6 @@ static struct platform_device ib62x0_led_device = {
 	}
 };
 
-static struct gpio_keys_button ib62x0_button_pins[] = {
-	{
-		.code		= KEY_COPY,
-		.gpio		= 29,
-		.desc		= "USB Copy",
-		.active_low	= 1,
-	},
-	{
-		.code		= KEY_RESTART,
-		.gpio		= 28,
-		.desc		= "Reset",
-		.active_low	= 1,
-	},
-};
-
-static struct gpio_keys_platform_data ib62x0_button_data = {
-	.buttons	= ib62x0_button_pins,
-	.nbuttons	= ARRAY_SIZE(ib62x0_button_pins),
-};
-
-static struct platform_device ib62x0_button_device = {
-	.name		= "gpio-keys",
-	.id		= -1,
-	.num_resources	= 0,
-	.dev		= {
-		.platform_data	= &ib62x0_button_data,
-	}
-};
-
 static void ib62x0_power_off(void)
 {
 	gpio_set_value(IB62X0_GPIO_POWER_OFF, 1);
@@ -129,7 +99,6 @@ void __init ib62x0_init(void)
 	kirkwood_ehci_init();
 	kirkwood_ge00_init(&ib62x0_ge00_data);
 	platform_device_register(&ib62x0_led_device);
-	platform_device_register(&ib62x0_button_device);
 	if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 &&
 	    gpio_direction_output(IB62X0_GPIO_POWER_OFF, 0) == 0)
 		pm_power_off = ib62x0_power_off;
-- 
1.7.10

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

* [PATCH 11/16] ARM: Kirkwood: Describe iConnects temperature sensor in DT.
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
                   ` (9 preceding siblings ...)
  2012-07-20 17:35 ` [PATCH 10/16] ARM: Kirkwood: Describe IB62x0 gpio-keys " Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  2012-07-20 17:35 ` [PATCH 12/16] ARM: Kirkwood: Describe Dreamplug LEDs " Andrew Lunn
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Now that we have I2C support in DT, describe the LM63 in
the DT file for the iConnect.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 arch/arm/boot/dts/kirkwood-iconnect.dts |    8 ++++++++
 arch/arm/mach-kirkwood/board-iconnect.c |   10 ----------
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
index 1ba75d4..a7dd07b 100644
--- a/arch/arm/boot/dts/kirkwood-iconnect.dts
+++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
@@ -18,6 +18,14 @@
 	};
 
 	ocp at f1000000 {
+		i2c at 11000 {
+			status = "okay";
+
+			lm63: lm63 at 4c {
+				compatible = "national,lm63";
+				reg = <0x4c>;
+			};
+		};
 		serial at 12000 {
 			clock-frequency = <200000000>;
 			status = "ok";
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
index b0d3cc4..df043aa 100644
--- a/arch/arm/mach-kirkwood/board-iconnect.c
+++ b/arch/arm/mach-kirkwood/board-iconnect.c
@@ -20,7 +20,6 @@
 #include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
 #include <linux/leds.h>
-#include <linux/i2c.h>
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
 #include <asm/mach/arch.h>
@@ -90,12 +89,6 @@ static unsigned int iconnect_mpp_config[] __initdata = {
 	0
 };
 
-static struct i2c_board_info __initdata iconnect_board_info[] = {
-	{
-		I2C_BOARD_INFO("lm63", 0x4c),
-	},
-};
-
 static struct mtd_partition iconnect_nand_parts[] = {
 	{
 		.name = "flash",
@@ -142,9 +135,6 @@ void __init iconnect_init(void)
 {
 	kirkwood_mpp_conf(iconnect_mpp_config);
 	kirkwood_nand_init(ARRAY_AND_SIZE(iconnect_nand_parts), 25);
-	kirkwood_i2c_init();
-	i2c_register_board_info(0, iconnect_board_info,
-		ARRAY_SIZE(iconnect_board_info));
 
 	kirkwood_ehci_init();
 	kirkwood_ge00_init(&iconnect_ge00_data);
-- 
1.7.10

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

* [PATCH 12/16] ARM: Kirkwood: Describe Dreamplug LEDs in DT.
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
                   ` (10 preceding siblings ...)
  2012-07-20 17:35 ` [PATCH 11/16] ARM: Kirkwood: Describe iConnects temperature sensor " Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  2012-07-20 17:35 ` [PATCH 13/16] ARM: Kirkwood: Describe GoFlex Net LEDs and SATA " Andrew Lunn
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 arch/arm/boot/dts/kirkwood-dreamplug.dts |   16 ++++++++++++++
 arch/arm/mach-kirkwood/board-dreamplug.c |   34 ------------------------------
 2 files changed, 16 insertions(+), 34 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 24de2b5..77fec4e 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -55,4 +55,20 @@
 		};
 	};
 
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		bluetooth {
+			label = "dreamplug:blue:bluetooth";
+			gpios = <&gpio1 15 1>;
+		};
+		wifi {
+			label = "dreamplug:green:wifi";
+			gpios = <&gpio1 16 1>;
+		};
+		wifi-ap {
+			label = "dreamplug:green:wifi_ap";
+			gpios = <&gpio1 17 1>;
+		};
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
index e494393..aeb234d 100644
--- a/arch/arm/mach-kirkwood/board-dreamplug.c
+++ b/arch/arm/mach-kirkwood/board-dreamplug.c
@@ -22,7 +22,6 @@
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/gpio.h>
-#include <linux/leds.h>
 #include <linux/mtd/physmap.h>
 #include <linux/spi/flash.h>
 #include <linux/spi/spi.h>
@@ -47,37 +46,6 @@ static struct mvsdio_platform_data dreamplug_mvsdio_data = {
 	/* unfortunately the CD signal has not been connected */
 };
 
-static struct gpio_led dreamplug_led_pins[] = {
-	{
-		.name			= "dreamplug:blue:bluetooth",
-		.gpio			= 47,
-		.active_low		= 1,
-	},
-	{
-		.name			= "dreamplug:green:wifi",
-		.gpio			= 48,
-		.active_low		= 1,
-	},
-	{
-		.name			= "dreamplug:green:wifi_ap",
-		.gpio			= 49,
-		.active_low		= 1,
-	},
-};
-
-static struct gpio_led_platform_data dreamplug_led_data = {
-	.leds		= dreamplug_led_pins,
-	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
-};
-
-static struct platform_device dreamplug_leds = {
-	.name	= "leds-gpio",
-	.id	= -1,
-	.dev	= {
-		.platform_data	= &dreamplug_led_data,
-	}
-};
-
 static unsigned int dreamplug_mpp_config[] __initdata = {
 	MPP0_SPI_SCn,
 	MPP1_SPI_MOSI,
@@ -100,6 +68,4 @@ void __init dreamplug_init(void)
 	kirkwood_ge00_init(&dreamplug_ge00_data);
 	kirkwood_ge01_init(&dreamplug_ge01_data);
 	kirkwood_sdio_init(&dreamplug_mvsdio_data);
-
-	platform_device_register(&dreamplug_leds);
 }
-- 
1.7.10

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

* [PATCH 13/16] ARM: Kirkwood: Describe GoFlex Net LEDs and SATA in DT.
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
                   ` (11 preceding siblings ...)
  2012-07-20 17:35 ` [PATCH 12/16] ARM: Kirkwood: Describe Dreamplug LEDs " Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  2012-07-20 17:35 ` [PATCH 14/16] ARM: Kirkwood: Describe ib62x0 LEDs " Andrew Lunn
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Josh Coombs <josh.coombs@gmail.com>
---
 arch/arm/boot/dts/kirkwood-goflexnet.dts |   50 ++++++++++++++++++
 arch/arm/mach-kirkwood/board-goflexnet.c |   84 ------------------------------
 2 files changed, 50 insertions(+), 84 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-goflexnet.dts b/arch/arm/boot/dts/kirkwood-goflexnet.dts
index c5d5a4e..f6974d1 100644
--- a/arch/arm/boot/dts/kirkwood-goflexnet.dts
+++ b/arch/arm/boot/dts/kirkwood-goflexnet.dts
@@ -45,5 +45,55 @@
 				reg = <0x02500000 0xd800000>;
 			};
 		};
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
+
+	};
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		health {
+			label = "status:green:health";
+			gpios = <&gpio1 14 1>;
+			linux,default-trigger = "default-on";
+		};
+		fault {
+			label = "status:orange:fault";
+			gpios = <&gpio1 15 1>;
+		};
+		left0 {
+			label = "status:white:left0";
+			gpios = <&gpio1 10 0>;
+		};
+		left1 {
+			label = "status:white:left1";
+			gpios = <&gpio1 11 0>;
+		};
+		left2 {
+			label = "status:white:left2";
+			gpios = <&gpio1 12 0>;
+		};
+		left3 {
+			label = "status:white:left3";
+			gpios = <&gpio1 13 0>;
+		};
+		right0 {
+			label = "status:white:right0";
+			gpios = <&gpio1 6 0>;
+		};
+		right1 {
+			label = "status:white:right1";
+			gpios = <&gpio1 7 0>;
+		};
+		right2 {
+			label = "status:white:right2";
+			gpios = <&gpio1 8 0>;
+		};
+		right3 {
+			label = "status:white:right3";
+			gpios = <&gpio1 9 0>;
+		};
 	};
 };
diff --git a/arch/arm/mach-kirkwood/board-goflexnet.c b/arch/arm/mach-kirkwood/board-goflexnet.c
index 3957ece..413e2c8 100644
--- a/arch/arm/mach-kirkwood/board-goflexnet.c
+++ b/arch/arm/mach-kirkwood/board-goflexnet.c
@@ -27,7 +27,6 @@
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/gpio.h>
-#include <linux/leds.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -41,86 +40,6 @@ static struct mv643xx_eth_platform_data goflexnet_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
 };
 
-static struct mv_sata_platform_data goflexnet_sata_data = {
-	.n_ports	= 2,
-};
-
-static struct gpio_led goflexnet_led_pins[] = {
-	{
-		.name			= "status:green:health",
-		.default_trigger	= "default-on",
-		.gpio			= 46,
-		.active_low		= 1,
-	},
-	{
-		.name			= "status:orange:fault",
-		.default_trigger	= "none",
-		.gpio			= 47,
-		.active_low		= 1,
-	},
-	{
-		.name			= "status:white:left0",
-		.default_trigger	= "none",
-		.gpio			= 42,
-		.active_low		= 0,
-	},
-	{
-		.name			= "status:white:left1",
-		.default_trigger	= "none",
-		.gpio			= 43,
-		.active_low		= 0,
-	},
-	{
-		.name			= "status:white:left2",
-		.default_trigger	= "none",
-		.gpio			= 44,
-		.active_low		= 0,
-	},
-	{
-		.name			= "status:white:left3",
-		.default_trigger	= "none",
-		.gpio			= 45,
-		.active_low		= 0,
-	},
-	{
-		.name			= "status:white:right0",
-		.default_trigger	= "none",
-		.gpio			= 38,
-		.active_low		= 0,
-	},
-	{
-		.name			= "status:white:right1",
-		.default_trigger	= "none",
-		.gpio			= 39,
-		.active_low		= 0,
-	},
-	{
-		.name			= "status:white:right2",
-		.default_trigger	= "none",
-		.gpio			= 40,
-		.active_low		= 0,
-	},
-	{
-		.name			= "status:white:right3",
-		.default_trigger	= "none",
-		.gpio			= 41,
-		.active_low		= 0,
-	},
-};
-
-static struct gpio_led_platform_data goflexnet_led_data = {
-	.leds		= goflexnet_led_pins,
-	.num_leds	= ARRAY_SIZE(goflexnet_led_pins),
-};
-
-static struct platform_device goflexnet_leds = {
-	.name	= "leds-gpio",
-	.id	= -1,
-	.dev	= {
-		.platform_data	= &goflexnet_led_data,
-	}
-};
-
 static unsigned int goflexnet_mpp_config[] __initdata = {
 	MPP29_GPIO,	/* USB Power Enable */
 	MPP47_GPIO,	/* LED Orange */
@@ -149,7 +68,4 @@ void __init goflexnet_init(void)
 	kirkwood_ehci_init();
 
 	kirkwood_ge00_init(&goflexnet_ge00_data);
-	kirkwood_sata_init(&goflexnet_sata_data);
-
-	platform_device_register(&goflexnet_leds);
 }
-- 
1.7.10

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

* [PATCH 14/16] ARM: Kirkwood: Describe ib62x0 LEDs in DT.
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
                   ` (12 preceding siblings ...)
  2012-07-20 17:35 ` [PATCH 13/16] ARM: Kirkwood: Describe GoFlex Net LEDs and SATA " Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  2012-07-20 17:35 ` [PATCH 15/16] ARM: Kirkwood: Describe iConnect " Andrew Lunn
  2012-07-20 17:35 ` [PATCH 16/16] ARM: Kirkwood: Replace mrvl with marvell Andrew Lunn
  15 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Simon Baatz <gmbnomis@gmail.com>
---
 arch/arm/boot/dts/kirkwood-ib62x0.dts |   17 ++++++++++++++++
 arch/arm/mach-kirkwood/board-ib62x0.c |   36 ---------------------------------
 2 files changed, 17 insertions(+), 36 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts
index 6726aa9..ab35288 100644
--- a/arch/arm/boot/dts/kirkwood-ib62x0.dts
+++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts
@@ -62,4 +62,21 @@
 			gpios = <&gpio0 28 1>;
 		};
 	};
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		green-os {
+			label = "ib62x0:green:os";
+			gpios = <&gpio0 25 0>;
+			linux,default-trigger = "default-on";
+		};
+		red-os {
+			label = "ib62x0:red:os";
+			gpios = <&gpio0 22 0>;
+		};
+		usb-copy {
+			label = "ib62x0:red:usb_copy";
+			gpios = <&gpio0 27 0>;
+		};
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c
index f30065e..cfc47f8 100644
--- a/arch/arm/mach-kirkwood/board-ib62x0.c
+++ b/arch/arm/mach-kirkwood/board-ib62x0.c
@@ -19,7 +19,6 @@
 #include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
 #include <linux/input.h>
-#include <linux/leds.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
@@ -50,40 +49,6 @@ static unsigned int ib62x0_mpp_config[] __initdata = {
 	0
 };
 
-static struct gpio_led ib62x0_led_pins[] = {
-	{
-		.name			= "ib62x0:green:os",
-		.default_trigger	= "default-on",
-		.gpio			= 25,
-		.active_low		= 0,
-	},
-	{
-		.name			= "ib62x0:red:os",
-		.default_trigger	= "none",
-		.gpio			= 22,
-		.active_low		= 0,
-	},
-	{
-		.name			= "ib62x0:red:usb_copy",
-		.default_trigger	= "none",
-		.gpio			= 27,
-		.active_low		= 0,
-	},
-};
-
-static struct gpio_led_platform_data ib62x0_led_data = {
-	.leds		= ib62x0_led_pins,
-	.num_leds	= ARRAY_SIZE(ib62x0_led_pins),
-};
-
-static struct platform_device ib62x0_led_device = {
-	.name	= "leds-gpio",
-	.id	= -1,
-	.dev	= {
-		.platform_data	= &ib62x0_led_data,
-	}
-};
-
 static void ib62x0_power_off(void)
 {
 	gpio_set_value(IB62X0_GPIO_POWER_OFF, 1);
@@ -98,7 +63,6 @@ void __init ib62x0_init(void)
 
 	kirkwood_ehci_init();
 	kirkwood_ge00_init(&ib62x0_ge00_data);
-	platform_device_register(&ib62x0_led_device);
 	if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 &&
 	    gpio_direction_output(IB62X0_GPIO_POWER_OFF, 0) == 0)
 		pm_power_off = ib62x0_power_off;
-- 
1.7.10

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

* [PATCH 15/16] ARM: Kirkwood: Describe iConnect LEDs in DT.
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
                   ` (13 preceding siblings ...)
  2012-07-20 17:35 ` [PATCH 14/16] ARM: Kirkwood: Describe ib62x0 LEDs " Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  2012-07-30 21:35   ` Adam Baker
  2012-07-20 17:35 ` [PATCH 16/16] ARM: Kirkwood: Replace mrvl with marvell Andrew Lunn
  15 siblings, 1 reply; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 arch/arm/boot/dts/kirkwood-iconnect.dts |   34 +++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-iconnect.c |   46 -------------------------------
 2 files changed, 34 insertions(+), 46 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
index a7dd07b..b77b38f 100644
--- a/arch/arm/boot/dts/kirkwood-iconnect.dts
+++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
@@ -31,4 +31,38 @@
 			status = "ok";
 		};
 	};
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		led-level {
+			label = "led_level";
+			gpios = <&gpio1 9 0>;
+			linux,default-trigger = "default-on";
+		};
+		power-blue {
+			label = "power:blue";
+			gpios = <&gpio1 11 0>;
+			linux,default-trigger = "timer";
+		};
+		usb1 {
+			label = "usb1:blue";
+			gpios = <&gpio1 12 0>;
+		};
+		usb2 {
+			label = "usb2:blue";
+			gpios = <&gpio1 13 0>;
+		};
+		usb3 {
+			label = "usb3:blue";
+			gpios = <&gpio1 14 0>;
+		};
+		usb4 {
+			label = "usb4:blue";
+			gpios = <&gpio1 15 0>;
+		};
+		otb {
+			label = "otb:blue";
+			gpios = <&gpio1 16 0>;
+		};
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
index df043aa..d7a9198 100644
--- a/arch/arm/mach-kirkwood/board-iconnect.c
+++ b/arch/arm/mach-kirkwood/board-iconnect.c
@@ -19,7 +19,6 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
-#include <linux/leds.h>
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
 #include <asm/mach/arch.h>
@@ -31,50 +30,6 @@ static struct mv643xx_eth_platform_data iconnect_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(11),
 };
 
-static struct gpio_led iconnect_led_pins[] = {
-	{
-		.name		= "led_level",
-		.gpio		= 41,
-		.default_trigger = "default-on",
-	}, {
-		.name		= "power:blue",
-		.gpio		= 42,
-		.default_trigger = "timer",
-	}, {
-		.name		= "power:red",
-		.gpio		= 43,
-	}, {
-		.name		= "usb1:blue",
-		.gpio		= 44,
-	}, {
-		.name		= "usb2:blue",
-		.gpio		= 45,
-	}, {
-		.name		= "usb3:blue",
-		.gpio		= 46,
-	}, {
-		.name		= "usb4:blue",
-		.gpio		= 47,
-	}, {
-		.name		= "otb:blue",
-		.gpio		= 48,
-	},
-};
-
-static struct gpio_led_platform_data iconnect_led_data = {
-	.leds		= iconnect_led_pins,
-	.num_leds	= ARRAY_SIZE(iconnect_led_pins),
-	.gpio_blink_set	= orion_gpio_led_blink_set,
-};
-
-static struct platform_device iconnect_leds = {
-	.name	= "leds-gpio",
-	.id	= -1,
-	.dev	= {
-		.platform_data	= &iconnect_led_data,
-	}
-};
-
 static unsigned int iconnect_mpp_config[] __initdata = {
 	MPP12_GPIO,
 	MPP35_GPIO,
@@ -140,7 +95,6 @@ void __init iconnect_init(void)
 	kirkwood_ge00_init(&iconnect_ge00_data);
 
 	platform_device_register(&iconnect_button_device);
-	platform_device_register(&iconnect_leds);
 }
 
 static int __init iconnect_pci_init(void)
-- 
1.7.10

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

* [PATCH 16/16] ARM: Kirkwood: Replace mrvl with marvell
  2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
                   ` (14 preceding siblings ...)
  2012-07-20 17:35 ` [PATCH 15/16] ARM: Kirkwood: Describe iConnect " Andrew Lunn
@ 2012-07-20 17:35 ` Andrew Lunn
  15 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-20 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

It has been decided to use marvell, not mrvl, in the compatibility
property. Search & replace.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 Documentation/devicetree/bindings/mtd/orion-nand.txt |    4 ++--
 arch/arm/boot/dts/kirkwood-dns320.dts                |    2 +-
 arch/arm/boot/dts/kirkwood-dns325.dts                |    2 +-
 arch/arm/boot/dts/kirkwood-dnskw.dtsi                |    2 +-
 arch/arm/boot/dts/kirkwood-dreamplug.dts             |    2 +-
 arch/arm/boot/dts/kirkwood-goflexnet.dts             |    2 +-
 arch/arm/boot/dts/kirkwood-ib62x0.dts                |    2 +-
 arch/arm/boot/dts/kirkwood-iconnect.dts              |    2 +-
 arch/arm/boot/dts/kirkwood-lschlv2.dts               |    2 +-
 arch/arm/boot/dts/kirkwood-lsxhl.dts                 |    2 +-
 arch/arm/boot/dts/kirkwood-ts219.dtsi                |    2 +-
 arch/arm/boot/dts/kirkwood.dtsi                      |    6 +++---
 arch/arm/mach-kirkwood/board-dt.c                    |    2 +-
 drivers/mtd/nand/orion_nand.c                        |    2 +-
 drivers/rtc/rtc-mv.c                                 |    2 +-
 15 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/Documentation/devicetree/bindings/mtd/orion-nand.txt b/Documentation/devicetree/bindings/mtd/orion-nand.txt
index b2356b7..2d6ab66 100644
--- a/Documentation/devicetree/bindings/mtd/orion-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/orion-nand.txt
@@ -1,7 +1,7 @@
 NAND support for Marvell Orion SoC platforms
 
 Required properties:
-- compatible : "mrvl,orion-nand".
+- compatible : "marvell,orion-nand".
 - reg : Base physical address of the NAND and length of memory mapped
 	region
 
@@ -24,7 +24,7 @@ nand at f4000000 {
 	ale = <1>;
 	bank-width = <1>;
 	chip-delay = <25>;
-	compatible = "mrvl,orion-nand";
+	compatible = "marvell,orion-nand";
 	reg = <0xf4000000 0x400>;
 
 	partition at 0 {
diff --git a/arch/arm/boot/dts/kirkwood-dns320.dts b/arch/arm/boot/dts/kirkwood-dns320.dts
index d41e204..5bb0bf3 100644
--- a/arch/arm/boot/dts/kirkwood-dns320.dts
+++ b/arch/arm/boot/dts/kirkwood-dns320.dts
@@ -4,7 +4,7 @@
 
 / {
 	model = "D-Link DNS-320 NAS (Rev A1)";
-	compatible = "dlink,dns-320-a1", "dlink,dns-320", "dlink,dns-kirkwood", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
+	compatible = "dlink,dns-320-a1", "dlink,dns-320", "dlink,dns-kirkwood", "marvell,kirkwood-88f6281", "marvell,kirkwood";
 
 	memory {
 		device_type = "memory";
diff --git a/arch/arm/boot/dts/kirkwood-dns325.dts b/arch/arm/boot/dts/kirkwood-dns325.dts
index 2662efc..d430713 100644
--- a/arch/arm/boot/dts/kirkwood-dns325.dts
+++ b/arch/arm/boot/dts/kirkwood-dns325.dts
@@ -4,7 +4,7 @@
 
 / {
 	model = "D-Link DNS-325 NAS (Rev A1)";
-	compatible = "dlink,dns-325-a1", "dlink,dns-325", "dlink,dns-kirkwood", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
+	compatible = "dlink,dns-325-a1", "dlink,dns-325", "dlink,dns-kirkwood", "marvell,kirkwood-88f6281", "marvell,kirkwood";
 
 	memory {
 		device_type = "memory";
diff --git a/arch/arm/boot/dts/kirkwood-dnskw.dtsi b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
index 2bad626..7408655 100644
--- a/arch/arm/boot/dts/kirkwood-dnskw.dtsi
+++ b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
@@ -2,7 +2,7 @@
 
 / {
 	model = "D-Link DNS NASes (kirkwood-based)";
-	compatible = "dlink,dns-kirkwood", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
+	compatible = "dlink,dns-kirkwood", "marvell,kirkwood-88f6281", "marvell,kirkwood";
 
 	gpio_keys {
 		compatible = "gpio-keys";
diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 77fec4e..26e281f 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -4,7 +4,7 @@
 
 / {
 	model = "Globalscale Technologies Dreamplug";
-	compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
+	compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood";
 
 	memory {
 		device_type = "memory";
diff --git a/arch/arm/boot/dts/kirkwood-goflexnet.dts b/arch/arm/boot/dts/kirkwood-goflexnet.dts
index f6974d1..7c8238f 100644
--- a/arch/arm/boot/dts/kirkwood-goflexnet.dts
+++ b/arch/arm/boot/dts/kirkwood-goflexnet.dts
@@ -4,7 +4,7 @@
 
 / {
 	model = "Seagate GoFlex Net";
-	compatible = "seagate,goflexnet", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
+	compatible = "seagate,goflexnet", "marvell,kirkwood-88f6281", "marvell,kirkwood";
 
 	memory {
 		device_type = "memory";
diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts
index ab35288..66794ed 100644
--- a/arch/arm/boot/dts/kirkwood-ib62x0.dts
+++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts
@@ -4,7 +4,7 @@
 
 / {
 	model = "RaidSonic ICY BOX IB-NAS62x0 (Rev B)";
-	compatible = "raidsonic,ib-nas6210-b", "raidsonic,ib-nas6220-b", "raidsonic,ib-nas6210", "raidsonic,ib-nas6220", "raidsonic,ib-nas62x0",  "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
+	compatible = "raidsonic,ib-nas6210-b", "raidsonic,ib-nas6220-b", "raidsonic,ib-nas6210", "raidsonic,ib-nas6220", "raidsonic,ib-nas62x0",  "marvell,kirkwood-88f6281", "marvell,kirkwood";
 
 	memory {
 		device_type = "memory";
diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
index b77b38f..52d9470 100644
--- a/arch/arm/boot/dts/kirkwood-iconnect.dts
+++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
@@ -4,7 +4,7 @@
 
 / {
 	model = "Iomega Iconnect";
-	compatible = "iom,iconnect-1.1", "iom,iconnect", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
+	compatible = "iom,iconnect-1.1", "iom,iconnect", "marvell,kirkwood-88f6281", "marvell,kirkwood";
 
 	memory {
 		device_type = "memory";
diff --git a/arch/arm/boot/dts/kirkwood-lschlv2.dts b/arch/arm/boot/dts/kirkwood-lschlv2.dts
index 37649b5..9510c9e 100644
--- a/arch/arm/boot/dts/kirkwood-lschlv2.dts
+++ b/arch/arm/boot/dts/kirkwood-lschlv2.dts
@@ -4,7 +4,7 @@
 
 / {
 	model = "Buffalo Linkstation LS-CHLv2";
-	compatible = "buffalo,lschlv2", "buffalo,lsxl", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
+	compatible = "buffalo,lschlv2", "buffalo,lsxl", "marvell,kirkwood-88f6281", "marvell,kirkwood";
 
 	memory {
 		device_type = "memory";
diff --git a/arch/arm/boot/dts/kirkwood-lsxhl.dts b/arch/arm/boot/dts/kirkwood-lsxhl.dts
index eb3c071..739019c 100644
--- a/arch/arm/boot/dts/kirkwood-lsxhl.dts
+++ b/arch/arm/boot/dts/kirkwood-lsxhl.dts
@@ -4,7 +4,7 @@
 
 / {
 	model = "Buffalo Linkstation LS-XHL";
-	compatible = "buffalo,lsxhl", "buffalo,lsxl", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
+	compatible = "buffalo,lsxhl", "buffalo,lsxl", "marvell,kirkwood-88f6281", "marvell,kirkwood";
 
 	memory {
 		device_type = "memory";
diff --git a/arch/arm/boot/dts/kirkwood-ts219.dtsi b/arch/arm/boot/dts/kirkwood-ts219.dtsi
index b4a789a..64ea27c 100644
--- a/arch/arm/boot/dts/kirkwood-ts219.dtsi
+++ b/arch/arm/boot/dts/kirkwood-ts219.dtsi
@@ -2,7 +2,7 @@
 
 / {
 	model = "QNAP TS219 family";
-	compatible = "qnap,ts219", "mrvl,kirkwood";
+	compatible = "qnap,ts219", "marvell,kirkwood";
 
 	memory {
 		device_type = "memory";
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index fbb96ce..cef9616 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -1,7 +1,7 @@
 /include/ "skeleton.dtsi"
 
 / {
-	compatible = "mrvl,kirkwood";
+	compatible = "marvell,kirkwood";
 	interrupt-parent = <&intc>;
 
 	intc: interrupt-controller {
@@ -55,7 +55,7 @@
 		};
 
 		rtc at 10300 {
-			compatible = "mrvl,kirkwood-rtc", "mrvl,orion-rtc";
+			compatible = "marvell,kirkwood-rtc", "marvell,orion-rtc";
 			reg = <0x10300 0x20>;
 			interrupts = <53>;
 		};
@@ -89,7 +89,7 @@
 			cle = <0>;
 			ale = <1>;
 			bank-width = <1>;
-			compatible = "mrvl,orion-nand";
+			compatible = "marvell,orion-nand";
 			reg = <0x3000000 0x400>;
 			chip-delay = <25>;
 			/* set partition map and/or chip-delay in board dts */
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 43142cf..e4eb450 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -32,7 +32,7 @@ struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = {
 		       NULL),
 	OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
 	OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL),
-	OF_DEV_AUXDATA("mrvl,orion-nand", 0xf4000000, "orion_nand", NULL),
+	OF_DEV_AUXDATA("marvell,orion-nand", 0xf4000000, "orion_nand", NULL),
 	{},
 };
 
diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index 513dc88..f8a5563 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -214,7 +214,7 @@ static int __devexit orion_nand_remove(struct platform_device *pdev)
 
 #ifdef CONFIG_OF
 static struct of_device_id orion_nand_of_match_table[] = {
-	{ .compatible = "mrvl,orion-nand", },
+	{ .compatible = "marvell,orion-nand", },
 	{},
 };
 #endif
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index b2185f4..ebc1649 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -297,7 +297,7 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
 
 #ifdef CONFIG_OF
 static struct of_device_id rtc_mv_of_match_table[] = {
-	{ .compatible = "mrvl,orion-rtc", },
+	{ .compatible = "marvell,orion-rtc", },
 	{}
 };
 #endif
-- 
1.7.10

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

* [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue.
  2012-07-20 17:35 ` [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue Andrew Lunn
@ 2012-07-22  7:22   ` Linus Walleij
  2012-07-22  9:53     ` Andrew Lunn
  0 siblings, 1 reply; 42+ messages in thread
From: Linus Walleij @ 2012-07-22  7:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 20, 2012 at 7:35 PM, Andrew Lunn <andrew@lunn.ch> wrote:

> Replace the deprecated master->transfer with transfer_one_message()
> and allow the SPI subsystem handle all the queuing of messages.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com>

Send these with Mark Brown on the To: line right now, I think he's
busy collecting SPI patches for the next merge window.

Yours,
Linus Walleij

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

* [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue.
  2012-07-22  7:22   ` Linus Walleij
@ 2012-07-22  9:53     ` Andrew Lunn
  2012-07-22 19:07       ` Mark Brown
  0 siblings, 1 reply; 42+ messages in thread
From: Andrew Lunn @ 2012-07-22  9:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Jul 22, 2012 at 09:22:09AM +0200, Linus Walleij wrote:
> On Fri, Jul 20, 2012 at 7:35 PM, Andrew Lunn <andrew@lunn.ch> wrote:
> 
> > Replace the deprecated master->transfer with transfer_one_message()
> > and allow the SPI subsystem handle all the queuing of messages.
> >
> > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > Acked-by: Linus Walleij <linus.walleij@linaro.org>
> > Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com>
> 
> Send these with Mark Brown on the To: line right now, I think he's
> busy collecting SPI patches for the next merge window.

Hi Linus, Mark and now Arnd.

I was planning sending all these via arm-soc. 

This patch is part of a bigger collection of Orion changes. The rest
are contributions from others which have already been ack-by, etc, on
the lists.

Somewhere near the beginning of this series is:

4385fbf SPI: Refactor spi-orion to use SPI framework queue.
d9d8293 spi-orion: remove uneeded spi_info
ee13b49 spi-orion: add device tree binding
76f0b84 ARM: kirkwood: use devicetree for SPI on dreamplug
05f504f ARM: kirkwood: use devicetree for orion-spi

You can see the chain of dependencies here. So at minimum i would need
to send the first three via Mark. I then need to cross my fingers and
hope he really picks them up, because without them, we are going to
have a number of boards which fail to find their root file system on
an SPI flash.

Now, maybe i've done all this wrong, since i'm a newbie to collecting
patches together for submission upstream....

You can see the complete set of patches here:

git://github.com/lunn/linux.git v3.5-rc7-for-next-v5

There is one exception and that is the very first patch:

I2C: MV64XXX: Add Device Tree support 

which Wolfram Sang insists goes via him. I see this less critical. If
for some reason it does not make it in, all it means is temperature
sensors and RTCs are missing, but at least the boards still boot.

	Andrew

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

* [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue.
  2012-07-22  9:53     ` Andrew Lunn
@ 2012-07-22 19:07       ` Mark Brown
  2012-07-22 19:32         ` Andrew Lunn
  0 siblings, 1 reply; 42+ messages in thread
From: Mark Brown @ 2012-07-22 19:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Jul 22, 2012 at 11:53:28AM +0200, Andrew Lunn wrote:

> You can see the chain of dependencies here. So at minimum i would need
> to send the first three via Mark. I then need to cross my fingers and
> hope he really picks them up, because without them, we are going to
> have a number of boards which fail to find their root file system on
> an SPI flash.

Well, I'd like to think that generally I'm reasonably responsive to
patch submissions and obviously there's no great urgency here since
we're in the merge window - nothing is likely to go in until 3.7 anyway,
though it'd be handy if the DT updates went in early (and they're very
low risk...).

> Now, maybe i've done all this wrong, since i'm a newbie to collecting
> patches together for submission upstream....

The general pattern with these things should be that the patches get
sent via the normal route and any unusual requirements discussed then.
To be honest it doesn't seem like there's much problem here, you've got
no build time dependencies or anything.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120722/03607612/attachment.sig>

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

* [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue.
  2012-07-22 19:07       ` Mark Brown
@ 2012-07-22 19:32         ` Andrew Lunn
  2012-07-22 22:42           ` Mark Brown
  2012-07-23 10:53           ` Sergei Shtylyov
  0 siblings, 2 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-22 19:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Jul 22, 2012 at 08:07:01PM +0100, Mark Brown wrote:
> On Sun, Jul 22, 2012 at 11:53:28AM +0200, Andrew Lunn wrote:
> 
> > You can see the chain of dependencies here. So at minimum i would need
> > to send the first three via Mark. I then need to cross my fingers and
> > hope he really picks them up, because without them, we are going to
> > have a number of boards which fail to find their root file system on
> > an SPI flash.
> 
> Well, I'd like to think that generally I'm reasonably responsive to
> patch submissions 

Well, this particular patch was first submitted May 19th and Ack-by
Linus on May 14th.

http://comments.gmane.org/gmane.linux.kernel.spi.devel/9937

It was reposted 10 Jun and Acked-by again in Jun 10 by Linus.

It was also reposted July 3.

   Andrew

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

* [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue.
  2012-07-22 19:32         ` Andrew Lunn
@ 2012-07-22 22:42           ` Mark Brown
  2012-07-23  7:27             ` Andrew Lunn
  2012-07-23 10:53           ` Sergei Shtylyov
  1 sibling, 1 reply; 42+ messages in thread
From: Mark Brown @ 2012-07-22 22:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Jul 22, 2012 at 09:32:43PM +0200, Andrew Lunn wrote:
> On Sun, Jul 22, 2012 at 08:07:01PM +0100, Mark Brown wrote:

> > Well, I'd like to think that generally I'm reasonably responsive to
> > patch submissions 

> Well, this particular patch was first submitted May 19th and Ack-by
> Linus on May 14th.

> http://comments.gmane.org/gmane.linux.kernel.spi.devel/9937

> It was reposted 10 Jun and Acked-by again in Jun 10 by Linus.

> It was also reposted July 3.

None of which were CCed to me; they were all before I started looking
after SPI so that's not surprising but still the number of reposts is
more a comment on why I'm helping out here than on what I said above.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120722/8e9b673e/attachment.sig>

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

* [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue.
  2012-07-22 22:42           ` Mark Brown
@ 2012-07-23  7:27             ` Andrew Lunn
  2012-07-23  9:37               ` Mark Brown
  0 siblings, 1 reply; 42+ messages in thread
From: Andrew Lunn @ 2012-07-23  7:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Jul 22, 2012 at 11:42:57PM +0100, Mark Brown wrote:
> On Sun, Jul 22, 2012 at 09:32:43PM +0200, Andrew Lunn wrote:
> > On Sun, Jul 22, 2012 at 08:07:01PM +0100, Mark Brown wrote:
> 
> > > Well, I'd like to think that generally I'm reasonably responsive to
> > > patch submissions 
> 
> > Well, this particular patch was first submitted May 19th and Ack-by
> > Linus on May 14th.
> 
> > http://comments.gmane.org/gmane.linux.kernel.spi.devel/9937
> 
> > It was reposted 10 Jun and Acked-by again in Jun 10 by Linus.
> 
> > It was also reposted July 3.
> 
> None of which were CCed to me; they were all before I started looking
> after SPI so that's not surprising but still the number of reposts is
> more a comment on why I'm helping out here than on what I said above.

Hi Mark

O.K., fair enough.

Will you accept any patches for this merge window? As you said, the DT
enablement is low risk. It should be possible to separate this one
patch from the other two.

https://github.com/lunn/linux/commit/794e259e3e23f02250ac12c74dd507a4b340b257

      Andrew

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

* [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue.
  2012-07-23  7:27             ` Andrew Lunn
@ 2012-07-23  9:37               ` Mark Brown
  2012-07-23 10:08                 ` [PATCH] spi-orion: add device tree binding Andrew Lunn
  2012-07-23 10:16                 ` [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue Andrew Lunn
  0 siblings, 2 replies; 42+ messages in thread
From: Mark Brown @ 2012-07-23  9:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 23, 2012 at 09:27:49AM +0200, Andrew Lunn wrote:

> Will you accept any patches for this merge window? As you said, the DT
> enablement is low risk. It should be possible to separate this one
> patch from the other two.

Can you send the patches please?

The bit I was saying was most low risk was the actual DT changes, as
opposed to the bits that parse and use the DT.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120723/7bfedb4b/attachment.sig>

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

* [PATCH] spi-orion: add device tree binding
  2012-07-23  9:37               ` Mark Brown
@ 2012-07-23 10:08                 ` Andrew Lunn
  2012-07-23 10:43                   ` Mark Brown
  2012-07-23 10:44                   ` Mark Brown
  2012-07-23 10:16                 ` [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue Andrew Lunn
  1 sibling, 2 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-23 10:08 UTC (permalink / raw)
  To: linux-arm-kernel

>From 528a19e9eda968cc673331d566cbfe20962d3b32 Mon Sep 17 00:00:00 2001
From: Michael Walle <michael@walle.cc>
Date: Wed, 6 Jun 2012 19:16:28 +0200
Subject: [PATCHv3] spi-orion: add device tree binding

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com>
---
v2: Add interrupts properties as optional. Not used at the moment.
    Add cell-index, since some SoCs have multiple SPI busses.
v3: Rebased onto 3.5-rc7 without the refactor patch.

---
 Documentation/devicetree/bindings/spi/spi-orion.txt |   19 +++++++++++++++++++
 drivers/spi/spi-orion.c                             |   17 +++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-orion.txt

diff --git a/Documentation/devicetree/bindings/spi/spi-orion.txt b/Documentation/devicetree/bindings/spi/spi-orion.txt
new file mode 100644
index 0000000..a3ff50f
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-orion.txt
@@ -0,0 +1,19 @@
+Marvell Orion SPI device
+
+Required properties:
+- compatible : should be "marvell,orion-spi".
+- reg : offset and length of the register set for the device
+- cell-index : Which of multiple SPI controllers is this.
+Optional properties:
+- interrupts : Is currently not used.
+
+Example:
+       spi at 10600 {
+	       compatible = "marvell,orion-spi";
+	       #address-cells = <1>;
+	       #size-cells = <0>;
+	       cell-index = <0>;
+	       reg = <0x10600 0x28>;
+	       interrupts = <23>;
+	       status = "disabled";
+       };
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index dfd04e9..74312a8 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -17,6 +17,7 @@
 #include <linux/io.h>
 #include <linux/spi/spi.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/clk.h>
 #include <asm/unaligned.h>
 
@@ -453,6 +454,8 @@ static int __init orion_spi_probe(struct platform_device *pdev)
 	struct orion_spi_info *spi_info;
 	unsigned long tclk_hz;
 	int status = 0;
+	const u32 *iprop;
+	int size;
 
 	spi_info = pdev->dev.platform_data;
 
@@ -464,6 +467,12 @@ static int __init orion_spi_probe(struct platform_device *pdev)
 
 	if (pdev->id != -1)
 		master->bus_num = pdev->id;
+	if (pdev->dev.of_node) {
+		iprop = of_get_property(pdev->dev.of_node, "cell-index",
+					&size);
+		if (iprop && size == sizeof(*iprop))
+			master->bus_num = *iprop;
+	}
 
 	/* we support only mode 0, and no options */
 	master->mode_bits = 0;
@@ -511,6 +520,7 @@ static int __init orion_spi_probe(struct platform_device *pdev)
 	if (orion_spi_reset(spi) < 0)
 		goto out_rel_mem;
 
+	master->dev.of_node = pdev->dev.of_node;
 	status = spi_register_master(master);
 	if (status < 0)
 		goto out_rel_mem;
@@ -552,10 +562,17 @@ static int __exit orion_spi_remove(struct platform_device *pdev)
 
 MODULE_ALIAS("platform:" DRIVER_NAME);
 
+static const struct of_device_id orion_spi_of_match_table[] __devinitdata = {
+	{ .compatible = "marvell,orion-spi", },
+	{}
+};
+MODULE_DEVICE_TABLE(of, orion_spi_of_match_table);
+
 static struct platform_driver orion_spi_driver = {
 	.driver = {
 		.name	= DRIVER_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(orion_spi_of_match_table),
 	},
 	.remove		= __exit_p(orion_spi_remove),
 };
-- 
1.7.10.4

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

* [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue.
  2012-07-23  9:37               ` Mark Brown
  2012-07-23 10:08                 ` [PATCH] spi-orion: add device tree binding Andrew Lunn
@ 2012-07-23 10:16                 ` Andrew Lunn
  2012-07-23 10:23                   ` Mark Brown
  1 sibling, 1 reply; 42+ messages in thread
From: Andrew Lunn @ 2012-07-23 10:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 23, 2012 at 10:37:47AM +0100, Mark Brown wrote:
> On Mon, Jul 23, 2012 at 09:27:49AM +0200, Andrew Lunn wrote:
> 
> > Will you accept any patches for this merge window? As you said, the DT
> > enablement is low risk. It should be possible to separate this one
> > patch from the other two.
> 
> Can you send the patches please?

I just sent the DT enabling patch. The other two, "Refactor spi-orion
to use SPI framework queue." and "remove uneeded spi_info" can wait
for the next merge window. For me, they are lower priority than
getting DT working.
 
> The bit I was saying was most low risk was the actual DT changes, as
> opposed to the bits that parse and use the DT.

Ah, O.K. I understood you wrongly. I actually think they are the most
dangerous part. A board booting with these DT changes, and without the
driver enablement for DT is likely to fail to find its root
filesystem.

Thanks
       Andrew

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

* [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue.
  2012-07-23 10:16                 ` [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue Andrew Lunn
@ 2012-07-23 10:23                   ` Mark Brown
  2012-07-23 10:49                     ` Andrew Lunn
  0 siblings, 1 reply; 42+ messages in thread
From: Mark Brown @ 2012-07-23 10:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 23, 2012 at 12:16:41PM +0200, Andrew Lunn wrote:
> On Mon, Jul 23, 2012 at 10:37:47AM +0100, Mark Brown wrote:

> > The bit I was saying was most low risk was the actual DT changes, as
> > opposed to the bits that parse and use the DT.

> Ah, O.K. I understood you wrongly. I actually think they are the most
> dangerous part. A board booting with these DT changes, and without the
> driver enablement for DT is likely to fail to find its root
> filesystem.

Why would that be?  If there's no DT support for the driver it'll just
ignore the DT.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120723/ef1f9e24/attachment-0001.sig>

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

* [PATCH] spi-orion: add device tree binding
  2012-07-23 10:08                 ` [PATCH] spi-orion: add device tree binding Andrew Lunn
@ 2012-07-23 10:43                   ` Mark Brown
  2012-07-23 10:59                     ` Andrew Lunn
  2012-07-23 10:44                   ` Mark Brown
  1 sibling, 1 reply; 42+ messages in thread
From: Mark Brown @ 2012-07-23 10:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 23, 2012 at 12:08:09PM +0200, Andrew Lunn wrote:
> From 528a19e9eda968cc673331d566cbfe20962d3b32 Mon Sep 17 00:00:00 2001
> From: Michael Walle <michael@walle.cc>
> Date: Wed, 6 Jun 2012 19:16:28 +0200
> Subject: [PATCHv3] spi-orion: add device tree binding

I really shouldn't need to remind you about the format for sending
patches :(

> +Optional properties:
> +- interrupts : Is currently not used.

Would it not be better to just omit this if it doesn't do anything and
doesn't have any semantics defined?

I've applied this.  If you could send the other patches that'd be
helpful...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120723/c69386a5/attachment.sig>

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

* [PATCH] spi-orion: add device tree binding
  2012-07-23 10:08                 ` [PATCH] spi-orion: add device tree binding Andrew Lunn
  2012-07-23 10:43                   ` Mark Brown
@ 2012-07-23 10:44                   ` Mark Brown
  2012-07-23 10:50                     ` Andrew Lunn
  1 sibling, 1 reply; 42+ messages in thread
From: Mark Brown @ 2012-07-23 10:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 23, 2012 at 12:08:09PM +0200, Andrew Lunn wrote:

> Signed-off-by: Michael Walle <michael@walle.cc>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> Acked-by: Jason Cooper <jason@lakedaemon.net>
> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com>

Hrm, I thought you said Linus W had acked this?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120723/da967c26/attachment.sig>

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

* [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue.
  2012-07-23 10:23                   ` Mark Brown
@ 2012-07-23 10:49                     ` Andrew Lunn
  2012-07-23 11:11                       ` Mark Brown
  0 siblings, 1 reply; 42+ messages in thread
From: Andrew Lunn @ 2012-07-23 10:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 23, 2012 at 11:23:36AM +0100, Mark Brown wrote:
> On Mon, Jul 23, 2012 at 12:16:41PM +0200, Andrew Lunn wrote:
> > On Mon, Jul 23, 2012 at 10:37:47AM +0100, Mark Brown wrote:
> 
> > > The bit I was saying was most low risk was the actual DT changes, as
> > > opposed to the bits that parse and use the DT.
> 
> > Ah, O.K. I understood you wrongly. I actually think they are the most
> > dangerous part. A board booting with these DT changes, and without the
> > driver enablement for DT is likely to fail to find its root
> > filesystem.
> 
> Why would that be?  If there's no DT support for the driver it'll just
> ignore the DT.

Yes, it ignores the DT. However, SPI driver never gets
instantiated. The FLASH chip on the SPI bus never gets
instantiated. MTD partitions are probably created, but since the
underlying device is missing, they don't work and the root filesystem
is not available.
 
There is no logic in the board code to first try DT, and if that
fails, use old fashioned platform_device instantiating of the drivers.

I've also had bad experiences when we have the old platform_device
instantiating plus DT also instantiating the same device.

The only way i've found to convert an existing board from
platform_device to DT is to first add DT support to the driver, and
then atomically swap platform_device structures for DT descriptions.

Andrew

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

* [PATCH] spi-orion: add device tree binding
  2012-07-23 10:44                   ` Mark Brown
@ 2012-07-23 10:50                     ` Andrew Lunn
  0 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-23 10:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 23, 2012 at 11:44:19AM +0100, Mark Brown wrote:
> On Mon, Jul 23, 2012 at 12:08:09PM +0200, Andrew Lunn wrote:
> 
> > Signed-off-by: Michael Walle <michael@walle.cc>
> > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > Acked-by: Jason Cooper <jason@lakedaemon.net>
> > Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com>
> 
> Hrm, I thought you said Linus W had acked this?

He acked the refactor patch, not this one.

   Andrew

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

* [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue.
  2012-07-22 19:32         ` Andrew Lunn
  2012-07-22 22:42           ` Mark Brown
@ 2012-07-23 10:53           ` Sergei Shtylyov
  2012-07-23 11:02             ` Andrew Lunn
  1 sibling, 1 reply; 42+ messages in thread
From: Sergei Shtylyov @ 2012-07-23 10:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 22-07-2012 23:32, Andrew Lunn wrote:

>>> You can see the chain of dependencies here. So at minimum i would need
>>> to send the first three via Mark. I then need to cross my fingers and
>>> hope he really picks them up, because without them, we are going to
>>> have a number of boards which fail to find their root file system on
>>> an SPI flash.

>> Well, I'd like to think that generally I'm reasonably responsive to
>> patch submissions

> Well, this particular patch was first submitted May 19th and Ack-by
> Linus on May 14th.

    It was acked even before submitted? ;-)

> http://comments.gmane.org/gmane.linux.kernel.spi.devel/9937

> It was reposted 10 Jun and Acked-by again in Jun 10 by Linus.

> It was also reposted July 3.

WBR, Sergei

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

* [PATCH] spi-orion: add device tree binding
  2012-07-23 10:43                   ` Mark Brown
@ 2012-07-23 10:59                     ` Andrew Lunn
  2012-07-23 11:12                       ` Mark Brown
  0 siblings, 1 reply; 42+ messages in thread
From: Andrew Lunn @ 2012-07-23 10:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 23, 2012 at 11:43:34AM +0100, Mark Brown wrote:
> On Mon, Jul 23, 2012 at 12:08:09PM +0200, Andrew Lunn wrote:
> > From 528a19e9eda968cc673331d566cbfe20962d3b32 Mon Sep 17 00:00:00 2001
> > From: Michael Walle <michael@walle.cc>
> > Date: Wed, 6 Jun 2012 19:16:28 +0200
> > Subject: [PATCHv3] spi-orion: add device tree binding
> 
> I really shouldn't need to remind you about the format for sending
> patches :(
> 
> > +Optional properties:
> > +- interrupts : Is currently not used.
> 
> Would it not be better to just omit this if it doesn't do anything and
> doesn't have any semantics defined?

I was specifically asked to include this, which is why it appeared in
v2, not the first version. I forget who it was who asked for it, maybe
Arnd Bergmann? I can dig through my email archive if you want to know.

> 
> I've applied this.  If you could send the other patches that'd be
> helpful...

O.K.

Thanks
	Andrew

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

* [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue.
  2012-07-23 10:53           ` Sergei Shtylyov
@ 2012-07-23 11:02             ` Andrew Lunn
  0 siblings, 0 replies; 42+ messages in thread
From: Andrew Lunn @ 2012-07-23 11:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 23, 2012 at 02:53:54PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 22-07-2012 23:32, Andrew Lunn wrote:
> 
> >>>You can see the chain of dependencies here. So at minimum i would need
> >>>to send the first three via Mark. I then need to cross my fingers and
> >>>hope he really picks them up, because without them, we are going to
> >>>have a number of boards which fail to find their root file system on
> >>>an SPI flash.
> 
> >>Well, I'd like to think that generally I'm reasonably responsive to
> >>patch submissions
> 
> >Well, this particular patch was first submitted May 19th and Ack-by
> >Linus on May 14th.
> 
>    It was acked even before submitted? ;-)

I have my dates wrong. See:

http://comments.gmane.org/gmane.linux.kernel.spi.devel/9937

First posted 9 May, acked 14th May.

      Andrew

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

* [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue.
  2012-07-23 10:49                     ` Andrew Lunn
@ 2012-07-23 11:11                       ` Mark Brown
  0 siblings, 0 replies; 42+ messages in thread
From: Mark Brown @ 2012-07-23 11:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 23, 2012 at 12:49:11PM +0200, Andrew Lunn wrote:

> There is no logic in the board code to first try DT, and if that
> fails, use old fashioned platform_device instantiating of the drivers.

Well, I'd really expect this to be done the other way around.

> I've also had bad experiences when we have the old platform_device
> instantiating plus DT also instantiating the same device.

Hopefully we can arrange for them to collide with each other...

> The only way i've found to convert an existing board from
> platform_device to DT is to first add DT support to the driver, and
> then atomically swap platform_device structures for DT descriptions.

I guess if it's not working then we need to do that, but it's really sad
that the DT deployment is this painful.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120723/0dd23d02/attachment.sig>

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

* [PATCH] spi-orion: add device tree binding
  2012-07-23 10:59                     ` Andrew Lunn
@ 2012-07-23 11:12                       ` Mark Brown
  2012-07-23 17:43                         ` Arnd Bergmann
  0 siblings, 1 reply; 42+ messages in thread
From: Mark Brown @ 2012-07-23 11:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 23, 2012 at 12:59:45PM +0200, Andrew Lunn wrote:
> On Mon, Jul 23, 2012 at 11:43:34AM +0100, Mark Brown wrote:
> > On Mon, Jul 23, 2012 at 12:08:09PM +0200, Andrew Lunn wrote:

> > > +Optional properties:
> > > +- interrupts : Is currently not used.

> > Would it not be better to just omit this if it doesn't do anything and
> > doesn't have any semantics defined?

> I was specifically asked to include this, which is why it appeared in
> v2, not the first version. I forget who it was who asked for it, maybe
> Arnd Bergmann? I can dig through my email archive if you want to know.

If you're going to include it you should define some sematics for it.
You could define an optional "yohNg1ai" property too...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120723/d1e789c4/attachment.sig>

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

* [PATCH] spi-orion: add device tree binding
  2012-07-23 11:12                       ` Mark Brown
@ 2012-07-23 17:43                         ` Arnd Bergmann
  0 siblings, 0 replies; 42+ messages in thread
From: Arnd Bergmann @ 2012-07-23 17:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 23 July 2012, Mark Brown wrote:
> On Mon, Jul 23, 2012 at 12:59:45PM +0200, Andrew Lunn wrote:
> > On Mon, Jul 23, 2012 at 11:43:34AM +0100, Mark Brown wrote:
> > > On Mon, Jul 23, 2012 at 12:08:09PM +0200, Andrew Lunn wrote:
> 
> > > > +Optional properties:
> > > > +- interrupts : Is currently not used.
> 
> > > Would it not be better to just omit this if it doesn't do anything and
> > > doesn't have any semantics defined?
> 
> > I was specifically asked to include this, which is why it appeared in
> > v2, not the first version. I forget who it was who asked for it, maybe
> > Arnd Bergmann? I can dig through my email archive if you want to know.
> 
> If you're going to include it you should define some sematics for it.
> You could define an optional "yohNg1ai" property too...

Agreed. I'm rather sure I did not ask for an unused property to be
documented. However, the documentation should definitely match the
example and the what kinds of properties are used in the device tree.

If the device has an interrupt that is not used by Linux, I would
document what the interrupt is for.

	Arnd

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

* [PATCH 15/16] ARM: Kirkwood: Describe iConnect LEDs in DT.
  2012-07-20 17:35 ` [PATCH 15/16] ARM: Kirkwood: Describe iConnect " Andrew Lunn
@ 2012-07-30 21:35   ` Adam Baker
  2012-07-31  6:36     ` Andrew Lunn
  0 siblings, 1 reply; 42+ messages in thread
From: Adam Baker @ 2012-07-30 21:35 UTC (permalink / raw)
  To: linux-arm-kernel

On 20/07/12 18:35, Andrew Lunn wrote:

Sorry it's taken a while to spot this but I've got one comment below

> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>   arch/arm/boot/dts/kirkwood-iconnect.dts |   34 +++++++++++++++++++++++
>   arch/arm/mach-kirkwood/board-iconnect.c |   46 -------------------------------
>   2 files changed, 34 insertions(+), 46 deletions(-)
>
> diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
> index a7dd07b..b77b38f 100644
> --- a/arch/arm/boot/dts/kirkwood-iconnect.dts
> +++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
> @@ -31,4 +31,38 @@
>   			status = "ok";
>   		};
>   	};
> +	gpio-leds {
> +		compatible = "gpio-leds";
> +
> +		led-level {
> +			label = "led_level";
> +			gpios = <&gpio1 9 0>;
> +			linux,default-trigger = "default-on";
> +		};
> +		power-blue {
> +			label = "power:blue";
> +			gpios = <&gpio1 11 0>;
> +			linux,default-trigger = "timer";
> +		};

Is there any reason that power:red is missing here?

> +		usb1 {
> +			label = "usb1:blue";
> +			gpios = <&gpio1 12 0>;
> +		};
> +		usb2 {
> +			label = "usb2:blue";
> +			gpios = <&gpio1 13 0>;
> +		};
> +		usb3 {
> +			label = "usb3:blue";
> +			gpios = <&gpio1 14 0>;
> +		};
> +		usb4 {
> +			label = "usb4:blue";
> +			gpios = <&gpio1 15 0>;
> +		};
> +		otb {
> +			label = "otb:blue";
> +			gpios = <&gpio1 16 0>;
> +		};
> +	};
>   };
> diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
> index df043aa..d7a9198 100644
> --- a/arch/arm/mach-kirkwood/board-iconnect.c
> +++ b/arch/arm/mach-kirkwood/board-iconnect.c
> @@ -19,7 +19,6 @@
>   #include <linux/mtd/partitions.h>
>   #include <linux/mv643xx_eth.h>
>   #include <linux/gpio.h>
> -#include <linux/leds.h>
>   #include <linux/input.h>
>   #include <linux/gpio_keys.h>
>   #include <asm/mach/arch.h>
> @@ -31,50 +30,6 @@ static struct mv643xx_eth_platform_data iconnect_ge00_data = {
>   	.phy_addr	= MV643XX_ETH_PHY_ADDR(11),
>   };
>
> -static struct gpio_led iconnect_led_pins[] = {
> -	{
> -		.name		= "led_level",
> -		.gpio		= 41,
> -		.default_trigger = "default-on",
> -	}, {
> -		.name		= "power:blue",
> -		.gpio		= 42,
> -		.default_trigger = "timer",
> -	}, {
> -		.name		= "power:red",
> -		.gpio		= 43,
> -	}, {
> -		.name		= "usb1:blue",
> -		.gpio		= 44,
> -	}, {
> -		.name		= "usb2:blue",
> -		.gpio		= 45,
> -	}, {
> -		.name		= "usb3:blue",
> -		.gpio		= 46,
> -	}, {
> -		.name		= "usb4:blue",
> -		.gpio		= 47,
> -	}, {
> -		.name		= "otb:blue",
> -		.gpio		= 48,
> -	},
> -};
> -
> -static struct gpio_led_platform_data iconnect_led_data = {
> -	.leds		= iconnect_led_pins,
> -	.num_leds	= ARRAY_SIZE(iconnect_led_pins),
> -	.gpio_blink_set	= orion_gpio_led_blink_set,
> -};
> -
> -static struct platform_device iconnect_leds = {
> -	.name	= "leds-gpio",
> -	.id	= -1,
> -	.dev	= {
> -		.platform_data	= &iconnect_led_data,
> -	}
> -};
> -
>   static unsigned int iconnect_mpp_config[] __initdata = {
>   	MPP12_GPIO,
>   	MPP35_GPIO,
> @@ -140,7 +95,6 @@ void __init iconnect_init(void)
>   	kirkwood_ge00_init(&iconnect_ge00_data);
>
>   	platform_device_register(&iconnect_button_device);
> -	platform_device_register(&iconnect_leds);
>   }
>
>   static int __init iconnect_pci_init(void)
>

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

* [PATCH 15/16] ARM: Kirkwood: Describe iConnect LEDs in DT.
  2012-07-30 21:35   ` Adam Baker
@ 2012-07-31  6:36     ` Andrew Lunn
  2012-07-31  7:08       ` Arnaud Patard (Rtp)
  0 siblings, 1 reply; 42+ messages in thread
From: Andrew Lunn @ 2012-07-31  6:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 30, 2012 at 10:35:34PM +0100, Adam Baker wrote:
> On 20/07/12 18:35, Andrew Lunn wrote:
> 
> Sorry it's taken a while to spot this but I've got one comment below
> 
> >Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> >---
> >  arch/arm/boot/dts/kirkwood-iconnect.dts |   34 +++++++++++++++++++++++
> >  arch/arm/mach-kirkwood/board-iconnect.c |   46 -------------------------------
> >  2 files changed, 34 insertions(+), 46 deletions(-)
> >
> >diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
> >index a7dd07b..b77b38f 100644
> >--- a/arch/arm/boot/dts/kirkwood-iconnect.dts
> >+++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
> >@@ -31,4 +31,38 @@
> >  			status = "ok";
> >  		};
> >  	};
> >+	gpio-leds {
> >+		compatible = "gpio-leds";
> >+
> >+		led-level {
> >+			label = "led_level";
> >+			gpios = <&gpio1 9 0>;
> >+			linux,default-trigger = "default-on";
> >+		};
> >+		power-blue {
> >+			label = "power:blue";
> >+			gpios = <&gpio1 11 0>;
> >+			linux,default-trigger = "timer";
> >+		};
> 
> Is there any reason that power:red is missing here?

The monkey driving the keyboard is not reliable at monkey work...

Please create a patch and i will try to get it into rc1.

       Thanks
  	 Andrew

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

* [PATCH 15/16] ARM: Kirkwood: Describe iConnect LEDs in DT.
  2012-07-31  6:36     ` Andrew Lunn
@ 2012-07-31  7:08       ` Arnaud Patard (Rtp)
  2012-07-31  7:20         ` Andrew Lunn
  0 siblings, 1 reply; 42+ messages in thread
From: Arnaud Patard (Rtp) @ 2012-07-31  7:08 UTC (permalink / raw)
  To: linux-arm-kernel

Andrew Lunn <andrew@lunn.ch> writes:

> On Mon, Jul 30, 2012 at 10:35:34PM +0100, Adam Baker wrote:
>> On 20/07/12 18:35, Andrew Lunn wrote:
>> 
>> Sorry it's taken a while to spot this but I've got one comment below
>> 
>> >Signed-off-by: Andrew Lunn <andrew@lunn.ch>
>> >---
>> >  arch/arm/boot/dts/kirkwood-iconnect.dts |   34 +++++++++++++++++++++++
>> >  arch/arm/mach-kirkwood/board-iconnect.c |   46 -------------------------------
>> >  2 files changed, 34 insertions(+), 46 deletions(-)
>> >
>> >diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
>> >index a7dd07b..b77b38f 100644
>> >--- a/arch/arm/boot/dts/kirkwood-iconnect.dts
>> >+++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
>> >@@ -31,4 +31,38 @@
>> >  			status = "ok";
>> >  		};
>> >  	};
>> >+	gpio-leds {
>> >+		compatible = "gpio-leds";
>> >+
>> >+		led-level {
>> >+			label = "led_level";
>> >+			gpios = <&gpio1 9 0>;
>> >+			linux,default-trigger = "default-on";
>> >+		};
>> >+		power-blue {
>> >+			label = "power:blue";
>> >+			gpios = <&gpio1 11 0>;
>> >+			linux,default-trigger = "timer";
>> >+		};
>> 
>> Is there any reason that power:red is missing here?
>
> The monkey driving the keyboard is not reliable at monkey work...
>
> Please create a patch and i will try to get it into rc1.

There's already a patch for that in your mailbox ("ARM: Kirkwood: Fix
iconnect leds"). I guess you're not yet fully awake :)

Arnaud

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

* [PATCH 15/16] ARM: Kirkwood: Describe iConnect LEDs in DT.
  2012-07-31  7:08       ` Arnaud Patard (Rtp)
@ 2012-07-31  7:20         ` Andrew Lunn
  2012-07-31  8:59           ` Arnaud Patard (Rtp)
  0 siblings, 1 reply; 42+ messages in thread
From: Andrew Lunn @ 2012-07-31  7:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jul 31, 2012 at 09:08:53AM +0200, Arnaud Patard wrote:
> Andrew Lunn <andrew@lunn.ch> writes:
> 
> > On Mon, Jul 30, 2012 at 10:35:34PM +0100, Adam Baker wrote:
> >> On 20/07/12 18:35, Andrew Lunn wrote:
> >> 
> >> Sorry it's taken a while to spot this but I've got one comment below
> >> 
> >> >Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> >> >---
> >> >  arch/arm/boot/dts/kirkwood-iconnect.dts |   34 +++++++++++++++++++++++
> >> >  arch/arm/mach-kirkwood/board-iconnect.c |   46 -------------------------------
> >> >  2 files changed, 34 insertions(+), 46 deletions(-)
> >> >
> >> >diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
> >> >index a7dd07b..b77b38f 100644
> >> >--- a/arch/arm/boot/dts/kirkwood-iconnect.dts
> >> >+++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
> >> >@@ -31,4 +31,38 @@
> >> >  			status = "ok";
> >> >  		};
> >> >  	};
> >> >+	gpio-leds {
> >> >+		compatible = "gpio-leds";
> >> >+
> >> >+		led-level {
> >> >+			label = "led_level";
> >> >+			gpios = <&gpio1 9 0>;
> >> >+			linux,default-trigger = "default-on";
> >> >+		};
> >> >+		power-blue {
> >> >+			label = "power:blue";
> >> >+			gpios = <&gpio1 11 0>;
> >> >+			linux,default-trigger = "timer";
> >> >+		};
> >> 
> >> Is there any reason that power:red is missing here?
> >
> > The monkey driving the keyboard is not reliable at monkey work...
> >
> > Please create a patch and i will try to get it into rc1.
> 
> There's already a patch for that in your mailbox ("ARM: Kirkwood: Fix
> iconnect leds"). I guess you're not yet fully awake :)

Hi Arnaud

Still need my second coffee of the day.

Those patches never went to the list, as far as i remember. Please can
you post the two fixes and the two development patches, as seperate
patchsets.

Thanks
	Andrew

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

* [PATCH 15/16] ARM: Kirkwood: Describe iConnect LEDs in DT.
  2012-07-31  7:20         ` Andrew Lunn
@ 2012-07-31  8:59           ` Arnaud Patard (Rtp)
  0 siblings, 0 replies; 42+ messages in thread
From: Arnaud Patard (Rtp) @ 2012-07-31  8:59 UTC (permalink / raw)
  To: linux-arm-kernel

Andrew Lunn <andrew@lunn.ch> writes:

> On Tue, Jul 31, 2012 at 09:08:53AM +0200, Arnaud Patard wrote:
>> Andrew Lunn <andrew@lunn.ch> writes:
>> 
>> > On Mon, Jul 30, 2012 at 10:35:34PM +0100, Adam Baker wrote:
>> >> On 20/07/12 18:35, Andrew Lunn wrote:
>> >> 
>> >> Sorry it's taken a while to spot this but I've got one comment below
>> >> 
>> >> >Signed-off-by: Andrew Lunn <andrew@lunn.ch>
>> >> >---
>> >> >  arch/arm/boot/dts/kirkwood-iconnect.dts |   34 +++++++++++++++++++++++
>> >> >  arch/arm/mach-kirkwood/board-iconnect.c |   46 -------------------------------
>> >> >  2 files changed, 34 insertions(+), 46 deletions(-)
>> >> >
>> >> >diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
>> >> >index a7dd07b..b77b38f 100644
>> >> >--- a/arch/arm/boot/dts/kirkwood-iconnect.dts
>> >> >+++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
>> >> >@@ -31,4 +31,38 @@
>> >> >  			status = "ok";
>> >> >  		};
>> >> >  	};
>> >> >+	gpio-leds {
>> >> >+		compatible = "gpio-leds";
>> >> >+
>> >> >+		led-level {
>> >> >+			label = "led_level";
>> >> >+			gpios = <&gpio1 9 0>;
>> >> >+			linux,default-trigger = "default-on";
>> >> >+		};
>> >> >+		power-blue {
>> >> >+			label = "power:blue";
>> >> >+			gpios = <&gpio1 11 0>;
>> >> >+			linux,default-trigger = "timer";
>> >> >+		};
>> >> 
>> >> Is there any reason that power:red is missing here?
>> >
>> > The monkey driving the keyboard is not reliable at monkey work...
>> >
>> > Please create a patch and i will try to get it into rc1.
>> 
>> There's already a patch for that in your mailbox ("ARM: Kirkwood: Fix
>> iconnect leds"). I guess you're not yet fully awake :)
>
> Hi Arnaud
>
> Still need my second coffee of the day.
>
> Those patches never went to the list, as far as i remember. Please can
> you post the two fixes and the two development patches, as seperate
> patchsets.

Will do.

Thanks,
Arnaud

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

end of thread, other threads:[~2012-07-31  8:59 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20 17:35 [PATCH 00/16] Orion DT conversions and fixes Andrew Lunn
2012-07-20 17:35 ` [PATCH 1/16] ARM: Orion: DT support for IRQ and GPIO Controllers Andrew Lunn
2012-07-20 17:35 ` [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue Andrew Lunn
2012-07-22  7:22   ` Linus Walleij
2012-07-22  9:53     ` Andrew Lunn
2012-07-22 19:07       ` Mark Brown
2012-07-22 19:32         ` Andrew Lunn
2012-07-22 22:42           ` Mark Brown
2012-07-23  7:27             ` Andrew Lunn
2012-07-23  9:37               ` Mark Brown
2012-07-23 10:08                 ` [PATCH] spi-orion: add device tree binding Andrew Lunn
2012-07-23 10:43                   ` Mark Brown
2012-07-23 10:59                     ` Andrew Lunn
2012-07-23 11:12                       ` Mark Brown
2012-07-23 17:43                         ` Arnd Bergmann
2012-07-23 10:44                   ` Mark Brown
2012-07-23 10:50                     ` Andrew Lunn
2012-07-23 10:16                 ` [PATCH 2/16] SPI: Refactor spi-orion to use SPI framework queue Andrew Lunn
2012-07-23 10:23                   ` Mark Brown
2012-07-23 10:49                     ` Andrew Lunn
2012-07-23 11:11                       ` Mark Brown
2012-07-23 10:53           ` Sergei Shtylyov
2012-07-23 11:02             ` Andrew Lunn
2012-07-20 17:35 ` [PATCH 3/16] ARM: Kirkwood: Ensure runit clock always ticks Andrew Lunn
2012-07-20 17:35 ` [PATCH 4/16] ARM: Orion: Add arch support needed for I2C via DT Andrew Lunn
2012-07-20 17:35 ` [PATCH 5/16] Kirkwood: Add basic device tree support for QNAP TS219 Andrew Lunn
2012-07-20 17:35 ` [PATCH 6/16] ARM: Orion: DTify the watchdog timer Andrew Lunn
2012-07-20 17:35 ` [PATCH 7/16] ATA: sata_mv: Add device tree support Andrew Lunn
2012-07-20 17:35 ` [PATCH 8/16] ARM: Kirkwood: Use DT to configure SATA device Andrew Lunn
2012-07-20 17:35 ` [PATCH 9/16] ARM: Kirkwood: Describe DNS325 temperature sensor in DT Andrew Lunn
2012-07-20 17:35 ` [PATCH 10/16] ARM: Kirkwood: Describe IB62x0 gpio-keys " Andrew Lunn
2012-07-20 17:35 ` [PATCH 11/16] ARM: Kirkwood: Describe iConnects temperature sensor " Andrew Lunn
2012-07-20 17:35 ` [PATCH 12/16] ARM: Kirkwood: Describe Dreamplug LEDs " Andrew Lunn
2012-07-20 17:35 ` [PATCH 13/16] ARM: Kirkwood: Describe GoFlex Net LEDs and SATA " Andrew Lunn
2012-07-20 17:35 ` [PATCH 14/16] ARM: Kirkwood: Describe ib62x0 LEDs " Andrew Lunn
2012-07-20 17:35 ` [PATCH 15/16] ARM: Kirkwood: Describe iConnect " Andrew Lunn
2012-07-30 21:35   ` Adam Baker
2012-07-31  6:36     ` Andrew Lunn
2012-07-31  7:08       ` Arnaud Patard (Rtp)
2012-07-31  7:20         ` Andrew Lunn
2012-07-31  8:59           ` Arnaud Patard (Rtp)
2012-07-20 17:35 ` [PATCH 16/16] ARM: Kirkwood: Replace mrvl with marvell Andrew Lunn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.