[Cbe-oss-dev] [RFC/PATCH] adding support for direct MBX interrupt on Axon based platform.

Jean-Christophe Dubois jdubois at mc.com
Sun May 20 17:41:55 EST 2007


On Saturday 19 May 2007 23:26:07 Benjamin Herrenschmidt wrote:
> > +static void c3po_mask(unsigned int irq)
> > +{
> > +}
> > +
> > +static void c3po_unmask(unsigned int irq)
> > +{
> > +}
> > +
> > +static void c3po_eoi(unsigned int irq)
> > +{
> > +}
> > +
> > +static void c3po_ack(unsigned int irq)
> > +{
> > +}
> > +
> > +static struct irq_chip c3po_chip = {
> > +	.typename = " AXON-C3PO",
> > +	.mask = c3po_mask,
> > +	.unmask = c3po_unmask,
> > +	.ack = c3po_ack,
> > +	.eoi = c3po_eoi,
> > +};
>
> I think you need none of that.
>
> > +static void c3po_irq_cascade(unsigned int irq, struct irq_desc *desc)
> > +{
> > +	int hw_int = (int)desc->handler_data;
> > +	unsigned int virq = irq_find_mapping(NULL, hw_int);
> > +
> > +	if (virq != NO_IRQ) {
> > +		generic_handle_irq(virq);
> > +	}
> > +
> > +	desc->chip->eoi(irq);
> > +}
>
> Why that cascade chip etc... ?
>
> If you use a different class, you get a unique IRQ number straight off
> the IIC. Thus you can just register an IIC interrupt !

You must be right. I guess this is a bit inherited ... and I like to be able 
to attach an hardware IRQ of my choice to the MBX. It is easier for my code. 
But I'll think about dumping this.

>   .../...
>
> Basically, -all- you need is
>
>  - Add a quirk to change the IRC class (or fix your OF)

I am not in control of the OF tree. IBM is ... So I need the quirk .

>  - Sythetize a HW irq number off the IIC (or fix our OF :-)

Same remark for the OF tree.

>  - Map and request the above.
>
> The IRQ number would be defined from the constants in interrupts.h, that
> is the node in bit 8, the class 0x10, and the source (0x0 or 0xb) in the
> low 4 bits.
>
> If you put it in the device-tree, then the "interrupts" property shall
> contain NN XX CC UU, where NN is the node, EXT isn't used in your case,
> CC is the class and UU the unit. For example, for node 0 class 1 unit 0:
> 0x00000100. In which case you can just use irq_of_parse_and_map() on the
> mbx node which contains that property to obtain a virq you can request.

For now I have to do without OF tree for the direct MBX. I'll talk to IBM to 
check if they would add it. 

However, theoretically this interrupt should really be attached to the mailbox 
node. But the mailbox node already has #interrupt-cells and interrupts 
properties pointing to the MPIC somehow ... What is the theory to have the 
same device handled by 2 distinct "interrupt controllers" (MPIC and IIC)?

JC

>
> Cheers,
> Ben.





More information about the cbe-oss-dev mailing list