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

2009-11-27 Thread Benjamin Herrenschmidt
On Sat, 2009-11-28 at 03:04 +0100, Segher Boessenkool wrote: > >> It turns out that we _need_ to ack the RSW (Reset Switch) > interrupt. > >> The other interrupt sources checked (EXI, VI, DI, AI, DSP/ARAM) > need > >> no explicit ack. > > > > That would probably mean that the reset switch interrupt

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

2009-11-27 Thread Segher Boessenkool
It turns out that we _need_ to ack the RSW (Reset Switch) interrupt. The other interrupt sources checked (EXI, VI, DI, AI, DSP/ARAM) need no explicit ack. That would probably mean that the reset switch interrupt is an edge interrupt. Nah, it means that the RSW is a flip-flop. Segher ___

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

2009-11-27 Thread Benjamin Herrenschmidt
On Fri, 2009-11-27 at 18:27 +0100, Albert Herranz wrote: > > I checked it too on the Nintendo GameCube making the ack a no-op. > > It turns out that we _need_ to ack the RSW (Reset Switch) interrupt. > The other interrupt sources checked (EXI, VI, DI, AI, DSP/ARAM) need > no explicit ack. That w

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

2009-11-27 Thread Albert Herranz
Segher Boessenkool wrote: >>> +/* >>> + * Each interrupt has a corresponding bit in both >>> + * the Interrupt Cause (ICR) and Interrupt Mask (IMR) registers. >>> + * >>> + * Enabling/disabling an interrupt line involves asserting/clearing >>> + * the corresponding bit in IM

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

2009-11-27 Thread Segher Boessenkool
+/* + * Each interrupt has a corresponding bit in both + * the Interrupt Cause (ICR) and Interrupt Mask (IMR) registers. + * + * Enabling/disabling an interrupt line involves asserting/ clearing + * the corresponding bit in IMR. ACK'ing a request simply involves + * asserting the corresponding

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

2009-11-26 Thread Segher Boessenkool
Maybe using FLIPPER (or GAMECUBE_FLIPPER) instead of GAMECUBE_COMMON is a good name? I'd prefer to not use a name that implies a specific hardware to describe two (mostly) similar but different hardwares. Hollywood is 100% compatible to Flipper though. No. There's no ARAM for example :)

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

2009-11-26 Thread Benjamin Herrenschmidt
On Fri, 2009-11-27 at 00:00 +0100, Segher Boessenkool wrote: > >>> +unsigned int flipper_pic_get_irq(void) > >>> +{ > >>> + void __iomem *io_base = flipper_irq_host->host_data; > >>> + int irq; > >>> + u32 irq_status; > >>> + > >>> + irq_status = in_be32(io_base + FLIPPER_IC

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

2009-11-26 Thread Segher Boessenkool
+unsigned int flipper_pic_get_irq(void) +{ + void __iomem *io_base = flipper_irq_host->host_data; + int irq; + u32 irq_status; + + irq_status = in_be32(io_base + FLIPPER_ICR) & +in_be32(io_base + FLIPPER_IMR); + if (irq_status == 0) +

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

2009-11-26 Thread Albert Herranz
Segher Boessenkool wrote: >>> Maybe using FLIPPER (or GAMECUBE_FLIPPER) instead of GAMECUBE_COMMON >>> is a good name? >> >> I'd prefer to not use a name that implies a specific hardware to >> describe two (mostly) similar but different hardwares. > > Hollywood is 100% compatible to Flipper though

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

2009-11-26 Thread Segher Boessenkool
Maybe using FLIPPER (or GAMECUBE_FLIPPER) instead of GAMECUBE_COMMON is a good name? I'd prefer to not use a name that implies a specific hardware to describe two (mostly) similar but different hardwares. Hollywood is 100% compatible to Flipper though. +/* + * Each interrupt has a correspo

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

2009-11-26 Thread Benjamin Herrenschmidt
On Thu, 2009-11-26 at 16:33 +0100, Albert Herranz wrote: > Benjamin Herrenschmidt wrote: > > On Sun, 2009-11-22 at 16:28 -0700, Grant Likely wrote: > >>> +unsigned int flipper_pic_get_irq(void) > >>> +{ > >>> + void __iomem *io_base = flipper_irq_host->host_data; > >>> + int irq; > >>>

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

2009-11-26 Thread Benjamin Herrenschmidt
On Thu, 2009-11-26 at 16:30 +0100, Albert Herranz wrote: > Benjamin Herrenschmidt wrote: > > On Sun, 2009-11-22 at 23:01 +0100, Albert Herranz wrote: > > > >> +static void flipper_pic_mask_and_ack(unsigned int virq) > >> +{ > >> + int irq = virq_to_hw(virq); > >> + void __iomem *io_base = get_ir

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

2009-11-26 Thread Albert Herranz
Benjamin Herrenschmidt wrote: > On Sun, 2009-11-22 at 16:28 -0700, Grant Likely wrote: >>> +unsigned int flipper_pic_get_irq(void) >>> +{ >>> + void __iomem *io_base = flipper_irq_host->host_data; >>> + int irq; >>> + u32 irq_status; >>> + >>> + irq_status = in_be32(io_base

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

2009-11-26 Thread Albert Herranz
Benjamin Herrenschmidt wrote: > On Sun, 2009-11-22 at 23:01 +0100, Albert Herranz wrote: > >> +static void flipper_pic_mask_and_ack(unsigned int virq) >> +{ >> +int irq = virq_to_hw(virq); >> +void __iomem *io_base = get_irq_chip_data(virq); >> + >> +clear_bit(irq, io_base + FLIPPER_IM

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

2009-11-25 Thread Benjamin Herrenschmidt
On Sun, 2009-11-22 at 16:28 -0700, Grant Likely wrote: > > +unsigned int flipper_pic_get_irq(void) > > +{ > > + void __iomem *io_base = flipper_irq_host->host_data; > > + int irq; > > + u32 irq_status; > > + > > + irq_status = in_be32(io_base + FLIPPER_ICR) & > > +

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

2009-11-25 Thread Benjamin Herrenschmidt
On Sun, 2009-11-22 at 23:01 +0100, Albert Herranz wrote: > +static void flipper_pic_mask_and_ack(unsigned int virq) > +{ > + int irq = virq_to_hw(virq); > + void __iomem *io_base = get_irq_chip_data(virq); > + > + clear_bit(irq, io_base + FLIPPER_IMR); > + set_bit(irq, io_base + FL

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

2009-11-25 Thread Albert Herranz
Segher Boessenkool wrote: >> config GAMECUBE_COMMON >> bool >> select NOT_COHERENT_CACHE >> +select FLIPPER_PIC > > Maybe using FLIPPER (or GAMECUBE_FLIPPER) instead of GAMECUBE_COMMON > is a good name? > I'd prefer to not use a name that implies a specific hardware to describe tw

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

2009-11-24 Thread Segher Boessenkool
config GAMECUBE_COMMON bool select NOT_COHERENT_CACHE + select FLIPPER_PIC Maybe using FLIPPER (or GAMECUBE_FLIPPER) instead of GAMECUBE_COMMON is a good name? +#define pr_fmt(fmt) DRV_MODULE_NAME ": " fmt Unused +/* + * Each interrupt has a corresponding bit in both

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

2009-11-23 Thread Albert Herranz
Grant Likely wrote: > On Sun, Nov 22, 2009 at 3:01 PM, Albert Herranz > wrote: >> 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 Ninten

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

2009-11-22 Thread Grant Likely
On Sun, Nov 22, 2009 at 3:01 PM, Albert Herranz wrote: > 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: Al

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

2009-11-22 Thread Albert Herranz
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 --- arch/powerpc/platforms/embedded6xx/Kconfig