Subject: kern/24729: ATA-133 support for AMD8111 IDE Controller
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <njoly@pasteur.fr>
List: netbsd-bugs
Date: 03/10/2004 15:01:15
>Number:         24729
>Category:       kern
>Synopsis:       ATA-133 support for AMD8111 IDE Controller
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 10 13:02:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Nicolas Joly
>Release:        NetBSD 1.6ZK (-current 20040310)
>Organization:
	Institut Pasteur
>Environment:
System: NetBSD lanfeust.sis.pasteur.fr 1.6ZK NetBSD 1.6ZK (GENERIC.MP) #0: Wed Mar 10 12:07:24 CET 2004 njoly@lanfeust.sis.pasteur.fr:/local/src/NetBSD/obj/amd64/sys/arch/amd64/compile/GENERIC.MP amd64
Architecture: x86_64
Machine: amd64
>Description:

AMD8111 IDE Controller work fine on my inew amd64 workstation (Tyan S2885
motherboard); but it only support up to ATA-100 devices.

The documentation claims that it can support ATA-133 too :

The enhanced IDE controller supports independent primary and secondary
ports. Each port supports two drives. Supported protocols include PIO
modes 0-4, multi-word DMA modes 0-2, ultra DMA modes 0-1, 2 (ATA-33), 3,
4 (ATA-66), 5 (ATA-100), and 6 (ATA-133).

[...]
viaide0 at pci0 dev 7 function 1
viaide0: Advanced Micro Devices AMD8111 IDE Controller (rev. 0x03)
viaide0: bus-master DMA support present
viaide0: primary channel configured to compatibility mode
viaide0: primary channel interrupting at ioapic0 pin 14 (irq 14)
atabus4 at viaide0 channel 0
viaide0: secondary channel configured to compatibility mode
viaide0: secondary channel interrupting at ioapic0 pin 15 (irq 15)
atabus5 at viaide0 channel 1
[...]
wd0 at atabus4 drive 0: <Maxtor 6E040L0>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 39205 MB, 79656 cyl, 16 head, 63 sec, 512 bytes/sect x 80293248 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
wd0(viaide0:0:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA data transfers)
wd1 at atabus5 drive 0: <Maxtor 6Y120L0>
wd1: drive supports 16-sector PIO transfers, LBA addressing
wd1: 114 GB, 238216 cyl, 16 head, 63 sec, 512 bytes/sect x 240121728 sectors
wd1: 32-bit data port
wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
wd1(viaide0:1:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA data transfers)

>How-To-Repeat:
Boot a box with AMD8111 IDE Controller and ATA-133 disks.
>Fix:
With the following patch, the controller now support ATA-133 and everything
seems to work fine.

wd0(viaide0:0:0): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133) (using DMA data transfers)
wd1(viaide0:1:0): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133) (using DMA data transfers)

Index: sys/dev/pci/viaide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/viaide.c,v
retrieving revision 1.10
diff -u -r1.10 viaide.c
--- sys/dev/pci/viaide.c	20 Feb 2004 16:36:29 -0000	1.10
+++ sys/dev/pci/viaide.c	10 Mar 2004 12:09:32 -0000
@@ -265,9 +265,11 @@
 		break;
 	case PCI_VENDOR_AMD:
 		switch (sc->sc_pp->ide_product) {
+		case PCI_PRODUCT_AMD_PBC8111_IDE:
+			sc->sc_wdcdev.UDMA_cap = 6;
+			break;
 		case PCI_PRODUCT_AMD_PBC766_IDE:
 		case PCI_PRODUCT_AMD_PBC768_IDE:
-		case PCI_PRODUCT_AMD_PBC8111_IDE:
 			sc->sc_wdcdev.UDMA_cap = 5;
 			break;
 		default:
>Release-Note:
>Audit-Trail:
>Unformatted: