summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-all.h
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2009-10-29 13:27:14 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2009-10-29 13:27:14 +0000
commit7d41dc5de879153d59c776ac17055428218b9c51 (patch)
tree3e885d599c95e54ed7b2e5a7121017207d9e8a0b /sys/dev/ata/ata-all.h
parentd890529b305a4da9bde5bfb17108249ebcc64c50 (diff)
downloadFreeBSD-src-7d41dc5de879153d59c776ac17055428218b9c51.zip
FreeBSD-src-7d41dc5de879153d59c776ac17055428218b9c51.tar.gz
Turn off use of ATA_A_4BIT on modern hardware. This flag was already
obsoleted in 1996 by ATA-2, and crashes some modern hardware like some revisions of the Serverworks K2 SATA controller. Even very ancient hardware seems not to require it. In the unlikely event this causes problems, the previous behavior can be re-enabled by defining ATA_LEGACY_SUPPORT at the top of this file. Reviewed by: Alexander Motin <mav@freebsd.org>
Diffstat (limited to 'sys/dev/ata/ata-all.h')
-rw-r--r--sys/dev/ata/ata-all.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/ata/ata-all.h b/sys/dev/ata/ata-all.h
index 4bb45e4..adee8f5 100644
--- a/sys/dev/ata/ata-all.h
+++ b/sys/dev/ata/ata-all.h
@@ -26,6 +26,11 @@
* $FreeBSD$
*/
+#if 0
+#define ATA_LEGACY_SUPPORT /* Enable obsolete features that break
+ * some modern devices */
+#endif
+
/* ATA register defines */
#define ATA_DATA 0 /* (RW) data */
@@ -81,7 +86,11 @@
#define ATA_PC98_CTLOFFSET 0x10c /* do for PC98 devices */
#define ATA_A_IDS 0x02 /* disable interrupts */
#define ATA_A_RESET 0x04 /* RESET controller */
-#define ATA_A_4BIT 0x08 /* 4 head bits */
+#ifdef ATA_LEGACY_SUPPORT
+#define ATA_A_4BIT 0x08 /* 4 head bits: obsolete 1996 */
+#else
+#define ATA_A_4BIT 0x00
+#endif
#define ATA_A_HOB 0x80 /* High Order Byte enable */
/* SATA register defines */
OpenPOWER on IntegriCloud