Skip to contentSkip to conversation

arm: dts: Legacy board IRQ issues

PATCH In review Magnus Damm 2 participants 8 messages Mar 20, 2018 – Mar 23, 2018

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

cover arm: dts: Legacy board IRQ issues

arm: dts: Legacy board IRQ issues

[PATCH 1/2] arm: dts: r8a7778 Bock-W Ethernet has busted IRQs [PATCH 2/2] arm: dts: sh73a0 KZM9 as unhandled IRQs on boot

These patches highlight two IRQ-related issues on the 32-bit ARM legacy boards. I've managed to reproduce the issues but not solve them. I'd be happy to see someone else fixing these if possible.

Not-Yet-Signed-off-by Magnus Damm <[email protected]>

---

Developed on top of renesas-drivers-2018-03-13-v4.16-rc5

 arch/arm/boot/dts/r8a7778-bockw.dts       |   12 ++++++++----
 arch/arm/boot/dts/r8a7778.dtsi            |    8 ++++----
 drivers/irqchip/irq-renesas-intc-irqpin.c |    4 ++--
 3 files changed, 14 insertions(+), 10 deletions(-)
#1 lore raw

PATCH 1/2 arm: dts: r8a7778 Bock-W Ethernet has busted IRQs

From: Magnus Damm <[email protected]>

The on-board ethernet on r8a7778 Bock-W does not work out of the box. Booting with initramfs and trying to do ifconfig up/down will show that something is busted.

Judging by the board schematics the IRQ signal from the LAN89218 chip gets routed to some magic board-specific FPGA and if the stars happen to be aligned this signal may also reach the r8a7778 SoC.

This temporary hack tries to use the on-chip GPIO device in r8a7778 for interrupts however on r8a7778 all the GPIO devices share the same interrupt line in the GIC but I wonder if this really has been tested. I recall writing the GPIO driver on r8a7779 and r8a73a4 and then extending to R-Car Gen2 and Gen3. Not sure if it will work on r8a7778 or not.

Most likely the PFC needs to be configured to configure the IRQ0 signal to use the irqpin driver, or the GPIO device may be used in a similar fashion as this patch.

Unfortunately more effort is needed to track this down. A perhaps related issue on Bock-W is that it sometimes hangs on boot without output on the serial console. Yum.

Not for upstream merge.

Not-Yet-Signed-off-by Magnus Damm <[email protected]>

---

Built on top of renesas-drivers-2018-03-13-v4.16-rc5

 arch/arm/boot/dts/r8a7778-bockw.dts |   12 ++++++++----
 arch/arm/boot/dts/r8a7778.dtsi      |    8 ++++----
 2 files changed, 12 insertions(+), 8 deletions(-)
arch/arm/boot/dts/r8a7778-bockw.dts +8 -4
@@ -66,13 +66,15 @@
 
 &bsc {
 	ethernet@18300000 {
-		compatible = "smsc,lan9220", "smsc,lan9115";
+		compatible = "smsc,lan89218", "smsc,lan9115";
 		reg = <0x18300000 0x1000>;
 
-		phy-mode = "mii";
-		interrupt-parent = <&irqpin>;
-		interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <12 IRQ_TYPE_LEVEL_HIGH>;
 		reg-io-width = <4>;
+		smsc,force-internal-phy;
+		smsc,irq-active-high;
+		smsc,irq-push-pull;
 		vddvario-supply = <&fixedregulator3v3>;
 		vdd33a-supply = <&fixedregulator3v3>;
 	};
@@ -185,6 +187,7 @@
 	#sound-dai-cells = <0>;
 };
 
+#if 0
 &sdhi0 {
 	pinctrl-0 = <&sdhi0_pins>, <&sdhi0_pup_pins>;
 	pinctrl-names = "default";
@@ -194,6 +197,7 @@
 	status = "okay";
 	wp-gpios = <&gpio3 18 GPIO_ACTIVE_HIGH>;
 };
