Commit Graph

35 Commits

Author SHA1 Message Date
itohy bb09c44e46 Make pciide(4)-only configurations (without other DMA-capable driver) compile. 2006-10-17 13:45:05 +00:00
jmcneill 5045be0e4d Restore IDE and UDMA timings on resume for the PIIX4. 2006-06-17 17:05:20 +00:00
bouyer f656fa41eb Add svwsata(4), a driver for Serverworks K2 SATA controllers. From
OpenBSD via Joerg Sonnenberger.
2006-03-06 18:35:24 +00:00
perry 93124077ae Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:27:29 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
rearnsha dfcdd57e20 Add support for the Artisea device operating in DPA mode.
Approved by briggs.
2005-02-11 21:12:32 +00:00
perry 18db93c7f6 de-__P 2005-02-04 02:10:35 +00:00
jmcneill 5a6c12cd3b Add powerhooks for PIIX IDE driver. 2005-01-26 21:50:31 +00:00
bouyer 489e5e5287 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().
2004-11-24 19:52:50 +00:00
thorpej 9cc521a148 Move most of wdc_softc into a new atac_softc structure that contains
info common to all types of ATA controllers.
2004-08-20 06:39:37 +00:00
thorpej 1600c8b8cd - 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.)
2004-08-19 23:25:35 +00:00
thorpej 65193a3b71 Protect against multiple inclusion. 2004-08-19 17:56:57 +00:00
thorpej 4b51cecfc2 - 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.
2004-08-14 15:08:04 +00:00
thorpej 46f4277564 WDCDEBUG -> ATADEBUG. 2004-08-13 04:10:49 +00:00
thorpej 5bd80d8373 Rename "struct channel_softc" to "struct wdc_channel". 2004-01-03 01:50:52 +00:00
thorpej b5a6099c59 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.
2003-12-19 19:29:10 +00:00
thorpej f6aaf54d60 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.
2003-12-19 19:09:20 +00:00
thorpej f94de27bbd Const poison the channel name. 2003-12-19 05:55:12 +00:00
thorpej deed3938a2 Move the PCIIDE_OPTIONS_* constants into pciidevar.h 2003-12-19 05:16:57 +00:00
thorpej 376fccb2a5 Add BA5 space tag/handles for Silicon Image SATALink. 2003-12-17 21:08:29 +00:00
fvdl 6242a54566 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).
2003-11-27 23:02:40 +00:00
mycroft a480189bf8 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.
2003-10-24 00:24:15 +00:00
bouyer 9d02ccdbdf 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.
2003-10-08 11:51:59 +00:00
mycroft 07da406c30 GC a structure element. 2003-09-23 09:11:43 +00:00
thorpej d7e289bb70 Add support for the Silicon Image SATALink 3112 Serial ATA controller. 2003-03-20 04:22:49 +00:00
bouyer 53a7926962 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.
2003-03-14 22:46:05 +00:00
thorpej f6cc829138 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.
2003-01-24 04:53:13 +00:00
simonb e5bd00e48d 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.
2001-06-08 04:48:54 +00:00
bouyer bc9dd935cf 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.
2001-01-12 16:03:59 +00:00
thorpej c40fa3c4d4 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.
2000-06-06 17:34:22 +00:00
bouyer 26f6c9a9cf - 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).
2000-04-01 14:32:22 +00:00
soren 748b241afb Export softc. 1999-11-13 13:40:28 +00:00
bouyer 19fddaeeb5 Merge bouyer-ide 1998-10-12 16:09:10 +00:00
cgd b37b33d302 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).
1998-03-04 06:35:11 +00:00