All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ARM: shmobile: kzm9g: add irqpin to DT
@ 2013-03-21 16:05 ` Guennadi Liakhovetski
  0 siblings, 0 replies; 20+ messages in thread
From: Guennadi Liakhovetski @ 2013-03-21 16:05 UTC (permalink / raw)
  To: linux-arm-kernel

These 3 patches extend irqpin DT bindings to more completely support 
sh73a0, add irqpin DT nodes to sh73a0.dtsi and use them to add ethernet 
support to kzm9g-reference.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

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

* [PATCH 0/3] ARM: shmobile: kzm9g: add irqpin to DT
@ 2013-03-21 16:05 ` Guennadi Liakhovetski
  0 siblings, 0 replies; 20+ messages in thread
From: Guennadi Liakhovetski @ 2013-03-21 16:05 UTC (permalink / raw)
  To: linux-arm-kernel

These 3 patches extend irqpin DT bindings to more completely support 
sh73a0, add irqpin DT nodes to sh73a0.dtsi and use them to add ethernet 
support to kzm9g-reference.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

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

* [PATCH 1/3] ARM: shmobile: irqpin: fix handling of spurious interrupts in DT case
  2013-03-21 16:05 ` Guennadi Liakhovetski
@ 2013-03-21 16:05   ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 20+ messages in thread
From: Guennadi Liakhovetski @ 2013-03-21 16:05 UTC (permalink / raw)
  To: linux-arm-kernel

To disable spurious interrupts, that get triggered on certain hardware, the
irqpin driver masks them on the parent interrupt controller. To specify
such broken devices a .control_parent parameter can be provided in the
platform data. In the DT case we need a property, to do the same. However,
this is not enough to correctly handle spurious interrupts in the DT case.
In the non-DT case all interrupts get mapped statically during probing,
therefore, if a spurious interrupt arrives, it can easily be mapped back
to hardware registers and bits and handled. In the DT case interrupts are
mapped only when a device, using that interrupt is instantiated from DT.
So, spurious interrupts occur unmapped and thus cannot be handled properly.
This patch fixes this by mapping such interrupts as they occur.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 .../interrupt-controller/renesas,intc-irqpin.txt   |   13 +++++++++++++
 drivers/irqchip/irq-renesas-intc-irqpin.c          |   13 +++++++++++++
 2 files changed, 26 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt

diff --git a/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt b/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt
new file mode 100644
index 0000000..e55d183
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt
@@ -0,0 +1,13 @@
+DT bindings for the R-/SH-Mobile irqpin controller
+
+Required properties:
+
+- compatible: has to be "renesas,intc-irqpin"
+- #interrupt-cells: has to be <2>
+
+Optional properties:
+
+- any properties, listed in interrupts.txt in this directory, and any standard
+  resource allocation properties
+- control-parent: disable and enable interrupts on the parent interrupt
+  controller, needed for some broken implementations
diff --git a/drivers/irqchip/irq-renesas-intc-irqpin.c b/drivers/irqchip/irq-renesas-intc-irqpin.c
index fd5dabc..82bbe8f 100644
--- a/drivers/irqchip/irq-renesas-intc-irqpin.c
+++ b/drivers/irqchip/irq-renesas-intc-irqpin.c
@@ -18,6 +18,7 @@
  */
 
 #include <linux/init.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
@@ -70,6 +71,7 @@ struct intc_irqpin_priv {
 	struct intc_irqpin_iomem iomem[INTC_IRQPIN_REG_NR];
 	struct intc_irqpin_irq irq[INTC_IRQPIN_MAX];
 	struct renesas_intc_irqpin_config config;
+	unsigned int min_irq;
 	unsigned int number_of_irqs;
 	struct platform_device *pdev;
 	struct irq_chip irq_chip;
@@ -249,6 +251,10 @@ static irqreturn_t intc_irqpin_irq_handler(int irq, void *dev_id)
 	struct intc_irqpin_priv *p = i->p;
 	unsigned long bit;
 
+	if (!i->domain_irq)
+		/* unmapped: spurious IRQ, map it now */
+		irq_create_mapping(p->irq_domain, irq - p->min_irq);
+
 	intc_irqpin_dbg(i, "demux1");
 	bit = intc_irqpin_hwirq_mask(p, INTC_IRQPIN_REG_SOURCE, i->hw_irq);
 
@@ -321,6 +327,7 @@ static int intc_irqpin_probe(struct platform_device *pdev)
 		}
 	}
 
+	p->min_irq = INT_MAX;
 	/* allow any number of IRQs between 1 and INTC_IRQPIN_MAX */
 	for (k = 0; k < INTC_IRQPIN_MAX; k++) {
 		irq = platform_get_resource(pdev, IORESOURCE_IRQ, k);
@@ -329,6 +336,8 @@ static int intc_irqpin_probe(struct platform_device *pdev)
 
 		p->irq[k].p = p;
 		p->irq[k].requested_irq = irq->start;
+		if (p->min_irq > irq->start)
+			p->min_irq = irq->start;
 	}
 
 	p->number_of_irqs = k;
@@ -372,6 +381,10 @@ static int intc_irqpin_probe(struct platform_device *pdev)
 	for (k = 0; k < p->number_of_irqs; k++)
 		intc_irqpin_mask_unmask_prio(p, k, 1);
 
+	if (!pdata)
+		p->config.control_parent = of_property_read_bool(pdev->dev.of_node,
+								 "control-parent");
+
 	/* use more severe masking method if requested */
 	if (p->config.control_parent) {
 		enable_fn = intc_irqpin_irq_enable_force;
-- 
1.7.2.5


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

* [PATCH 1/3] ARM: shmobile: irqpin: fix handling of spurious interrupts in DT case
@ 2013-03-21 16:05   ` Guennadi Liakhovetski
  0 siblings, 0 replies; 20+ messages in thread
