Subject: Interrupt interaction with OFW properties.
To: None <port-ofppc@netbsd.org>
From: Jochen Kunz <jkunz@unixag-kl.fh-kl.de>
List: port-ofppc
Date: 06/03/2003 21:59:34
Hi.=20

I am working on the MD code to make port-ofppc run on the Motorola
PowerStack II. PCI and ISA attachments are working, now I am on the
interrupt handling stuff. (See my post of a dmesg to port-prep
recently.)=20

As Matt Thomas sugested I pulled pci_attach_hook() / fixpci() /
find_node_intr() from sys/arch/macppc/pci/pci_machdep.c and integrated
this into my sys/arch/ofppc/motorola/powerstackII_pci.c. The OFW on the
PowerStack II disables all PCI devices by default. This code sets
PCI_COMMAND_STATUS_REG and PCI_INTERRUPT_REG of each PCI device
according to the OFW properties, thus enabling the device.=20

The code from macppc queries for the property "AAPL,interrupts". Is this
somthing special to macppc? The OFW on the PowerStack II has the
property "interrupts" and the OFW-PCI binding talks about "interrupts"
too. Or is there some special semantic behind the ","?=20

The OFW "interrupts" property is allways 1 for all PCI devices, so the
PCI attach code gets "IRQ 1" for all PCI devices. If I don't use the
find_node_intr() function and leave PCI_INTERRUPT_REG untouched, the
devices get the correct interrupt. (I know the interrupt routing of that
machine from the Linux source linux/arch/ppc/kernel/prep_pci.c,
Utah_pci_IRQ_map[] and Utah_pci_IRQ_routes[]). So it looks to me like
the OFW initializes the PCI_INTERRUPT_REG correct, but doesn't supply a
correct "interrupts" property. Correct? Or is there somthing else I
don't know already.=20
--=20


tsch=FC=DF,
       Jochen

Homepage: http://www.unixag-kl.fh-kl.de/~jkunz/