Skip to contentSkip to conversation

marzen-reference ethernet patches

PATCH New Simon Horman 3 participants 11 messages May 15, 2013 – May 13, 2014

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v2 cover marzen-reference ethernet patches

Hi,

this series builds on work by Laurent Pinchart and in turn prior work by Guennadi Liakhovetski and myself.

The four small patches attepts to fix SMSC ethernet support for the marzen-reference board. It does seem to be sufficient in order to initialise the NIC and complete a boot using nfsroot. However, as reported by Laurent earlier, there appear to be some issues with spurious interrupts.

This series is based on the renesas-next-20130515v2 tag of my renesas branch.

Laurent Pinchart (2):
ARM: shmobile: marzen-reference: Reference the correct IRQ for
ethernet
ARM: shmobile: marzen-reference: Update lan device name in pinctrl
maps

Simon Horman (2):
ARM: shmobile: marzen-reference: Initialise irqpin
ARM: shmobile: marzen-reference: Set SMSC lan to use irq-push-pull

 arch/arm/boot/dts/r8a7779-marzen-reference.dts  |  5 +++--
 arch/arm/mach-shmobile/board-marzen-reference.c | 12 +++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH v2 1/4 ARM: shmobile: marzen-reference: Reference the correct IRQ for ethernet

From: Laurent Pinchart <[email protected]>

The SMSC ethernet controller uses an external IRQ line that goes through the irqpin controller. Set the interrupt parent to irqpin0 and fix the interrupt number.

---
 arch/arm/boot/dts/r8a7779-marzen-reference.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/r8a7779-marzen-reference.dts +2 -2
index 72be4c8..10cfc7f 100644
@@ -38,8 +38,8 @@
 		compatible = "smsc,lan9220", "smsc,lan9115";
 		reg = <0x18000000 0x100>;
 		phy-mode = "mii";
-		interrupt-parent = <&gic>;
-		interrupts = <0 28 0x4>;
+		interrupt-parent = <&irqpin0>;
+		interrupts = <1 0x4>;
 		reg-io-width = <4>;
 		vddvario-supply = <&fixedregulator3v3>;
 		vdd33a-supply = <&fixedregulator3v3>;
Signature · 1 line
1.8.2.1
#2 lore raw

PATCH v2 2/4 ARM: shmobile: marzen-reference: Update lan device name in pinctrl maps

In reply to Simon Horman

From: Laurent Pinchart <[email protected]>

The ethernet device is instantiated from the device tree, use the correct name in the pinctrl mappings.

---
 arch/arm/mach-shmobile/board-marzen-reference.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-shmobile/board-marzen-reference.c +2 -2
index 480d882..5332e89 100644
@@ -43,9 +43,9 @@ static const struct pinctrl_map marzen_pinctrl_map[] = {
 	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
 				  "sdhi0_wp", "sdhi0"),
 	/* SMSC */
-	PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779",
+	PIN_MAP_MUX_GROUP_DEFAULT("18000000.lan0", "pfc-r8a7779",
 				  "intc_irq1_b", "intc"),
-	PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779",
+	PIN_MAP_MUX_GROUP_DEFAULT("18000000.lan0", "pfc-r8a7779",
 				  "lbsc_ex_cs0", "lbsc"),
 };
 
Signature · 1 line
1.8.2.1
#3 lore raw

PATCH v2 3/4 ARM: shmobile: marzen-reference: Initialise irqpin

In reply to Simon Horman

Empirically it appears to be necessary to call r8a7779_init_irq_extpin(1) in order to initialise irqpin for use with IRQ1. This is already done in the marzen board code. This adds the call to the marzen-reference board code.

The motivation for this is to allow use of SMSC LAN, which uses IRQ1, with marzen-reference.

---
 arch/arm/mach-shmobile/board-marzen-reference.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/board-marzen-reference.c +7 -1
index 5332e89..f83b6d1 100644
@@ -63,12 +63,18 @@ static const char *marzen_boards_compat_dt[] __initdata = {
 	NULL,
 };
 
+void __init marzen_init_irq(void)
+{
+	r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */
+	r8a7779_init_irq_dt();
+}
+
 DT_MACHINE_START(MARZEN, "marzen")
 	.smp		= smp_ops(r8a7779_smp_ops),
 	.map_io		= r8a7779_map_io,
 	.init_early	= r8a7779_init_delay,
 	.nr_irqs	= NR_IRQS_LEGACY,
-	.init_irq	= r8a7779_init_irq_dt,
+	.init_irq	= marzen_init_irq,
 	.init_machine	= marzen_init,
 	.init_time	= shmobile_timer_init,
 	.dt_compat	= marzen_boards_compat_dt,
Signature · 1 line
1.8.2.1
#4 lore raw

PATCH v2 3/4 ARM: shmobile: marzen-reference: Initialise irqpin

Hi Simon,

Thanks for the patch.

Quoted 7 lines · On Wednesday 15 May 2013 11:57:29 Simon Horman wrote:

Empirically it appears to be necessary to call r8a7779_init_irq_extpin(1) in order to initialise irqpin for use with IRQ1. This is already done in the marzen board code. This adds the call to the marzen-reference board code.

