Subject: Re: [PATCH] Fix Maple PATA IRQ assignment.

From: Benjamin Herrenschmidt <[email-masked]>
Date: Tue, 02 Jan 2007 08:33:50 +1100

On Mon, 2007-01-01 at 21:44 +0100, Segher Boessenkool wrote:
> > I'm not sure you can switch it to native mode in sw... worth double
> > checking though. All boards based on 8111 on powerpc have this problem,
> > I think. What of the js20 and js21 with IBM firmware ?
> 
> At least with SLOF, we use native mode.
> 
> > Or does it have
> > the ide strapped to native mode ?
> 
> It's not a strapping, it's a purely software thing -- see the PCIIDE
> specification.

I know the PCI IDE spec, but there are a number of chips out there that
cannot be changed without a strap. In this case, it's easy to test
though we'll need fixups in the device-tree to indicate the change in
routing, or a quirk.

The thing is, there -is- a cascaded 8259 in there, and that's where the
IRQ14 and IRQ15 end up in legacy mode (edge sensitive even) iirc, unless
they are aslo routed to the APIC directly, but in anyway it's hidden by
the firmware.

So we can have a quirk in the Maple code to reconfigure that all in
native mode. That will mean a bit more IRQ sharing since both IDE
channels will suddenly share PIRQA though... along with whatever else
uses that pin. Maybe not the best solution...

Or keep the hook and use it in libata. It makes sense I think in
general. I reckon other platforms might have good use of being able to
"remap" those IRQs 14 and 15 from IDE controllers in legacy mode. I've
seen plenty of cases where  they are kept in that mode just to keep the
IRQs non-shared.

> Lots of controllers get the interrupt thing wrong though -- but
> AMD8111 isn't one of those.

Ben.