Home | History | Annotate | Download | only in pci
History log of /src/sys/arch/macppc/pci/pci_machdep.c
RevisionDateAuthorComments
 1.44  11-Aug-2025  macallan 'interrupts' set to 1 means check interrupt-map in OF speak
now we find the correct IRQs for the pdcides found in Xserve G4
 1.43  26-Jan-2021  thorpej There is not much point in of_compatible() returning -1 for "no match"
and >= 0 for "match". Just make it return 0 for "no match" and >0 for
"match" so it can be treated like a boolean expression.

As such of_match_compatible() (a wrapper around of_compatible()) is now
obsolete, and will be removed once all call sites are converted to an
appropriate replacement.
 1.42  01-Mar-2019  msaitoh branches: 1.42.12;
- Almost all ppbreg.h's definitions are also in pcireg.h. Remove duplicated
definitions from ppbreg.h and move some definitions from ppbreg.h to
pcireg.h.
- Change fast back-to-back "capable" to "enable" in pci_subr.c.
- Print Primary Discard Timer, Secondary Discard Timer, Discard Timer Status
and Discard Timer SERR# Enable bit in pci_subr.c.
- PCI_BRIDGE_PREFETCHBASE32_REG and PCI_BRIDGE_PREFETCHLIMIT32_REG are
"upper" 32bit registers, rename to *UP32_REG to avoid confusion.
- Use macro.
 1.41  19-Oct-2016  nonaka branches: 1.41.16;
Added MSI/MSI-X and interrupt_distribute(9) support for powerpc.
 1.40  01-Jul-2011  dyoung branches: 1.40.12; 1.40.30; 1.40.34;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.39  18-Jun-2011  matt struct device * -> device_t
struct cfdata * -> cfdata_t
use device accessors, use device_private.
some softc/device_t splits (macppc needs a bunch more)
aprint*_dev used considerably more
 1.38  20-Dec-2010  matt branches: 1.38.6;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.37  14-Mar-2009  dsl branches: 1.37.4;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.36  25-Dec-2007  macallan branches: 1.36.10; 1.36.18; 1.36.24;
get rid of macppc's private pci_bus_dma_tag
 1.35  17-Oct-2007  garbled branches: 1.35.2; 1.35.4; 1.35.8;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.34  09-Feb-2007  macallan branches: 1.34.6; 1.34.14; 1.34.22; 1.34.24; 1.34.26; 1.34.28;
- don't call load-ata on PB3400 and similar machines - it occasionally
freaks out when a cardbus device is present.
enable with options PB3400_CARDBUS_HACK
- add a hack to make the DEC 21140 found on UMAX E100 cards work, for some
reason OF doesn't see it
enable with options UMAX_E100_HACK
 1.33  03-Jan-2007  macallan if we encounter a cardbus bridge with bogus bus number try to get OF to
assign it a bus number so cardbus* will attach properly.
Should fix PR26508
 1.32  27-Sep-2006  macallan branches: 1.32.2;
on PowerBook 3400c and similar machines redirect the built-in tlp's IRQ to
60 if we find a 2nd OHare - OF claims 27 which is wrong and keeps the tlp
from working.
Tested on a PB3400c, should work on 2400 and original G3 as well.
 1.31  24-Sep-2006  briggs Dump the pin and line information only if DEBUG is defined.
 1.30  05-Aug-2006  sanjayl branches: 1.30.4; 1.30.6;
1st cut of Powermac G5 support (uses bridge mode).
 1.29  11-Dec-2005  christos branches: 1.29.4; 1.29.8;
merge ktrace-lwp.
 1.28  03-Jun-2005  matt branches: 1.28.2;
Cleanup new warnings...
 1.27  07-Dec-2004  briggs Bring in some code to deal with devices in the lower slots of a UMAX S900
and perhaps PowerMac 9500. These slots sit behind a PCI-PCI bridge, and
devices in those slots inherit the PCI-PCI bridge interrupt. Derived from
a patch submitted in PR port-macppc/26341 by Michael Loreny, who was also
diligent in prodding me to look at it.
 1.26  07-Dec-2004  briggs OpenFirmware on machines with the "Grackle" bridge assign an 'AAPL,interrupts'