The motivation for this is to allow use of SMSC LAN, which uses IRQ1, with marzen-reference.

This is an acceptable workaround for now, but in the not-so-long term we want to move that code to the irqpin driver.

I've had a brief look at the irq-renesas-intc-irqpin driver, and it definitely looks like some love is needed there. I don't have any free time for that at the moment, but I could provide pointers if anyone wants to work on moving irqpin-related arch code to the driver.

Quoted 30 lines
---
 arch/arm/mach-shmobile/board-marzen-reference.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/arch/arm/mach-shmobile/board-marzen-reference.c index 5332e89..f83b6d1 100644

arch/arm/mach-shmobile/board-marzen-reference.c +7 -1
@@ -63,12 +63,18 @@ static const char *marzen_boards_compat_dt[] __initdata
 = { NULL,
 };
 
+void __init marzen_init_irq(void)
+{
+	r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */
+	r8a7779_init_irq_dt();
+}
+
 DT_MACHINE_START(MARZEN, "marzen")
 	.smp		= smp_ops(r8a7779_smp_ops),
 	.map_io		= r8a7779_map_io,
 	.init_early	= r8a7779_init_delay,
 	.nr_irqs	= NR_IRQS_LEGACY,
-	.init_irq	= r8a7779_init_irq_dt,
+	.init_irq	= marzen_init_irq,
 	.init_machine	= marzen_init,
 	.init_time	= shmobile_timer_init,
 	.dt_compat	= marzen_boards_compat_dt,
Signature · 3 lines
Regards,

Laurent Pinchart
#5 lore raw

PATCH v2 3/4 ARM: shmobile: marzen-reference: Initialise irqpin

Quoted 10 lines · Laurent Pinchart

Hi Simon,

Thanks for the patch.

Quoted 5 lines · On Wednesday 15 May 2013 11:57:29 Simon Horman wrote:

Empirically it appears to be necessary to call r8a7779_init_irq_extpin(1) in order to initialise irqpin for use with IRQ1. This is already done in the marzen board code. This adds the call to the marzen-reference board code.

Quoted 5 lines
Quoted 2 lines

The motivation for this is to allow use of SMSC LAN, which uses IRQ1, with marzen-reference.

This is an acceptable workaround for now, but in the not-so-long term we want to move that code to the irqpin driver.

Yes, I agree that this not a long term solution.

Quoted 40 lines

I've had a brief look at the irq-renesas-intc-irqpin driver, and it definitely looks like some love is needed there. I don't have any free time for that at the moment, but I could provide pointers if anyone wants to work on moving irqpin-related arch code to the driver.

Quoted 30 lines
---
 arch/arm/mach-shmobile/board-marzen-reference.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/arch/arm/mach-shmobile/board-marzen-reference.c index 5332e89..f83b6d1 100644

arch/arm/mach-shmobile/board-marzen-reference.c +7 -1
@@ -63,12 +63,18 @@ static const char *marzen_boards_compat_dt[] __initdata
 = { NULL,
 };
 
+void __init marzen_init_irq(void)
+{
+	r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */
+	r8a7779_init_irq_dt();
+}
+
 DT_MACHINE_START(MARZEN, "marzen")
 	.smp		= smp_ops(r8a7779_smp_ops),
 	.map_io		= r8a7779_map_io,
 	.init_early	= r8a7779_init_delay,
 	.nr_irqs	= NR_IRQS_LEGACY,
-	.init_irq	= r8a7779_init_irq_dt,
+	.init_irq	= marzen_init_irq,
 	.init_machine	= marzen_init,
 	.init_time	= shmobile_timer_init,
 	.dt_compat	= marzen_boards_compat_dt,
Signature · 3 lines
Regards,

Laurent Pinchart
#6 lore raw

PATCH v2 4/4 ARM: shmobile: marzen-reference: Set SMSC lan to use irq-push-pull

In reply to Simon Horman

This change makes the DTS consistent with the platform data that exists in board-marzen.c.

Empirically it does not appear to be necessary.

---
 arch/arm/boot/dts/r8a7779-marzen-reference.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/r8a7779-marzen-reference.dts +1 -0
index 10cfc7f..fe32e1a 100644
@@ -40,6 +40,7 @@
 		phy-mode = "mii";
 		interrupt-parent = <&irqpin0>;
 		interrupts = <1 0x4>;
+		smsc,irq-push-pull;
 		reg-io-width = <4>;
 		vddvario-supply = <&fixedregulator3v3>;
 		vdd33a-supply = <&fixedregulator3v3>;
Signature · 1 line
1.8.2.1
#7 lore raw

PATCH v2 4/4 ARM: shmobile: marzen-reference: Set SMSC lan to use irq-push-pull

Hi Simon,

Thanks for the patch.

Quoted 6 lines · On Wednesday 15 May 2013 11:57:30 Simon Horman wrote:

This change makes the DTS consistent with the platform data that exists in board-marzen.c.

Empirically it does not appear to be necessary.

Quoted 17 lines
---
 arch/arm/boot/dts/r8a7779-marzen-reference.dts | 1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/arch/arm/boot/dts/r8a7779-marzen-reference.dts index 10cfc7f..fe32e1a 100644