From: Guennadi Liakhovetski @ 2013-03-21 16:05 UTC (permalink / raw)
  To: linux-arm-kernel

To disable spurious interrupts, that get triggered on certain hardware, the
irqpin driver masks them on the parent interrupt controller. To specify
such broken devices a .control_parent parameter can be provided in the
platform data. In the DT case we need a property, to do the same. However,
this is not enough to correctly handle spurious interrupts in the DT case.
In the non-DT case all interrupts get mapped statically during probing,
therefore, if a spurious interrupt arrives, it can easily be mapped back
to hardware registers and bits and handled. In the DT case interrupts are
mapped only when a device, using that interrupt is instantiated from DT.
So, spurious interrupts occur unmapped and thus cannot be handled properly.
This patch fixes this by mapping such interrupts as they occur.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 .../interrupt-controller/renesas,intc-irqpin.txt   |   13 +++++++++++++
 drivers/irqchip/irq-renesas-intc-irqpin.c          |   13 +++++++++++++
 2 files changed, 26 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt

diff --git a/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt b/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt
new file mode 100644
index 0000000..e55d183
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt
@@ -0,0 +1,13 @@
+DT bindings for the R-/SH-Mobile irqpin controller
+
+Required properties:
+
+- compatible: has to be "renesas,intc-irqpin"
+- #interrupt-cells: has to be <2>
+
+Optional properties:
+
+- any properties, listed in interrupts.txt in this directory, and any standard
+  resource allocation properties
+- control-parent: disable and enable interrupts on the parent interrupt
+  controller, needed for some broken implementations
diff --git a/drivers/irqchip/irq-renesas-intc-irqpin.c b/drivers/irqchip/irq-renesas-intc-irqpin.c
index fd5dabc..82bbe8f 100644
--- a/drivers/irqchip/irq-renesas-intc-irqpin.c
+++ b/drivers/irqchip/irq-renesas-intc-irqpin.c
@@ -18,6 +18,7 @@
  */
 
 #include <linux/init.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
@@ -70,6 +71,7 @@ struct intc_irqpin_priv {
 	struct intc_irqpin_iomem iomem[INTC_IRQPIN_REG_NR];
 	struct intc_irqpin_irq irq[INTC_IRQPIN_MAX];
 	struct renesas_intc_irqpin_config config;
+	unsigned int min_irq;
 	unsigned int number_of_irqs;
 	struct platform_device *pdev;
 	struct irq_chip irq_chip;
@@ -249,6 +251,10 @@ static irqreturn_t intc_irqpin_irq_handler(int irq, void *dev_id)
 	struct intc_irqpin_priv *p = i->p;
 	unsigned long bit;
 
+	if (!i->domain_irq)
+		/* unmapped: spurious IRQ, map it now */
+		irq_create_mapping(p->irq_domain, irq - p->min_irq);
+
 	intc_irqpin_dbg(i, "demux1");
 	bit = intc_irqpin_hwirq_mask(p, INTC_IRQPIN_REG_SOURCE, i->hw_irq);
 
@@ -321,6 +327,7 @@ static int intc_irqpin_probe(struct platform_device *pdev)
 		}
 	}
 
