Home | History | Annotate | Download | only in pci
History log of /src/sys/dev/pci/pciidevar.h
RevisionDateAuthorComments
 1.51  26-Dec-2021  andvar fix various typos, mainly in comments.
 1.50  19-Apr-2018  christos s/static inline/static __inline/g for consistency.
 1.49  22-Oct-2017  jdolecek branches: 1.49.2;
do not share queue between the non-indepedant channels; instead make
sure only one of the channels is ever active on the same controller

fixes PR kern/52606 by Martin Husemann, thanks for report and testing
 1.48  19-Oct-2017  jdolecek replace the chek for the shared channel of cmdide(4) a flag of the
product array, rather than switch inside attach routine

XXX judging from product name, Silicon Image 0680 might be newer than 0649
XXX and hence have actually independant channels, but I don't have the hw
XXX so keeping as-is

no functional change, just to improve visibility in course of fixing
PR kern/52606
 1.47  24-Aug-2015  pooka add some _KERNEL_OPT as the finishing touch
 1.46  31-Jul-2012  bouyer branches: 1.46.2; 1.46.16;
Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdc
cleanup and SATA PMP support), now that I'm back to fix the fallouts.
 1.45  26-Jul-2012  jakllsch Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@
 1.44  02-Jul-2012  bouyer Add sata Port MultiPlier (PMP) support to the ata bus layer,
as described in
http://mail-index.netbsd.org/tech-kern/2012/06/23/msg013442.html
PMP support in integrated to the atabus layer.
struct ata_channel's ch_drive[] is not dynamically allocated, and ch_ndrive
(renamed to ch_ndrives) closely reflects the size of the ch_drive[] array.
Add helper functions atabus_alloc_drives() and atabus_free_drives()
to manage ch_drive[]/ch_ndrives.
Add wdc_maxdrives to struct wdc_softc so that bus front-end can specify
how much drive they really support (master/slave or single).
ata_reset_drive() callback gains a uint32_t *sigp argument which,
when not NULL, will contain the signature of the device being reset.
While there, some cosmetic changes:
- added a drive_type enum to ata_drive_datas, and stop encoding the
probed drive type in drive_flags (we were out of drive flags anyway).
- rename DRIVE_ATAPIST to DRIVE_ATAPIDSCW to better reflect what this
really is
- remove ata_channel->ata_drives, it's redundant with the pointer in
ata_drive_datas
- factor out the interpretation of SATA signatures in sata_interpet_sig()

propagate these changes to the ATA HBA drivers, and add support for PMP
to ahcisata(4) and siisata(4).