arch/arm/boot/dts/r8a7779-marzen-reference.dts +1 -0
@@ -40,6 +40,7 @@
 		phy-mode = "mii";
 		interrupt-parent = <&irqpin0>;
 		interrupts = <1 0x4>;
+		smsc,irq-push-pull;
 		reg-io-width = <4>;
 		vddvario-supply = <&fixedregulator3v3>;
 		vdd33a-supply = <&fixedregulator3v3>;
Signature · 3 lines
Regards,

Laurent Pinchart
#8 lore raw

PATCH v2 4/4 ARM: shmobile: marzen-reference: Set SMSC lan to use irq-push-pull

Hi Simon,

Quoted 5 lines · On Wednesday 15 May 2013 11:15:01 Laurent Pinchart wrote:

Hi Simon,

Thanks for the patch.

On Wednesday 15 May 2013 11:57:30 Simon Horman wrote:

Quoted 8 lines
Quoted 6 lines

This change makes the DTS consistent with the platform data that exists in board-marzen.c.

Empirically it does not appear to be necessary.

I've noticed that this patch hasn't landed in mainline. Do you still plan to upstream it ?

While the board has a pull-up resistor on the IRQ signal and can thus accommodate an open-drain configuration, using push-pull mode would lower the rise time.

Quoted 21 lines
Quoted 21 lines

---

 arch/arm/boot/dts/r8a7779-marzen-reference.dts | 1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/arch/arm/boot/dts/r8a7779-marzen-reference.dts index 10cfc7f..fe32e1a 100644

arch/arm/boot/dts/r8a7779-marzen-reference.dts +1 -0
@@ -40,6 +40,7 @@
 
 		phy-mode = "mii";
 		interrupt-parent = <&irqpin0>;
 		interrupts = <1 0x4>;
 
+		smsc,irq-push-pull;
 
arch/arm/boot/dts/r8a7779-marzen-reference.dts +0 -0
 		reg-io-width = <4>;
 		vddvario-supply = <&fixedregulator3v3>;
 		vdd33a-supply = <&fixedregulator3v3>;
Signature · 3 lines
Regards,

Laurent Pinchart
#9 lore raw

PATCH v2 4/4 ARM: shmobile: marzen-reference: Set SMSC lan to use irq-push-pull

Quoted 15 lines · Laurent Pinchart

Hi Simon,

Quoted 12 lines · On Wednesday 15 May 2013 11:15:01 Laurent Pinchart wrote:

Hi Simon,

Thanks for the patch.

Quoted 6 lines · On Wednesday 15 May 2013 11:57:30 Simon Horman wrote:

This change makes the DTS consistent with the platform data that exists in board-marzen.c.

Empirically it does not appear to be necessary.

Quoted 8 lines
Quoted 1 line

I've noticed that this patch hasn't landed in mainline. Do you still plan to upstream it ?

While the board has a pull-up resistor on the IRQ signal and can thus accommodate an open-drain configuration, using push-pull mode would lower the rise time.

Sorry for letting that slip through the cracks (for an entire year!). I'll queue it up after giving Magnus a chance to veto it.

Quoted 27 lines
Quoted 21 lines
Quoted 21 lines

---

 arch/arm/boot/dts/r8a7779-marzen-reference.dts | 1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/arch/arm/boot/dts/r8a7779-marzen-reference.dts index 10cfc7f..fe32e1a 100644

arch/arm/boot/dts/r8a7779-marzen-reference.dts +1 -0
@@ -40,6 +40,7 @@
 
 		phy-mode = "mii";
 		interrupt-parent = <&irqpin0>;
 		interrupts = <1 0x4>;
 
+		smsc,irq-push-pull;
 
arch/arm/boot/dts/r8a7779-marzen-reference.dts +0 -0
 		reg-io-width = <4>;
 		vddvario-supply = <&fixedregulator3v3>;
 		vdd33a-supply = <&fixedregulator3v3>;
Signature · 3 lines
Regards,

Laurent Pinchart
#10 lore raw

PATCH v2 4/4 ARM: shmobile: marzen-reference: Set SMSC lan to use irq-push-pull

Quoted 21 lines · Simon Horman
Quoted 20 lines · Laurent Pinchart

Hi Simon,

Quoted 5 lines · On Wednesday 15 May 2013 11:15:01 Laurent Pinchart wrote:

Hi Simon,

Thanks for the patch.

On Wednesday 15 May 2013 11:57:30 Simon Horman wrote:

Quoted 8 lines
Quoted 6 lines

This change makes the DTS consistent with the platform data that exists in board-marzen.c.

Empirically it does not appear to be necessary.

I've noticed that this patch hasn't landed in mainline. Do you still plan to upstream it ?

Quoted 6 lines
Quoted 3 lines

While the board has a pull-up resistor on the IRQ signal and can thus accommodate an open-drain configuration, using push-pull mode would lower the rise time.

Sorry for letting that slip through the cracks (for an entire year!). I'll queue it up after giving Magnus a chance to veto it.

I have spoken to Magnus off-line and queued up this patch.