+	p->min_irq = INT_MAX;
 	/* allow any number of IRQs between 1 and INTC_IRQPIN_MAX */
 	for (k = 0; k < INTC_IRQPIN_MAX; k++) {
 		irq = platform_get_resource(pdev, IORESOURCE_IRQ, k);
@@ -329,6 +336,8 @@ static int intc_irqpin_probe(struct platform_device *pdev)
 
 		p->irq[k].p = p;
 		p->irq[k].requested_irq = irq->start;
+		if (p->min_irq > irq->start)
+			p->min_irq = irq->start;
 	}
 
 	p->number_of_irqs = k;
@@ -372,6 +381,10 @@ static int intc_irqpin_probe(struct platform_device *pdev)
 	for (k = 0; k < p->number_of_irqs; k++)
 		intc_irqpin_mask_unmask_prio(p, k, 1);
 
+	if (!pdata)
+		p->config.control_parent = of_property_read_bool(pdev->dev.of_node,
+								 "control-parent");
+
 	/* use more severe masking method if requested */
 	if (p->config.control_parent) {
 		enable_fn = intc_irqpin_irq_enable_force;
-- 
1.7.2.5

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

* [PATCH 2/3] ARM: shmobile: sh73a0: add irqpin DT nodes
  2013-03-21 16:05 ` Guennadi Liakhovetski
@ 2013-03-21 16:05   ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 20+ messages in thread
From: Guennadi Liakhovetski @ 2013-03-21 16:05 UTC (permalink / raw)
  To: linux-arm-kernel

Add DT nodes for the 4 irqpin interrupt controllers on sh73a0. We add them
to sh73a0.dtsi, which is also used by configurations, doing all their
device instantiation from board the .c code. We rely on the fact, that
such configurations don't instantiate devices from the device-tree.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 arch/arm/boot/dts/sh73a0.dtsi |   81 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 81 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/sh73a0.dtsi b/arch/arm/boot/dts/sh73a0.dtsi
index 3e4d383..ec40bf7 100644
--- a/arch/arm/boot/dts/sh73a0.dtsi
+++ b/arch/arm/boot/dts/sh73a0.dtsi
@@ -38,6 +38,87 @@
 		      <0xf0000100 0x100>;
 	};
 
+	irqpin0: irqpin@e6900000 {
+		compatible = "renesas,intc-irqpin";
+		#interrupt-cells = <2>;
+		interrupt-controller;
+		reg = <0xe6900000 4>,
+			<0xe6900010 4>,
+			<0xe6900020 1>,
+			<0xe6900040 1>,
+			<0xe6900060 1>;
+		interrupt-parent = <&gic>;
+		interrupts = <0 1 0x4
+			      0 2 0x4
+			      0 3 0x4
+			      0 4 0x4
+			      0 5 0x4
+			      0 6 0x4
+			      0 7 0x4
+			      0 8 0x4>;
+	};
+
+	irqpin1: irqpin@e6900004 {
+		compatible = "renesas,intc-irqpin";
+		#interrupt-cells = <2>;
+		interrupt-controller;
+		reg = <0xe6900004 4>,
+			<0xe6900014 4>,
+			<0xe6900024 1>,
+			<0xe6900044 1>,
+			<0xe6900064 1>;
+		interrupt-parent = <&gic>;
+		interrupts = <0 9 0x4
+			      0 10 0x4
+			      0 11 0x4
+			      0 12 0x4
+			      0 13 0x4
+			      0 14 0x4
+			      0 15 0x4
+			      0 16 0x4>;
+		control-parent;
+	};
+
+	irqpin2: irqpin@e6900008 {
+		compatible = "renesas,intc-irqpin";
+		#interrupt-cells = <2>;
+		interrupt-controller;
+		reg = <0xe6900008 4>,
+			<0xe6900018 4>,
+			<0xe6900028 1>,
+			<0xe6900048 1>,
+			<0xe6900068 1>;
+		interrupt-parent = <&gic>;
+		interrupts = <0 17 0x4
+			      0 18 0x4
+			      0 19 0x4
+			      0 20 0x4
+			      0 21 0x4
+			      0 22 0x4
+			      0 23 0x4
+			      0 24 0x4>;
+	};
+
+	irqpin3: irqpin@e690000c {
+		compatible = "renesas,intc-irqpin";
+		#interrupt-cells = <2>;
+		interrupt-controller;
+		reg = <0xe690000c 4>,
+			<0xe690001c 4>,
+			<0xe690002c 1>,
+			<0xe690004c 1>,
+			<0xe690006c 1>;
+		interrupt-parent = <&gic>;
+		interrupts = <0 25 0x4
+			      0 26 0x4
+			      0 27 0x4
+			      0 28 0x4
+			      0 29 0x4
+			      0 30 0x4
+			      0 31 0x4
+			      0 32 0x4>;
+	};
+
 	i2c0: i2c@0xe6820000 {
 		#address-cells = <1>;
 		#size-cells = <0>;
-- 
1.7.2.5


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

* [PATCH 2/3] ARM: shmobile: sh73a0: add irqpin DT nodes
@ 2013-03-21 16:05   ` Guennadi Liakhovetski
  0 siblings, 0 replies; 20+ messages in thread
From: Guennadi Liakhovetski @ 2013-03-21 16:05 UTC (permalink / raw)
  To: linux-arm-kernel

Add DT nodes for the 4 irqpin interrupt controllers on sh73a0. We add them
to sh73a0.dtsi, which is also used by configurations, doing all their
device instantiation from board the .c code. We rely on the fact, that
such configurations don't instantiate devices from the device-tree.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 arch/arm/boot/dts/sh73a0.dtsi |   81 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 81 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/sh73a0.dtsi b/arch/arm/boot/dts/sh73a0.dtsi
index 3e4d383..ec40bf7 100644
--- a/arch/arm/boot/dts/sh73a0.dtsi
+++ b/arch/arm/boot/dts/sh73a0.dtsi
@@ -38,6 +38,87 @@
 		      <0xf0000100 0x100>;
 	};
 
