Skip to contentSkip to conversation

powerpc: Wii IRQ fixes

PATCH In review Jonathan Neuschäfer 2 participants 4 messages May 10, 2018 – May 21, 2018 PowerPC

lore
Share & tools
lore
#0 lore raw

cover powerpc: Wii IRQ fixes

This series makes it possible to use the SD card on the Wii. The WLAN now also works on the SDIO level, but fails to connect to a network for some reason.

Patch 1 seems quite obvious, although I don't know why the code was broken in this particular way.

Patch 2 might not be the right solution for the problem at hand, but it works and should only cause problems when both processors in the system (PPC and ARM) try to use the same interrupt, if at all.

Jonathan Neuschäfer (2):
powerpc: flipper-pic: Don't match all IRQ domains
powerpc: hlwd-pic: Prevent interrupts from being handled by Starlet

 arch/powerpc/platforms/embedded6xx/flipper-pic.c | 8 --------
 arch/powerpc/platforms/embedded6xx/hlwd-pic.c    | 5 +++++
 2 files changed, 5 insertions(+), 8 deletions(-)
Signature · 1 line
2.17.0
#1 lore raw

PATCH 1/2 powerpc: flipper-pic: Don't match all IRQ domains

On the Wii, there is a secondary IRQ controller (hlwd-pic), so flipper-pic's match operation should not be hardcoded to return 1. In fact, the default matching logic is sufficient, and we can completely omit flipper_pic_match.

---

Note: This shouldn't break Linux on the GameCube, but I've only tested on the Wii. Some confirmation that I didn't break interrupt handling on the GC would be nice. (If someone still runs mainline on the GC.)

---
 arch/powerpc/platforms/embedded6xx/flipper-pic.c | 8 --------
 1 file changed, 8 deletions(-)
arch/powerpc/platforms/embedded6xx/flipper-pic.c +0 -8
index 7206f3f573d4..db0be007fd06 100644
@@ -108,16 +108,8 @@ static int flipper_pic_map(struct irq_domain *h, unsigned int virq,
 	return 0;
 }
 
-static int flipper_pic_match(struct irq_domain *h, struct device_node *np,
-			     enum irq_domain_bus_token bus_token)
-{
-	return 1;
-}
-
-
 static const struct irq_domain_ops flipper_irq_domain_ops = {
 	.map = flipper_pic_map,
-	.match = flipper_pic_match,
 };
 
 /*
Signature · 1 line
2.17.0
#3 lore raw

PATCH 2/2 powerpc: hlwd-pic: Prevent interrupts from being handled by Starlet

In reply to Jonathan Neuschäfer

The interrupt controller inside the Wii's Hollywood chip is connected to two masters, the "Broadway" PowerPC and the "Starlet" ARM926, each with their own interrupt status and mask registers.

When booting the Wii with mini[1], interrupts from the SD card controller (IRQ 7) are handled by the ARM, because mini provides SD access over IPC. Linux however can't currently use or disable this IPC service, so both sides try to handle IRQ 7 without coordination.

Let's instead make sure that all interrupts that are unmasked on the PPC side are masked on the ARM side; this will also make sure that Linux can properly talk to the SD card controller (and potentially other devices).

If access to a device through IPC is desired in the future, interrupts from that device should not be handled by Linux directly.

[1]: https://github.com/lewurm/mini

---
 arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/powerpc/platforms/embedded6xx/hlwd-pic.c +5 -0
index e3e3af73e9d8..8112b39879d6 100644
@@ -35,6 +35,8 @@
  */
 #define HW_BROADWAY_ICR		0x00
 #define HW_BROADWAY_IMR		0x04
+#define HW_STARLET_ICR		0x08
+#define HW_STARLET_IMR		0x0c
 
 
 /*
@@ -74,6 +76,9 @@ static void hlwd_pic_unmask(struct irq_data *d)
 	void __iomem *io_base = irq_data_get_irq_chip_data(d);
 
 	setbits32(io_base + HW_BROADWAY_IMR, 1 << irq);
+
+	/* Make sure the ARM (aka. Starlet) doesn't handle this interrupt. */
+	clrbits32(io_base + HW_STARLET_IMR, 1 << irq);
 }
 
 
Signature · 1 line
2.17.0
#2 lore raw

Re: [1/2] powerpc: flipper-pic: Don't match all IRQ domains

In reply to Jonathan Neuschäfer
Quoted 6 lines · On Thu, 2018-05-10 at 21:59:18 UTC, =?utf-8?q?Jonathan_Neusch=C3=A4fer?= wrote:

On the Wii, there is a secondary IRQ controller (hlwd-pic), so flipper-pic's match operation should not be hardcoded to return 1. In fact, the default matching logic is sufficient, and we can completely omit flipper_pic_match.

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/c068e6b8caa0c796535cb12f64767c

cheers