Thanks to:
- Protocase (http://www.protocase.com/) which provided a system
with lots of controllers, SATA PMP and drive slots
- Conservation Genomics Laboratory, Department of Biology, New Mexico State
University for hosting the above system
- Brook Milligan, who set up remote access and has been very responsive
when SATA cable move was needed
 1.43  04-Apr-2011  dyoung branches: 1.43.4;
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.42  06-Nov-2010  jakllsch branches: 1.42.2;
Rework pciide(4) detachment to take the legacy interrupt mapping into
consideration and avoid future code duplication.

Ports wanting to enable detachment of controllers with compatibility-mapped
channels will need to supply a pciide_machdep_compat_intr_disestablish()
function.
 1.41  05-Nov-2010  jakllsch Pave the way for detachment of pciide(4)-family ATA controllers.
 1.40  14-Nov-2009  cegger branches: 1.40.2; 1.40.4;
include <sys/device_if.h> for device_t. There is no use of struct device.
 1.39  05-Oct-2009  dyoung It's a big job to write detachment hooks for pciide(4) and all of
its derivatives, and I haven't the time myself. In struct
pciide_product_desc, provide a tiny bit of commented-out code to
guide an enterprising developer who takes on the immense task.
 1.38  06-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.37  15-Mar-2009  cegger ansify function definitions
 1.36  04-Jan-2008  joerg branches: 1.36.10; 1.36.18; 1.36.24;
Allow saving of up to 4 PCI registers in the IDE code.
 1.35  17-Oct-2006  itohy branches: 1.35.24; 1.35.30; 1.35.38;
Make pciide(4)-only configurations (without other DMA-capable driver) compile.
 1.34  17-Jun-2006  jmcneill branches: 1.34.4; 1.34.6;
Restore IDE and UDMA timings on resume for the PIIX4.
 1.33  06-Mar-2006  bouyer branches: 1.33.6; 1.33.8;
Add svwsata(4), a driver for Serverworks K2 SATA controllers. From
OpenBSD via Joerg Sonnenberger.
 1.32  24-Dec-2005  perry branches: 1.32.4; 1.32.6; 1.32.8;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.31  11-Dec-2005  christos merge ktrace-lwp.
 1.30  27-Feb-2005  perry branches: 1.30.2; 1.30.4;
nuke trailing whitespace
 1.29  11-Feb-2005  rearnsha Add support for the Artisea device operating in DPA mode.

Approved by briggs.
 1.28  04-Feb-2005  perry de-__P
 1.27  26-Jan-2005  jmcneill Add powerhooks for PIIX IDE driver.
 1.26  24-Nov-2004  bouyer branches: 1.26.4; 1.26.6;
Move bus_dma setup out of pciide_dma_init() in a new function,
pciide_dma_dmamap_setup(), for the benefit of drivers that needs special
registers setup in dmainit().
 1.25  20-Aug-2004  thorpej Move most of wdc_softc into a new atac_softc structure that contains
info common to all types of ATA controllers.
 1.24  19-Aug-2004  thorpej - Add and use a CHAN_TO_WDC() macro to get the wdc_softc from an
ata_channel.
- Add and use a CHAN_TO_WDC_REGS() macro to get the wdc_regs from an
ata_channel.
- Add and use a CHAN_TO_PCIIDE() macro to get the pciide_softc from an
ata_channel.
- Add and use a CHAN_TO_PCHAN() macro to get the pciide_channel from an
ata_channel. (This one just hides a cast, and is really just for
consistency with the others.)
 1.23  19-Aug-2004  thorpej Protect against multiple inclusion.
 1.22  14-Aug-2004  thorpej - Split the register handles out of struct wdc_channel into a separate
wdc_regs structure, and array of which (indexed per channel) is pointed
to by struct wdc_softc.
- Move the resulting wdc_channel structure to atavar.h and rename it to
ata_channel. Rename the corresponding flags.
- Add a "ch_ndrive" member to struct ata_channel, which indicates the
maximum number of drives that can be present on the channel. For now,
this is always 2. Add an ATA_MAXDRIVES constant that places an upper
limit on this value, also currently 2.
 1.21  13-Aug-2004  thorpej WDCDEBUG -> ATADEBUG.
 1.20  03-Jan-2004  thorpej branches: 1.20.4;
Rename "struct channel_softc" to "struct wdc_channel".
 1.19  19-Dec-2003  thorpej While legacy PCI IDE controllers have only 2 channels, it is quite common
for modern PCI SATA controllers to have more. Define a new PCIIDE_MAX_CHANNELS
which to specify the maximum number of channels we support, and use it to
allocate channel resources.
 1.18  19-Dec-2003  thorpej Some controllers must have certain bits always be set in the IDEDMA_CMD
register for proper operation. Add a prototype field in the pciide_channel
for this register and use it as necessary when writing the IDEDMA_CMD
register.
 1.17  19-Dec-2003  thorpej Const poison the channel name.
 1.16  19-Dec-2003  thorpej Move the PCIIDE_OPTIONS_* constants into pciidevar.h
 1.15  17-Dec-2003  thorpej Add BA5 space tag/handles for Silicon Image SATALink.
 1.14  27-Nov-2003  fvdl There are some cards that map the ATA control and IDE DMA registers
in a different fashion. Individually, they have the same functionality,
but their layout is different. An example of such a chipset is
the Promise 203xx.

To be able to deal with this, transform the cmd and dma bus_space handles
into an array of handles, each seperately created with bus_space_subregion.
The code generated by using the extra indirection shouldn't change much,
since the extra indirection is negated by having the offset calculation
already done in bus_space_subregion. E.g.

bus_space_write_4(tag, handle, offset, value)

becomes

bus_space_write_4(tag, handles[offset], 0, value)

Reviewed by Manuel Bouyer. Tested on wdc_isa, wdc_pcmcia, viaide, piixide (i386)
and on cmdide (sparc64).
 1.13  24-Oct-2003  mycroft Remove IDE_PCI_CLASS_OVERRIDE -- it wasn't actually used anywhere. In lieu of
it, add a class/subclass check to drivers that do not (appear) to have a unique
ID for the IDE controller. This includes aceride, cypide and optiide.
 1.12  08-Oct-2003  bouyer Split pciide in per-chip family driver, as proposed in
http://mail-index.netbsd.org/tech-kern/2003/09/25/0007.html
We now have:
acardide* at pci? dev ? function ? # Acard IDE controllers
aceride* at pci? dev ? function ? # Acer Lab IDE controllers
cmdide* at pci? dev ? function ? # CMD tech IDE controllers
cypide* at pci? dev ? function ? # Cypress IDE controllers
hptide* at pci? dev ? function ? # Triones/HighPoint IDE controllers
optiide* at pci? dev ? function ? # Opti IDE controllers
piixide* at pci? dev ? function ? # Intel IDE controllers
pdcide* at pci? dev ? function ? # Promise IDE controllers
siside* at pci? dev ? function ? # SiS IDE controllers
slide* at pci? dev ? function ? # Symphony Labs IDE controllers
viaide* at pci? dev ? function ? # VIA/AMD/Nvidia IDE controllers
pciide* at pci? dev ? function ? flags 0x0000 # GENERIC pciide driver

serverworks driver not commited yet; there are still copyright issues about
it.
 1.11  23-Sep-2003  mycroft GC a structure element.
 1.10  20-Mar-2003  thorpej branches: 1.10.2;
Add support for the Silicon Image SATALink 3112 Serial ATA controller.
 1.9  14-Mar-2003  bouyer Rework SiS support: more controller supported (up to Ultra/133) and better
support for the older ones.
Information for this work extracted from Soeren Schmidt's FreeBSD driver.
 1.8  24-Jan-2003  thorpej Add support for the NVIDIA nForce ATA100 and nForce2 ATA133
IDE controllers, which are more-or-less compatible with the
AMD controllers.

XXX Need to determine the correct timing value for the nForce2
XXX at Ultra133, so we cap it at Ultra100, for now.
 1.7  08-Jun-2001  simonb branches: 1.7.16;
For ports that wire up pciide in compatibility mode, have
them define __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
in pci_machdep.h and pciide_map_compat_intr() only calls
pciide_machdep_compat_intr_establish() if that preprocessor
define exists.

Ports that don't need to do this no longer need to supply a
dummy function.
 1.6  12-Jan-2001  bouyer branches: 1.6.2;
Fix bug which affects pciide controllers in native mode (found by
Paul Kranenburg, many thanks !): the control register I/O is 4 byte long
although only one is used, but the control register is at offset 2, and not
0 as expected by IC code. Use bus_space_subregion() to get a handle which
points to the control register, and is one byte long.
 1.5  06-Jun-2000  thorpej branches: 1.5.2;
Actually program the DMA mode of the drives into the Cypress
controller. Fixes a long-standing problem where IDE DMA wasn't
working on the AlphaPC 164SX.
 1.4  01-Apr-2000  bouyer branches: 1.4.2;
- DMA code cleanup: pciide_dma_finish() doesn't stop/unload the current DMA op
if an IRQ was not detected, unless the force flag was given. Use this to
detect if the IRQ was for us (closer to shared IRQ for controllers which
don't have their own IRQ handler in pciide.c) and to poll for DMA xfer.
Also makes the timeout recovery code simpler.
- ATAPI cleanup: don't call controller-specific functions from atapiconf.c
(wdc_*), so that it's possible to attach an atapibus to something else
than a wdc/pciide (Hi Lennart :).
Overload struct scsi_adapter with struct atapi_adapter, defined
as struct scsi_adapter + atapi-specific callbacks. scsipi_link still points
to an scsi_adapter, atapi code casts it to atapi_adapter if needed.
Move atapi_softc to atapiconf.h so that it can be used by the underlying
controller code (e.g. atapi_wdc.c).
Add an atapi-specific callback *atapi_probedev(), which probe a drive
in a controller-specific way, allocate the sc_link and fills in the
ataparams if needed. It then calls atapi_probedev() (from atapiconf.c)
to do the generic initialisations and attach the device.
- While I'm there merge and centralise the state definitions in atavar.h.
It should now be possible to use a common ata/atapi routine to set the
drive's modes (will do later).
 1.3  13-Nov-1999  soren Export softc.
 1.2  12-Oct-1998  bouyer branches: 1.2.6; 1.2.12; 1.2.14; 1.2.18;
Merge bouyer-ide
 1.1  04-Mar-1998  cgd branches: 1.1.2;
PCI IDE glue. Right now, just glues 'wdc's to PCI IDE controller
channels. Eventually should do things like support PCI IDE DMA (it _DOES
NOT_ do that now).
 1.1.2.1  04-Jun-1998  bouyer Commit changes to the IDE system in a branch. This allows a better separation
between higth-level and low-level (i.e. registers read/write) and generalize
the queue for all commands. This also add supports for IDE DMA.
 1.2.18.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.14.1  15-Nov-1999  fvdl Sync with -current
 1.2.12.2  15-Jan-2001  bouyer req_sense_length is dead.
 1.2.12.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.2.6.1  07-Jul-2000  he Apply patch (requested by bouyer):
Add support for the following PCIIDE controllers:
o AMD 756
o CMD PCI0648 and PCI0649
o Hightpoint HPT366
o OPTi 82c621 (and a few of its derivatives)
o Promise Ultra/33 and Ultra/66
o Intel 82801 (ICH/ICH0)
Also fix PR#10437 (detect more ATAPI devices).
 1.4.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.5.2.1  04-Feb-2001  he Pull up revision 1.6 (requested by bouyer):
Fix bug which affects pciide controllers in native mode. Main
effect was a non-functionnal IDE controller on some sparc64 and
macppc when booted from IDE disk.
 1.6.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.7.16.2  12-Jul-2004  he Pull up revision 1.10 (via patch, requested by grant in ticket #1720):
Add support for SATALink 3112.
 1.7.16.1  16-Jun-2003  grant Apply patch (requested by bouyer in ticket #1234):

Rework SiS support: more controller supported (up to Ultra/133) and better
support for the older ones.
Information for this work extracted from Soeren Schmidt's FreeBSD driver.
 1.10.2.8  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.10.2.7  15-Feb-2005  skrll Sync with HEAD.
 1.10.2.6  04-Feb-2005  skrll Sync with HEAD.
 1.10.2.5  29-Nov-2004  skrll Sync with HEAD.
 1.10.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.10.2.2  25-Aug-2004  skrll Sync with HEAD.
 1.10.2.1  03-Aug-2004  skrll Sync with HEAD
 1.20.4.1  16-Mar-2005  tron Pull up revision 1.26 (requested by bouyer in ticket #1016):
Move bus_dma setup out of pciide_dma_init() in a new function,
pciide_dma_dmamap_setup(), for the benefit of drivers that needs special
registers setup in dmainit().
 1.26.6.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.26.6.1  12-Feb-2005  yamt sync with head.
 1.26.4.1  29-Apr-2005  kent sync with -current
 1.30.4.3  21-Jan-2008  yamt sync with head
 1.30.4.2  30-Dec-2006  yamt sync with head.
 1.30.4.1  21-Jun-2006  yamt sync with head.
 1.30.2.1  04-May-2006  tron Pull up following revision(s) (requested by jonathan in ticket #1298):
share/man/man4/pciide.4: revision 1.60
share/man/man4/Makefile: revision 1.376 via patch
sys/dev/pci/svwsata.c: revision 1.1
sys/dev/pci/files.pci: revision 1.243
sys/arch/i386/conf/INSTALL: revision 1.281
sys/dev/pci/pcidevs: revision 1.771 via patch
sys/dev/pci/pciidevar.h: revision 1.33
sys/arch/i386/conf/XEN0: revision 1.34
sys/arch/i386/conf/GENERIC: revision 1.732
sys/dev/pci/pciide_svwsata_reg.h: revision 1.1
Add svwsata(4), a driver for Serverworks K2 SATA controllers. From
OpenBSD via Joerg Sonnenberger.
 1.32.8.2  26-Jun-2006  yamt sync with head.
 1.32.8.1  13-Mar-2006  yamt sync with head.
 1.32.6.1  22-Apr-2006  simonb Sync with head.
 1.32.4.1  09-Sep-2006  rpaulo sync with head
 1.33.8.1  13-Jul-2006  gdamore Merge from HEAD.
 1.33.6.1  19-Jun-2006  chap Sync with head.
 1.34.6.1  22-Oct-2006  yamt sync with head
 1.34.4.1  18-Nov-2006  ad Sync with head.
 1.35.38.1  08-Jan-2008  bouyer Sync with HEAD
 1.35.30.1  18-Feb-2008  mjf Sync with HEAD.
 1.35.24.1  09-Jan-2008  matt 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.3  11-Mar-2010  yamt sync with head
 1.36.10.2  16-May-2009  yamt sync with head
 1.36.10.1  04-May-2009  yamt sync with head.
 1.40.4.2  21-Apr-2011  rmind sync with head
 1.40.4.1  05-Mar-2011  rmind sync with head
 1.40.2.1  06-Nov-2010  uebayasi Sync with HEAD.
 1.42.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.43.4.1  30-Oct-2012  yamt sync with head
 1.46.16.1  22-Sep-2015  skrll Sync with HEAD
 1.46.2.1  03-Dec-2017  jdolecek update from HEAD
 1.49.2.1  22-Apr-2018  pgoyette Sync with HEAD

RSS XML Feed