+	irqpin0: irqpin at e6900000 {
+		compatible = "renesas,intc-irqpin";
+		#interrupt-cells = <2>;
+		interrupt-controller;
+		reg = <0xe6900000 4>,
+			<0xe6900010 4>,
+			<0xe6900020 1>,
+			<0xe6900040 1>,
+			<0xe6900060 1>;
+		interrupt-parent = <&gic>;
+		interrupts = <0 1 0x4
+			      0 2 0x4
+			      0 3 0x4
+			      0 4 0x4
+			      0 5 0x4
+			      0 6 0x4
+			      0 7 0x4
+			      0 8 0x4>;
+	};
+
+	irqpin1: irqpin at e6900004 {
+		compatible = "renesas,intc-irqpin";
+		#interrupt-cells = <2>;
+		interrupt-controller;
+		reg = <0xe6900004 4>,
+			<0xe6900014 4>,
+			<0xe6900024 1>,
+			<0xe6900044 1>,
+			<0xe6900064 1>;
+		interrupt-parent = <&gic>;
+		interrupts = <0 9 0x4
+			      0 10 0x4
+			      0 11 0x4
+			      0 12 0x4
+			      0 13 0x4
+			      0 14 0x4
+			      0 15 0x4
+			      0 16 0x4>;
+		control-parent;
+	};
+
+	irqpin2: irqpin at e6900008 {
+		compatible = "renesas,intc-irqpin";
+		#interrupt-cells = <2>;
+		interrupt-controller;
+		reg = <0xe6900008 4>,
+			<0xe6900018 4>,
+			<0xe6900028 1>,
+			<0xe6900048 1>,
+			<0xe6900068 1>;
+		interrupt-parent = <&gic>;
+		interrupts = <0 17 0x4
+			      0 18 0x4
+			      0 19 0x4
+			      0 20 0x4
+			      0 21 0x4
+			      0 22 0x4
+			      0 23 0x4
+			      0 24 0x4>;
+	};
+
+	irqpin3: irqpin at e690000c {
+		compatible = "renesas,intc-irqpin";
+		#interrupt-cells = <2>;
+		interrupt-controller;
+		reg = <0xe690000c 4>,
+			<0xe690001c 4>,
+			<0xe690002c 1>,
+			<0xe690004c 1>,
+			<0xe690006c 1>;
+		interrupt-parent = <&gic>;
+		interrupts = <0 25 0x4
+			      0 26 0x4
+			      0 27 0x4
+			      0 28 0x4
+			      0 29 0x4
+			      0 30 0x4
+			      0 31 0x4
+			      0 32 0x4>;
+	};
+
 	i2c0: i2c at 0xe6820000 {
 		#address-cells = <1>;
 		#size-cells = <0>;
-- 
1.7.2.5

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

* [PATCH 3/3] ARM: shmobile: kzm9g-reference: add ethernet support
  2013-03-21 16:05 ` Guennadi Liakhovetski
@ 2013-03-21 16:05   ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 20+ messages in thread
From: Guennadi Liakhovetski @ 2013-03-21 16:05 UTC (permalink / raw)
  To: linux-arm-kernel

Add a DT node for the SMSC 9221 ethernet chip, found on kzm9g, to its
reference implementation.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
index f33b5cc..5972abb 100644
--- a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
+++ b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
@@ -44,6 +44,19 @@
 		regulator-always-on;
 		regulator-boot-on;
 	};
+
+	lan9220@10000000 {
+		compatible = "smsc,lan9220", "smsc,lan9115";
+		reg = <0x10000000 0x100>;
+		phy-mode = "mii";
+		interrupt-parent = <&irqpin0>;
+		interrupts = <3 0>;	/* active low */
+		reg-io-width = <4>;
+		smsc,irq-push-pull;
+		smsc,save-mac-address;
+		vddvario-supply = <&reg_1p8v>;
+		vdd33a-supply = <&reg_3p3v>;
+	};
 };
 
 &mmcif {
-- 
1.7.2.5


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

* [PATCH 3/3] ARM: shmobile: kzm9g-reference: add ethernet support
@ 2013-03-21 16:05   ` Guennadi Liakhovetski
  0 siblings, 0 replies; 20+ messages in thread
From: Guennadi Liakhovetski @ 2013-03-21 16:05 UTC (permalink / raw)
  To: linux-arm-kernel

Add a DT node for the SMSC 9221 ethernet chip, found on kzm9g, to its
reference implementation.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
index f33b5cc..5972abb 100644
--- a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
+++ b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
@@ -44,6 +44,19 @@
 		regulator-always-on;
 		regulator-boot-on;
 	};
