Skip to contentSkip to conversation

Orion DT conversions and fixes.

PATCH New Andrew Lunn 7 participants 42 messages Jul 20, 2012 – Jul 31, 2012

Subsystems (11)
lore
Share & tools
lore

Andrew Lunn

author maintainer
#0 lore raw

cover Orion DT conversions and fixes.

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

author maintainer
#1 lore raw

PATCH 1/16 ARM: Orion: DT support for IRQ and GPIO Controllers

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.

---
 .../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(-)
Documentation/devicetree/bindings/arm/mrvl/intc.txt +20 -0
index 80b9a94..8b53273 100644
@@ -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>;
+        };
Documentation/devicetree/bindings/gpio/mrvl-gpio.txt +23 -0
index 05428f3..e137874 100644
@@ -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>;
+		};
arch/arm/Kconfig +1 -0
index a91009c..39bb941 100644
@@ -1105,6 +1105,7 @@ config PLAT_ORION
 	bool
 	select CLKSRC_MMIO
 	select GENERIC_IRQ_CHIP
+	select IRQ_DOMAIN
 	select COMMON_CLK
 
 config PLAT_PXA
arch/arm/boot/dts/kirkwood.dtsi +27 -0
index 926528b..66544d7 100644
@@ -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>;
arch/arm/mach-dove/irq.c +29 -29

76 lines not on this page · raw message

arch/arm/mach-kirkwood/board-dt.c +2 -1
index edc3f8a..27ac3d8 100644
@@ -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 <[email protected]> */
 	.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,
arch/arm/mach-kirkwood/irq.c +16 -22
index c4c68e5..720063f 100644
@@ -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);
 }
arch/arm/mach-mv78xx0/irq.c +8 -14
index e421b70..eff9a75 100644
@@ -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);
 }
arch/arm/mach-orion5x/irq.c +8 -14
index b1b45ff..17da709 100644
@@ -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);
 }
arch/arm/plat-orion/gpio.c +125 -41

256 lines not on this page · raw message

arch/arm/plat-orion/include/plat/gpio.h +7 -9
index bec0c98..81c6fc8 100644
@@ -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
arch/arm/plat-orion/include/plat/irq.h +1 -2
index f05eeab..50547e4 100644
@@ -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
arch/arm/plat-orion/irq.c +40 -0
index 2d5b9c1..d751964 100644
@@ -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
Signature · 1 line
1.7.10
author maintainer
#2 lore raw

PATCH 2/16 SPI: Refactor spi-orion to use SPI framework queue.

In reply to Andrew Lunn

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

---
 drivers/spi/spi-orion.c |  209 ++++++++++++++---------------------------------
 1 file changed, 61 insertions(+), 148 deletions(-)
drivers/spi/spi-orion.c +61 -148
index dfd04e9..547d983 100644
@@ -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);
 
Signature · 1 line
1.7.10
#3 lore raw

PATCH 2/16 SPI: Refactor spi-orion to use SPI framework queue.

Quoted 6 lines · Andrew Lunn

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

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

author maintainer
#4 lore raw

PATCH 2/16 SPI: Refactor spi-orion to use SPI framework queue.

Quoted 11 lines · Linus Walleij
Quoted 6 lines · Andrew Lunn

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

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

#5 lore raw

PATCH 2/16 SPI: Refactor spi-orion to use SPI framework queue.

Quoted 5 lines · Andrew Lunn

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

Quoted 2 lines

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>

author maintainer
#6 lore raw

PATCH 2/16 SPI: Refactor spi-orion to use SPI framework queue.

Quoted 10 lines · Mark Brown
Quoted 5 lines · Andrew Lunn

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

#7 lore raw

PATCH 2/16 SPI: Refactor spi-orion to use SPI framework queue.

Quoted 5 lines · Andrew Lunn
Quoted 2 lines · Mark Brown

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

Quoted 8 lines

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>

author maintainer
#8 lore raw

PATCH 2/16 SPI: Refactor spi-orion to use SPI framework queue.

Quoted 11 lines · Mark Brown
Quoted 9 lines · Andrew Lunn
Quoted 2 lines · Mark Brown

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

Quoted 7 lines
Quoted 3 lines

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

#9 lore raw

PATCH 2/16 SPI: Refactor spi-orion to use SPI framework queue.

Quoted 3 lines · Andrew Lunn

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>

author maintainer
#10 lore raw

PATCH 1/1 spi-orion: add device tree binding

Quoted 1 line

From 528a19e9eda968cc673331d566cbfe20962d3b32 Mon Sep 17 00:00:00 2001

From: Michael Walle <[email protected]>
Date: Wed, 6 Jun 2012 19:16:28 +0200
Subject: [PATCHv3] spi-orion: add device tree binding

---
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
Documentation/devicetree/bindings/spi/spi-orion.txt new file +19 -0
new file mode 100644
index 0000000..a3ff50f
@@ -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";
+       };
drivers/spi/spi-orion.c +17 -0
index dfd04e9..74312a8 100644
@@ -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),
 };
Signature · 1 line
1.7.10.4
#11 lore raw

PATCH 1/1 spi-orion: add device tree binding

Quoted 4 lines · Andrew Lunn

From 528a19e9eda968cc673331d566cbfe20962d3b32 Mon Sep 17 00:00:00 2001
From: Michael Walle <[email protected]>
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 :(

Quoted 2 lines

+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>

author maintainer
#12 lore raw

PATCH 1/1 spi-orion: add device tree binding

Quoted 6 lines · Mark Brown
Quoted 4 lines · Andrew Lunn

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

Quoted 8 lines

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

Quoted 2 lines

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

Quoted 3 lines

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

O.K.

Thanks
Andrew

#13 lore raw

PATCH 1/1 spi-orion: add device tree binding

Quoted 6 lines · Andrew Lunn
Quoted 4 lines · Mark Brown
Quoted 2 lines · Andrew Lunn

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

Quoted 6 lines
Quoted 2 lines

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>

#14 lore raw

PATCH 1/1 spi-orion: add device tree binding

Quoted 10 lines · Mark Brown
Quoted 8 lines · Andrew Lunn
Quoted 7 lines · Mark Brown
Quoted 2 lines · Andrew Lunn

+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?

Quoted 6 lines
Quoted 3 lines

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

#15 lore raw

PATCH 1/1 spi-orion: add device tree binding

In reply to Andrew Lunn
Quoted 4 lines · Andrew Lunn

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>

author maintainer
#17 lore raw

PATCH 2/16 SPI: Refactor spi-orion to use SPI framework queue.

In reply to Mark Brown
Quoted 7 lines · Mark Brown
Quoted 3 lines · Andrew Lunn

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.

Quoted 2 lines

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

#18 lore raw

PATCH 2/16 SPI: Refactor spi-orion to use SPI framework queue.

Quoted 9 lines · Andrew Lunn
Quoted 2 lines · Mark Brown

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>

author maintainer
#19 lore raw

PATCH 2/16 SPI: Refactor spi-orion to use SPI framework queue.

Quoted 6 lines · Mark Brown
Quoted 4 lines · Andrew Lunn
Quoted 2 lines · Mark Brown

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.

Quoted 7 lines
Quoted 4 lines

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

#20 lore raw

PATCH 2/16 SPI: Refactor spi-orion to use SPI framework queue.

Quoted 2 lines · Andrew Lunn

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.

Quoted 2 lines

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

Quoted 3 lines

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>

#21 lore raw

PATCH 2/16 SPI: Refactor spi-orion to use SPI framework queue.

In reply to Andrew Lunn

Hello.

Quoted 11 lines · Andrew Lunn
Quoted 8 lines
Quoted 5 lines

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? ;-)

Quoted 5 lines

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

author maintainer
#22 lore raw

PATCH 2/16 SPI: Refactor spi-orion to use SPI framework queue.

Quoted 10 lines · Sergei Shtylyov

Hello.

Quoted 5 lines · Andrew Lunn
Quoted 5 lines
Quoted 5 lines

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.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

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

author maintainer
#23 lore raw

PATCH 3/16 ARM: Kirkwood: Ensure runit clock always ticks.

In reply to Andrew Lunn

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.

---
 arch/arm/mach-kirkwood/common.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-kirkwood/common.c +5 -0