+#endif
 
 &hspi0 {
 	pinctrl-0 = <&hspi0_pins>;
arch/arm/boot/dts/r8a7778.dtsi +4 -4
@@ -88,7 +88,7 @@
 				GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
 		sense-bitfield-width = <2>;
 	};
-
+#if 0
 	gpio0: gpio@ffc40000 {
 		compatible = "renesas,gpio-r8a7778", "renesas,rcar-gen1-gpio";
 		reg = <0xffc40000 0x2c>;
@@ -99,7 +99,7 @@
 		#interrupt-cells = <2>;
 		interrupt-controller;
 	};
-
+#endif
 	gpio1: gpio@ffc41000 {
 		compatible = "renesas,gpio-r8a7778", "renesas,rcar-gen1-gpio";
 		reg = <0xffc41000 0x2c>;
@@ -110,7 +110,7 @@
 		#interrupt-cells = <2>;
 		interrupt-controller;
 	};
-
+#if 0
 	gpio2: gpio@ffc42000 {
 		compatible = "renesas,gpio-r8a7778", "renesas,rcar-gen1-gpio";
 		reg = <0xffc42000 0x2c>;
@@ -143,7 +143,7 @@
 		#interrupt-cells = <2>;
 		interrupt-controller;
 	};
-
+#endif
 	pfc: pin-controller@fffc0000 {
 		compatible = "renesas,pfc-r8a7778";
 		reg = <0xfffc0000 0x118>;
#2 lore raw

Re: [PATCH 1/2] arm: dts: r8a7778 Bock-W Ethernet has busted IRQs

Hi Magnus, Uli,

Quoted 20 lines · Magnus Damm

From: Magnus Damm <[email protected]>

The on-board ethernet on r8a7778 Bock-W does not work out of the box. Booting with initramfs and trying to do ifconfig up/down will show that something is busted.

Judging by the board schematics the IRQ signal from the LAN89218 chip gets routed to some magic board-specific FPGA and if the stars happen to be aligned this signal may also reach the r8a7778 SoC.

This temporary hack tries to use the on-chip GPIO device in r8a7778 for interrupts however on r8a7778 all the GPIO devices share the same interrupt line in the GIC but I wonder if this really has been tested. I recall writing the GPIO driver on r8a7779 and r8a73a4 and then extending to R-Car Gen2 and Gen3. Not sure if it will work on r8a7778 or not.

Most likely the PFC needs to be configured to configure the IRQ0 signal to use the irqpin driver, or the GPIO device may be used in a similar fashion as this patch.

Quoted 7 lines

Unfortunately more effort is needed to track this down. A perhaps related issue on Bock-W is that it sometimes hangs on boot without output on the serial console. Yum.

Not for upstream merge.

Not-Yet-Signed-off-by Magnus Damm <[email protected]>

Is this the issue "[PATCH v3 0/5] r8a7778/bockw: fix SMSC Ethernet for MP"
(https://marc.info/?l=linux-sh&m=144172695421685&w=2) was meant to fix?

irqchip: renesas-intc-irqpin: r8a7778 IRLM setup support
ARM: shmobile: r8a7778: enable IRLM setup via DT
ARM: shmobile: bockw dts: enable SMSC interrupt
ARM: shmobile_defconfig: enable PINCTRL_SINGLE
ARM: multi_v7_defconfig: enable PINCTRL_SINGLE

Seems like only the first patch in that series ever made it upstream.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#3 lore raw

PATCH 2/2 arm: dts: sh73a0 KZM9 as unhandled IRQs on boot

In reply to Magnus Damm

From: Magnus Damm <[email protected]>

Booting sh73a0 KZM9G results in the following on the console:

[    0.030000] renesas_intc_irqpin e6900000.interrupt-controller: driving 8 irqs
[    0.040000] random: crng init done
[    0.120000] irq 35: nobody cared (try booting with the "irqpoll" option)
[    0.120000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.16.0-rc5 #4
[    0.120000] Hardware name: Generic SH73A0 (Flattened Device Tree)
...
[    0.120000] Disabling IRQ #35
[    0.120000] renesas_intc_irqpin e6900004.interrupt-controller: driving 8 irqs

Judging by the friendly board documentation there is nothing hooked up to that IRQ line. I wish we had proper schematics and not a less detailed board manual.

With this patch I've tried to extend the irqpin driver to mask all interrupts on boot but it does not seem to help. Perhaps the PFC hardware needs to be configured somehow. More effort is needed to solve this issue.

Not for upstream merge.

Not-Yet-Signed-off-by Magnus Damm <[email protected]>

---

Developed on top of renesas-drivers-2018-03-13-v4.16-rc5

 drivers/irqchip/irq-renesas-intc-irqpin.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/irqchip/irq-renesas-intc-irqpin.c +2 -2
@@ -558,11 +558,11 @@ static int intc_irqpin_probe(struct plat
 			}
 		}
 	}
-
+#if 0
 	/* unmask all interrupts on prio level */
 	for (k = 0; k < nirqs; k++)
 		intc_irqpin_mask_unmask_prio(p, k, 0);
-
+#endif
 	dev_info(dev, "driving %d irqs\n", nirqs);
 
 	return 0;
#4 lore raw

Re: [PATCH 2/2] arm: dts: sh73a0 KZM9 as unhandled IRQs on boot

Hi Magnus,

Quoted 4 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Booting sh73a0 KZM9G results in the following on the console:

Quoted 8 lines
[    0.030000] renesas_intc_irqpin e6900000.interrupt-controller: driving 8 irqs
[    0.040000] random: crng init done
[    0.120000] irq 35: nobody cared (try booting with the "irqpoll" option)
[    0.120000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.16.0-rc5 #4
[    0.120000] Hardware name: Generic SH73A0 (Flattened Device Tree)
...
[    0.120000] Disabling IRQ #35
[    0.120000] renesas_intc_irqpin e6900004.interrupt-controller: driving 8 irqs

Thanks for bringing this to my attention again. I always assumed it was one of the IIO devices keeping an IRQ line asserted, but it turns out I was wrong...

Quoted 3 lines

Judging by the friendly board documentation there is nothing hooked up to that IRQ line. I wish we had proper schematics and not a less detailed board manual.

Oh there is: PORT54/IRQ10/FSICCK is driven by the same 11.2896 MHz oscillator (OSC4) as FSIACK.

Quoted 3 lines

With this patch I've tried to extend the irqpin driver to mask all interrupts on boot but it does not seem to help. Perhaps the PFC hardware needs to be configured somehow. More effort is needed to solve this issue.

That pin is part of the HDMI interface, cfr. section 5.27.

I've tried the below, but it doesn't work, as the interrupt controller is probed before the pfc (it has to, due to dependencies from pfc on irqpin[0-3]).

arch/arm/boot/dts/sh73a0-kzm9g.dts +9 -0
@@ -331,6 +331,15 @@
 };
 
 &pfc {
+       pinctrl-0 = <&fsic_pins>;
+       pinctrl-names = "default";
+
+       fsic_pins: hdmi {
+               /* FSICCK is driven by OSC4, causing interrupt storm */
+               groups = "fsic_mclk_in";
+               function = "fsic";
+       };
+
        i2c3_pins: i2c3 {
                groups = "i2c3_1";
                function = "i2c3";

So probably we need some early quirk in pfc-sh73a0.c, to configure the pin as fsicck on kzm9g.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#5 lore raw

Re: [PATCH 2/2] arm: dts: sh73a0 KZM9 as unhandled IRQs on boot

Hi Magnus,

Quoted 52 lines · Geert Uytterhoeven
Quoted 4 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Booting sh73a0 KZM9G results in the following on the console:

Quoted 8 lines
[    0.030000] renesas_intc_irqpin e6900000.interrupt-controller: driving 8 irqs
[    0.040000] random: crng init done
[    0.120000] irq 35: nobody cared (try booting with the "irqpoll" option)
[    0.120000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.16.0-rc5 #4
[    0.120000] Hardware name: Generic SH73A0 (Flattened Device Tree)
...
[    0.120000] Disabling IRQ #35
[    0.120000] renesas_intc_irqpin e6900004.interrupt-controller: driving 8 irqs

Thanks for bringing this to my attention again. I always assumed it was one of the IIO devices keeping an IRQ line asserted, but it turns out I was wrong...

Quoted 3 lines

Judging by the friendly board documentation there is nothing hooked up to that IRQ line. I wish we had proper schematics and not a less detailed board manual.

Oh there is: PORT54/IRQ10/FSICCK is driven by the same 11.2896 MHz oscillator (OSC4) as FSIACK.

Quoted 3 lines

With this patch I've tried to extend the irqpin driver to mask all interrupts on boot but it does not seem to help. Perhaps the PFC hardware needs to be configured somehow. More effort is needed to solve this issue.

That pin is part of the HDMI interface, cfr. section 5.27.

I've tried the below, but it doesn't work, as the interrupt controller is probed before the pfc (it has to, due to dependencies from pfc on irqpin[0-3]).

arch/arm/boot/dts/sh73a0-kzm9g.dts +9 -0
@@ -331,6 +331,15 @@
 };
 
 &pfc {
+       pinctrl-0 = <&fsic_pins>;
+       pinctrl-names = "default";
+
+       fsic_pins: hdmi {
+               /* FSICCK is driven by OSC4, causing interrupt storm */
+               groups = "fsic_mclk_in";
+               function = "fsic";
+       };
+
        i2c3_pins: i2c3 {
                groups = "i2c3_1";
                function = "i2c3";
Quoted 2 lines

So probably we need some early quirk in pfc-sh73a0.c, to configure the pin as fsicck on kzm9g.

That's done by switching PORT54 from FN0 to FN6, i.e. changing 0xe6051036 from 0xa0 to 0xa6.

I did that from U-Boot, and verified it's still that way when the PFC driver initializes, but it doesn't help, with or without your patch.

So it seems more likely the intc-irqpin driver is not disabling interrupts that are not requested?

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#6 lore raw

Re: [PATCH 2/2] arm: dts: sh73a0 KZM9 as unhandled IRQs on boot

Hi Geert,

Quoted 62 lines · Geert Uytterhoeven

Hi Magnus,

Quoted 52 lines · Geert Uytterhoeven
Quoted 4 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Booting sh73a0 KZM9G results in the following on the console:

Quoted 8 lines
[    0.030000] renesas_intc_irqpin e6900000.interrupt-controller: driving 8 irqs
[    0.040000] random: crng init done
[    0.120000] irq 35: nobody cared (try booting with the "irqpoll" option)
[    0.120000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.16.0-rc5 #4
[    0.120000] Hardware name: Generic SH73A0 (Flattened Device Tree)
...
[    0.120000] Disabling IRQ #35
[    0.120000] renesas_intc_irqpin e6900004.interrupt-controller: driving 8 irqs

Thanks for bringing this to my attention again. I always assumed it was one of the IIO devices keeping an IRQ line asserted, but it turns out I was wrong...

Quoted 3 lines

Judging by the friendly board documentation there is nothing hooked up to that IRQ line. I wish we had proper schematics and not a less detailed board manual.

Oh there is: PORT54/IRQ10/FSICCK is driven by the same 11.2896 MHz oscillator (OSC4) as FSIACK.

Quoted 3 lines

With this patch I've tried to extend the irqpin driver to mask all interrupts on boot but it does not seem to help. Perhaps the PFC hardware needs to be configured somehow. More effort is needed to solve this issue.

That pin is part of the HDMI interface, cfr. section 5.27.

I've tried the below, but it doesn't work, as the interrupt controller is probed before the pfc (it has to, due to dependencies from pfc on irqpin[0-3]).

arch/arm/boot/dts/sh73a0-kzm9g.dts +9 -0
@@ -331,6 +331,15 @@
 };
 
 &pfc {
+       pinctrl-0 = <&fsic_pins>;
+       pinctrl-names = "default";
+
+       fsic_pins: hdmi {
+               /* FSICCK is driven by OSC4, causing interrupt storm */
+               groups = "fsic_mclk_in";
+               function = "fsic";
+       };
+
        i2c3_pins: i2c3 {
                groups = "i2c3_1";
                function = "i2c3";
Quoted 2 lines

So probably we need some early quirk in pfc-sh73a0.c, to configure the pin as fsicck on kzm9g.

That's done by switching PORT54 from FN0 to FN6, i.e. changing 0xe6051036 from 0xa0 to 0xa6.

Quoted 5 lines

I did that from U-Boot, and verified it's still that way when the PFC driver initializes, but it doesn't help, with or without your patch.

So it seems more likely the intc-irqpin driver is not disabling interrupts that are not requested?

Thanks for checking. Yeah the interrupt disabling poriton in the driver might not work as expected. Also there is that "control-parent" workaround in the driver as well, and perhaps combined with that the PFC is not working as expected might result in spurious interrupts - not sure.

I wonder if we still get interrupts if we configure the pin as GPIO?

Thanks,

/ magnus

#7 lore raw

Re: [PATCH 2/2] arm: dts: sh73a0 KZM9 as unhandled IRQs on boot

Hi Magnus,

Quoted 46 lines · Magnus Damm
Quoted 44 lines · Geert Uytterhoeven
Quoted 28 lines · Geert Uytterhoeven
Quoted 4 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Booting sh73a0 KZM9G results in the following on the console:

Quoted 8 lines
[    0.030000] renesas_intc_irqpin e6900000.interrupt-controller: driving 8 irqs
[    0.040000] random: crng init done
[    0.120000] irq 35: nobody cared (try booting with the "irqpoll" option)
[    0.120000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.16.0-rc5 #4
[    0.120000] Hardware name: Generic SH73A0 (Flattened Device Tree)
...
[    0.120000] Disabling IRQ #35
[    0.120000] renesas_intc_irqpin e6900004.interrupt-controller: driving 8 irqs

Thanks for bringing this to my attention again. I always assumed it was one of the IIO devices keeping an IRQ line asserted, but it turns out I was wrong...

Quoted 3 lines

Judging by the friendly board documentation there is nothing hooked up to that IRQ line. I wish we had proper schematics and not a less detailed board manual.

Oh there is: PORT54/IRQ10/FSICCK is driven by the same 11.2896 MHz oscillator (OSC4) as FSIACK.

Quoted 3 lines

With this patch I've tried to extend the irqpin driver to mask all interrupts on boot but it does not seem to help. Perhaps the PFC hardware needs to be configured somehow. More effort is needed to solve this issue.

Quoted 7 lines

That pin is part of the HDMI interface, cfr. section 5.27.

I've tried the below, but it doesn't work, as the interrupt controller is probed before the pfc (it has to, due to dependencies from pfc on irqpin[0-3]).

So probably we need some early quirk in pfc-sh73a0.c, to configure the pin as fsicck on kzm9g.

That's done by switching PORT54 from FN0 to FN6, i.e. changing 0xe6051036 from 0xa0 to 0xa6.

I did that from U-Boot, and verified it's still that way when the PFC driver initializes, but it doesn't help, with or without your patch.

Quoted 8 lines
Quoted 2 lines

So it seems more likely the intc-irqpin driver is not disabling interrupts that are not requested?

Thanks for checking. Yeah the interrupt disabling poriton in the driver might not work as expected. Also there is that "control-parent" workaround in the driver as well, and perhaps combined with that the PFC is not working as expected might result in spurious interrupts - not sure.

At least the actual disabling ("Disabling IRQ #35") seems to work.

Quoted 1 line

I wonder if we still get interrupts if we configure the pin as GPIO?

Thanks or the suggesion! I will try, eventually...

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds