Thread (181 messages) 181 messages, 8 authors, 2009-11-28

Re: [RFC PATCH 11/19] powerpc: gamecube/wii: flipper interrupt controller support

From: Grant Likely <hidden>
Date: 2009-11-22 23:29:21

On Sun, Nov 22, 2009 at 3:01 PM, Albert Herranz [off-list ref] w=
rote:
Add support for the interrupt controller included in the "Flipper"
chipset of the Nintendo GameCube video game console.
The same interrupt controller is also present in the "Hollywood" chipset
of the Nintendo Wii.

Signed-off-by: Albert Herranz <redacted>
---
=A0arch/powerpc/platforms/embedded6xx/Kconfig =A0 =A0 =A0 | =A0 =A06 +
=A0arch/powerpc/platforms/embedded6xx/Makefile =A0 =A0 =A0| =A0 =A01 +
=A0arch/powerpc/platforms/embedded6xx/flipper-pic.c | =A0247 ++++++++++++=
++++++++++
quoted hunk ↗ jump to hunk
=A0arch/powerpc/platforms/embedded6xx/flipper-pic.h | =A0 25 +++
=A04 files changed, 279 insertions(+), 0 deletions(-)
=A0create mode 100644 arch/powerpc/platforms/embedded6xx/flipper-pic.c
=A0create mode 100644 arch/powerpc/platforms/embedded6xx/flipper-pic.h
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/pl=
atforms/embedded6xx/Kconfig
quoted hunk ↗ jump to hunk
index bfd88be..29a98c6 100644
--- a/arch/powerpc/platforms/embedded6xx/Kconfig
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -94,6 +94,7 @@ config MPC10X_STORE_GATHERING
=A0config GAMECUBE_COMMON
=A0 =A0 =A0 =A0bool
=A0 =A0 =A0 =A0select NOT_COHERENT_CACHE
+ =A0 =A0 =A0 select FLIPPER_PIC

=A0config USBGECKO_UDBG
=A0 =A0 =A0 =A0bool "USB Gecko udbg console for the Nintendo GameCube/Wii=
"
quoted hunk ↗ jump to hunk
@@ -108,3 +109,8 @@ config USBGECKO_UDBG
=A0 =A0 =A0 =A0 =A0If in doubt, say N here.

+config FLIPPER_PIC
+ =A0 =A0 =A0 bool
+ =A0 =A0 =A0 depends on GAMECUBE_COMMON
+ =A0 =A0 =A0 default y
You'll always want this driver when GAMECUBE common is set.  Don't add
another Kconfig entry.
quoted hunk ↗ jump to hunk
+
diff --git a/arch/powerpc/platforms/embedded6xx/Makefile b/arch/powerpc/p=
latforms/embedded6xx/Makefile
quoted hunk ↗ jump to hunk
index 0ab7492..35258fd 100644
--- a/arch/powerpc/platforms/embedded6xx/Makefile
+++ b/arch/powerpc/platforms/embedded6xx/Makefile
@@ -8,3 +8,4 @@ obj-$(CONFIG_PPC_HOLLY) =A0 =A0 =A0 =A0 +=3D holly.o
=A0obj-$(CONFIG_PPC_PRPMC2800) =A0 =A0+=3D prpmc2800.o
=A0obj-$(CONFIG_PPC_C2K) =A0 =A0 =A0 =A0 =A0+=3D c2k.o
=A0obj-$(CONFIG_USBGECKO_UDBG) =A0 =A0+=3D usbgecko_udbg.o
+obj-$(CONFIG_FLIPPER_PIC) =A0 =A0 =A0+=3D flipper-pic.o
+unsigned int flipper_pic_get_irq(void)
+{
+ =A0 =A0 =A0 void __iomem *io_base =3D flipper_irq_host->host_data;
+ =A0 =A0 =A0 int irq;
+ =A0 =A0 =A0 u32 irq_status;
+
+ =A0 =A0 =A0 irq_status =3D in_be32(io_base + FLIPPER_ICR) &
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0in_be32(io_base + FLIPPER_IMR);
+ =A0 =A0 =A0 if (irq_status =3D=3D 0)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; =A0 =A0 =A0/* no more IRQs pendi=
ng */

NO_IRQ_IGNORE
+
+ =A0 =A0 =A0 __asm__ __volatile__("cntlzw %0,%1" : "=3Dr"(irq) : "r"(irq=
_status));
+ =A0 =A0 =A0 return irq_linear_revmap(flipper_irq_host, 31 - irq);
+}
+
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help