index f261cd2..3de2d6d 100644
@@ -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);
 }
 
 /*****************************************************************************
Signature · 1 line
1.7.10
author maintainer
#24 lore raw

PATCH 4/16 ARM: Orion: Add arch support needed for I2C via DT.

In reply to Andrew Lunn

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.

---
 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(+)
arch/arm/boot/dts/kirkwood.dtsi +10 -0
index a3350fd..e13d746 100644
@@ -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";
+		};
 	};
 };
arch/arm/mach-kirkwood/board-dt.c +2 -0
index 8f8da5d..24c8fdd 100644
@@ -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),
 	{},
 };
 
arch/arm/mach-kirkwood/common.c +2 -0
index 3de2d6d..df8079e 100644
@@ -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.
arch/arm/plat-orion/common.c +1 -0
index c179378..d245a87 100644
@@ -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
Signature · 1 line
1.7.10
author maintainer
#25 lore raw

PATCH 5/16 Kirkwood: Add basic device tree support for QNAP TS219.

In reply to Andrew Lunn

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.

---
 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
arch/arm/boot/dts/kirkwood-ts219-6281.dts new file +21 -0
new file mode 100644
index 0000000..ccbf327
@@ -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
arch/arm/boot/dts/kirkwood-ts219-6282.dts new file +21 -0
new file mode 100644
index 0000000..fbe9932
@@ -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
arch/arm/boot/dts/kirkwood-ts219.dtsi new file +74 -0

74 lines not on this page · raw message

arch/arm/mach-kirkwood/Kconfig +14 -0
index 199764f..8e62fa7 100644
@@ -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
arch/arm/mach-kirkwood/Makefile +1 -0
index d2b0590..8b02328 100644
@@ -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
arch/arm/mach-kirkwood/Makefile.boot +1 -0
index 02edbdf..4a1f66a 100644
@@ -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
arch/arm/mach-kirkwood/board-dt.c +4 -0
index 24c8fdd..b7cd6d2 100644
@@ -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
 };
 
arch/arm/mach-kirkwood/board-ts219.c new file +87 -0

87 lines not on this page · raw message

arch/arm/mach-kirkwood/common.h +5 -0
index 9248fa2..e0c2324 100644
@@ -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);
Signature · 1 line
1.7.10
author maintainer
#26 lore raw

PATCH 6/16 ARM: Orion: DTify the watchdog timer.

In reply to Andrew Lunn

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

---
 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
Documentation/devicetree/bindings/watchdog/marvel.txt new file +14 -0
new file mode 100644
index 0000000..0b2503a
@@ -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";
+	};
arch/arm/boot/dts/kirkwood.dtsi +6 -0
index e13d746..3e0e9b9 100644
@@ -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>;
arch/arm/mach-kirkwood/board-dt.c +1 -1
index b7cd6d2..73e75cf 100644
@@ -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();
drivers/watchdog/orion_wdt.c +8 -0
index 0f57369..1531e02 100644
@@ -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),
 	},
 };
 
Signature · 1 line
1.7.10
author maintainer
#27 lore raw

PATCH 7/16 ATA: sata_mv: Add device tree support

In reply to Andrew Lunn

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.

---
 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
Documentation/devicetree/bindings/ata/marvell.txt new file +16 -0
new file mode 100644
index 0000000..b5cdd20
@@ -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>;
+	}
arch/arm/boot/dts/kirkwood.dtsi +7 -0
index 3e0e9b9..fbb96ce 100644
@@ -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>;
arch/arm/mach-kirkwood/board-dt.c +1 -0
index 73e75cf..d0ad250 100644
@@ -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),
 	{},
 };
 
drivers/ata/sata_mv.c +29 -13

73 lines not on this page · raw message

Signature · 1 line
1.7.10
author maintainer
#28 lore raw

PATCH 8/16 ARM: Kirkwood: Use DT to configure SATA device.

In reply to Andrew Lunn

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

---
 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(-)
arch/arm/boot/dts/kirkwood-dns320.dts +5 -0
index dc09a73..f2a9808 100644
@@ -26,6 +26,11 @@
 			status = "okay";
 		};
 
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
+
 		nand at 3000000 {
 			status = "okay";
 
arch/arm/boot/dts/kirkwood-dns325.dts +5 -0
index c2a5562..10bc819 100644
@@ -21,6 +21,11 @@
 			status = "okay";
 		};
 
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
+
 		nand at 3000000 {
 			status = "okay";
 
arch/arm/boot/dts/kirkwood-dreamplug.dts +5 -0
index d74d1ae..24de2b5 100644
@@ -48,6 +48,11 @@
 				};
 			};
 		};
+
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <1>;
+		};
 	};
 
 };
arch/arm/boot/dts/kirkwood-ib62x0.dts +5 -0
index ada0f0c..f8e2bc6 100644
@@ -21,6 +21,11 @@
 			status = "okay";
 		};
 
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
+
 		nand at 3000000 {
 			status = "okay";
 
arch/arm/boot/dts/kirkwood-ts219.dtsi +4 -0
index 7b3f961..b4a789a 100644
@@ -70,5 +70,9 @@
 				};
 			};
 		};
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
 	};
 };
arch/arm/mach-kirkwood/board-dnskw.c +0 -5
index 58c2d68..179f4b3 100644
@@ -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);
arch/arm/mach-kirkwood/board-dreamplug.c +0 -5
index eb0e4d5..e494393 100644
@@ -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);
arch/arm/mach-kirkwood/board-ib62x0.c +0 -5
index eddf1df..56d198e 100644
@@ -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 &&
arch/arm/mach-kirkwood/board-ts219.c +0 -5
index 00b79ea..1750e68 100644
@@ -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;
Signature · 1 line
1.7.10
author maintainer
#29 lore raw

PATCH 9/16 ARM: Kirkwood: Describe DNS325 temperature sensor in DT.

In reply to Andrew Lunn

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

---
 arch/arm/boot/dts/kirkwood-dns325.dts |    8 ++++++++
 arch/arm/mach-kirkwood/board-dnskw.c  |   15 ++-------------
 2 files changed, 10 insertions(+), 13 deletions(-)
arch/arm/boot/dts/kirkwood-dns325.dts +8 -0
index 10bc819..e040d6c 100644
@@ -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";
arch/arm/mach-kirkwood/board-dnskw.c +2 -13
index 179f4b3..1c97efa 100644
@@ -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. */
Signature · 1 line
1.7.10
author maintainer
#30 lore raw