+
+	lan9220 at 10000000 {
+		compatible = "smsc,lan9220", "smsc,lan9115";
+		reg = <0x10000000 0x100>;
+		phy-mode = "mii";
+		interrupt-parent = <&irqpin0>;
+		interrupts = <3 0>;	/* active low */
+		reg-io-width = <4>;
+		smsc,irq-push-pull;
+		smsc,save-mac-address;
+		vddvario-supply = <&reg_1p8v>;
+		vdd33a-supply = <&reg_3p3v>;
+	};
 };
 
 &mmcif {
-- 
1.7.2.5

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

* Re: [PATCH 0/3] ARM: shmobile: kzm9g: add irqpin to DT
  2013-03-21 16:05 ` Guennadi Liakhovetski
@ 2013-03-27  5:59   ` Simon Horman
  -1 siblings, 0 replies; 20+ messages in thread
From: Simon Horman @ 2013-03-27  5:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 05:05:33PM +0100, Guennadi Liakhovetski wrote:
> These 3 patches extend irqpin DT bindings to more completely support 
> sh73a0, add irqpin DT nodes to sh73a0.dtsi and use them to add ethernet 
> support to kzm9g-reference.

Hi Guennadi,

thanks for this. I am really happy to see this change.

I wonder if it might be possible for you to wire up similar changes
for the r8a7779/marzen. reference-marzen claims to support the SMSC LAN
in its dts file, however it doesn't work due to missing irqpin setup.

If so I can test any patches you make.
Or I can give you remote access to a marzen.
Whichever works best for you.


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

* [PATCH 0/3] ARM: shmobile: kzm9g: add irqpin to DT
@ 2013-03-27  5:59   ` Simon Horman
  0 siblings, 0 replies; 20+ messages in thread
From: Simon Horman @ 2013-03-27  5:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 05:05:33PM +0100, Guennadi Liakhovetski wrote:
> These 3 patches extend irqpin DT bindings to more completely support 
> sh73a0, add irqpin DT nodes to sh73a0.dtsi and use them to add ethernet 
> support to kzm9g-reference.

Hi Guennadi,

thanks for this. I am really happy to see this change.

I wonder if it might be possible for you to wire up similar changes
for the r8a7779/marzen. reference-marzen claims to support the SMSC LAN
in its dts file, however it doesn't work due to missing irqpin setup.

If so I can test any patches you make.
Or I can give you remote access to a marzen.
Whichever works best for you.

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

* Re: [PATCH 1/3] ARM: shmobile: irqpin: fix handling of spurious interrupts in DT case
  2013-03-21 16:05   ` Guennadi Liakhovetski
@ 2013-03-27 10:47     ` Simon Horman
  -1 siblings, 0 replies; 20+ messages in thread
From: Simon Horman @ 2013-03-27 10:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 05:05:36PM +0100, Guennadi Liakhovetski wrote:
> To disable spurious interrupts, that get triggered on certain hardware, the
> irqpin driver masks them on the parent interrupt controller. To specify
> such broken devices a .control_parent parameter can be provided in the
> platform data. In the DT case we need a property, to do the same. However,
> this is not enough to correctly handle spurious interrupts in the DT case.
> In the non-DT case all interrupts get mapped statically during probing,
> therefore, if a spurious interrupt arrives, it can easily be mapped back
> to hardware registers and bits and handled. In the DT case interrupts are
> mapped only when a device, using that interrupt is instantiated from DT.
> So, spurious interrupts occur unmapped and thus cannot be handled properly.
> This patch fixes this by mapping such interrupts as they occur.
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Thanks, queued up for v3.10 in the intc-external-irq branch of the renesas tree.

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

* [PATCH 1/3] ARM: shmobile: irqpin: fix handling of spurious interrupts in DT case
@ 2013-03-27 10:47     ` Simon Horman
  0 siblings, 0 replies; 20+ messages in thread
From: Simon Horman @ 2013-03-27 10:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 05:05:36PM +0100, Guennadi Liakhovetski wrote:
> To disable spurious interrupts, that get triggered on certain hardware, the
> irqpin driver masks them on the parent interrupt controller. To specify
> such broken devices a .control_parent parameter can be provided in the
> platform data. In the DT case we need a property, to do the same. However,
> this is not enough to correctly handle spurious interrupts in the DT case.
> In the non-DT case all interrupts get mapped statically during probing,
> therefore, if a spurious interrupt arrives, it can easily be mapped back
> to hardware registers and bits and handled. In the DT case interrupts are
> mapped only when a device, using that interrupt is instantiated from DT.
> So, spurious interrupts occur unmapped and thus cannot be handled properly.
> This patch fixes this by mapping such interrupts as they occur.
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Thanks, queued up for v3.10 in the intc-external-irq branch of the renesas tree.

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

* Re: [PATCH 3/3] ARM: shmobile: kzm9g-reference: add ethernet support
  2013-03-21 16:05   ` Guennadi Liakhovetski
@ 2013-03-27 10:47     ` Simon Horman
  -1 siblings, 0 replies; 20+ messages in thread
From: Simon Horman @ 2013-03-27 10:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 05:05:44PM +0100, Guennadi Liakhovetski wrote:
> Add a DT node for the SMSC 9221 ethernet chip, found on kzm9g, to its
> reference implementation.

Thanks, queued up for v3.10 in the boards branch of the renesas tree.

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

* [PATCH 3/3] ARM: shmobile: kzm9g-reference: add ethernet support
@ 2013-03-27 10:47     ` Simon Horman
  0 siblings, 0 replies; 20+ messages in thread
From: Simon Horman @ 2013-03-27 10:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 05:05:44PM +0100, Guennadi Liakhovetski wrote:
> Add a DT node for the SMSC 9221 ethernet chip, found on kzm9g, to its
> reference implementation.

Thanks, queued up for v3.10 in the boards branch of the renesas tree.

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

* Re: [PATCH 2/3] ARM: shmobile: sh73a0: add irqpin DT nodes
  2013-03-21 16:05   ` Guennadi Liakhovetski
@ 2013-03-27 10:47     ` Simon Horman
  -1 siblings, 0 replies; 20+ messages in thread
From: Simon Horman @ 2013-03-27 10:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 05:05:40PM +0100, Guennadi Liakhovetski wrote:
> Add DT nodes for the 4 irqpin interrupt controllers on sh73a0. We add them
> to sh73a0.dtsi, which is also used by configurations, doing all their
> device instantiation from board the .c code. We rely on the fact, that
> such configurations don't instantiate devices from the device-tree.

Thanks, queued up for v3.10 in the soc branch of the renesas tree.

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

* [PATCH 2/3] ARM: shmobile: sh73a0: add irqpin DT nodes
@ 2013-03-27 10:47     ` Simon Horman
  0 siblings, 0 replies; 20+ messages in thread
From: Simon Horman @ 2013-03-27 10:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 05:05:40PM +0100, Guennadi Liakhovetski wrote:
> Add DT nodes for the 4 irqpin interrupt controllers on sh73a0. We add them
> to sh73a0.dtsi, which is also used by configurations, doing all their
> device instantiation from board the .c code. We rely on the fact, that
> such configurations don't instantiate devices from the device-tree.

Thanks, queued up for v3.10 in the soc branch of the renesas tree.

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

* Re: [PATCH 1/3] ARM: shmobile: irqpin: fix handling of spurious interrupts in DT case
  2013-03-27 10:47     ` Simon Horman
@ 2013-03-28  5:30       ` Simon Horman
  -1 siblings, 0 replies; 20+ messages in thread
From: Simon Horman @ 2013-03-28  5:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 27, 2013 at 07:47:47PM +0900, Simon Horman wrote:
> On Thu, Mar 21, 2013 at 05:05:36PM +0100, Guennadi Liakhovetski wrote:
> > To disable spurious interrupts, that get triggered on certain hardware, the
> > irqpin driver masks them on the parent interrupt controller. To specify
> > such broken devices a .control_parent parameter can be provided in the
> > platform data. In the DT case we need a property, to do the same. However,
> > this is not enough to correctly handle spurious interrupts in the DT case.
> > In the non-DT case all interrupts get mapped statically during probing,
> > therefore, if a spurious interrupt arrives, it can easily be mapped back
> > to hardware registers and bits and handled. In the DT case interrupts are
> > mapped only when a device, using that interrupt is instantiated from DT.
> > So, spurious interrupts occur unmapped and thus cannot be handled properly.
> > This patch fixes this by mapping such interrupts as they occur.
> > 
> > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> 
> Thanks, queued up for v3.10 in the intc-external-irq branch of the renesas tree.

As requested by Magnus I have dropped this patch.

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

* [PATCH 1/3] ARM: shmobile: irqpin: fix handling of spurious interrupts in DT case
@ 2013-03-28  5:30       ` Simon Horman
  0 siblings, 0 replies; 20+ messages in thread
From: Simon Horman @ 2013-03-28  5:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 27, 2013 at 07:47:47PM +0900, Simon Horman wrote:
> On Thu, Mar 21, 2013 at 05:05:36PM +0100, Guennadi Liakhovetski wrote:
> > To disable spurious interrupts, that get triggered on certain hardware, the
> > irqpin driver masks them on the parent interrupt controller. To specify
> > such broken devices a .control_parent parameter can be provided in the
> > platform data. In the DT case we need a property, to do the same. However,
> > this is not enough to correctly handle spurious interrupts in the DT case.
> > In the non-DT case all interrupts get mapped statically during probing,
> > therefore, if a spurious interrupt arrives, it can easily be mapped back
> > to hardware registers and bits and handled. In the DT case interrupts are
> > mapped only when a device, using that interrupt is instantiated from DT.
> > So, spurious interrupts occur unmapped and thus cannot be handled properly.
> > This patch fixes this by mapping such interrupts as they occur.
> > 
> > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> 
> Thanks, queued up for v3.10 in the intc-external-irq branch of the renesas tree.

As requested by Magnus I have dropped this patch.

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

* Re: [PATCH 1/3] ARM: shmobile: irqpin: fix handling of spurious interrupts in DT case
  2013-03-28  5:30       ` Simon Horman
@ 2013-05-14 22:07         ` Laurent Pinchart
  -1 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2013-05-14 22:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 28 March 2013 14:30:45 Simon Horman wrote:
> On Wed, Mar 27, 2013 at 07:47:47PM +0900, Simon Horman wrote:
> > On Thu, Mar 21, 2013 at 05:05:36PM +0100, Guennadi Liakhovetski wrote:
> > > To disable spurious interrupts, that get triggered on certain hardware,
> > > the irqpin driver masks them on the parent interrupt controller. To
> > > specify such broken devices a .control_parent parameter can be provided
> > > in the platform data. In the DT case we need a property, to do the same.
> > > However, this is not enough to correctly handle spurious interrupts in
> > > the DT case. In the non-DT case all interrupts get mapped statically
> > > during probing, therefore, if a spurious interrupt arrives, it can
> > > easily be mapped back to hardware registers and bits and handled. In the
> > > DT case interrupts are mapped only when a device, using that interrupt
> > > is instantiated from DT. So, spurious interrupts occur unmapped and thus
> > > cannot be handled properly. This patch fixes this by mapping such
> > > interrupts as they occur.
> > > 
> > > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> > 
> > Thanks, queued up for v3.10 in the intc-external-irq branch of the renesas
> > tree.
>
> As requested by Magnus I have dropped this patch.

I'm running into similar spurious interrupt issues on both kzm9g-reference and 
marzen-reference. Magnus, you've rejected this patch, how would you like the 
issue to be fixed ? Could you please provide a patch ? This is blocking 
pinctrl DT testing, as I can't get any board to boot properly through DT with 
ethernet support.

-- 
Regards,

Laurent Pinchart


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

* [PATCH 1/3] ARM: shmobile: irqpin: fix handling of spurious interrupts in DT case
@ 2013-05-14 22:07         ` Laurent Pinchart
  0 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2013-05-14 22:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 28 March 2013 14:30:45 Simon Horman wrote:
> On Wed, Mar 27, 2013 at 07:47:47PM +0900, Simon Horman wrote:
> > On Thu, Mar 21, 2013 at 05:05:36PM +0100, Guennadi Liakhovetski wrote:
> > > To disable spurious interrupts, that get triggered on certain hardware,
> > > the irqpin driver masks them on the parent interrupt controller. To
> > > specify such broken devices a .control_parent parameter can be provided
> > > in the platform data. In the DT case we need a property, to do the same.
> > > However, this is not enough to correctly handle spurious interrupts in
> > > the DT case. In the non-DT case all interrupts get mapped statically
> > > during probing, therefore, if a spurious interrupt arrives, it can
> > > easily be mapped back to hardware registers and bits and handled. In the
> > > DT case interrupts are mapped only when a device, using that interrupt
> > > is instantiated from DT. So, spurious interrupts occur unmapped and thus
> > > cannot be handled properly. This patch fixes this by mapping such
> > > interrupts as they occur.
> > > 
> > > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> > 
> > Thanks, queued up for v3.10 in the intc-external-irq branch of the renesas
> > tree.
>
> As requested by Magnus I have dropped this patch.

I'm running into similar spurious interrupt issues on both kzm9g-reference and 
marzen-reference. Magnus, you've rejected this patch, how would you like the 
issue to be fixed ? Could you please provide a patch ? This is blocking 
pinctrl DT testing, as I can't get any board to boot properly through DT with 
ethernet support.

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2013-05-14 22:07 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-21 16:05 [PATCH 0/3] ARM: shmobile: kzm9g: add irqpin to DT Guennadi Liakhovetski
2013-03-21 16:05 ` Guennadi Liakhovetski
2013-03-21 16:05 ` [PATCH 1/3] ARM: shmobile: irqpin: fix handling of spurious interrupts in DT case Guennadi Liakhovetski
2013-03-21 16:05   ` Guennadi Liakhovetski
2013-03-27 10:47   ` Simon Horman
2013-03-27 10:47     ` Simon Horman
2013-03-28  5:30     ` Simon Horman
2013-03-28  5:30       ` Simon Horman
2013-05-14 22:07       ` Laurent Pinchart
2013-05-14 22:07         ` Laurent Pinchart
2013-03-21 16:05 ` [PATCH 2/3] ARM: shmobile: sh73a0: add irqpin DT nodes Guennadi Liakhovetski
2013-03-21 16:05   ` Guennadi Liakhovetski
2013-03-27 10:47   ` Simon Horman
2013-03-27 10:47     ` Simon Horman
2013-03-21 16:05 ` [PATCH 3/3] ARM: shmobile: kzm9g-reference: add ethernet support Guennadi Liakhovetski
2013-03-21 16:05   ` Guennadi Liakhovetski
2013-03-27 10:47   ` Simon Horman
2013-03-27 10:47     ` Simon Horman
2013-03-27  5:59 ` [PATCH 0/3] ARM: shmobile: kzm9g: add irqpin to DT Simon Horman
2013-03-27  5:59   ` Simon Horman

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.