Home | History | Annotate | Download | only in pci
History log of /src/sys/arch/i386/pci/pcibios.c
RevisionDateAuthorComments
 1.40  10-Nov-2019  chs in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.39  26-Jul-2010  jym branches: 1.39.60;
Add PAE to ALL kernel, so that most paddr_t format string errors get caught
during compilation.

While here, fix the compilation for ALL.
 1.38  28-Apr-2010  dyoung On x86, change the bus_space_tag_t to a pointer to a struct
bus_space_tag. For now, bus_space_tag's only member is
bst_type, the type of space, which is either X86_BUS_SPACE_IO
or X86_BUS_SPACE_MEM. In the future, new bus_space_tag members
will refer to override-functions installed by a new function,
bus_space_tag_create(9).

Add pointers to constant struct bus_space_tag, x86_bus_space_io and
x86_bus_space_mem. Use them to replace most uses of X86_BUS_SPACE_IO
and X86_BUS_SPACE_MEM.

Add an x86-specific bus_space_is_equal(9) implementation that compares
the two tags' bst_type.
 1.37  16-Feb-2010  dyoung branches: 1.37.2;
Get rid of all PCI_CONF_MODE #ifdef'age except for the little bit
that initializes pci_mode, which I have moved to the top.

Make pci_mode private to pci_machdep.c.

Provide pci_mode_set() for pcibios.c to configure the PCI Configuration
Mechanism. KASSERT() in pci_mode_set() that the mechanism is not
changing from anything but the "don't know" value, -1.
 1.36  28-Apr-2008  martin branches: 1.36.14; 1.36.20;
Remove clause 3 and 4 from TNF licenses
 1.35  25-Dec-2007  perry branches: 1.35.6; 1.35.8; 1.35.10;
Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
 1.34  04-Mar-2007  christos branches: 1.34.20; 1.34.26; 1.34.28; 1.34.32;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.33  05-Feb-2007  dyoung branches: 1.33.2;
Cosmetic: use the name PCI_INTERRUPT_REG instead of the number
0x3c.
 1.32  19-Feb-2006  thorpej branches: 1.32.14;
Use aprint_*().
 1.31  26-Dec-2005  perry branches: 1.31.2; 1.31.4; 1.31.6;
u_intN_t -> uintN_t
 1.30  24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.29  11-Dec-2005  christos merge ktrace-lwp.
 1.28  22-Jun-2005  sekiya branches: 1.28.2;
Remove unnecessary #includes.
 1.27  22-Jun-2005  sekiya It turns out that pci_addr_fixup() doesn't require PCIBIOS either. Decouple,
run it from mainbus_attach().
 1.26  21-Jun-2005  sekiya Error out if obsolete fixup config directives are used.

Pointed out by wiz@
 1.25  21-Jun-2005  sekiya Rework the configuration scheme for PCI fixups:

* bus enumeration fixups are not PCIBIOS-specific, interrupt fixups are done
by both PCIBIOS and ACPI. The redundancy is very redundant. Therefore,
rename PCIBIOS_*_FIXUP to PCI_*_FIXUP, use PCI_INTR_FIXUP in place of
ACPI_PCI_FIXUP, and change code refences to match.

* move the fixup defines from opt_pcibios.h to opt_pcifixup.h to reflect
the above.

* fix up the PCI bus numbering in mainbus_attach(), right after we detect the
configuration mode. This probably renders the fixup in pcibios.c
redundant -- but it should be harmless.

These changes make cardbus work in ACPI-only machines, when PCI_BUS_FIXUP
and PCI_INTR_FIXUP are defined.
 1.24  21-Jun-2005  sekiya Fix uninitialized pointer problem in rbus code ... just because the kernel is
compiled with PCIBIOS_ADDR_FIXUP doesn't necessarily mean that
pcibios_addr_fixup() succeeded ...
 1.23  20-Jun-2005  sekiya pci_device_foreach(), pci_device_foreach_min(), pci_bridge_foreach(), and
pci_bridge_hook don't actually have any dependancies on PCIBIOS-specific code,
and they can be used to fixup PCI bus numbering in the absence of the BIOS.

