History log of /netbsd-current/sys/dev/pci/satalink.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.58 25-Sep-2022 thorpej

Remove unnecessary include of <sys/malloc.h>.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.57 21-Oct-2019 christos

follow the channel locking protocol during probe (like the other drivers)


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.56 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.55 20-Oct-2017 jdolecek

branches: 1.55.2; 1.55.4;
move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606


# 1.54 07-Oct-2017 jdolecek

Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.53 23-Aug-2016 msaitoh

branches: 1.53.4;
Remove PCI_PRODUCT_CMDTECH_240's entry because CMDTECH_AAR_1210SA has
the same ID.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.52 29-Mar-2014 christos

branches: 1.52.4; 1.52.6; 1.52.12;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.51 07-Oct-2013 jakllsch

Use the universal pciide_detach() for detach function of all remaining
pciide-core drivers, except pciide at pnpbios which isn't actually PCI.


# 1.50 15-Sep-2013 martin

Comment out unused variables


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.49 27-Oct-2012 chs

branches: 1.49.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


# 1.48 31-Jul-2012 bouyer

branches: 1.48.2;
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.47 26-Jul-2012 jakllsch

Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@


# 1.46 24-Jul-2012 jakllsch

Revert dsl@'s changes of Sun, 15 Jul 2012 10:55:35 +0000 and
Sun, 15 Jul 2012 10:56:50 +0000, excepting the kernel version bump.
First step in reverting regressions to ata(4) subsystem during the addition of
port multiplier support.


# 1.45 15-Jul-2012 dsl

Some namespace protection (and add greppablity).
Prefix the DRIVE_ and DRIVET_ constants from atavar.h with ATA_.
Don't use an enum for drive_type - you don't know how big it will be.
Move driver_type to avoid implicit structure padding (esp on arm).
This change is purely lexical and mechanical.

Update to 6.99.9 - this wasn't done when the SATA PMP changes
were made - I'm sure they warranted a bump.


# 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


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 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'


Revision tags: bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4
# 1.42 05-Nov-2010 jakllsch

branches: 1.42.2;
Pave the way for detachment of pciide(4)-family ATA controllers.


Revision tags: uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.41 08-Jun-2010 mrg

attach on Sil240 and IXP 300 chips as well, as if they are 3112
variants. should fix PR#32577, id's found in linux driver.


Revision tags: uebayasi-xip-base1
# 1.40 23-Mar-2010 mrg

only apply the satalink 3112 rev 0.1 and earlier to actual 3112 based
cards, not eg, 3512 cards.

should help performance for 3512 cards, derived from discussions in
PR#42980: satalink DMA fails under amd64.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.39 26-Nov-2009 njoly

branches: 1.39.2; 1.39.4;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.38 28-Apr-2008 martin

Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.37 10-Apr-2008 cegger

branches: 1.37.2; 1.37.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.36 18-Mar-2008 cube

Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.35 27-Dec-2007 ws

branches: 1.35.2; 1.35.6;
Change cacheline fixup for 3114's second set of channels, too.
Fix provided by Masanori Kanaoka in PR 37519.
Fixed differently to avoid code duplication.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base jmcneill-pm-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base post-newlock2-merge
# 1.34 09-Feb-2007 ad

branches: 1.34.20; 1.34.26; 1.34.32;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


# 1.32 25-Oct-2006 bouyer

Use common wdc_sataprobe() where possible; explain why we can't in satalink.c


Revision tags: yamt-splraiseipl-base2
# 1.31 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 26-Jun-2006 xtraeme

branches: 1.30.4; 1.30.6;
Add missing __KERNEL_RCSID()


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 elad-kernelauth-base simonb-timecounters-base
# 1.29 29-Mar-2006 thorpej

branches: 1.29.4;
Use device_cfdata().


Revision tags: peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.28 16-Jan-2006 bouyer

