Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Add the notion of "shadow registers" to the wdc driver. ...



details:   https://anonhg.NetBSD.org/src/rev/a8160355f89d
branches:  trunk
changeset: 566956:a8160355f89d
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue May 25 20:42:40 2004 +0000

description:
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.

diffstat:

 sys/arch/acorn32/eb7500atx/rside.c     |   5 +++--
 sys/arch/acorn32/mainbus/wdc_pioc.c    |   8 +++++---
 sys/arch/acorn32/podulebus/icside.c    |   5 +++--
 sys/arch/acorn32/podulebus/rapide.c    |   5 +++--
 sys/arch/acorn32/podulebus/simide.c    |   5 +++--
 sys/arch/amiga/dev/wdc_amiga.c         |   5 +++--
 sys/arch/i386/pnpbios/pciide_pnpbios.c |   5 +++--
 sys/arch/mac68k/obio/wdc_obio.c        |   6 ++++--
 sys/arch/macppc/dev/kauai.c            |   5 +++--
 sys/arch/macppc/dev/wdc_obio.c         |   5 +++--
 sys/arch/playstation2/dev/wdc_spd.c    |   5 +++--
 sys/arch/prep/dev/wdc_obio.c           |   6 ++++--
 sys/dev/ic/wdc.c                       |  15 +++++++++++++--
 sys/dev/ic/wdc_upc.c                   |   5 +++--
 sys/dev/ic/wdcreg.h                    |   8 +++++---
 sys/dev/ic/wdcvar.h                    |  11 ++++++++---
 sys/dev/isa/wdc_isa.c                  |   6 ++++--
 sys/dev/isapnp/wdc_isapnp.c            |   5 +++--
 sys/dev/ofisa/wdc_ofisa.c              |   6 +++---
 sys/dev/pci/pciide_common.c            |   6 ++++--
 sys/dev/pci/satalink.c                 |   3 ++-
 sys/dev/pcmcia/wdc_pcmcia.c            |   5 +++--
 sys/dev/podulebus/dtide.c              |   5 +++--
 sys/dev/podulebus/hcide.c              |   5 +++--
 24 files changed, 94 insertions(+), 51 deletions(-)

diffs (truncated from 697 to 300 lines):