To that end, decouple them from PCIBIOS.
 1.22  03-Feb-2005  perry de-__P, partially ANSIfy
 1.21  21-Nov-2004  augustss branches: 1.21.4; 1.21.6;
Some more Sharp MM20 fixup code that I forgot to commit in the first round.
 1.20  21-Oct-2004  augustss Add a gross hack to route the ECHI interrupt on the Sharp MM20.
You can read the long and sad story about the BIOS in a comment.
 1.19  03-May-2004  kochi don't use large stuff on stack.
(char devinfo[256] -> char *devinfo)
 1.18  30-Apr-2004  christos Add code to deal with the losing Libretto L2/L3 pcibios. From Masanori
Kanaoka. I've been sitting on this code for 3 years, and have not done
anything better with it. It is ugly, it needs to be handled better, but
it is better to have it #ifdef'ed out rather than nothing.
 1.17  24-Apr-2004  uwe Adapt to pci_devinfo signature change.
 1.16  11-Apr-2004  kochi de __P, ANSIfy PCIBIOS related files.
 1.15  04-Apr-2004  kochi Support for PIRQ[E-H], found in recent intel south bridges
(ICH2 and later), which fixes PR/23700.
The changes are from Hiroyuki Bessho and Masanori Kanaoka in PR/23700
with a little modification of interrupt router lookup from mine.
 1.14  27-Oct-2003  christos branches: 1.14.2;
Back out the libretto related hacks I accidentally committed. They are
in CVS in case one wants them :-)
 1.13  25-Oct-2003  christos Fix uninitialized variable warnings
 1.12  17-Sep-2003  drochner syntax error in comment
 1.11  26-Feb-2003  fvdl branches: 1.11.2;
Adapt for i386/x86 change.
 1.10  01-Oct-2002  fvdl Merge Bill Sommerfeld's i386 MP branch. This code has some known
caveats, but works quite well in a lot of MP cases, and all
UP cases that I have tested. Parts of this will hopefully be
reworked in the not-too-distant future.
 1.9  28-Jan-2002  christos branches: 1.9.2;
Look for _PIR in addition to $PIR. My libretto L2 now works without
any other kludges.
 1.8  22-Jan-2002  uch Add pci_bridge_foreach ().
 1.7  15-Nov-2001  lukem add RCSID
 1.6  06-Jul-2001  mcr branches: 1.6.2;
context argument added to pci_device_foreach().
 1.5  01-Aug-2000  uch branches: 1.5.4; 1.5.6;
reserve AGP space to avoid resource conflict.
 1.4  18-Jul-2000  soda - define pcibiosverbose here, instead of each C source.
- use PIR_DEVFUNC_{DEVICE,FUNCTION}.
 1.3  28-Apr-2000  uch branches: 1.3.6;
PCIBIOS_IRQS changed to PCIBIOS_IRQS_HINT. PCIBIOS_IRQS_HINT is
used when no IRQ guess. when at least 1 PCI device configured
correctly, unused.
 1.2  17-Nov-1999  thorpej branches: 1.2.2;
Fix up the PCI bus numbering after fixing up interrupts.
 1.1  17-Nov-1999  thorpej Basic interface to the PCI BIOS and PCI Interrupt Routing table, separated
out from UCHIYAMA Yasushi's PCI BIOS patches, and fairly heavily reworked
by me.

Main differences:
- Only use the PCI BIOS to get the config mechanism and interrupt routing
info for now. No need to use the BIOS for PCI config access right now,
since the old mechanism works fine, and this keeps the code smaller.
- PCI BIOS initialization code path is much different.
- Always use the $PIR table if it exists, and only fallback to the
PCI BIOS 2.1 GetInterruptRouting call if it's not there.

This module does not include any of the fixup code; that is coming
in separate commits.
 1.2.2.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.6.1  10-Aug-2000  soda Pull up to netbsd-1-5 branch
Approved by: thorpej

- define PCIBIOS_PRINTV() as pcibiosverbose printf(),
instead of DPRINTF() in each C source.

- define PIR_DEVFUNC_{DEVICE,FUNCTION}.

- fix oversight introduced in pci_addr_fixup.c revision 1.4,
pointed out by Michael Shalayeff <mickey@openbsd.org>.

- reserve AGP space to avoid resource conflict.

