Home | History | Annotate | Download | only in pci
History log of /src/sys/arch/sandpoint/pci/pci_machdep.c
RevisionDateAuthorComments
 1.38  20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.37  01-Jun-2017  chs remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.36  26-Nov-2016  nonaka PCI MSI/MSI-X manipulation stub functions are not provided as weak alias.
 1.35  19-Oct-2016  nonaka Added MSI/MSI-X and interrupt_distribute(9) support for powerpc.
 1.34  02-Oct-2015  msaitoh branches: 1.34.2;
PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific
 1.33  29-Mar-2014  christos branches: 1.33.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.32  26-Mar-2014  christos fix sprintf.
 1.31  28-Dec-2011  phx branches: 1.31.6; 1.31.10;
Add a workaround for the VT6410 IDE controller on the Iomega Storcenter.
Its interrupt cannot be disabled and remains asserted during the whole
device probing procedure, causing an interrupt storm.
This was fixed by establishing an edge-triggered interrupt for it, so it
will trigger only once during probing.
This workaround makes the WDC_NO_IDS option obsolete, which was removed
from the GENERIC config.
 1.30  06-Nov-2011  phx branches: 1.30.4;
Fixed PCI line to EPIC IRQ mapping for Iomega Storcenter.
 1.29  01-Jul-2011  dyoung branches: 1.29.2;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.28  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.27  30-Apr-2011  phx branches: 1.27.2;
Detect QNAP board last, because a Realtek chip at pci device 15 is used
on several boards.
 1.26  04-Apr-2011  dyoung Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.

For the most part, these changes add a 'const' where there was no
'const' before, however, some drivers and MD code used to modify
pci_attach_args. Now those drivers either copy their pci_attach_args
and modify the copy, or refrain from modifying pci_attach_args:

Xen: according to Manuel Bouyer, writing to pci_attach_args in
pci_intr_map() was a leftover from Xen 2. Probably a bug. I
stopped writing it. I have not tested this change.

siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args.
Probably a bug. I use a temporary variable. I have not tested this
change.

slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args.
Probably a bug. Use a local pci_attach_args. I have not tested
this change.

viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the
caller's pci_attach_args. Probably a bug. Make a local copy of the
caller's pci_attach_args and modify the copy. I have not tested
this change.

While I'm here, make pci_mapreg_submap() static.

With these changes in place, I have tested the compilation of these
kernels:

alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-eb NSLU2
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX
HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR
TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sgimips GENERIC32_IP2x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC

As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels
with or without my patches in place:

### evbmips-el GDIUM

nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop

### evbarm-el MPCSA_GENERIC
src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'

### ia64 GENERIC

/tmp/genassym.28085/assym.c: In function 'f111':
/tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb'
/tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type

### sgimips GENERIC32_IP3x

crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
 1.25  26-Mar-2011  phx Recognize QNAP V200 board, used in the TS-201 and newer TS-101 models.
 1.24  19-Mar-2011  phx DLink DSM-G600 IDSEL-14 (USB) needs special handling: Pin A is mapped to
EPIC-IRQ 1, but Pin C must be mapped to IRQ 2.
 1.23  14-Feb-2011  nisimura add EPIC definition for Netronics NH230/NH231 and the brothers.
 1.22  10-Feb-2011  nisimura - add D-Link EPIC defition to pci_machdep.c
- change the way to reboot/pwroff to make satmgr.c more flexible for
a multiple byte sat protocol.
 1.21  07-Feb-2011  nisimura add StorCenter heuristic by PCI vendor ID detection.
 1.20  20-Dec-2010  matt branches: 1.20.2; 1.20.4;
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.19  28-May-2010  phx QNAP support (untested): PCI fixup and corrected PCI address lines (+1).
Patch submitted by Toru Nishimura.
 1.18  27-May-2010  phx Disable EPIC_DEBUGIRQ. Reenable when needed.
 1.17  30-Jul-2009  nisimura branches: 1.17.2; 1.17.4;
- fix EUMB com console attach case.
- #ifdef out pci_conf_interrupt() for PCI_NETBSD_CONFIGURE option.
Requested and tested by kiyohara.
 1.16  30-May-2008  ad pci_intr_setattr(), allows PCI interrupts to be marked MPSAFE on x86, and
other platforms if the code is added.

pci_intr_map(...)
pci_intr_setattr(pc, ih, PCI_INTR_MPSAFE, 1);
pci_intr_establish(...)
 1.15  19-Nov-2007  nisimura branches: 1.15.14; 1.15.16; 1.15.18; 1.15.20;
- SandpointX3 practices serial mode EPIC with the help of special
FPGA circuit. pin A input only; pin B/C/D are not counted in.
- With EnCorePP1 heuristics find that i82559 (AD25) responds to EPIC 2.
 1.14  27-Oct-2007  nisimura branches: 1.14.2;
- copy intr.h from prep and make mods.
- ANSI-fy pci_machdep.c
 1.13  17-Oct-2007  garbled 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.12  11-Dec-2005  christos branches: 1.12.30; 1.12.38; 1.12.48; 1.12.50; 1.12.52; 1.12.54;
merge ktrace-lwp.
 1.11  15-Jul-2003  lukem branches: 1.11.16;
__KERNEL_RCSID()
 1.10  27-Sep-2002  provos branches: 1.10.6;
remove trailing \n in panic(). approved perry.
 1.9  24-May-2002  briggs Only attempt to handle mapping IDE interrupts if we are in SERIAL mode.
 1.8  12-Apr-2002  briggs branches: 1.8.2; 1.8.4;