diff -r 81a0f18bd0cd -r a8160355f89d sys/arch/acorn32/eb7500atx/rside.c
--- a/sys/arch/acorn32/eb7500atx/rside.c        Tue May 25 20:32:31 2004 +0000
+++ b/sys/arch/acorn32/eb7500atx/rside.c        Tue May 25 20:42:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rside.c,v 1.2 2004/01/04 13:49:49 chris Exp $  */
+/*     $NetBSD: rside.c,v 1.3 2004/05/25 20:42:40 thorpej Exp $        */
 
 /*
  * Copyright (c) 2004 Christopher Gilbert
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rside.c,v 1.2 2004/01/04 13:49:49 chris Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rside.c,v 1.3 2004/05/25 20:42:40 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -213,6 +213,7 @@
                                continue;
                        }
                }
+               wdc_init_shadow_regs(cp);
 
                if (bus_space_map(cp->ctl_iot,
                    rside_info[channel].aux_register, 0x4, 0, &cp->ctl_ioh))
diff -r 81a0f18bd0cd -r a8160355f89d sys/arch/acorn32/mainbus/wdc_pioc.c
--- a/sys/arch/acorn32/mainbus/wdc_pioc.c       Tue May 25 20:32:31 2004 +0000
+++ b/sys/arch/acorn32/mainbus/wdc_pioc.c       Tue May 25 20:42:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_pioc.c,v 1.15 2004/01/03 22:56:52 thorpej Exp $    */
+/*     $NetBSD: wdc_pioc.c,v 1.16 2004/05/25 20:42:40 thorpej Exp $    */
 
 /*
  * Copyright (c) 1997-1998 Mark Brinicombe.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_pioc.c,v 1.15 2004/01/03 22:56:52 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_pioc.c,v 1.16 2004/05/25 20:42:40 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -114,6 +114,7 @@
                        return 0;
                }
        }
+       wdc_init_shadow_regs(&ch);
 
        if (bus_space_map(ch.ctl_iot, iobase + WDC_PIOC_AUXREG_OFFSET,
            WDC_PIOC_AUXREG_NPORTS, 0, &ch.ctl_ioh)) {
@@ -163,7 +164,8 @@
                        panic("%s: couldn't submap drive registers",
                            self->dv_xname);
        }
-           
+       wdc_init_shadow_regs(&sc->wdc_channel);
+
        if (bus_space_map(sc->wdc_channel.ctl_iot,
            iobase + WDC_PIOC_AUXREG_OFFSET, WDC_PIOC_AUXREG_NPORTS, 0,
            &sc->wdc_channel.ctl_ioh))
diff -r 81a0f18bd0cd -r a8160355f89d sys/arch/acorn32/podulebus/icside.c
--- a/sys/arch/acorn32/podulebus/icside.c       Tue May 25 20:32:31 2004 +0000
+++ b/sys/arch/acorn32/podulebus/icside.c       Tue May 25 20:42:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: icside.c,v 1.20 2004/01/03 22:56:52 thorpej Exp $      */
+/*     $NetBSD: icside.c,v 1.21 2004/05/25 20:42:40 thorpej Exp $      */
 
 /*
  * Copyright (c) 1997-1998 Mark Brinicombe
@@ -42,7 +42,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: icside.c,v 1.20 2004/01/03 22:56:52 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: icside.c,v 1.21 2004/05/25 20:42:40 thorpej Exp $");
 
 #include <sys/systm.h>
 #include <sys/conf.h>
@@ -279,6 +279,7 @@
                                i, i == 0 ? 4 : 1, &cp->cmd_iohs[i]) != 0)
                                return;
                }
+               wdc_init_shadow_regs(cp);
                if (bus_space_map(iot, iobase + ide->auxregs[channel],
                    AUX_REGISTER_SPACE, 0, &cp->ctl_ioh))
                        return;
diff -r 81a0f18bd0cd -r a8160355f89d sys/arch/acorn32/podulebus/rapide.c
--- a/sys/arch/acorn32/podulebus/rapide.c       Tue May 25 20:32:31 2004 +0000
+++ b/sys/arch/acorn32/podulebus/rapide.c       Tue May 25 20:42:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rapide.c,v 1.19 2004/01/03 22:56:52 thorpej Exp $      */
+/*     $NetBSD: rapide.c,v 1.20 2004/05/25 20:42:40 thorpej Exp $      */
 
 /*
  * Copyright (c) 1997-1998 Mark Brinicombe
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rapide.c,v 1.19 2004/01/03 22:56:52 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rapide.c,v 1.20 2004/05/25 20:42:40 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -273,6 +273,7 @@
                                continue;
                        }
                }
+               wdc_init_shadow_regs(cp);
                if (bus_space_map(iot, iobase +
                    rapide_info[channel].aux_register, 4, 0, &cp->ctl_ioh)) {
                        bus_space_unmap(iot, cp->cmd_baseioh,
diff -r 81a0f18bd0cd -r a8160355f89d sys/arch/acorn32/podulebus/simide.c
--- a/sys/arch/acorn32/podulebus/simide.c       Tue May 25 20:32:31 2004 +0000
+++ b/sys/arch/acorn32/podulebus/simide.c       Tue May 25 20:42:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: simide.c,v 1.18 2004/01/03 22:56:52 thorpej Exp $      */
+/*     $NetBSD: simide.c,v 1.19 2004/05/25 20:42:40 thorpej Exp $      */
 
 /*
  * Copyright (c) 1997-1998 Mark Brinicombe
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: simide.c,v 1.18 2004/01/03 22:56:52 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: simide.c,v 1.19 2004/05/25 20:42:40 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -270,6 +270,7 @@
                                continue;
                        }
                }
+               wdc_init_shadow_regs(cp);
                if (bus_space_map(cp->ctl_iot, iobase +
                    simide_info[channel].aux_register, 4, 0, &cp->ctl_ioh)) {
                        bus_space_unmap(cp->cmd_iot, cp->cmd_baseioh,
diff -r 81a0f18bd0cd -r a8160355f89d sys/arch/amiga/dev/wdc_amiga.c
--- a/sys/arch/amiga/dev/wdc_amiga.c    Tue May 25 20:32:31 2004 +0000
+++ b/sys/arch/amiga/dev/wdc_amiga.c    Tue May 25 20:42:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_amiga.c,v 1.20 2004/01/06 18:46:07 he Exp $ */
+/*     $NetBSD: wdc_amiga.c,v 1.21 2004/05/25 20:42:40 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_amiga.c,v 1.20 2004/01/06 18:46:07 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_amiga.c,v 1.21 2004/05/25 20:42:40 thorpej Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -128,6 +128,7 @@
                        return;
                }
        }
+       wdc_init_shadow_regs(&sc->wdc_channel);
 
        if (sc->sc_a1200)
                sc->wdc_channel.ctl_ioh = sc->ctl_iot.base;
diff -r 81a0f18bd0cd -r a8160355f89d sys/arch/i386/pnpbios/pciide_pnpbios.c
--- a/sys/arch/i386/pnpbios/pciide_pnpbios.c    Tue May 25 20:32:31 2004 +0000
+++ b/sys/arch/i386/pnpbios/pciide_pnpbios.c    Tue May 25 20:42:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pciide_pnpbios.c,v 1.14 2004/01/03 22:56:53 thorpej Exp $      */
+/*     $NetBSD: pciide_pnpbios.c,v 1.15 2004/05/25 20:42:40 thorpej Exp $      */
 
 /*
  * Copyright (c) 1999 Soren S. Jorvang.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pciide_pnpbios.c,v 1.14 2004/01/03 22:56:53 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pciide_pnpbios.c,v 1.15 2004/05/25 20:42:40 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -156,6 +156,7 @@
                            return;
                }
        }
+       wdc_init_shadow_regs(wdc_cp);
 
        wdc_cp->ctl_iot = wdc_cp->data32iot = compat_iot;
        wdc_cp->ctl_ioh = wdc_cp->data32ioh = ctl_ioh;
diff -r 81a0f18bd0cd -r a8160355f89d sys/arch/mac68k/obio/wdc_obio.c
--- a/sys/arch/mac68k/obio/wdc_obio.c   Tue May 25 20:32:31 2004 +0000
+++ b/sys/arch/mac68k/obio/wdc_obio.c   Tue May 25 20:42:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_obio.c,v 1.14 2004/01/09 17:00:02 fredb Exp $ */
+/*     $NetBSD: wdc_obio.c,v 1.15 2004/05/25 20:42:40 thorpej Exp $ */
 
 /*
  * Copyright (c) 2002 Takeshi Shibagaki  All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.14 2004/01/09 17:00:02 fredb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.15 2004/05/25 20:42:40 thorpej Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -112,6 +112,7 @@
                                return 0;
                        }
                }
+               wdc_init_shadow_regs(&ch);
 
 
                if (bus_space_subregion(ch.cmd_iot, ch.cmd_baseioh,
@@ -183,6 +184,7 @@
                        return;
                }
        }
+       wdc_init_shadow_regs(&sc->wdc_channel);
 
        if (bus_space_subregion(sc->wdc_channel.cmd_iot,
                                sc->wdc_channel.cmd_baseioh,
diff -r 81a0f18bd0cd -r a8160355f89d sys/arch/macppc/dev/kauai.c
--- a/sys/arch/macppc/dev/kauai.c       Tue May 25 20:32:31 2004 +0000
+++ b/sys/arch/macppc/dev/kauai.c       Tue May 25 20:42:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kauai.c,v 1.12 2004/01/04 07:08:13 dbj Exp $   */
+/*     $NetBSD: kauai.c,v 1.13 2004/05/25 20:42:41 thorpej Exp $       */
 
 /*-
  * Copyright (c) 2003 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kauai.c,v 1.12 2004/01/04 07:08:13 dbj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kauai.c,v 1.13 2004/05/25 20:42:41 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -164,6 +164,7 @@
                        return;
                }
        }
+       wdc_init_shadow_regs(chp);
 
        if (pci_intr_establish(pa->pa_pc, ih, IPL_BIO, wdcintr, chp) == NULL) {
                printf("%s: unable to establish interrupt\n", self->dv_xname);
diff -r 81a0f18bd0cd -r a8160355f89d sys/arch/macppc/dev/wdc_obio.c
--- a/sys/arch/macppc/dev/wdc_obio.c    Tue May 25 20:32:31 2004 +0000
+++ b/sys/arch/macppc/dev/wdc_obio.c    Tue May 25 20:42:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_obio.c,v 1.36 2004/01/04 07:08:13 dbj Exp $        */
+/*     $NetBSD: wdc_obio.c,v 1.37 2004/05/25 20:42:41 thorpej Exp $    */
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.36 2004/01/04 07:08:13 dbj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.37 2004/05/25 20:42:41 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -172,6 +172,7 @@
                        return;
                }
        }
+       wdc_init_shadow_regs(chp);
 #if 0
        chp->data32iot = chp->cmd_iot;
        chp->data32ioh = chp->cmd_ioh;
diff -r 81a0f18bd0cd -r a8160355f89d sys/arch/playstation2/dev/wdc_spd.c
--- a/sys/arch/playstation2/dev/wdc_spd.c       Tue May 25 20:32:31 2004 +0000
+++ b/sys/arch/playstation2/dev/wdc_spd.c       Tue May 25 20:42:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_spd.c,v 1.13 2004/01/06 18:46:07 he Exp $  */
+/*     $NetBSD: wdc_spd.c,v 1.14 2004/05/25 20:42:41 thorpej Exp $     */
 
 /*-
  * Copyright (c) 2001, 2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_spd.c,v 1.13 2004/01/06 18:46:07 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_spd.c,v 1.14 2004/05/25 20:42:41 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -227,6 +227,7 @@
        ch->cmd_iot = &_wdc_spd_space;
        for (i = 0; i < 8; i++)
                ch->cmd_iohs[i] = SPD_HDD_IO_BASE + i * 2; /*  wdc register is 16 bit wide. */



Home | Main Index | Thread Index | Old Index