PATCH 10/16 ARM: Kirkwood: Describe IB62x0 gpio-keys in DT.

In reply to Andrew Lunn

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

---
 arch/arm/boot/dts/kirkwood-ib62x0.dts |   16 ++++++++++++++++
 arch/arm/mach-kirkwood/board-ib62x0.c |   31 -------------------------------
 2 files changed, 16 insertions(+), 31 deletions(-)
arch/arm/boot/dts/kirkwood-ib62x0.dts +16 -0
index f8e2bc6..6726aa9 100644
@@ -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>;
+		};
+	};
 };
arch/arm/mach-kirkwood/board-ib62x0.c +0 -31
index 56d198e..f30065e 100644
@@ -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;
Signature · 1 line
1.7.10
author maintainer
#31 lore raw

PATCH 11/16 ARM: Kirkwood: Describe iConnects temperature sensor in DT.

In reply to Andrew Lunn

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

---
 arch/arm/boot/dts/kirkwood-iconnect.dts |    8 ++++++++
 arch/arm/mach-kirkwood/board-iconnect.c |   10 ----------
 2 files changed, 8 insertions(+), 10 deletions(-)
arch/arm/boot/dts/kirkwood-iconnect.dts +8 -0
index 1ba75d4..a7dd07b 100644
@@ -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";
arch/arm/mach-kirkwood/board-iconnect.c +0 -10
index b0d3cc4..df043aa 100644
@@ -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);
Signature · 1 line
1.7.10
author maintainer
#32 lore raw

PATCH 12/16 ARM: Kirkwood: Describe Dreamplug LEDs in DT.

In reply to Andrew Lunn
---
 arch/arm/boot/dts/kirkwood-dreamplug.dts |   16 ++++++++++++++
 arch/arm/mach-kirkwood/board-dreamplug.c |   34 ------------------------------
 2 files changed, 16 insertions(+), 34 deletions(-)
arch/arm/boot/dts/kirkwood-dreamplug.dts +16 -0
index 24de2b5..77fec4e 100644
@@ -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>;
+		};
+	};
 };
arch/arm/mach-kirkwood/board-dreamplug.c +0 -34
index e494393..aeb234d 100644
@@ -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);
 }
Signature · 1 line
1.7.10
author maintainer
#33 lore raw

PATCH 13/16 ARM: Kirkwood: Describe GoFlex Net LEDs and SATA in DT.

In reply to Andrew Lunn
---
 arch/arm/boot/dts/kirkwood-goflexnet.dts |   50 ++++++++++++++++++
 arch/arm/mach-kirkwood/board-goflexnet.c |   84 ------------------------------
 2 files changed, 50 insertions(+), 84 deletions(-)
arch/arm/boot/dts/kirkwood-goflexnet.dts +50 -0
index c5d5a4e..f6974d1 100644
@@ -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>;
+		};
 	};
 };
arch/arm/mach-kirkwood/board-goflexnet.c +0 -84

100 lines not on this page · raw message

