Module Name:    src
Committed By:   kiyohara
Date:           Tue Feb  9 12:48:06 UTC 2016

Modified Files:
        src/sys/arch/evbmips/alchemy: autoconf.c

Log Message:
Clear ATAC_CAP_DATA32, if dev is atabus@wdc@pcmcia@aupcmcia.  It is 32-bit 
transfers are not supported.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbmips/alchemy/autoconf.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/evbmips/alchemy/autoconf.c
diff -u src/sys/arch/evbmips/alchemy/autoconf.c:1.19 src/sys/arch/evbmips/alchemy/autoconf.c:1.20
--- src/sys/arch/evbmips/alchemy/autoconf.c:1.19	Sat Oct 27 17:17:50 2012
+++ src/sys/arch/evbmips/alchemy/autoconf.c	Tue Feb  9 12:48:06 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.19 2012/10/27 17:17:50 chs Exp $ */
+/* $NetBSD: autoconf.c,v 1.20 2016/02/09 12:48:06 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.19 2012/10/27 17:17:50 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.20 2016/02/09 12:48:06 kiyohara Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -48,6 +48,8 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v
 #include <mips/alchemy/include/auvar.h>
 #include <mips/alchemy/include/aubusvar.h>
 
+#include <dev/ata/atavar.h>
+
 /*
  * Configure all devices on system
  */     
@@ -80,8 +82,6 @@ cpu_rootconf(void)
 void
 device_register(device_t dev, void *aux)
 {
-	struct aubus_attach_args *aa = aux;
-
 	/*
 	 * We don't ever know the boot device.  But that's because the
 	 * firmware only loads from the network.
@@ -89,6 +89,7 @@ device_register(device_t dev, void *aux)
 
 	/* Fetch the MAC addresses from YAMON. */
 	if (device_is_a(dev, "aumac")) {
+		struct aubus_attach_args *aa = aux;
 		prop_data_t pd;
 		const char *cp;
 		char *cp0;
@@ -126,4 +127,18 @@ device_register(device_t dev, void *aux)
 			prop_object_release(pd);
 		}
 	}
+	if (device_is_a(dev, "atabus")) {
+		device_t p1 = device_parent(dev);
+		device_t p2 = device_parent(p1);
+		device_t p3 = device_parent(p2);
+
+		if (device_is_a(p1, "wdc") &&
+		    device_is_a(p2, "pcmcia") &&
+		    device_is_a(p3, "aupcmcia")) {
+			struct ata_channel *chp = aux;
+
+			/* 32-bit transfers are not supported. */
+			chp->ch_atac->atac_cap &= ~ATAC_CAP_DATA32;
+		}
+	}
 }

Reply via email to