Commit Graph

209 Commits

Author SHA1 Message Date
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
bouyer 99d6009c2a Make the ATA mid-layer appears as atabus, as proposed in
http://mail-index.netbsd.org/tech-kern/2003/09/25/0006.html
This adds a device (atabus) between IDE controllers and wd or atapibus, to
have each ATA channel show up in the device tree. Later there will be atabus
devices in /dev, so that we can do IOCTL on them.
Each atabus has its own kernel thread, to handle operations that needs polling,
e.g. reset and others.

Device probing on each bus it defered to the atabus thread creation.
This allows to do the reset and basic device probes in parallel, which reduce
boot time on systems with several pciide controllers.
2003-10-08 10:58:12 +00:00
bouyer 7b066791c8 Remove references to University of California from my copyright notices. 2003-10-05 17:48:49 +00:00
mycroft eefae40298 Hide the use of config_interrupts() in one place. 2003-09-25 19:29:48 +00:00
mycroft f9d629fb93 Fix more probe delay and/or failure problems:
1) Don't wait for DRQ on an IDENTIFY command -- if it's not set when we see
   BSY clear, abort the command and ignore the drive.  (Do this by testing
   for DRQ in the read/write cases in __wdccommand_intr().)
2) Don't wait for DRQ to deassert when we finish an IDENTIFY (or any other
   non-block command that reads data) -- we don't do this for block I/O, and
   empirically it doesn't clear on my CF cards at all, causing a pointless 1s
   delay.
3) Add comments to some of the delay()s, and add missing ones in wdcreset()
   and the WDCC_RECAL in the so-called "pre-ATA" probe.
4) Slightly simplify the reset sequence -- we were doing an extra I/O.
5) Modify the register writability test to make sure that registers are not
   overlapped -- this can happen in some weird cases with a missing device 1.
6) Check the error register value after the reset -- if it's not 01h or 81h,
   as appropriate (see ATA spec), punt.
Tested with a number of ATA-only, ATAPI-only, mixed ATA-ATAPI, CF, and IDE
disk configurations.

Also remove the SINGLE_DRIVE nonsense again.
2003-09-23 09:19:22 +00:00
bouyer 0ca58f3790 Ops, remove a line that escaped out of my local tree. 2003-09-21 11:30:43 +00:00
bouyer 9f91a8476e The return value from pciide_mapregs_* are ignored; make them return void.
Re-add support for HPT366 in compat mode.
2003-09-21 11:20:37 +00:00
bouyer c6beeca692 Since we can't detect ghost drives in the wdc back-end, resurect
WDC_CAPABILITY_SINGLE_DRIVE.
2003-09-21 11:14:00 +00:00
enami 893414b366 Make sure the message from pciide_chipen() starts at the beginning of line. 2003-09-20 22:46:02 +00:00
mycroft d40837608f 1) Use config_interrupts() to attach IDE and ATAPI drives. This eliminates
most polling.
2) Clean up some goofiness in pciide -- get rid of the whole "candisable" path
   (it's gratuitous) and simplify the code by calling pciide_map_compat_intr(),
   *_set_modes() and wdc_print_modes() from central locations.
3) Add a register writability and register ghost test to eliminate phantom
   drives more quickly.
2003-09-19 21:35:56 +00:00
bouyer 65b0588afd Add back support for the legacy VT8237 IDE controller.
This wasn't an error, on this chipset we have the SATA controller on function
0 of the IDE controller, not the pcib bridge.
Fix provided by Stephen Degler.
2003-09-17 16:55:20 +00:00
bouyer e9a21b0707 Add support for Intel 82801EB Serial ATA. Not tested with a drive yet,
Matthias Scheler tested that the controller attaches properly.
2003-09-15 20:24:42 +00:00
bouyer 036c4d23c0 Add support for VIA 8237 Serial ATA. From Stephen Degler in kern/22727,
with some cleanup by me.
2003-09-15 20:15:44 +00:00
bouyer 1f8e327374 Add support for VIA VT8237 (KT600) IDE controller. From Stephen Degler in
PR port-i386/22453.
2003-08-17 15:52:06 +00:00
bouyer 395a6a0006 Corect offset for the promise "magic registers" (it depends on channel number).
This makes cable detect work properly for newer promise (pdc268 and newer).
2003-08-10 14:51:55 +00:00
bouyer 9a6b838fb4 Correct setup of General Purpose Register for PDC20265 (Ultra/100) and newer.
From Andreas Johansson in private mail.
2003-06-28 23:13:26 +00:00
bouyer 2eb9add444 Add support for ICH5, from Quentin Garnier in private mail. 2003-06-28 23:04:11 +00:00
thorpej 577fd9d8fa * Use aprint*().
* Add Ultra/133 to wdc_print_modes().
2003-05-17 21:52:03 +00:00
nakayama 1e411d7027 Make DMA mode works on Promise Ultra66/100 with 48-bit LBA drives.
Ok'ed by bouyer in tech-kern@netbsd.org.
2003-04-28 05:20:29 +00:00
christos 9a119fd83b PR/21236: Simon Hitzemann: Fix missing space in error format. While I am
there make a single copy of the error string instead of 6 and share it.
2003-04-19 23:37:26 +00:00
kent 42243152f6 Add '(ICH3)' to the names of 82801CA for consistency with other 82801xx names 2003-04-05 13:00:15 +00:00
kent fa6424efa5 Support for ICH4M IDE Controller 2003-04-04 11:01:48 +00:00
thorpej d7e289bb70 Add support for the Silicon Image SATALink 3112 Serial ATA controller. 2003-03-20 04:22:49 +00:00
thorpej a3e379d70c Fix pasto. 2003-03-19 15:13:57 +00:00
thorpej b1469da17f Add register definitions for the Intel i31244 Serial ATA controller. 2003-03-18 01:41:54 +00:00
thorpej 97cbf6847d Add very basic support for the Intel i31244 Serial ATA controller.
We only support legacy (i.e. PCI IDE compatible) mode, for now.  Also
note that DMA is disabled for rev 0 chips unless explicitly enabled
with PCIIDE_I31244_ENABLEDMA.
2003-03-18 01:13:08 +00:00
bouyer 3cb1252a05 Ops, I commited the previous change (improved SiS support) from thr wrong tree.
Sync with the latest diff I made available, and also include changes from
kern/20710 which is much better than the hack I've done.
2003-03-15 12:23:34 +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
enami 0c1c93f120 Match ServerWorks CSB6 IDE controller. 2003-02-28 22:07:05 +00:00
thorpej 3381232270 Experimental support for RAID volumes configured by ATA "RAID" controllers.
Such RAID controllers are actually just IDE controllers with a BIOS that
can create RAID volumes and write the configuration info to config blocks
on the disks.  The BIOS can do I/O to these volumes, and the OS must
understand the config blocks and implement RAID in software in order to be
able to use these volumes.

