Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Add sata Port MultiPlier (PMP) support to the ata bus la...
details: https://anonhg.NetBSD.org/src/rev/13cb85d035a1
branches: trunk
changeset: 779967:13cb85d035a1
user: bouyer <bouyer%NetBSD.org@localhost>
date: Mon Jul 02 18:15:44 2012 +0000
description:
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
diffstat:
sys/arch/acorn32/eb7500atx/rside.c | 6 +-
sys/arch/acorn32/mainbus/wdc_pioc.c | 6 +-
sys/arch/acorn32/podulebus/icside.c | 6 +-
sys/arch/acorn32/podulebus/rapide.c | 6 +-
sys/arch/acorn32/podulebus/simide.c | 6 +-
sys/arch/amiga/dev/efa.c | 6 +-
sys/arch/amiga/dev/wdc_amiga.c | 6 +-
sys/arch/amiga/dev/wdc_buddha.c | 4 +-
sys/arch/arm/gemini/obio_wdc.c | 6 +-
sys/arch/atari/dev/wdc_mb.c | 6 +-
sys/arch/evbarm/iq31244/wdc_obio.c | 6 +-
sys/arch/evbarm/tsarm/wdc_ts.c | 6 +-
sys/arch/evbppc/mpc85xx/wdc_obio.c | 4 +-
sys/arch/i386/pci/gcscide.c | 6 +-
sys/arch/i386/pnpbios/pciide_pnpbios.c | 8 +-
sys/arch/landisk/dev/wdc_obio.c | 6 +-
sys/arch/mac68k/obio/wdc_obio.c | 6 +-
sys/arch/macppc/dev/kauai.c | 11 +-
sys/arch/macppc/dev/wdc_obio.c | 10 +-
sys/arch/mips/adm5120/dev/wdc_extio.c | 6 +-
sys/arch/mmeye/dev/wdc_mainbus.c | 6 +-
sys/arch/prep/pnpbus/wdc_pnpbus.c | 6 +-
sys/conf/files | 7 +-
sys/dev/ata/ata.c | 251 ++++++++++++++++++++-------
sys/dev/ata/ata_wdc.c | 12 +-
sys/dev/ata/atavar.h | 50 ++--
sys/dev/ata/files.ata | 5 +-
sys/dev/ata/sata_subr.c | 55 +++++-
sys/dev/ata/satapmp_subr.c | 251 +++++++++++++++++++++++++++
sys/dev/ata/satapmpreg.h | 7 +-
sys/dev/ata/satapmpvar.h | 35 +++
sys/dev/ata/satavar.h | 3 +-
sys/dev/ata/wd.c | 32 ++-
sys/dev/ic/ahcisata_core.c | 300 +++++++++++++++++++++++++-------
sys/dev/ic/ahcisatavar.h | 3 +-
sys/dev/ic/mvsata.c | 32 +-
sys/dev/ic/ninjaata32.c | 12 +-
sys/dev/ic/siisata.c | 152 ++++++++--------
sys/dev/ic/wdc.c | 116 ++++++------
sys/dev/ic/wdc_upc.c | 6 +-
sys/dev/ic/wdcvar.h | 10 +-
sys/dev/isa/wdc_isa.c | 6 +-
sys/dev/isapnp/wdc_isapnp.c | 6 +-
sys/dev/ofisa/wdc_ofisa.c | 6 +-
sys/dev/pci/acardide.c | 7 +-
sys/dev/pci/aceride.c | 7 +-
sys/dev/pci/artsata.c | 6 +-
sys/dev/pci/cmdide.c | 12 +-
sys/dev/pci/cypide.c | 8 +-
sys/dev/pci/geodeide.c | 7 +-
sys/dev/pci/hptide.c | 9 +-
sys/dev/pci/iteide.c | 7 +-
sys/dev/pci/ixpide.c | 7 +-
sys/dev/pci/jmide.c | 7 +-
sys/dev/pci/nside.c | 7 +-
sys/dev/pci/optiide.c | 7 +-
sys/dev/pci/pciide_common.c | 21 +-
sys/dev/pci/pciidevar.h | 4 +-
sys/dev/pci/pdcide.c | 19 +-
sys/dev/pci/pdcsata.c | 10 +-
sys/dev/pci/piixide.c | 10 +-
sys/dev/pci/rccide.c | 7 +-
sys/dev/pci/rdcide.c | 9 +-
sys/dev/pci/satalink.c | 23 +-
sys/dev/pci/schide.c | 7 +-
sys/dev/pci/siside.c | 10 +-
sys/dev/pci/slide.c | 7 +-
sys/dev/pci/stpcide.c | 7 +-
sys/dev/pci/svwsata.c | 5 +-
sys/dev/pci/toshide.c | 7 +-
sys/dev/pci/viaide.c | 14 +-
sys/dev/pcmcia/wdc_pcmcia.c | 6 +-
sys/dev/podulebus/dtide.c | 6 +-
sys/dev/podulebus/hcide.c | 6 +-
sys/dev/scsipi/atapi_wdc.c | 14 +-
sys/dev/usb/umass_isdata.c | 11 +-
76 files changed, 1234 insertions(+), 556 deletions(-)
diffs (truncated from 4898 to 300 lines):
diff -r 61f85a013944 -r 13cb85d035a1 sys/arch/acorn32/eb7500atx/rside.c
--- a/sys/arch/acorn32/eb7500atx/rside.c Mon Jul 02 18:13:13 2012 +0000
+++ b/sys/arch/acorn32/eb7500atx/rside.c Mon Jul 02 18:15:44 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rside.c,v 1.11 2011/07/19 15:59:52 dyoung Exp $ */
+/* $NetBSD: rside.c,v 1.12 2012/07/02 18:15:44 bouyer Exp $ */
/*
* Copyright (c) 2004 Christopher Gilbert
@@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rside.c,v 1.11 2011/07/19 15:59:52 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rside.c,v 1.12 2012/07/02 18:15:44 bouyer Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -190,6 +190,7 @@
sc->sc_wdcdev.sc_atac.atac_pio_cap = 0;
sc->sc_wdcdev.sc_atac.atac_channels = sc->sc_chanarray;
sc->sc_wdcdev.sc_atac.atac_nchannels = 2;
+ sc->sc_wdcdev.wdc_maxdrives = 2;
for (channel = 0 ; channel < 2; channel++) {
scp = &sc->rside_channels[channel];
sc->sc_chanarray[channel] = &scp->rc_channel;
@@ -199,7 +200,6 @@
cp->ch_channel = channel;
cp->ch_atac = &sc->sc_wdcdev.sc_atac;
cp->ch_queue = &scp->rc_chqueue;
- cp->ch_ndrive = 2;
wdr->cmd_iot = wdr->ctl_iot = &sc->sc_tag;
if (bus_space_map(wdr->cmd_iot,
rside_info[channel].drive_registers,
diff -r 61f85a013944 -r 13cb85d035a1 sys/arch/acorn32/mainbus/wdc_pioc.c
--- a/sys/arch/acorn32/mainbus/wdc_pioc.c Mon Jul 02 18:13:13 2012 +0000
+++ b/sys/arch/acorn32/mainbus/wdc_pioc.c Mon Jul 02 18:15:44 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_pioc.c,v 1.25 2011/07/19 15:59:53 dyoung Exp $ */
+/* $NetBSD: wdc_pioc.c,v 1.26 2012/07/02 18:15:44 bouyer Exp $ */
/*
* Copyright (c) 1997-1998 Mark Brinicombe.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_pioc.c,v 1.25 2011/07/19 15:59:53 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_pioc.c,v 1.26 2012/07/02 18:15:44 bouyer Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -185,9 +185,9 @@
sc->sc_wdcdev.sc_atac.atac_channels = sc->sc_chanlist;
sc->sc_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
sc->sc_wdcdev.sc_atac.atac_nchannels = 1;
+ sc->sc_wdcdev.wdc_maxdrives = 2;
sc->sc_channel.ch_channel = 0;
sc->sc_channel.ch_queue = &sc->sc_chqueue;
- sc->sc_channel.ch_ndrive = 2;
wdc_init_shadow_regs(&sc->sc_channel);
diff -r 61f85a013944 -r 13cb85d035a1 sys/arch/acorn32/podulebus/icside.c
--- a/sys/arch/acorn32/podulebus/icside.c Mon Jul 02 18:13:13 2012 +0000
+++ b/sys/arch/acorn32/podulebus/icside.c Mon Jul 02 18:15:44 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: icside.c,v 1.29 2011/07/19 15:59:54 dyoung Exp $ */
+/* $NetBSD: icside.c,v 1.30 2012/07/02 18:15:44 bouyer Exp $ */
/*
* Copyright (c) 1997-1998 Mark Brinicombe
@@ -42,7 +42,7 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: icside.c,v 1.29 2011/07/19 15:59:54 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: icside.c,v 1.30 2012/07/02 18:15:44 bouyer Exp $");
#include <sys/systm.h>
#include <sys/conf.h>
@@ -259,6 +259,7 @@
sc->sc_wdcdev.sc_atac.atac_nchannels = ide->channels;
sc->sc_wdcdev.sc_atac.atac_cap |= ATAC_CAP_DATA16;
sc->sc_wdcdev.sc_atac.atac_pio_cap = 0;
+ sc->sc_wdcdev.wdc_maxdrives = 2;
sc->sc_pa = pa;
for (channel = 0; channel < ide->channels; ++channel) {
@@ -270,7 +271,6 @@
cp->ch_channel = channel;
cp->ch_atac = &sc->sc_wdcdev.sc_atac;
cp->ch_queue = &icp->ic_chqueue;
- cp->ch_ndrive = 2;
wdr->cmd_iot = &sc->sc_tag;
wdr->ctl_iot = &sc->sc_tag;
if (ide->modspace)
diff -r 61f85a013944 -r 13cb85d035a1 sys/arch/acorn32/podulebus/rapide.c
--- a/sys/arch/acorn32/podulebus/rapide.c Mon Jul 02 18:13:13 2012 +0000
+++ b/sys/arch/acorn32/podulebus/rapide.c Mon Jul 02 18:15:44 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rapide.c,v 1.27 2011/07/19 15:59:54 dyoung Exp $ */
+/* $NetBSD: rapide.c,v 1.28 2012/07/02 18:15:44 bouyer Exp $ */
/*
* Copyright (c) 1997-1998 Mark Brinicombe
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rapide.c,v 1.27 2011/07/19 15:59:54 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rapide.c,v 1.28 2012/07/02 18:15:44 bouyer Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -250,6 +250,7 @@
sc->sc_wdcdev.sc_atac.atac_pio_cap = 0;
sc->sc_wdcdev.sc_atac.atac_channels = sc->sc_chanarray;
sc->sc_wdcdev.sc_atac.atac_nchannels = 2;
+ sc->sc_wdcdev.wdc_maxdrives = 2;
for (channel = 0 ; channel < 2; channel++) {
rcp = &sc->rapide_channels[channel];
sc->sc_chanarray[channel] = &rcp->rc_channel;
@@ -259,7 +260,6 @@
cp->ch_channel = channel;
cp->ch_atac = &sc->sc_wdcdev.sc_atac;
cp->ch_queue = &rcp->rc_chqueue;
- cp->ch_ndrive = 2;
wdr->cmd_iot = iot;
wdr->ctl_iot = iot;
wdr->data32iot = iot;
diff -r 61f85a013944 -r 13cb85d035a1 sys/arch/acorn32/podulebus/simide.c
--- a/sys/arch/acorn32/podulebus/simide.c Mon Jul 02 18:13:13 2012 +0000
+++ b/sys/arch/acorn32/podulebus/simide.c Mon Jul 02 18:15:44 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: simide.c,v 1.26 2011/07/19 15:59:54 dyoung Exp $ */
+/* $NetBSD: simide.c,v 1.27 2012/07/02 18:15:44 bouyer Exp $ */
/*
* Copyright (c) 1997-1998 Mark Brinicombe
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: simide.c,v 1.26 2011/07/19 15:59:54 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: simide.c,v 1.27 2012/07/02 18:15:44 bouyer Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -249,6 +249,7 @@
sc->sc_wdcdev.sc_atac.atac_pio_cap = 0;
sc->sc_wdcdev.sc_atac.atac_channels = sc->sc_chanarray;
sc->sc_wdcdev.sc_atac.atac_nchannels = 2;
+ sc->sc_wdcdev.wdc_maxdrives = 2;
for (channel = 0 ; channel < 2; channel++) {
scp = &sc->simide_channels[channel];
sc->sc_chanarray[channel] = &scp->sc_channel;
@@ -258,7 +259,6 @@
cp->ch_channel = channel;
cp->ch_atac = &sc->sc_wdcdev.sc_atac;
cp->ch_queue = &scp->sc_chqueue;
- cp->ch_ndrive = 2;
wdr->cmd_iot = wdr->ctl_iot = &sc->sc_tag;
iobase = pa->pa_podule->mod_base;
if (bus_space_map(wdr->cmd_iot, iobase +
diff -r 61f85a013944 -r 13cb85d035a1 sys/arch/amiga/dev/efa.c
--- a/sys/arch/amiga/dev/efa.c Mon Jul 02 18:13:13 2012 +0000
+++ b/sys/arch/amiga/dev/efa.c Mon Jul 02 18:15:44 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efa.c,v 1.5 2011/11/05 17:44:25 rkujawa Exp $ */
+/* $NetBSD: efa.c,v 1.6 2012/07/02 18:15:44 bouyer Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -159,6 +159,7 @@
sc->sc_wdcdev.sc_atac.atac_dev = self;
sc->sc_wdcdev.sc_atac.atac_channels = sc->sc_chanlist;
sc->sc_wdcdev.sc_atac.atac_cap = ATAC_CAP_DATA16;
+ sc->sc_wdcdev.wdc_maxdrives = 2;
if (sc->sc_32bit_io)
sc->sc_wdcdev.sc_atac.atac_cap |= ATAC_CAP_DATA32;
@@ -206,7 +207,6 @@
sc->sc_ports[chnum].chan.ch_channel = chnum;
sc->sc_ports[chnum].chan.ch_atac = &sc->sc_wdcdev.sc_atac;
sc->sc_ports[chnum].chan.ch_queue = &sc->sc_ports[chnum].queue;
- sc->sc_ports[chnum].chan.ch_ndrive = 2;
if (!sc->sc_32bit_io)
efa_select_regset(sc, chnum, 0); /* Start in PIO0. */
@@ -485,7 +485,7 @@
for (drive = 0; drive < 2; drive++) {
drvp = &chp->ch_drive[drive];
- if ((drvp->drive_flags & DRIVE) == 0)
+ if (drvp->drive_type == DRIVET_NONE)
continue; /* nothing to see here */
if (drvp->PIO_cap < mode);
diff -r 61f85a013944 -r 13cb85d035a1 sys/arch/amiga/dev/wdc_amiga.c
--- a/sys/arch/amiga/dev/wdc_amiga.c Mon Jul 02 18:13:13 2012 +0000
+++ b/sys/arch/amiga/dev/wdc_amiga.c Mon Jul 02 18:15:44 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_amiga.c,v 1.33 2011/07/19 15:55:27 dyoung Exp $ */
+/* $NetBSD: wdc_amiga.c,v 1.34 2012/07/02 18:15:44 bouyer Exp $ */
/*-
* Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_amiga.c,v 1.33 2011/07/19 15:55:27 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_amiga.c,v 1.34 2012/07/02 18:15:44 bouyer Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -134,10 +134,10 @@
sc->sc_chanlist[0] = &sc->sc_channel;
sc->sc_wdcdev.sc_atac.atac_channels = sc->sc_chanlist;
sc->sc_wdcdev.sc_atac.atac_nchannels = 1;
+ sc->sc_wdcdev.wdc_maxdrives = 2;
sc->sc_channel.ch_channel = 0;
sc->sc_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
sc->sc_channel.ch_queue = &sc->sc_chqueue;
- sc->sc_channel.ch_ndrive = 2;
wdc_init_shadow_regs(&sc->sc_channel);
diff -r 61f85a013944 -r 13cb85d035a1 sys/arch/amiga/dev/wdc_buddha.c
--- a/sys/arch/amiga/dev/wdc_buddha.c Mon Jul 02 18:13:13 2012 +0000
+++ b/sys/arch/amiga/dev/wdc_buddha.c Mon Jul 02 18:15:44 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_buddha.c,v 1.5 2011/07/19 15:55:27 dyoung Exp $ */
+/* $NetBSD: wdc_buddha.c,v 1.6 2012/07/02 18:15:44 bouyer Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -114,6 +114,7 @@
sc->sc_wdcdev.sc_atac.atac_pio_cap = 0;
sc->sc_wdcdev.sc_atac.atac_channels = sc->wdc_chanarray;
sc->sc_wdcdev.sc_atac.atac_nchannels = nchannels;
+ sc->sc_wdcdev.wdc_maxdrives = 2;
wdc_allocate_regs(&sc->sc_wdcdev);
@@ -134,7 +135,6 @@
"can't allocate memory for command queue\n");
return;
}
- cp->ch_ndrive = 2;
/*
* XXX According to the Buddha docs, we should use a method
diff -r 61f85a013944 -r 13cb85d035a1 sys/arch/arm/gemini/obio_wdc.c
--- a/sys/arch/arm/gemini/obio_wdc.c Mon Jul 02 18:13:13 2012 +0000
+++ b/sys/arch/arm/gemini/obio_wdc.c Mon Jul 02 18:15:44 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: obio_wdc.c,v 1.3 2011/07/01 19:32:28 dyoung Exp $ */
+/* $NetBSD: obio_wdc.c,v 1.4 2012/07/02 18:15:44 bouyer Exp $ */
/* adapted from iq31244/wdc_obio.c:
* NetBSD: wdc_obio.c,v 1.5 2008/04/28 20:23:16 martin Exp
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obio_wdc.c,v 1.3 2011/07/01 19:32:28 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio_wdc.c,v 1.4 2012/07/02 18:15:44 bouyer Exp $");
#include "locators.h"
@@ -138,10 +138,10 @@
sc->wdc_chanlist[0] = &sc->ata_channel;
sc->sc_wdcdev.sc_atac.atac_channels = sc->wdc_chanlist;
sc->sc_wdcdev.sc_atac.atac_nchannels = 1;
+ sc->sc_wdcdev.wdc_maxdrives = 2;
sc->ata_channel.ch_channel = 0;
sc->ata_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
sc->ata_channel.ch_queue = &sc->wdc_chqueue;
- sc->ata_channel.ch_ndrive = 2;
wdc_init_shadow_regs(&sc->ata_channel);
aprint_normal("\n");
diff -r 61f85a013944 -r 13cb85d035a1 sys/arch/atari/dev/wdc_mb.c
--- a/sys/arch/atari/dev/wdc_mb.c Mon Jul 02 18:13:13 2012 +0000
+++ b/sys/arch/atari/dev/wdc_mb.c Mon Jul 02 18:15:44 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_mb.c,v 1.35 2011/07/01 20:34:05 dyoung Exp $ */
+/* $NetBSD: wdc_mb.c,v 1.36 2012/07/02 18:15:44 bouyer Exp $ */
/*-
* Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_mb.c,v 1.35 2011/07/01 20:34:05 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_mb.c,v 1.36 2012/07/02 18:15:44 bouyer Exp $");
Home |
Main Index |
Thread Index |
Old Index