branches: 1.28.2; 1.28.4; 1.28.6; 1.28.8; 1.28.10;
properly use ata_channel->ch_ndrive:
- initialize it properly in the bus front-ends (all 2, exept in wdc_pcmcia.c
for the "Sandisk CompactFlash Card" where it's set to 1)
- remplace hardcoded '2' by ata_channel->ch_ndrive in MI IDE drivers.

From Christos Zoulas in kern/32501.


# 1.27 24-Dec-2005 perry

branches: 1.27.2;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.26 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.25 01-Jun-2005 ragge

branches: 1.25.2;
The read/read multiple cacheline problem may also appear on the 3114
controller, so apply the cacheline fix to it as well.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.24 27-Feb-2005 perry

branches: 1.24.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge kent-audio1-base
# 1.23 05-Sep-2004 skd

branches: 1.23.4; 1.23.6;
Fill out correct cap variable so that DMA works again.


# 1.22 21-Aug-2004 thorpej

atastart() (called only at splbio(), and from interrupts) can change
drive_flags, to make sure all drive_flags manipulations are done at
splbio().


# 1.21 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.20 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.19 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.18 13-Aug-2004 thorpej

Don't bother with bits that tell of the presence of optional callbacks;
just check the function pointers for NULL.


# 1.17 19-Jul-2004 msaitoh

branches: 1.17.2;
Add Adaptec AAR-1210SA serial ATA RAID.
RAID is not supported by this driver.


# 1.16 23-Jun-2004 briggs

When the Silicon Image 3112 retries a PCI memory read command, it
may retry it as a memory read multiple command under some circumstances.
This can totally confuse some PCI controllers, so ensure that it
will never do this by making sure that the Read Threshold (FIFO
Read Request Control) field of the FIFO Valid Byte Count and Control
registers for both channels (BA5 offset 0x40 and 0x44) are set to
be at least as large as the cacheline size register (the unit of
measure for these registers is 32 bytes).


# 1.15 28-May-2004 thorpej

Use the common sata_speed() routine.


# 1.14 25-May-2004 thorpej

Add the notion of "shadow registers" to the wdc driver. These shadow
registers are registers that overlap with others on many controllers, but
which may actually be distinct on some controllers. Right now, the two
shadows are:

- wd_status (usually overlaps wd_command)
- wd_features (usually overlaps wd_error)

Add a new helper function, wdc_init_shadow_regs(), used to initialize
the shadow register handles on controllers where they do actually overlap.

Partially from Jordan Rhody @ Wasabi Systems, Inc.


# 1.13 07-May-2004 sekiya

Add support for Silicon Image 3512 chip to satalink driver -- treat it as
a 3112 variant (without RAID support), which does the right thing with the
controller on my K8NNXP.


Revision tags: netbsd-2-0-base
# 1.12 07-Jan-2004 thorpej

branches: 1.12.2;
Initialize some importantant members of the drive info structure. (I have
no idea how this worked for me before, but I swear that it did...)

kern/24015.


# 1.11 03-Jan-2004 thorpej

More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc


# 1.10 03-Jan-2004 thorpej

Rename "struct channel_softc" to "struct wdc_channel".


# 1.9 01-Jan-2004 thorpej

Rename:
- wdc_xfer to ata_xfer
- channel_queue to ata_queue
and move them to <dev/ata/atavar.h> so they can be used by non-wdc ATA
controllers. Clean up the member names of these structures while at it.


# 1.8 31-Dec-2003 martin

Include <dev/ata/atareg.h>, so that WDSD_IBM is defined.


# 1.7 30-Dec-2003 thorpej

Move the drive probing code out of atabusconfig() and into a new
wdc_drvprobe() function. wdc_drvprobe() is used if the controller
does not specify a custom one prior to calling wdcattach(). The
WDC_CAPABILITY_DRVPROBE bit is gone.


# 1.6 20-Dec-2003 thorpej

Fix a typo.


# 1.5 20-Dec-2003 thorpej

Add support for the Silicon Image 3114 SATALink 4-port SATA controller.


# 1.4 19-Dec-2003 thorpej

Use a register map to find the offsets of various per-channel
registers in the BA5 space.


# 1.3 15-Dec-2003 thorpej

Remove the notice that was in cmdide.c before SATALink support was split
out. All of the code in this file was written by me.


# 1.2 15-Dec-2003 thorpej

Use the SControl and SStatus registers to query the SATA PHY for
device detection.


# 1.1 13-Dec-2003 thorpej

Split out the Silicon Image SATALink support into its own driver,
"satalink".


# 1.57 21-Oct-2019 christos

follow the channel locking protocol during probe (like the other drivers)


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.56 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.55 20-Oct-2017 jdolecek

branches: 1.55.2; 1.55.4;
move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606


# 1.54 07-Oct-2017 jdolecek

Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.53 23-Aug-2016 msaitoh

branches: 1.53.4;
Remove PCI_PRODUCT_CMDTECH_240's entry because CMDTECH_AAR_1210SA has
the same ID.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.52 29-Mar-2014 christos

branches: 1.52.4; 1.52.6; 1.52.12;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.51 07-Oct-2013 jakllsch

Use the universal pciide_detach() for detach function of all remaining
pciide-core drivers, except pciide at pnpbios which isn't actually PCI.


# 1.50 15-Sep-2013 martin

Comment out unused variables


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.49 27-Oct-2012 chs

branches: 1.49.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


# 1.48 31-Jul-2012 bouyer

branches: 1.48.2;
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.47 26-Jul-2012 jakllsch

Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@


# 1.46 24-Jul-2012 jakllsch

Revert dsl@'s changes of Sun, 15 Jul 2012 10:55:35 +0000 and
Sun, 15 Jul 2012 10:56:50 +0000, excepting the kernel version bump.
First step in reverting regressions to ata(4) subsystem during the addition of
port multiplier support.


# 1.45 15-Jul-2012 dsl

Some namespace protection (and add greppablity).
Prefix the DRIVE_ and DRIVET_ constants from atavar.h with ATA_.
Don't use an enum for drive_type - you don't know how big it will be.
Move driver_type to avoid implicit structure padding (esp on arm).
This change is purely lexical and mechanical.

Update to 6.99.9 - this wasn't done when the SATA PMP changes
were made - I'm sure they warranted a bump.


# 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


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 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'


Revision tags: bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4
# 1.42 05-Nov-2010 jakllsch

branches: 1.42.2;
Pave the way for detachment of pciide(4)-family ATA controllers.


Revision tags: uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.41 08-Jun-2010 mrg

attach on Sil240 and IXP 300 chips as well, as if they are 3112
variants. should fix PR#32577, id's found in linux driver.


Revision tags: uebayasi-xip-base1
# 1.40 23-Mar-2010 mrg

only apply the satalink 3112 rev 0.1 and earlier to actual 3112 based
cards, not eg, 3512 cards.

should help performance for 3512 cards, derived from discussions in
PR#42980: satalink DMA fails under amd64.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.39 26-Nov-2009 njoly

branches: 1.39.2; 1.39.4;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.38 28-Apr-2008 martin

Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.37 10-Apr-2008 cegger

branches: 1.37.2; 1.37.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.36 18-Mar-2008 cube

Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.35 27-Dec-2007 ws

branches: 1.35.2; 1.35.6;
Change cacheline fixup for 3114's second set of channels, too.
Fix provided by Masanori Kanaoka in PR 37519.
Fixed differently to avoid code duplication.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base jmcneill-pm-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base post-newlock2-merge
# 1.34 09-Feb-2007 ad

branches: 1.34.20; 1.34.26; 1.34.32;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


# 1.32 25-Oct-2006 bouyer

Use common wdc_sataprobe() where possible; explain why we can't in satalink.c


Revision tags: yamt-splraiseipl-base2
# 1.31 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 26-Jun-2006 xtraeme

branches: 1.30.4; 1.30.6;
Add missing __KERNEL_RCSID()


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 elad-kernelauth-base simonb-timecounters-base
# 1.29 29-Mar-2006 thorpej

branches: 1.29.4;
Use device_cfdata().


Revision tags: peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.28 16-Jan-2006 bouyer

branches: 1.28.2; 1.28.4; 1.28.6; 1.28.8; 1.28.10;
properly use ata_channel->ch_ndrive:
- initialize it properly in the bus front-ends (all 2, exept in wdc_pcmcia.c
for the "Sandisk CompactFlash Card" where it's set to 1)
- remplace hardcoded '2' by ata_channel->ch_ndrive in MI IDE drivers.

From Christos Zoulas in kern/32501.


# 1.27 24-Dec-2005 perry

branches: 1.27.2;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.26 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.25 01-Jun-2005 ragge

branches: 1.25.2;
The read/read multiple cacheline problem may also appear on the 3114
controller, so apply the cacheline fix to it as well.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.24 27-Feb-2005 perry

branches: 1.24.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge kent-audio1-base
# 1.23 05-Sep-2004 skd

branches: 1.23.4; 1.23.6;
Fill out correct cap variable so that DMA works again.


# 1.22 21-Aug-2004 thorpej

atastart() (called only at splbio(), and from interrupts) can change
drive_flags, to make sure all drive_flags manipulations are done at
splbio().


# 1.21 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.20 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.19 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.18 13-Aug-2004 thorpej

Don't bother with bits that tell of the presence of optional callbacks;
just check the function pointers for NULL.


# 1.17 19-Jul-2004 msaitoh

branches: 1.17.2;
Add Adaptec AAR-1210SA serial ATA RAID.
RAID is not supported by this driver.


# 1.16 23-Jun-2004 briggs

When the Silicon Image 3112 retries a PCI memory read command, it
may retry it as a memory read multiple command under some circumstances.
This can totally confuse some PCI controllers, so ensure that it
will never do this by making sure that the Read Threshold (FIFO
Read Request Control) field of the FIFO Valid Byte Count and Control
registers for both channels (BA5 offset 0x40 and 0x44) are set to
be at least as large as the cacheline size register (the unit of
measure for these registers is 32 bytes).


# 1.15 28-May-2004 thorpej

Use the common sata_speed() routine.


# 1.14 25-May-2004 thorpej

Add the notion of "shadow registers" to the wdc driver. These shadow
registers are registers that overlap with others on many controllers, but
which may actually be distinct on some controllers. Right now, the two
shadows are:

- wd_status (usually overlaps wd_command)
- wd_features (usually overlaps wd_error)

Add a new helper function, wdc_init_shadow_regs(), used to initialize
the shadow register handles on controllers where they do actually overlap.

Partially from Jordan Rhody @ Wasabi Systems, Inc.


# 1.13 07-May-2004 sekiya

Add support for Silicon Image 3512 chip to satalink driver -- treat it as
a 3112 variant (without RAID support), which does the right thing with the
controller on my K8NNXP.


Revision tags: netbsd-2-0-base
# 1.12 07-Jan-2004 thorpej

branches: 1.12.2;
Initialize some importantant members of the drive info structure. (I have
no idea how this worked for me before, but I swear that it did...)

kern/24015.


# 1.11 03-Jan-2004 thorpej

More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc


# 1.10 03-Jan-2004 thorpej

Rename "struct channel_softc" to "struct wdc_channel".


# 1.9 01-Jan-2004 thorpej

Rename:
- wdc_xfer to ata_xfer
- channel_queue to ata_queue
and move them to <dev/ata/atavar.h> so they can be used by non-wdc ATA
controllers. Clean up the member names of these structures while at it.


# 1.8 31-Dec-2003 martin

Include <dev/ata/atareg.h>, so that WDSD_IBM is defined.


# 1.7 30-Dec-2003 thorpej

Move the drive probing code out of atabusconfig() and into a new
wdc_drvprobe() function. wdc_drvprobe() is used if the controller
does not specify a custom one prior to calling wdcattach(). The
WDC_CAPABILITY_DRVPROBE bit is gone.


# 1.6 20-Dec-2003 thorpej

Fix a typo.


# 1.5 20-Dec-2003 thorpej

Add support for the Silicon Image 3114 SATALink 4-port SATA controller.


# 1.4 19-Dec-2003 thorpej

Use a register map to find the offsets of various per-channel
registers in the BA5 space.


# 1.3 15-Dec-2003 thorpej

Remove the notice that was in cmdide.c before SATALink support was split
out. All of the code in this file was written by me.


# 1.2 15-Dec-2003 thorpej

Use the SControl and SStatus registers to query the SATA PHY for
device detection.


# 1.1 13-Dec-2003 thorpej

Split out the Silicon Image SATALink support into its own driver,
"satalink".


Revision tags: isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.56 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.55 20-Oct-2017 jdolecek

branches: 1.55.2;
move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606


# 1.54 07-Oct-2017 jdolecek

Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)


Revision tags: netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.53 23-Aug-2016 msaitoh

branches: 1.53.4;
Remove PCI_PRODUCT_CMDTECH_240's entry because CMDTECH_AAR_1210SA has
the same ID.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.52 29-Mar-2014 christos

branches: 1.52.4; 1.52.6; 1.52.12;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.51 07-Oct-2013 jakllsch

Use the universal pciide_detach() for detach function of all remaining
pciide-core drivers, except pciide at pnpbios which isn't actually PCI.


# 1.50 15-Sep-2013 martin

Comment out unused variables


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.49 27-Oct-2012 chs

branches: 1.49.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


# 1.48 31-Jul-2012 bouyer

branches: 1.48.2;
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.47 26-Jul-2012 jakllsch

Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@


# 1.46 24-Jul-2012 jakllsch

Revert dsl@'s changes of Sun, 15 Jul 2012 10:55:35 +0000 and
Sun, 15 Jul 2012 10:56:50 +0000, excepting the kernel version bump.
First step in reverting regressions to ata(4) subsystem during the addition of
port multiplier support.


# 1.45 15-Jul-2012 dsl

Some namespace protection (and add greppablity).
Prefix the DRIVE_ and DRIVET_ constants from atavar.h with ATA_.
Don't use an enum for drive_type - you don't know how big it will be.
Move driver_type to avoid implicit structure padding (esp on arm).
This change is purely lexical and mechanical.

Update to 6.99.9 - this wasn't done when the SATA PMP changes
were made - I'm sure they warranted a bump.


# 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


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 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'


Revision tags: bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4
# 1.42 05-Nov-2010 jakllsch

branches: 1.42.2;
Pave the way for detachment of pciide(4)-family ATA controllers.


Revision tags: uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.41 08-Jun-2010 mrg

attach on Sil240 and IXP 300 chips as well, as if they are 3112
variants. should fix PR#32577, id's found in linux driver.


Revision tags: uebayasi-xip-base1
# 1.40 23-Mar-2010 mrg

only apply the satalink 3112 rev 0.1 and earlier to actual 3112 based
cards, not eg, 3512 cards.

should help performance for 3512 cards, derived from discussions in
PR#42980: satalink DMA fails under amd64.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.39 26-Nov-2009 njoly

branches: 1.39.2; 1.39.4;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.38 28-Apr-2008 martin

Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.37 10-Apr-2008 cegger

branches: 1.37.2; 1.37.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.36 18-Mar-2008 cube

Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.35 27-Dec-2007 ws

branches: 1.35.2; 1.35.6;
Change cacheline fixup for 3114's second set of channels, too.
Fix provided by Masanori Kanaoka in PR 37519.
Fixed differently to avoid code duplication.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base jmcneill-pm-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base post-newlock2-merge
# 1.34 09-Feb-2007 ad

branches: 1.34.20; 1.34.26; 1.34.32;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


# 1.32 25-Oct-2006 bouyer

Use common wdc_sataprobe() where possible; explain why we can't in satalink.c


Revision tags: yamt-splraiseipl-base2
# 1.31 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 26-Jun-2006 xtraeme

branches: 1.30.4; 1.30.6;
Add missing __KERNEL_RCSID()


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 elad-kernelauth-base simonb-timecounters-base
# 1.29 29-Mar-2006 thorpej

branches: 1.29.4;
Use device_cfdata().


Revision tags: peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.28 16-Jan-2006 bouyer

branches: 1.28.2; 1.28.4; 1.28.6; 1.28.8; 1.28.10;
properly use ata_channel->ch_ndrive:
- initialize it properly in the bus front-ends (all 2, exept in wdc_pcmcia.c
for the "Sandisk CompactFlash Card" where it's set to 1)
- remplace hardcoded '2' by ata_channel->ch_ndrive in MI IDE drivers.

From Christos Zoulas in kern/32501.


# 1.27 24-Dec-2005 perry

branches: 1.27.2;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.26 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.25 01-Jun-2005 ragge

branches: 1.25.2;
The read/read multiple cacheline problem may also appear on the 3114
controller, so apply the cacheline fix to it as well.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.24 27-Feb-2005 perry

branches: 1.24.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge kent-audio1-base
# 1.23 05-Sep-2004 skd

branches: 1.23.4; 1.23.6;
Fill out correct cap variable so that DMA works again.


# 1.22 21-Aug-2004 thorpej

atastart() (called only at splbio(), and from interrupts) can change
drive_flags, to make sure all drive_flags manipulations are done at
splbio().


# 1.21 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.20 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.19 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.18 13-Aug-2004 thorpej

Don't bother with bits that tell of the presence of optional callbacks;
just check the function pointers for NULL.


# 1.17 19-Jul-2004 msaitoh

branches: 1.17.2;
Add Adaptec AAR-1210SA serial ATA RAID.
RAID is not supported by this driver.


# 1.16 23-Jun-2004 briggs

When the Silicon Image 3112 retries a PCI memory read command, it
may retry it as a memory read multiple command under some circumstances.
This can totally confuse some PCI controllers, so ensure that it
will never do this by making sure that the Read Threshold (FIFO
Read Request Control) field of the FIFO Valid Byte Count and Control
registers for both channels (BA5 offset 0x40 and 0x44) are set to
be at least as large as the cacheline size register (the unit of
measure for these registers is 32 bytes).


# 1.15 28-May-2004 thorpej

Use the common sata_speed() routine.


# 1.14 25-May-2004 thorpej

Add the notion of "shadow registers" to the wdc driver. These shadow
registers are registers that overlap with others on many controllers, but
which may actually be distinct on some controllers. Right now, the two
shadows are:

- wd_status (usually overlaps wd_command)
- wd_features (usually overlaps wd_error)

Add a new helper function, wdc_init_shadow_regs(), used to initialize
the shadow register handles on controllers where they do actually overlap.

Partially from Jordan Rhody @ Wasabi Systems, Inc.


# 1.13 07-May-2004 sekiya

Add support for Silicon Image 3512 chip to satalink driver -- treat it as
a 3112 variant (without RAID support), which does the right thing with the
controller on my K8NNXP.


Revision tags: netbsd-2-0-base
# 1.12 07-Jan-2004 thorpej

branches: 1.12.2;
Initialize some importantant members of the drive info structure. (I have
no idea how this worked for me before, but I swear that it did...)

kern/24015.


# 1.11 03-Jan-2004 thorpej

More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc


# 1.10 03-Jan-2004 thorpej

Rename "struct channel_softc" to "struct wdc_channel".


# 1.9 01-Jan-2004 thorpej

Rename:
- wdc_xfer to ata_xfer
- channel_queue to ata_queue
and move them to <dev/ata/atavar.h> so they can be used by non-wdc ATA
controllers. Clean up the member names of these structures while at it.


# 1.8 31-Dec-2003 martin

Include <dev/ata/atareg.h>, so that WDSD_IBM is defined.


# 1.7 30-Dec-2003 thorpej

Move the drive probing code out of atabusconfig() and into a new
wdc_drvprobe() function. wdc_drvprobe() is used if the controller
does not specify a custom one prior to calling wdcattach(). The
WDC_CAPABILITY_DRVPROBE bit is gone.


# 1.6 20-Dec-2003 thorpej

Fix a typo.


# 1.5 20-Dec-2003 thorpej

Add support for the Silicon Image 3114 SATALink 4-port SATA controller.


# 1.4 19-Dec-2003 thorpej

Use a register map to find the offsets of various per-channel
registers in the BA5 space.


# 1.3 15-Dec-2003 thorpej

Remove the notice that was in cmdide.c before SATALink support was split
out. All of the code in this file was written by me.


# 1.2 15-Dec-2003 thorpej

Use the SControl and SStatus registers to query the SATA PHY for
device detection.


# 1.1 13-Dec-2003 thorpej

Split out the Silicon Image SATALink support into its own driver,
"satalink".


# 1.55 20-Oct-2017 jdolecek

move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606


# 1.54 07-Oct-2017 jdolecek

Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.53 23-Aug-2016 msaitoh

branches: 1.53.4;
Remove PCI_PRODUCT_CMDTECH_240's entry because CMDTECH_AAR_1210SA has
the same ID.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.52 29-Mar-2014 christos

branches: 1.52.4; 1.52.6; 1.52.12;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.51 07-Oct-2013 jakllsch

Use the universal pciide_detach() for detach function of all remaining
pciide-core drivers, except pciide at pnpbios which isn't actually PCI.


# 1.50 15-Sep-2013 martin

Comment out unused variables


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.49 27-Oct-2012 chs

branches: 1.49.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


# 1.48 31-Jul-2012 bouyer

branches: 1.48.2;
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.47 26-Jul-2012 jakllsch

Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@


# 1.46 24-Jul-2012 jakllsch

Revert dsl@'s changes of Sun, 15 Jul 2012 10:55:35 +0000 and
Sun, 15 Jul 2012 10:56:50 +0000, excepting the kernel version bump.
First step in reverting regressions to ata(4) subsystem during the addition of
port multiplier support.


# 1.45 15-Jul-2012 dsl

Some namespace protection (and add greppablity).
Prefix the DRIVE_ and DRIVET_ constants from atavar.h with ATA_.
Don't use an enum for drive_type - you don't know how big it will be.
Move driver_type to avoid implicit structure padding (esp on arm).
This change is purely lexical and mechanical.

Update to 6.99.9 - this wasn't done when the SATA PMP changes
were made - I'm sure they warranted a bump.


# 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


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 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'


Revision tags: bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4
# 1.42 05-Nov-2010 jakllsch

branches: 1.42.2;
Pave the way for detachment of pciide(4)-family ATA controllers.


Revision tags: uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.41 08-Jun-2010 mrg

attach on Sil240 and IXP 300 chips as well, as if they are 3112
variants. should fix PR#32577, id's found in linux driver.


Revision tags: uebayasi-xip-base1
# 1.40 23-Mar-2010 mrg

only apply the satalink 3112 rev 0.1 and earlier to actual 3112 based
cards, not eg, 3512 cards.

should help performance for 3512 cards, derived from discussions in
PR#42980: satalink DMA fails under amd64.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.39 26-Nov-2009 njoly

branches: 1.39.2; 1.39.4;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.38 28-Apr-2008 martin

Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.37 10-Apr-2008 cegger

branches: 1.37.2; 1.37.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.36 18-Mar-2008 cube

Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.35 27-Dec-2007 ws

branches: 1.35.2; 1.35.6;
Change cacheline fixup for 3114's second set of channels, too.
Fix provided by Masanori Kanaoka in PR 37519.
Fixed differently to avoid code duplication.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base jmcneill-pm-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base post-newlock2-merge
# 1.34 09-Feb-2007 ad

branches: 1.34.20; 1.34.26; 1.34.32;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


# 1.32 25-Oct-2006 bouyer

Use common wdc_sataprobe() where possible; explain why we can't in satalink.c


Revision tags: yamt-splraiseipl-base2
# 1.31 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 26-Jun-2006 xtraeme

branches: 1.30.4; 1.30.6;
Add missing __KERNEL_RCSID()


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 elad-kernelauth-base simonb-timecounters-base
# 1.29 29-Mar-2006 thorpej

branches: 1.29.4;
Use device_cfdata().


Revision tags: peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.28 16-Jan-2006 bouyer

branches: 1.28.2; 1.28.4; 1.28.6; 1.28.8; 1.28.10;
properly use ata_channel->ch_ndrive:
- initialize it properly in the bus front-ends (all 2, exept in wdc_pcmcia.c
for the "Sandisk CompactFlash Card" where it's set to 1)
- remplace hardcoded '2' by ata_channel->ch_ndrive in MI IDE drivers.

From Christos Zoulas in kern/32501.


# 1.27 24-Dec-2005 perry

branches: 1.27.2;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.26 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.25 01-Jun-2005 ragge

branches: 1.25.2;
The read/read multiple cacheline problem may also appear on the 3114
controller, so apply the cacheline fix to it as well.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.24 27-Feb-2005 perry

branches: 1.24.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge kent-audio1-base
# 1.23 05-Sep-2004 skd

branches: 1.23.4; 1.23.6;
Fill out correct cap variable so that DMA works again.


# 1.22 21-Aug-2004 thorpej

atastart() (called only at splbio(), and from interrupts) can change
drive_flags, to make sure all drive_flags manipulations are done at
splbio().


# 1.21 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.20 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.19 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.18 13-Aug-2004 thorpej

Don't bother with bits that tell of the presence of optional callbacks;
just check the function pointers for NULL.


# 1.17 19-Jul-2004 msaitoh

branches: 1.17.2;
Add Adaptec AAR-1210SA serial ATA RAID.
RAID is not supported by this driver.


# 1.16 23-Jun-2004 briggs

When the Silicon Image 3112 retries a PCI memory read command, it
may retry it as a memory read multiple command under some circumstances.
This can totally confuse some PCI controllers, so ensure that it
will never do this by making sure that the Read Threshold (FIFO
Read Request Control) field of the FIFO Valid Byte Count and Control
registers for both channels (BA5 offset 0x40 and 0x44) are set to
be at least as large as the cacheline size register (the unit of
measure for these registers is 32 bytes).


# 1.15 28-May-2004 thorpej

Use the common sata_speed() routine.


# 1.14 25-May-2004 thorpej

Add the notion of "shadow registers" to the wdc driver. These shadow
registers are registers that overlap with others on many controllers, but
which may actually be distinct on some controllers. Right now, the two
shadows are:

- wd_status (usually overlaps wd_command)
- wd_features (usually overlaps wd_error)

Add a new helper function, wdc_init_shadow_regs(), used to initialize
the shadow register handles on controllers where they do actually overlap.

Partially from Jordan Rhody @ Wasabi Systems, Inc.


# 1.13 07-May-2004 sekiya

Add support for Silicon Image 3512 chip to satalink driver -- treat it as
a 3112 variant (without RAID support), which does the right thing with the
controller on my K8NNXP.


Revision tags: netbsd-2-0-base
# 1.12 07-Jan-2004 thorpej

branches: 1.12.2;
Initialize some importantant members of the drive info structure. (I have
no idea how this worked for me before, but I swear that it did...)

kern/24015.


# 1.11 03-Jan-2004 thorpej

More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc


# 1.10 03-Jan-2004 thorpej

Rename "struct channel_softc" to "struct wdc_channel".


# 1.9 01-Jan-2004 thorpej

Rename:
- wdc_xfer to ata_xfer
- channel_queue to ata_queue
and move them to <dev/ata/atavar.h> so they can be used by non-wdc ATA
controllers. Clean up the member names of these structures while at it.


# 1.8 31-Dec-2003 martin

Include <dev/ata/atareg.h>, so that WDSD_IBM is defined.


# 1.7 30-Dec-2003 thorpej

Move the drive probing code out of atabusconfig() and into a new
wdc_drvprobe() function. wdc_drvprobe() is used if the controller
does not specify a custom one prior to calling wdcattach(). The
WDC_CAPABILITY_DRVPROBE bit is gone.


# 1.6 20-Dec-2003 thorpej

Fix a typo.


# 1.5 20-Dec-2003 thorpej

Add support for the Silicon Image 3114 SATALink 4-port SATA controller.


# 1.4 19-Dec-2003 thorpej

Use a register map to find the offsets of various per-channel
registers in the BA5 space.


# 1.3 15-Dec-2003 thorpej

Remove the notice that was in cmdide.c before SATALink support was split
out. All of the code in this file was written by me.


# 1.2 15-Dec-2003 thorpej

Use the SControl and SStatus registers to query the SATA PHY for
device detection.


# 1.1 13-Dec-2003 thorpej

Split out the Silicon Image SATALink support into its own driver,
"satalink".


# 1.54 07-Oct-2017 jdolecek

Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.53 23-Aug-2016 msaitoh

branches: 1.53.4;
Remove PCI_PRODUCT_CMDTECH_240's entry because CMDTECH_AAR_1210SA has
the same ID.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.52 29-Mar-2014 christos

branches: 1.52.4; 1.52.6; 1.52.12;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.51 07-Oct-2013 jakllsch

Use the universal pciide_detach() for detach function of all remaining
pciide-core drivers, except pciide at pnpbios which isn't actually PCI.


# 1.50 15-Sep-2013 martin

Comment out unused variables


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.49 27-Oct-2012 chs

branches: 1.49.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


# 1.48 31-Jul-2012 bouyer

branches: 1.48.2;
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.47 26-Jul-2012 jakllsch

Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@


# 1.46 24-Jul-2012 jakllsch

Revert dsl@'s changes of Sun, 15 Jul 2012 10:55:35 +0000 and
Sun, 15 Jul 2012 10:56:50 +0000, excepting the kernel version bump.
First step in reverting regressions to ata(4) subsystem during the addition of
port multiplier support.


# 1.45 15-Jul-2012 dsl

Some namespace protection (and add greppablity).
Prefix the DRIVE_ and DRIVET_ constants from atavar.h with ATA_.
Don't use an enum for drive_type - you don't know how big it will be.
Move driver_type to avoid implicit structure padding (esp on arm).
This change is purely lexical and mechanical.

Update to 6.99.9 - this wasn't done when the SATA PMP changes
were made - I'm sure they warranted a bump.


# 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


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 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'


Revision tags: bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4
# 1.42 05-Nov-2010 jakllsch

branches: 1.42.2;
Pave the way for detachment of pciide(4)-family ATA controllers.


Revision tags: uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.41 08-Jun-2010 mrg

attach on Sil240 and IXP 300 chips as well, as if they are 3112
variants. should fix PR#32577, id's found in linux driver.


Revision tags: uebayasi-xip-base1
# 1.40 23-Mar-2010 mrg

only apply the satalink 3112 rev 0.1 and earlier to actual 3112 based
cards, not eg, 3512 cards.

should help performance for 3512 cards, derived from discussions in
PR#42980: satalink DMA fails under amd64.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.39 26-Nov-2009 njoly

branches: 1.39.2; 1.39.4;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.38 28-Apr-2008 martin

Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.37 10-Apr-2008 cegger

branches: 1.37.2; 1.37.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.36 18-Mar-2008 cube

Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.35 27-Dec-2007 ws

branches: 1.35.2; 1.35.6;
Change cacheline fixup for 3114's second set of channels, too.
Fix provided by Masanori Kanaoka in PR 37519.
Fixed differently to avoid code duplication.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base jmcneill-pm-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base post-newlock2-merge
# 1.34 09-Feb-2007 ad

branches: 1.34.20; 1.34.26; 1.34.32;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


# 1.32 25-Oct-2006 bouyer

Use common wdc_sataprobe() where possible; explain why we can't in satalink.c


Revision tags: yamt-splraiseipl-base2
# 1.31 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 26-Jun-2006 xtraeme

branches: 1.30.4; 1.30.6;
Add missing __KERNEL_RCSID()


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 elad-kernelauth-base simonb-timecounters-base
# 1.29 29-Mar-2006 thorpej

branches: 1.29.4;
Use device_cfdata().


Revision tags: peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.28 16-Jan-2006 bouyer

branches: 1.28.2; 1.28.4; 1.28.6; 1.28.8; 1.28.10;
properly use ata_channel->ch_ndrive:
- initialize it properly in the bus front-ends (all 2, exept in wdc_pcmcia.c
for the "Sandisk CompactFlash Card" where it's set to 1)
- remplace hardcoded '2' by ata_channel->ch_ndrive in MI IDE drivers.

From Christos Zoulas in kern/32501.


# 1.27 24-Dec-2005 perry

branches: 1.27.2;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.26 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.25 01-Jun-2005 ragge

branches: 1.25.2;
The read/read multiple cacheline problem may also appear on the 3114
controller, so apply the cacheline fix to it as well.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.24 27-Feb-2005 perry

branches: 1.24.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge kent-audio1-base
# 1.23 05-Sep-2004 skd

branches: 1.23.4; 1.23.6;
Fill out correct cap variable so that DMA works again.


# 1.22 21-Aug-2004 thorpej

atastart() (called only at splbio(), and from interrupts) can change
drive_flags, to make sure all drive_flags manipulations are done at
splbio().


# 1.21 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.20 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.19 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.18 13-Aug-2004 thorpej

Don't bother with bits that tell of the presence of optional callbacks;
just check the function pointers for NULL.


# 1.17 19-Jul-2004 msaitoh

branches: 1.17.2;
Add Adaptec AAR-1210SA serial ATA RAID.
RAID is not supported by this driver.


# 1.16 23-Jun-2004 briggs

When the Silicon Image 3112 retries a PCI memory read command, it
may retry it as a memory read multiple command under some circumstances.
This can totally confuse some PCI controllers, so ensure that it
will never do this by making sure that the Read Threshold (FIFO
Read Request Control) field of the FIFO Valid Byte Count and Control
registers for both channels (BA5 offset 0x40 and 0x44) are set to
be at least as large as the cacheline size register (the unit of
measure for these registers is 32 bytes).


# 1.15 28-May-2004 thorpej

Use the common sata_speed() routine.


# 1.14 25-May-2004 thorpej

Add the notion of "shadow registers" to the wdc driver. These shadow
registers are registers that overlap with others on many controllers, but
which may actually be distinct on some controllers. Right now, the two
shadows are:

- wd_status (usually overlaps wd_command)
- wd_features (usually overlaps wd_error)

Add a new helper function, wdc_init_shadow_regs(), used to initialize
the shadow register handles on controllers where they do actually overlap.

Partially from Jordan Rhody @ Wasabi Systems, Inc.


# 1.13 07-May-2004 sekiya

Add support for Silicon Image 3512 chip to satalink driver -- treat it as
a 3112 variant (without RAID support), which does the right thing with the
controller on my K8NNXP.


Revision tags: netbsd-2-0-base
# 1.12 07-Jan-2004 thorpej

branches: 1.12.2;
Initialize some importantant members of the drive info structure. (I have
no idea how this worked for me before, but I swear that it did...)

kern/24015.


# 1.11 03-Jan-2004 thorpej

More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc


# 1.10 03-Jan-2004 thorpej

Rename "struct channel_softc" to "struct wdc_channel".


# 1.9 01-Jan-2004 thorpej

Rename:
- wdc_xfer to ata_xfer
- channel_queue to ata_queue
and move them to <dev/ata/atavar.h> so they can be used by non-wdc ATA
controllers. Clean up the member names of these structures while at it.


# 1.8 31-Dec-2003 martin

Include <dev/ata/atareg.h>, so that WDSD_IBM is defined.


# 1.7 30-Dec-2003 thorpej

Move the drive probing code out of atabusconfig() and into a new
wdc_drvprobe() function. wdc_drvprobe() is used if the controller
does not specify a custom one prior to calling wdcattach(). The
WDC_CAPABILITY_DRVPROBE bit is gone.


# 1.6 20-Dec-2003 thorpej

Fix a typo.


# 1.5 20-Dec-2003 thorpej

Add support for the Silicon Image 3114 SATALink 4-port SATA controller.


# 1.4 19-Dec-2003 thorpej

Use a register map to find the offsets of various per-channel
registers in the BA5 space.


# 1.3 15-Dec-2003 thorpej

Remove the notice that was in cmdide.c before SATALink support was split
out. All of the code in this file was written by me.


# 1.2 15-Dec-2003 thorpej

Use the SControl and SStatus registers to query the SATA PHY for
device detection.


# 1.1 13-Dec-2003 thorpej

Split out the Silicon Image SATALink support into its own driver,
"satalink".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.53 23-Aug-2016 msaitoh

Remove PCI_PRODUCT_CMDTECH_240's entry because CMDTECH_AAR_1210SA has
the same ID.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.52 29-Mar-2014 christos

branches: 1.52.4; 1.52.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.51 07-Oct-2013 jakllsch

Use the universal pciide_detach() for detach function of all remaining
pciide-core drivers, except pciide at pnpbios which isn't actually PCI.


# 1.50 15-Sep-2013 martin

Comment out unused variables


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.49 27-Oct-2012 chs

branches: 1.49.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


# 1.48 31-Jul-2012 bouyer

branches: 1.48.2;
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.47 26-Jul-2012 jakllsch

Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@


# 1.46 24-Jul-2012 jakllsch

Revert dsl@'s changes of Sun, 15 Jul 2012 10:55:35 +0000 and
Sun, 15 Jul 2012 10:56:50 +0000, excepting the kernel version bump.
First step in reverting regressions to ata(4) subsystem during the addition of
port multiplier support.


# 1.45 15-Jul-2012 dsl

Some namespace protection (and add greppablity).
Prefix the DRIVE_ and DRIVET_ constants from atavar.h with ATA_.
Don't use an enum for drive_type - you don't know how big it will be.
Move driver_type to avoid implicit structure padding (esp on arm).
This change is purely lexical and mechanical.

Update to 6.99.9 - this wasn't done when the SATA PMP changes
were made - I'm sure they warranted a bump.


# 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


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 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'


Revision tags: bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4
# 1.42 05-Nov-2010 jakllsch

branches: 1.42.2;
Pave the way for detachment of pciide(4)-family ATA controllers.


Revision tags: uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.41 08-Jun-2010 mrg

attach on Sil240 and IXP 300 chips as well, as if they are 3112
variants. should fix PR#32577, id's found in linux driver.


Revision tags: uebayasi-xip-base1
# 1.40 23-Mar-2010 mrg

only apply the satalink 3112 rev 0.1 and earlier to actual 3112 based
cards, not eg, 3512 cards.

should help performance for 3512 cards, derived from discussions in
PR#42980: satalink DMA fails under amd64.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211
# 1.39 26-Nov-2009 njoly

branches: 1.39.2; 1.39.4;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base mjf-devfs2-base
# 1.38 28-Apr-2008 martin

Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.37 10-Apr-2008 cegger

branches: 1.37.2; 1.37.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.36 18-Mar-2008 cube

Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.


Revision tags: nick-net80211-sync-base bouyer-xeni386-nbase bouyer-xeni386-base mjf-devfs-base matt-armv6-base hpcarm-cleanup-base
# 1.35 27-Dec-2007 ws

branches: 1.35.2; 1.35.6;
Change cacheline fixup for 3114's second set of channels, too.
Fix provided by Masanori Kanaoka in PR 37519.
Fixed differently to avoid code duplication.


Revision tags: nick-csl-alignment-base5 matt-armv6-prevmlocking vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base jmcneill-pm-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base ad-audiomp-base post-newlock2-merge
# 1.34 09-Feb-2007 ad

branches: 1.34.20; 1.34.26; 1.34.32;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


# 1.32 25-Oct-2006 bouyer

Use common wdc_sataprobe() where possible; explain why we can't in satalink.c


Revision tags: yamt-splraiseipl-base2
# 1.31 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 26-Jun-2006 xtraeme

branches: 1.30.4; 1.30.6;
Add missing __KERNEL_RCSID()


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 elad-kernelauth-base simonb-timecounters-base
# 1.29 29-Mar-2006 thorpej

branches: 1.29.4;
Use device_cfdata().


Revision tags: peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.28 16-Jan-2006 bouyer

branches: 1.28.2; 1.28.4; 1.28.6; 1.28.8; 1.28.10;
properly use ata_channel->ch_ndrive:
- initialize it properly in the bus front-ends (all 2, exept in wdc_pcmcia.c
for the "Sandisk CompactFlash Card" where it's set to 1)
- remplace hardcoded '2' by ata_channel->ch_ndrive in MI IDE drivers.

From Christos Zoulas in kern/32501.


# 1.27 24-Dec-2005 perry

branches: 1.27.2;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.26 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.25 01-Jun-2005 ragge

branches: 1.25.2;
The read/read multiple cacheline problem may also appear on the 3114
controller, so apply the cacheline fix to it as well.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.24 27-Feb-2005 perry

branches: 1.24.2;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge kent-audio1-base
# 1.23 05-Sep-2004 skd

branches: 1.23.4; 1.23.6;
Fill out correct cap variable so that DMA works again.


# 1.22 21-Aug-2004 thorpej

atastart() (called only at splbio(), and from interrupts) can change
drive_flags, to make sure all drive_flags manipulations are done at
splbio().


# 1.21 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.20 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.19 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.18 13-Aug-2004 thorpej

Don't bother with bits that tell of the presence of optional callbacks;
just check the function pointers for NULL.


# 1.17 19-Jul-2004 msaitoh

branches: 1.17.2;
Add Adaptec AAR-1210SA serial ATA RAID.
RAID is not supported by this driver.


# 1.16 23-Jun-2004 briggs

When the Silicon Image 3112 retries a PCI memory read command, it
may retry it as a memory read multiple command under some circumstances.
This can totally confuse some PCI controllers, so ensure that it
will never do this by making sure that the Read Threshold (FIFO
Read Request Control) field of the FIFO Valid Byte Count and Control
registers for both channels (BA5 offset 0x40 and 0x44) are set to
be at least as large as the cacheline size register (the unit of
measure for these registers is 32 bytes).


# 1.15 28-May-2004 thorpej

Use the common sata_speed() routine.


# 1.14 25-May-2004 thorpej

Add the notion of "shadow registers" to the wdc driver. These shadow
registers are registers that overlap with others on many controllers, but
which may actually be distinct on some controllers. Right now, the two
shadows are:

- wd_status (usually overlaps wd_command)
- wd_features (usually overlaps wd_error)

Add a new helper function, wdc_init_shadow_regs(), used to initialize
the shadow register handles on controllers where they do actually overlap.

Partially from Jordan Rhody @ Wasabi Systems, Inc.


# 1.13 07-May-2004 sekiya

Add support for Silicon Image 3512 chip to satalink driver -- treat it as
a 3112 variant (without RAID support), which does the right thing with the
controller on my K8NNXP.


Revision tags: netbsd-2-0-base
# 1.12 07-Jan-2004 thorpej

branches: 1.12.2;
Initialize some importantant members of the drive info structure. (I have
no idea how this worked for me before, but I swear that it did...)

kern/24015.


# 1.11 03-Jan-2004 thorpej

More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc


# 1.10 03-Jan-2004 thorpej

Rename "struct channel_softc" to "struct wdc_channel".


# 1.9 01-Jan-2004 thorpej

Rename:
- wdc_xfer to ata_xfer
- channel_queue to ata_queue
and move them to <dev/ata/atavar.h> so they can be used by non-wdc ATA
controllers. Clean up the member names of these structures while at it.


# 1.8 31-Dec-2003 martin

Include <dev/ata/atareg.h>, so that WDSD_IBM is defined.


# 1.7 30-Dec-2003 thorpej

Move the drive probing code out of atabusconfig() and into a new
wdc_drvprobe() function. wdc_drvprobe() is used if the controller
does not specify a custom one prior to calling wdcattach(). The
WDC_CAPABILITY_DRVPROBE bit is gone.


# 1.6 20-Dec-2003 thorpej

Fix a typo.


# 1.5 20-Dec-2003 thorpej

Add support for the Silicon Image 3114 SATALink 4-port SATA controller.


# 1.4 19-Dec-2003 thorpej

Use a register map to find the offsets of various per-channel
registers in the BA5 space.


# 1.3 15-Dec-2003 thorpej

Remove the notice that was in cmdide.c before SATALink support was split
out. All of the code in this file was written by me.


# 1.2 15-Dec-2003 thorpej

Use the SControl and SStatus registers to query the SATA PHY for
device detection.


# 1.1 13-Dec-2003 thorpej

Split out the Silicon Image SATALink support into its own driver,
"satalink".