Map winbond interrupts.
 1.7  29-Oct-2001  thorpej branches: 1.7.2;
pci_conf_interrupt() takes bus/dev/pin, not bus/dev/func.
 1.6  30-Aug-2001  briggs branches: 1.6.4;
- Change default time frequency to 100MHz from 66MHz.
- Support the serial mode interrupts (with a kernel configuration option)
on the Sandpoint X3.
- Initialize cpu_timebase.
- Enable tulip driver.
 1.5  20-Aug-2001  wiz "wierd" is weird.
 1.4  10-Jun-2001  briggs branches: 1.4.2;
Adapt to new PowerPC pmap.
Use more common PowerPC code including bus_dma and unified bus_space.
 1.3  15-May-2001  lukem delint: don't try & return something from void pci_intr_disestablish()
 1.2  07-Feb-2001  briggs branches: 1.2.2; 1.2.4;
Handle setting the proper interrupt line for devices behind bridges.
 1.1  04-Feb-2001  briggs Support for the Motorola Sandpoint reference platform using the
MPC8240 processor module. See the README for more information.
 1.2.4.1  21-Jun-2001  nathanw Catch up to -current.
 1.2.2.2  11-Feb-2001  bouyer Sync with HEAD.
 1.2.2.1  07-Feb-2001  bouyer file pci_machdep.c was added on branch thorpej_scsipi on 2001-02-11 19:12:03 +0000
 1.4.2.5  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.4.2.4  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.3  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.2  13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.4.2.1  25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.6.4.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.7.2.4  18-Oct-2002  nathanw Catch up to -current.
 1.7.2.3  20-Jun-2002  nathanw Catch up to -current.
 1.7.2.2  17-Apr-2002  nathanw Catch up to -current.
 1.7.2.1  29-Oct-2001  nathanw file pci_machdep.c was added on branch nathanw_sa on 2002-04-17 00:04:18 +0000
 1.8.4.1  24-May-2002  perry resolve 1.6 pullup ticket #18, from briggs
needed to make sandpoint port build again
pulls up revision number 1.9
Original commit message:

> Only attempt to handle mapping IDE interrupts if we are in SERIAL mode.
 1.8.2.1  30-May-2002  gehenna Catch up with -current.
 1.10.6.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.6.2  18-Sep-2004  skrll Sync with HEAD.
 1.10.6.1  03-Aug-2004  skrll Sync with HEAD
 1.11.16.2  07-Dec-2007  yamt sync with head
 1.11.16.1  27-Oct-2007  yamt sync with head.
 1.12.54.3  21-Nov-2007  bouyer Sync with HEAD
 1.12.54.2  13-Nov-2007  bouyer Sync with HEAD
 1.12.54.1  25-Oct-2007  bouyer Sync with HEAD.
 1.12.52.1  18-Oct-2007  yamt sync with head.
 1.12.50.2  09-Jan-2008  matt sync with HEAD
 1.12.50.1  06-Nov-2007  matt sync with HEAD
 1.12.48.3  21-Nov-2007  joerg Sync with HEAD.
 1.12.48.2  28-Oct-2007  joerg Sync with HEAD.
 1.12.48.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.12.38.5  16-Jun-2007  nisimura some correction for interrupt fixup. Hope this more precise and better
suited.
 1.12.38.4  08-Jun-2007  nisimura - fix EPIC IRQ mapping for additional SATA controller found Synology
- aprint_error
 1.12.38.3  23-May-2007  nisimura - pci_machdep.c tries to fixup PCI stuff by identifying the target with
some heuristics.
- have eumb device nodes for bus.h and mainbus.c and machdep.c.
 1.12.38.2  04-May-2007  nisimura - make machine/openpicreg.h free from brd specific IRQ assignment.
Need to invent the concise way to specify brd definitions.
- compensate the change above by adding lines to pci/pci_machdep.c
- intr_establish() needs +16 offset to register PCI interrupts.
 1.12.38.1  04-May-2007  nisimura get rid of a line to include isa/icu.h
 1.12.30.2  03-Dec-2007  ad Sync with HEAD.
 1.12.30.1  23-Oct-2007  ad Sync with head.
 1.14.2.1  08-Dec-2007  mjf Sync with HEAD.
 1.15.20.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.15.18.3  11-Aug-2010  yamt sync with head.
 1.15.18.2  19-Aug-2009  yamt sync with head.
 1.15.18.1  04-May-2009  yamt sync with head.
 1.15.16.1  04-Jun-2008  yamt sync with head
 1.15.14.1  02-Jun-2008  mjf Sync with HEAD.
 1.17.4.4  31-May-2011  rmind sync with head
 1.17.4.3  21-Apr-2011  rmind sync with head
 1.17.4.2  05-Mar-2011  rmind sync with head
 1.17.4.1  30-May-2010  rmind sync with head
 1.17.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.20.4.2  17-Feb-2011  bouyer Sync with HEAD
 1.20.4.1  08-Feb-2011  bouyer Sync with HEAD
 1.20.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.27.2.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.29.2.3  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.29.2.2  17-Apr-2012  yamt sync with head
 1.29.2.1  10-Nov-2011  yamt sync with head
 1.30.4.1  18-Feb-2012  mrg merge to -current.
 1.31.10.1  18-May-2014  rmind sync with head
 1.31.6.2  03-Dec-2017  jdolecek update from HEAD
 1.31.6.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.33.6.3  28-Aug-2017  skrll Sync with HEAD
 1.33.6.2  05-Dec-2016  skrll Sync with HEAD
 1.33.6.1  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.34.2.2  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.34.2.1  04-Nov-2016  pgoyette Sync with HEAD

RSS XML Feed