Source-Changes-HG archive

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

[src/trunk]: src/sys/arch adjust several missed drivers for wdcprobe() change...



details:   https://anonhg.NetBSD.org/src/rev/be07d69d9270
branches:  trunk
changeset: 459421:be07d69d9270
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Mon Sep 09 22:01:23 2019 +0000

description:
adjust several missed drivers for wdcprobe() changes of ATA NCQ branch

for dreamcast g1 just drop the custom reset function, it doesn't seem to do
anything useful over the generic variant

PR kern/54538 by Izumi Tsutsui

diffstat:

 sys/arch/dreamcast/dev/g1/wdc_g1.c    |  27 +++++++++++++++++----------
 sys/arch/evbppc/mpc85xx/wdc_obio.c    |  13 +++----------
 sys/arch/mips/adm5120/dev/wdc_extio.c |  16 +++++++---------
 sys/arch/mmeye/dev/wdc_mainbus.c      |  15 ++++-----------
 4 files changed, 31 insertions(+), 40 deletions(-)

diffs (258 lines):

diff -r b48f8c92a003 -r be07d69d9270 sys/arch/dreamcast/dev/g1/wdc_g1.c
--- a/sys/arch/dreamcast/dev/g1/wdc_g1.c        Mon Sep 09 18:11:20 2019 +0000
+++ b/sys/arch/dreamcast/dev/g1/wdc_g1.c        Mon Sep 09 22:01:23 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_g1.c,v 1.3 2017/10/20 07:06:06 jdolecek Exp $ */
+/* $NetBSD: wdc_g1.c,v 1.4 2019/09/09 22:01:23 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -62,7 +62,9 @@
 
 static int     wdc_g1_probe(device_t, cfdata_t, void *);
 static void    wdc_g1_attach(device_t, device_t, void *);
+#if 0
 static void    wdc_g1_do_reset(struct ata_channel *, int);
+#endif
 static int     wdc_g1_intr(void *);
 
 CFATTACH_DECL_NEW(wdc_g1bus, sizeof(struct wdc_g1_softc),
@@ -71,9 +73,7 @@
 static int
 wdc_g1_probe(device_t parent, cfdata_t cf, void *aux)
 {
-       struct ata_channel ch;
        struct g1bus_attach_args *ga = aux;
-       struct wdc_softc wdc;
        struct wdc_regs wdr;
        int result = 0, i;
 #ifdef ATADEBUG
@@ -84,11 +84,9 @@
        for (i = 0; i < 0x200000 / 4; i++)
                (void)((volatile uint32_t *)0xa0000000)[i];
 
-       memset(&wdc, 0, sizeof(wdc));
-       memset(&ch, 0, sizeof(ch));
-       ch.ch_atac = &wdc.sc_atac;
+#if 0
        wdc.reset = wdc_g1_do_reset;
-       wdc.regs = &wdr;
+#endif
 
        wdr.cmd_iot = ga->ga_memt;
        if (bus_space_map(wdr.cmd_iot, WDC_G1_CMD_ADDR,
@@ -101,7 +99,7 @@
                        goto outunmap;
        }
 
-       wdc_init_shadow_regs(&ch);
+       wdc_init_shadow_regs(&wdr);
 
        wdr.ctl_iot = ga->ga_memt;
        if (bus_space_map(wdr.ctl_iot, WDC_G1_CTL_ADDR,
@@ -112,9 +110,8 @@
        /* fake up device name for ATADEBUG_PRINT() with DEBUG_PROBE */
        memset(&dev, 0, sizeof(dev));
        strncat(dev.dv_xname, "wdc(g1probe)", sizeof(dev.dv_xname));
-       wdc.sc_atac.atac_dev = &dev;
 #endif
-       result = wdcprobe(&ch);
+       result = wdcprobe(&wdr);
        
        bus_space_unmap(wdr.ctl_iot, wdr.ctl_ioh, WDC_G1_AUXREG_NPORTS);
  outunmap:
@@ -160,7 +157,9 @@
        sc->sc_wdcdev.sc_atac.atac_channels = sc->wdc_chanlist;
        sc->sc_wdcdev.sc_atac.atac_nchannels = 1;
        sc->sc_wdcdev.wdc_maxdrives = 2;
+#if 0
        sc->sc_wdcdev.reset = wdc_g1_do_reset;
+#endif
        sc->ata_channel.ch_channel = 0;
        sc->ata_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
 
@@ -181,6 +180,13 @@
        return wdcintr(arg);
 }
 
+#if 0
+/*
+ * This does what the generic wdc_do_reset() does, only with unnecessary
+ * additional GD-ROM reset. Keep code around in case this turns out to be
+ * actually useful/necessary. ATAPI code should do it's own reset in either
+ * case anyway.
+ */
 static void
 wdc_g1_do_reset(struct ata_channel *chp, int poll)
 {
@@ -214,3 +220,4 @@
        if (poll != 0)
                splx(s);
 }
+#endif
diff -r b48f8c92a003 -r be07d69d9270 sys/arch/evbppc/mpc85xx/wdc_obio.c
--- a/sys/arch/evbppc/mpc85xx/wdc_obio.c        Mon Sep 09 18:11:20 2019 +0000
+++ b/sys/arch/evbppc/mpc85xx/wdc_obio.c        Mon Sep 09 22:01:23 2019 +0000
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.6 2017/10/20 07:06:06 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.7 2019/09/09 22:01:23 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -100,8 +100,6 @@
 {
        struct generic_attach_args * const ga = aux;
        bus_size_t size = ga->ga_size;
-       struct ata_channel ch;
-       struct wdc_softc wdc;
        struct wdc_regs wdr;
        struct device dev;
        int rv = 0;
@@ -115,18 +113,13 @@
         * We need to see if a CF is attached in True-IDE mode
         */
        memset(&dev, 0, sizeof(dev));
-       memset(&wdc, 0, sizeof(wdc));
-       memset(&ch, 0, sizeof(ch));
        memset(&wdr, 0, sizeof(wdr));
 
        dev.dv_xname[0] = '?';
-       wdc.sc_atac.atac_dev = &dev;
-       ch.ch_atac = &wdc.sc_atac;
-       wdc.regs = &wdr;
 
        if (wdc_obio_initregmap(&wdr, ga->ga_bst, ga->ga_addr, size)) {
-               wdc_init_shadow_regs(&ch);
-               rv = wdcprobe(&ch);
+               wdc_init_shadow_regs(&wdr);
+               rv = wdcprobe(&wdr);
                bus_space_unmap(wdr.cmd_iot, wdr.cmd_baseioh, size);
        }
 
diff -r b48f8c92a003 -r be07d69d9270 sys/arch/mips/adm5120/dev/wdc_extio.c
--- a/sys/arch/mips/adm5120/dev/wdc_extio.c     Mon Sep 09 18:11:20 2019 +0000
+++ b/sys/arch/mips/adm5120/dev/wdc_extio.c     Mon Sep 09 22:01:23 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_extio.c,v 1.10 2017/10/20 07:06:07 jdolecek Exp $ */
+/*     $NetBSD: wdc_extio.c,v 1.11 2019/09/09 22:01:23 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 2007 David Young.  All rights reserved.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_extio.c,v 1.10 2017/10/20 07:06:07 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_extio.c,v 1.11 2019/09/09 22:01:23 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -156,7 +156,7 @@
 
 static int
 wdc_extio_map(struct extio_attach_args *ea, struct wdc_regs *wdr,
-    struct ata_channel *chp, void **gpio, struct gpio_pinmap *pinmap)
+    void **gpio, struct gpio_pinmap *pinmap)
 {
        int i;
 
@@ -200,7 +200,7 @@
                goto post_bus_err;
        }
 
-       wdc_init_shadow_regs(chp);
+       wdc_init_shadow_regs(wdr);
 
        return 0;
 post_bus_err:
@@ -234,8 +234,6 @@
 wdc_extio_match(device_t parent, cfdata_t cf, void *aux)
 {
        struct extio_attach_args *ea = (struct extio_attach_args *)aux;
-       struct ata_channel ch;
-       struct wdc_softc wdc;
        struct wdc_regs wdr;
        int result = 0;
        void *gpio;
@@ -260,10 +258,10 @@
                    (WDC_CAPABILITY_PREATA|WDC_CAPABILITY_NO_EXTRA_RESETS);
        }
 
-       if (wdc_extio_map(ea, &wdr, &ch, &gpio, &pm) == -1)
+       if (wdc_extio_map(ea, &wdr, &gpio, &pm) == -1)
                return 0;
 
-       result = wdcprobe(&ch);
+       result = wdcprobe(&wdr);
 
        bus_space_unmap(wdr.cmd_iot, wdr.cmd_baseioh, WDC_OBIO_CF_WINSIZE);
 #if 0
@@ -289,7 +287,7 @@
        sc->sc_wdcdev.regs = wdr = &sc->sc_wdc_regs;
        chp->ch_atac = &sc->sc_wdcdev.sc_atac;
 
-       if (wdc_extio_map(ea, wdr, chp, &sc->sc_gpio, &sc->sc_pinmap) == -1)
+       if (wdc_extio_map(ea, wdr, &sc->sc_gpio, &sc->sc_pinmap) == -1)
                return;
 
        cf = device_cfdata(sc->sc_wdcdev.sc_atac.atac_dev);
diff -r b48f8c92a003 -r be07d69d9270 sys/arch/mmeye/dev/wdc_mainbus.c
--- a/sys/arch/mmeye/dev/wdc_mainbus.c  Mon Sep 09 18:11:20 2019 +0000
+++ b/sys/arch/mmeye/dev/wdc_mainbus.c  Mon Sep 09 22:01:23 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_mainbus.c,v 1.6 2017/10/20 07:06:07 jdolecek Exp $ */
+/*     $NetBSD: wdc_mainbus.c,v 1.7 2019/09/09 22:01:23 jdolecek Exp $ */
 /*
  * Copyright (c) 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_mainbus.c,v 1.6 2017/10/20 07:06:07 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_mainbus.c,v 1.7 2019/09/09 22:01:23 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -70,8 +70,6 @@
 wdc_mainbus_match(device_t parent, cfdata_t match, void *aux)
 {
        struct mainbus_attach_args *ma = aux;
-       struct ata_channel ch;
-       struct wdc_softc wdc;
        struct wdc_regs wdr;
        int result = 0, i;
 
@@ -83,11 +81,6 @@
            ma->ma_irq1 == MAINBUSCF_IRQ1_DEFAULT)
                return 0;
 
-       memset(&wdc, 0, sizeof(wdc));
-       memset(&ch, 0, sizeof(ch));
-       ch.ch_atac = &wdc.sc_atac;
-       wdc.regs = &wdr;
-
        wdr.cmd_iot = SH3_BUS_SPACE_PCMCIA_IO;
        if (bus_space_map(wdr.cmd_iot, ma->ma_addr1,
            WDC_MAINBUS_REG_NPORTS, 0, &wdr.cmd_baseioh) != 0)
@@ -98,7 +91,7 @@
                    i == 0 ? 4 : 1, &wdr.cmd_iohs[i]) != 0)
                        goto outunmap;
        }
-       wdc_init_shadow_regs(&ch);
+       wdc_init_shadow_regs(&wdr);
 
        wdr.ctl_iot = SH3_BUS_SPACE_PCMCIA_IO;
        if (bus_space_map(wdr.ctl_iot, ma->ma_addr1 + WDC_MAINBUS_AUXREG_OFFSET,
@@ -115,7 +108,7 @@
 printf("CF COR=0x%x\n", bus_space_read_1(iot, ioh, 0x200));
 delay(1000000);
 #endif
-       result = wdcprobe(&ch);
+       result = wdcprobe(&wdr);
 
        bus_space_unmap(wdr.ctl_iot, wdr.ctl_ioh, WDC_MAINBUS_AUXREG_NPORTS);
 outunmap:



Home | Main Index | Thread Index | Old Index