Signature · 1 line
1.7.10
author maintainer
#34 lore raw

PATCH 14/16 ARM: Kirkwood: Describe ib62x0 LEDs in DT.

In reply to Andrew Lunn
---
 arch/arm/boot/dts/kirkwood-ib62x0.dts |   17 ++++++++++++++++
 arch/arm/mach-kirkwood/board-ib62x0.c |   36 ---------------------------------
 2 files changed, 17 insertions(+), 36 deletions(-)
arch/arm/boot/dts/kirkwood-ib62x0.dts +17 -0
index 6726aa9..ab35288 100644
@@ -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>;
+		};
+	};
 };
arch/arm/mach-kirkwood/board-ib62x0.c +0 -36
index f30065e..cfc47f8 100644
@@ -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;
Signature · 1 line
1.7.10
author maintainer
#35 lore raw

PATCH 15/16 ARM: Kirkwood: Describe iConnect LEDs in DT.

In reply to Andrew Lunn
---
 arch/arm/boot/dts/kirkwood-iconnect.dts |   34 +++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-iconnect.c |   46 -------------------------------
 2 files changed, 34 insertions(+), 46 deletions(-)
arch/arm/boot/dts/kirkwood-iconnect.dts +34 -0
index a7dd07b..b77b38f 100644
@@ -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>;
+		};
+	};
 };
arch/arm/mach-kirkwood/board-iconnect.c +0 -46

64 lines not on this page · raw message

Signature · 1 line
1.7.10
#36 lore raw

PATCH 15/16 ARM: Kirkwood: Describe iConnect LEDs in DT.

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

Quoted 17 lines
---
  arch/arm/boot/dts/kirkwood-iconnect.dts |   34 +++++++++++++++++++++++
  arch/arm/mach-kirkwood/board-iconnect.c |   46 -------------------------------
  2 files changed, 34 insertions(+), 46 deletions(-)
arch/arm/boot/dts/kirkwood-iconnect.dts +3 -0
index a7dd07b..b77b38f 100644
@@ -31,4 +31,38 @@
  			status = "ok";
  		};
  	};
+	gpio-leds {
+		compatible = "gpio-leds";
+

arch/arm/boot/dts/kirkwood-iconnect.dts line 46

Quoted 10 lines
arch/arm/boot/dts/kirkwood-iconnect.dts +10 -0
+		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?

Quoted 94 lines
arch/arm/boot/dts/kirkwood-iconnect.dts +21 -0
+		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>;
+		};
+	};
  };
arch/arm/mach-kirkwood/board-iconnect.c +0 -46
index df043aa..d7a9198 100644
@@ -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)
author maintainer
#37 lore raw

PATCH 15/16 ARM: Kirkwood: Describe iConnect LEDs in DT.

Quoted 25 lines · Adam Baker

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

Quoted 21 lines
---
 arch/arm/boot/dts/kirkwood-iconnect.dts |   34 +++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-iconnect.c |   46 -------------------------------
 2 files changed, 34 insertions(+), 46 deletions(-)
arch/arm/boot/dts/kirkwood-iconnect.dts +7 -0
index a7dd07b..b77b38f 100644
@@ -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";
Quoted 8 lines

arch/arm/boot/dts/kirkwood-iconnect.dts line 46

Quoted 6 lines
arch/arm/boot/dts/kirkwood-iconnect.dts +6 -0
+		};
+		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

#38 lore raw

PATCH 15/16 ARM: Kirkwood: Describe iConnect LEDs in DT.

Quoted 35 lines · Andrew Lunn
Quoted 25 lines · Adam Baker

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

Quoted 21 lines
---
 arch/arm/boot/dts/kirkwood-iconnect.dts |   34 +++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-iconnect.c |   46 -------------------------------
 2 files changed, 34 insertions(+), 46 deletions(-)
arch/arm/boot/dts/kirkwood-iconnect.dts +7 -0
index a7dd07b..b77b38f 100644
@@ -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";
Quoted 8 lines

arch/arm/boot/dts/kirkwood-iconnect.dts line 46

Quoted 6 lines
arch/arm/boot/dts/kirkwood-iconnect.dts +6 -0
+		};
+		power-blue {
+			label = "power:blue";
+			gpios = <&gpio1 11 0>;
+			linux,default-trigger = "timer";
+		};

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

Quoted 3 lines

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

author maintainer
#39 lore raw

PATCH 15/16 ARM: Kirkwood: Describe iConnect LEDs in DT.

