Port-powerpc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Interrupt handling and routing: The Big Picture

Jochen Kunz wrote:

> My problem is: Where and how to hook up what code to deal with the
> special PIC of the MPC5200.

See my previous posting.

> 1st Problem: How to get an interrupt to the handler of the device?

This will work automatically once the MPC5200B PIC is implemented and
initialized. The drivers will just use intr_establish() like always.

> [..virq..]
> OK. Seems I don't need to fight with this.


> 2nd Problem: How to hook up the special MPC5200 PIC to the generic
> interrupt handling stuff of the kernel.
> The fun starts with intr_establish(). It walks "struct pic_ops
> *pics[MAX_PICS]" by means of find_pic_by_hwirq(). So I have to fill a
> "struct pic_ops" somewhere in my code and feed it to pic_add()?

You need to detect the PICNODE_TYPE. Then you will check for this type in
init_ofppc_interrupt() and call the PIC's setup-function, e.g.
setup_mpc5200() (from powerpc/pic/pic_mpc5200.c, which you have to write).

This function will initialize everything for the PIC and call pic_add().

You don't need to care about the rest.

> 3rd Problem: How to hookup to autoconf(9).
> In addition I have to provide something like "efika_intr_map()".

Hm. You mean for the embedded devices?

> It
> maps the OFW interrupt properties as given by the device attach
> arguments to a "hwirq" to feed this in turn to intr_establish()? This
> should be enough to get the on chip peripherals running.

This should be done by genofw_setup_pciiintr_map(). It will either read the
interrupt information directly from the Efika's OFW nodes, or it will
fallback to reading the interrupts from the PCI device (as for the

Check the OFW tree of you Efika if it contains information about the
interrupts (I don't remember ATM).

> The PCI code has generic functions for this. (genofw_pci_intr_map()
> genofw_setup_pciintr_map()) I still have no clue about how to shove
> "efika_intr_map()" in there. As PCI is optional, I'll don't care about
> this at the moment.

You can always check the model_name for "Efika" and then call
efika_intr_map() for the embedded MPC5200 devices.

I would even suggest to call it mpc5200_intr_map() and make a new directory
like arch/powerpc/mpc5200 for all the new device drivers.

Is the MPC5200 compatible to other CPUs?

Frank Wille

Home | Main Index | Thread Index | Old Index