by UCHIYAMA Yasushi <uch@netbsd.org>

- Fix a problem uncovered by rev 1.5 of pcibios.c:

Avoid interpreting the upper 32 bits of 64-bit BARs as a 32-bit BAR.
Otherwise, the code would assume that the value 0 was incorrect and either:
(a) [on bus 0] "fix up" the address to some nonzero value, thus placing
the decoded address range outside of 32-bit address space, or
(b) [elsewhere] completely disable the device.

The fact that this behaviour depends on the bus number of the device is
already XXX'd.

XXX: This will need revisiting if and when we ever want to handle a PCI bus
XXX: with more than 32 bits of address space on an i386.

The onboard Adaptec 7890 on my Dell Precision Workstation 410 works again.

by Nathan J Williams <nathanw@netbsd.org>

Revisions pulled up:
> cvs rdiff -r1.2 -r1.3 syssrc/sys/arch/i386/pci/pcibios.h
> cvs rdiff -r1.3 -r1.5 syssrc/sys/arch/i386/pci/pcibios.c
> cvs rdiff -r1.3 -r1.7 syssrc/sys/arch/i386/pci/pci_addr_fixup.c
 1.5.6.4  18-Oct-2002  nathanw Catch up to -current.
 1.5.6.3  28-Feb-2002  nathanw Catch up to -current.
 1.5.6.2  08-Jan-2002  nathanw Catch up to -current.
 1.5.6.1  24-Aug-2001  nathanw Catch up with -current.
 1.5.4.2  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.5.4.1  01-Aug-2000  bouyer file pcibios.c was added on branch thorpej_scsipi on 2000-11-20 20:09:35 +0000
 1.6.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.6.2.2  11-Feb-2002  jdolecek Sync w/ -current.
 1.6.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.2  24-Feb-2002  sommerfeld squish some more assembler warnings.
 1.9.2.1  28-Jan-2002  sommerfeld file pcibios.c was added on branch sommerfeld_i386mp_1 on 2002-02-24 01:55:12 +0000
 1.11.2.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.2.6  04-Feb-2005  skrll Sync with HEAD.
 1.11.2.5  29-Nov-2004  skrll Sync with HEAD.
 1.11.2.4  02-Nov-2004  skrll Sync with HEAD.
 1.11.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.11.2.1  03-Aug-2004  skrll Sync with HEAD
 1.14.2.1  28-Apr-2004  jmc Pullup rev 1.15 (requested by kochi in ticket #188)

Support for PIRQ[E-H], found in recent intel south bridges
(ICH2 and later). PR#23700
 1.21.6.1  12-Feb-2005  yamt sync with head.
 1.21.4.1  29-Apr-2005  kent sync with -current
 1.28.2.4  21-Jan-2008  yamt sync with head
 1.28.2.3  03-Sep-2007  yamt sync with head.
 1.28.2.2  26-Feb-2007  yamt sync with head.
 1.28.2.1  21-Jun-2006  yamt sync with head.
 1.31.6.1  22-Apr-2006  simonb Sync with head.
 1.31.4.1  09-Sep-2006  rpaulo sync with head
 1.31.2.1  01-Mar-2006  yamt sync with head.
 1.32.14.1  09-Feb-2007  ad Sync with HEAD.
 1.33.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.34.32.1  02-Jan-2008  bouyer Sync with HEAD
 1.34.28.1  26-Dec-2007  ad Sync with head.
 1.34.26.1  18-Feb-2008  mjf Sync with HEAD.
 1.34.20.1  09-Jan-2008  matt sync with HEAD
 1.35.10.3  11-Aug-2010  yamt sync with head.
 1.35.10.2  11-Mar-2010  yamt sync with head
 1.35.10.1  16-May-2008  yamt sync with head.
 1.35.8.1  18-May-2008  yamt sync with head.
 1.35.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.36.20.2  17-Aug-2010  uebayasi Sync with HEAD.
 1.36.20.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.36.14.1  24-Oct-2010  jym Sync with HEAD
 1.37.2.2  05-Mar-2011  rmind sync with head
 1.37.2.1  30-May-2010  rmind sync with head
 1.39.60.1  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411

RSS XML Feed