Module Name:    src
Committed By:   jdolecek
Date:           Mon Sep  9 22:01:23 UTC 2019

Modified Files:
        src/sys/arch/dreamcast/dev/g1: wdc_g1.c
        src/sys/arch/evbppc/mpc85xx: wdc_obio.c
        src/sys/arch/mips/adm5120/dev: wdc_extio.c
        src/sys/arch/mmeye/dev: wdc_mainbus.c

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/dreamcast/dev/g1/wdc_g1.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbppc/mpc85xx/wdc_obio.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mips/adm5120/dev/wdc_extio.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mmeye/dev/wdc_mainbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/dreamcast/dev/g1/wdc_g1.c
diff -u src/sys/arch/dreamcast/dev/g1/wdc_g1.c:1.3 src/sys/arch/dreamcast/dev/g1/wdc_g1.c:1.4
--- src/sys/arch/dreamcast/dev/g1/wdc_g1.c:1.3	Fri Oct 20 07:06:06 2017
+++ src/sys/arch/dreamcast/dev/g1/wdc_g1.c	Mon Sep  9 22:01:23 2019
@@ -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 @@ struct wdc_g1_softc {
 
 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 @@ CFATTACH_DECL_NEW(wdc_g1bus, sizeof(stru
 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 @@ wdc_g1_probe(device_t parent, cfdata_t c
 	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 @@ wdc_g1_probe(device_t parent, cfdata_t c
 			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 @@ wdc_g1_probe(device_t parent, cfdata_t c
 	/* 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 @@ wdc_g1_attach(struct device *parent, str
 	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 @@ wdc_g1_intr(void *arg)
 	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 @@ wdc_g1_do_reset(struct ata_channel *chp,
 	if (poll != 0)
 		splx(s);
 }
+#endif

Index: src/sys/arch/evbppc/mpc85xx/wdc_obio.c
diff -u src/sys/arch/evbppc/mpc85xx/wdc_obio.c:1.6 src/sys/arch/evbppc/mpc85xx/wdc_obio.c:1.7
--- src/sys/arch/evbppc/mpc85xx/wdc_obio.c:1.6	Fri Oct 20 07:06:06 2017
+++ src/sys/arch/evbppc/mpc85xx/wdc_obio.c	Mon Sep  9 22:01:23 2019
@@ -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 @@ wdc_obio_match(device_t parent, cfdata_t
 {
 	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 @@ wdc_obio_match(device_t parent, cfdata_t
 	 * 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);
 	}
 

Index: src/sys/arch/mips/adm5120/dev/wdc_extio.c
diff -u src/sys/arch/mips/adm5120/dev/wdc_extio.c:1.10 src/sys/arch/mips/adm5120/dev/wdc_extio.c:1.11
--- src/sys/arch/mips/adm5120/dev/wdc_extio.c:1.10	Fri Oct 20 07:06:07 2017
+++ src/sys/arch/mips/adm5120/dev/wdc_extio.c	Mon Sep  9 22:01:23 2019
@@ -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 @@ wdc_extio_reset(struct ata_channel *chp,
 
 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 @@ wdc_extio_map(struct extio_attach_args *
 		goto post_bus_err;
 	}
 
-	wdc_init_shadow_regs(chp);
+	wdc_init_shadow_regs(wdr);
 
 	return 0;
 post_bus_err:
@@ -234,8 +234,6 @@ int
 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_extio_match(device_t parent, cfdata_
 		    (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 @@ wdc_extio_attach(device_t parent, device
 	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);

Index: src/sys/arch/mmeye/dev/wdc_mainbus.c
diff -u src/sys/arch/mmeye/dev/wdc_mainbus.c:1.6 src/sys/arch/mmeye/dev/wdc_mainbus.c:1.7
--- src/sys/arch/mmeye/dev/wdc_mainbus.c:1.6	Fri Oct 20 07:06:07 2017
+++ src/sys/arch/mmeye/dev/wdc_mainbus.c	Mon Sep  9 22:01:23 2019
@@ -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 @@ static int
 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 @@ wdc_mainbus_match(device_t parent, cfdat
 	    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 @@ wdc_mainbus_match(device_t parent, cfdat
 		    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 @@ bus_space_write_1(iot, ioh, 0x200, 0x41)
 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:

Reply via email to