RE: PLEASE REVIEW: Adding a pci_if method to facilitate specialized PCI bus drivers

From: John Baldwin (jhb_at_FreeBSD.org)
Date: 06/27/03

  • Next message: John Baldwin: "Re: pkg_create broken by design?"
    Date: Fri, 27 Jun 2003 13:37:00 -0400 (EDT)
    To: Thomas Moestl <t.moestl@tu-bs.de>
    
    

    On 13-Jun-2003 Thomas Moestl wrote:
    > Hi,
    >
    > I've attached a patch that adds a new pci_if method,
    > assign_interrupt, and makes the PCI code implement and use
    > it. This is private to the PCI bus and is only used internally (to
    > find an interrupt of a child device); it is a method so that derived
    > PCI bus drivers can override it.
    >
    > This is very useful for the sparc64 OFW PCI bus driver which I will
    > commit soon, hopefully. On sparc64, there are some on-board devices
    > which have special interrupt lines. To route their interrupts, we need
    > not only know the device to route for, but also an interrupt index
    > which is stored in the firmware for this device, and which is used to
    > route on bridges instead of the intpin (in other cases, there's even
    > the complete interrupt number stored there; for devices in PCI slots,
    > we (usually) can use the intpin).
    >
    > This requires us to get this firmware property in the OFW PCI bus
    > driver before routing the interrupt; that can't be done in the pcib
    > route_interrupt method, since we don't know whether we are routing for
    > another bridge (where we use whichever index we get passed) or for a
    > child device (in which case we would need to look at the firmware
    > property).

    Actually, can't you tell this by doing:

            if (device_get_parent(device_get_parent(dev)) == pcib)
                    /* Routing direct child. */
            else
                    /* Routing descedent of a child bridge. */

    -- 
    John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
    "Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
    

  • Next message: John Baldwin: "Re: pkg_create broken by design?"

    Relevant Pages

    • Re: can someone explain...[ PCI interrupts]
      ... interrupts for PCI devices are roughly split up into two categories: INTx interrupt lines and MSI interrupts. ... Each processor contains a local APIC that can receive messages from other APICs and send messages to other local APICs. ... Basically, an IRQ value is a cookie useful for binding a device interrupt tuple or an ISA IRQ) to a x86 interrupt tuple. ...
      (freebsd-current)
    • 2.6.17-rc3 "Bus #03 (-#06) is hidden behind transparent bridge"
      ... PCI: PCI BIOS revision 2.10 entry at 0xf031f, ... ACPI: Interpreter enabled ... Using PIC for interrupt routing ... Using APIC driver default ...
      (Linux-Kernel)
    • Re: wont work: 2.6.0 && SiI 3112 SATA
      ... PCI: PCI BIOS revision 2.10 entry at 0xf0031, ... PCI: Found IRQ 10 for device 0000:00:1f.1 ... hde: lost interrupt ...
      (Linux-Kernel)
    • Re: Thinkpad X31 und CF-Card-Reader
      ... ACPI: bus type pci registered ... Embedded Controller interrupt mode. ... hde: ... ide: failed opcode was: unknown ...
      (de.comp.os.unix.linux.hardware)
    • Re: can someone explain...[ PCI interrupts]
      ... interrupts for PCI devices are roughly split up into two categories: INTx interrupt lines and MSI interrupts. ... Each processor contains a local APIC that can receive messages from other APICs and send messages to other local APICs. ... Basically, an IRQ value is a cookie useful for binding a device interrupt tuple or an ISA IRQ) to a x86 interrupt tuple. ...
      (freebsd-current)