property instead of 'interrupt-map' and 'interrupt-map-mask' properties.
Adjust for this by checking for the latter, and if they're not present
(and the parent isn't 'pci-bridge'), then look for 'AAPL,interrupts'.

Problem analyzed and patched by Tim Kelly on port-macppc. I modified the
patch to move the fallback into find_node_intr(), tweaking some previously-
disabled code.
 1.25  08-Apr-2004  matt Deal with OFW trees that have interrupt nodes without an #address-cells
property. Treat them as if they had such a property but its value was 0.
 1.24  24-Feb-2004  wiz branches: 1.24.2;
Spell interrupt with two rs. From Peter Postma.
 1.23  20-Aug-2003  matt Relax things so that OFW implementations that don't conform to the OFW PCI
bindings will work.
 1.22  18-Aug-2003  matt Properly walk the OF tree to map a PCI node's interrupt property into the
proper settings for the interrupt-controller.
 1.21  15-Jul-2003  lukem __KERNEL_RCSID()
 1.20  27-Sep-2002  provos branches: 1.20.6;
remove trailing \n in panic(). approved perry.
 1.19  22-Aug-2002  wrstuden Enable memory for cards with 64-bit memory mappings in addition to
32-bit memory mappings. Makes Intel GigE card work in my Beige G3.

Patch from thorpej
 1.18  22-Jul-2001  wiz branches: 1.18.6; 1.18.14; 1.18.16;
bcopy -> memcpy, bzero -> memset, bcmp -> memcmp.
Reviewed by Matt Thomas, ok'd by Tsubai Masanari.
 1.17  19-Jun-2001  simonb branches: 1.17.2;
Add/change prototypes so that macpcc builds with -Wstrict-prototypes.
 1.16  06-Jun-2001  matt Changes new pmap, common param.h, vmparam.h, and moved includes.
 1.15  09-Jan-2001  tsubai branches: 1.15.2;
Configure PCI_INTERRUPT_LINE on the other side of the pci-bridge on OF3 too.
 1.14  28-Dec-2000  sommerfeld Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q
 1.13  29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.12  26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.11  04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.10  03-Feb-2000  tsubai branches: 1.10.2;
* Split bandit and grackle.
* Add UniNorth support.

Now pcibus is attached like:
bandit0 at mainbus0
pci0 at bandit0 bus 0
...
 1.9  05-May-1999  thorpej branches: 1.9.2;
- Add come comments.
- Do a little cleanup.
- Protect the entirety of pci_conf_{read,write}() with splhigh()/splx().
 1.8  15-Mar-1999  tsubai branches: 1.8.2;
Check the accessibility before reading from configuration space.
 1.7  04-Feb-1999  tsubai Add PCI-PCI bridge support for Bandit.
 1.6  21-Oct-1998  tsubai Use PCI function number correctly.
 1.5  15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.4  17-Jul-1998  tsubai Fix typo.
 1.3  17-Jul-1998  tsubai Change pcitag_t format for bandit.
 1.2  13-Jul-1998  tsubai Add support for Motorola MPC106.
 1.1  15-May-1998  tsubai Initial import of macppc port.
 1.8.2.1  06-May-1999  perry branches: 1.8.2.1.2;
pullup 1.8->1.9 (thorpej)
 1.8.2.1.2.1  21-Jun-1999  thorpej Sync w/ -current.
 1.9.2.3  18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.9.2.2  05-Jan-2001  bouyer Sync with HEAD
 1.9.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.10.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.15.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.17.2.3  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.17.2.2  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.17.2.1  03-Aug-2001  lukem update to -current
 1.18.16.1  24-Nov-2002  tron Pull up revision 1.19 (requested by thorpej in ticket #717):
Enable memory for cards with 64-bit memory mappings in addition to
32-bit memory mappings. Makes Intel GigE card work in my Beige G3.
Patch from thorpej
 1.18.14.1  31-Aug-2002  gehenna catch up with -current.
 1.18.6.3  18-Oct-2002  nathanw Catch up to -current.
 1.18.6.2  27-Aug-2002  nathanw Catch up to -current.
 1.18.6.1  22-Jul-2001  nathanw file pci_machdep.c was added on branch nathanw_sa on 2002-08-27 23:44:47 +0000
 1.20.6.5  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.20.6.4  18-Dec-2004  skrll Sync with HEAD.
 1.20.6.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.20.6.2  18-Sep-2004  skrll Sync with HEAD.
 1.20.6.1  03-Aug-2004  skrll Sync with HEAD
 1.24.2.2  24-Jul-2005  tron Pull up revision 1.26 (requested by briggs in ticket #1329):
OpenFirmware on machines with the "Grackle" bridge assign an 'AAPL,interrupts'
property instead of 'interrupt-map' and 'interrupt-map-mask' properties.
Adjust for this by checking for the latter, and if they're not present
(and the parent isn't 'pci-bridge'), then look for 'AAPL,interrupts'.
Problem analyzed and patched by Tim Kelly on port-macppc. I modified the
patch to move the fallback into find_node_intr(), tweaking some previously-
disabled code.
 1.24.2.1  09-Apr-2004  jmc branches: 1.24.2.1.2;
Pullup rev 1.25 (requested by matt in ticket #102)

Deal with OFW trees that have interrupt nodes without an #address-cells
property. Treat them as if they had such a property but its value was 0.
 1.24.2.1.2.2  16-May-2005  riz Pull up revision 1.27 (requested by macallan in ticket #1521):
Bring in some code to deal with devices in the lower slots of a UMAX S900
and perhaps PowerMac 9500. These slots sit behind a PCI-PCI bridge, and
devices in those slots inherit the PCI-PCI bridge interrupt. Derived from
a patch submitted in PR port-macppc/26341 by Michael Loreny, who was also
diligent in prodding me to look at it.
 1.24.2.1.2.1  08-May-2005  snj Pull up revision 1.26 (requested by briggs in ticket #1330):
OpenFirmware on machines with the "Grackle" bridge assign an 'AAPL,interrupts'
property instead of 'interrupt-map' and 'interrupt-map-mask' properties.
Adjust for this by checking for the latter, and if they're not present
(and the parent isn't 'pci-bridge'), then look for 'AAPL,interrupts'.
Problem analyzed and patched by Tim Kelly on port-macppc. I modified the
patch to move the fallback into find_node_intr(), tweaking some previously-
disabled code.
 1.28.2.4  21-Jan-2008  yamt sync with head
 1.28.2.3  27-Oct-2007  yamt sync with head.
 1.28.2.2  26-Feb-2007  yamt sync with head.
 1.28.2.1  30-Dec-2006  yamt sync with head.
 1.29.8.1  11-Aug-2006  yamt sync with head
 1.29.4.1  09-Sep-2006  rpaulo sync with head
 1.30.6.1  22-Oct-2006  yamt sync with head
 1.30.4.2  12-Jan-2007  ad Sync with head.
 1.30.4.1  18-Nov-2006  ad Sync with head.
 1.32.2.1  04-Mar-2007  bouyer Pull up following revision(s) (requested by macallan in ticket #471):
sys/arch/macppc/pci/pci_machdep.c: revision 1.33
if we encounter a cardbus bridge with bogus bus number try to get OF to
assign it a bus number so cardbus* will attach properly.
Should fix PR26508
 1.34.28.1  25-Oct-2007  bouyer Sync with HEAD.
 1.34.26.1  18-Oct-2007  yamt sync with head.
 1.34.24.2  09-Jan-2008  matt sync with HEAD
 1.34.24.1  06-Nov-2007  matt sync with HEAD
 1.34.22.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.34.14.5  18-Jun-2007  macallan also initialize _dma_bus_mem_to_phys and _dma_phys_to_bus_mem methods
 1.34.14.4  07-Jun-2007  garbled Convert macppc to powerpc bus_space. Lots of work here from Matt Thomas,
as well as the common ofwoea code from myself. Compile tested only,
still probably needs some fine tuning.

Also in this commit:
Convert macppc to new shared ofwoea routines.
Lots of KNF.
 1.34.14.3  05-Jun-2007  matt Make macppc use the common powerpc bus_dma.c
 1.34.14.2  06-May-2007  macallan ansify, sprinkle static
 1.34.14.1  06-May-2007  macallan switch macppc over to generic PCI code from arch/powerpc/pci
 1.34.6.1  23-Oct-2007  ad Sync with head.
 1.35.8.1  02-Jan-2008  bouyer Sync with HEAD
 1.35.4.1  26-Dec-2007  ad Sync with head.
 1.35.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.36.24.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.36.18.1  28-Apr-2009  skrll Sync with HEAD.
 1.36.10.1  04-May-2009  yamt sync with head.
 1.37.4.1  05-Mar-2011  rmind sync with head
 1.38.6.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.40.34.1  04-Nov-2016  pgoyette Sync with HEAD
 1.40.30.1  05-Dec-2016  skrll Sync with HEAD
 1.40.12.1  03-Dec-2017  jdolecek update from HEAD
 1.41.16.1  10-Jun-2019  christos Sync with HEAD
 1.42.12.1  03-Apr-2021  thorpej Sync with HEAD.

RSS XML Feed