Only SPAN (simple concatenation) and RAID0 are supported at this time,
and writing back config blocks is also not supported at this time.  Currently,
only the Promise configuration scheme is supported, although supporting
the Highpoint scheme should not be too difficult.

In any case, this is sufficient to use the Promise RAID0 volume (thus
preserving the win2k AS installation) on this new Intel server I have.

Thanks to Soren Schmidt for doing the work in FreeBSD; it made this
task much easier.  The config block parsing code is adapted from his
work.
2003-01-27 18:21:23 +00:00
thorpej f57bacfc63 Add a couple more Promise ATA133 controllers. 2003-01-25 04:45:24 +00:00
thorpej b3ffb6e4ab * Enable Ultra133 on the NVIDIA nForce 2.
* Make sure to test for PCI_VENDOR_AMD before testing for any
  AMD products.
2003-01-24 05:51:04 +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
matt 46531db96c Recognize Promise Serial ATA/150 TX2plus 2002-12-26 20:54:03 +00:00
bouyer 59fc067cf7 For sis_setup_channel, acer_setup_channel, hpt_setup_channel,
pdc202xx_setup_channel, pdc20268_setup_channel:
Properly compute the address of the DMA control register for channel 1.
I think the controllers ignore these bits, I suspect it's only there so that
the BIOS can tell the OS is has configured DMA, but better be correct.
Thanks to Alexander Yurchenko for pointing this out.
2002-11-20 19:20:24 +00:00
kent 5636e4e770 Add support for VIA VT8235 2002-10-05 17:07:32 +00:00
thorpej b75a007d9f Add trailing ; to CFATTACH_DECL. 2002-10-02 16:51:16 +00:00
thorpej 387fc6dc87 Use CFATTACH_DECL(). 2002-09-30 20:37:04 +00:00
thorpej f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
bouyer f30ddf1a29 Fix typo in comment. From Alexander Yurchenko <grange@rt.mipt.ru> 2002-09-15 20:27:09 +00:00
bouyer 9ca1f94f72 Support Ultra/133 on promise controllers that can do it. 2002-08-25 17:26:58 +00:00
bouyer a9d165fd6a Correct setup for Ultra133 capable VIA chipsets, From Matthias Drochner
on current-users, with cross-check and some improvement from linux-2.4.19
and FreeBSD-current.
Also don't set the APO_UDMA_CLK66 bit for Ultra/100 capable chipset, and
support Ultra/133 for the VT8233A.
2002-08-25 17:25:33 +00:00
bouyer 0d17a940f8 Add support for HPT372. From sdegler@kashmir.degler.net in kern/17908,
with some improvement from me, and from FreeBSD.
2002-08-23 16:24:54 +00:00
bouyer 1a7bae9619 Add support for Promise Ultra133TX2 and Ultra133TX2v2, from FreeBSD and
stephen@degler.net in kern/17509.
2002-08-23 16:02:32 +00:00
toshii 16a190bb23 Use UDMA/100 on SiS745 chipset. 2002-08-10 16:33:23 +00:00
bouyer 2362df5330 Add support for the 82801DB ICH4 IDE controller, from kern/17757 by
Andreas Wrede <andreas@planix.com>
2002-07-30 21:01:57 +00:00
wiz 645df36eff Spell '[Rr]ight' correctly. From Jim Bernard. 2002-07-26 14:11:34 +00:00
onoe 46243dd61d Add support of Silicon Image 0680 Ultra ATA/133 ATA Controller.
It's ugly that all register values are written in numeric, but I can't
find any definition of the registers to be written in literal.
2002-07-26 10:23:30 +00:00
bouyer 8e745944fe Ops, this had already been commited by cjs.
Still, call the controller ATA133, even though we use it at ATA100 for now ...
2002-07-22 20:56:57 +00:00