Quoted 37 lines · Arnaud Patard
Quoted 35 lines · Andrew Lunn
Quoted 33 lines · Adam Baker

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

Quoted 17 lines
---
 arch/arm/boot/dts/kirkwood-iconnect.dts |   34 +++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-iconnect.c |   46 -------------------------------
 2 files changed, 34 insertions(+), 46 deletions(-)
arch/arm/boot/dts/kirkwood-iconnect.dts +3 -0
index a7dd07b..b77b38f 100644
@@ -31,4 +31,38 @@
 			status = "ok";
 		};
 	};
+	gpio-leds {
+		compatible = "gpio-leds";
+

arch/arm/boot/dts/kirkwood-iconnect.dts line 46

Quoted 10 lines
arch/arm/boot/dts/kirkwood-iconnect.dts +10 -0
+		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?

Quoted 6 lines
Quoted 3 lines

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

#40 lore raw

PATCH 15/16 ARM: Kirkwood: Describe iConnect LEDs in DT.

Quoted 45 lines · Andrew Lunn
Quoted 37 lines · Arnaud Patard
Quoted 35 lines · Andrew Lunn
Quoted 33 lines · Adam Baker

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

Quoted 17 lines
---
 arch/arm/boot/dts/kirkwood-iconnect.dts |   34 +++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-iconnect.c |   46 -------------------------------
 2 files changed, 34 insertions(+), 46 deletions(-)
arch/arm/boot/dts/kirkwood-iconnect.dts +3 -0
index a7dd07b..b77b38f 100644
@@ -31,4 +31,38 @@
 			status = "ok";
 		};
 	};
+	gpio-leds {
+		compatible = "gpio-leds";
+

arch/arm/boot/dts/kirkwood-iconnect.dts line 46

Quoted 10 lines
arch/arm/boot/dts/kirkwood-iconnect.dts +10 -0
+		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?

Quoted 6 lines
Quoted 3 lines

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

Quoted 7 lines

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

author maintainer
#41 lore raw

PATCH 16/16 ARM: Kirkwood: Replace mrvl with marvell

In reply to Andrew Lunn

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

---
 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(-)
Documentation/devicetree/bindings/mtd/orion-nand.txt +2 -2
index b2356b7..2d6ab66 100644
@@ -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 {
arch/arm/boot/dts/kirkwood-dns320.dts +1 -1
index d41e204..5bb0bf3 100644
@@ -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";
arch/arm/boot/dts/kirkwood-dns325.dts +1 -1
index 2662efc..d430713 100644
@@ -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";
arch/arm/boot/dts/kirkwood-dnskw.dtsi +1 -1
index 2bad626..7408655 100644
@@ -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";
arch/arm/boot/dts/kirkwood-dreamplug.dts +1 -1
index 77fec4e..26e281f 100644
@@ -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";
arch/arm/boot/dts/kirkwood-goflexnet.dts +1 -1
index f6974d1..7c8238f 100644
@@ -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";
arch/arm/boot/dts/kirkwood-ib62x0.dts +1 -1
index ab35288..66794ed 100644
@@ -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";
arch/arm/boot/dts/kirkwood-iconnect.dts +1 -1
index b77b38f..52d9470 100644
@@ -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";
arch/arm/boot/dts/kirkwood-lschlv2.dts +1 -1
index 37649b5..9510c9e 100644
@@ -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";
arch/arm/boot/dts/kirkwood-lsxhl.dts +1 -1
index eb3c071..739019c 100644
@@ -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";
arch/arm/boot/dts/kirkwood-ts219.dtsi +1 -1
index b4a789a..64ea27c 100644
@@ -2,7 +2,7 @@
 
 / {
 	model = "QNAP TS219 family";
-	compatible = "qnap,ts219", "mrvl,kirkwood";
+	compatible = "qnap,ts219", "marvell,kirkwood";
 
 	memory {
 		device_type = "memory";
arch/arm/boot/dts/kirkwood.dtsi +3 -3
index fbb96ce..cef9616 100644
@@ -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 */
arch/arm/mach-kirkwood/board-dt.c +1 -1
index 43142cf..e4eb450 100644
@@ -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),
 	{},
 };
 
drivers/mtd/nand/orion_nand.c +1 -1
index 513dc88..f8a5563 100644
@@ -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
drivers/rtc/rtc-mv.c +1 -1
index b2185f4..ebc1649 100644
@@ -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
Signature · 1 line
1.7.10