Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 May 2007 12:50:25 GMT
From:      Artem Naluzhny<tut@nhamon.com.ua>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/113195: [PATCH] add support for ATI IXP SB600 non-RAID SATA/PATA controllers
Message-ID:  <200705311250.l4VCoPMj087237@www.freebsd.org>
Resent-Message-ID: <200705311300.l4VD0C9X051145@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         113195
>Category:       kern
>Synopsis:       [PATCH] add support for ATI IXP SB600 non-RAID SATA/PATA controllers
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 31 13:00:11 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Artem Naluzhny
>Release:        7.0-CURRENT
>Organization:
>Environment:
FreeBSD tut.intra 7.0-CURRENT FreeBSD 7.0-CURRENT #4: Thu May 31 13:58:38 EEST 2007     root@tut.intra:/usr/obj/usr/src/sys/TUT  i386
>Description:
$ pciconf -clv

atapci0@pci0:18:0:      class=0x01018f card=0x01f51028 chip=0x43801002 rev=0x00 hdr=0x00
    vendor     = 'ATI Technologies Inc.'
    device     = 'IXP SB600 Serial ATA Controller'
    class      = mass storage
    subclass   = ATA
    cap 01[60] = powerspec 2  supports D0 D3  current D0
    cap 12[70] = unknown

atapci1@pci0:20:1:      class=0x01018a card=0x01f51028 chip=0x438c1002 rev=0x00 hdr=0x00
    vendor     = 'ATI Technologies Inc.'
    device     = 'IXP SB600 ATA Controller'
    class      = mass storage
    subclass   = ATA
    cap 05[70] = MSI supports 1 message

-----------------------------------------------------------------------------
Before the patch:

atapci0: <GENERIC ATA controller> port 0x8438-0x843f,0x8454-0x8457,0x8430-0x8437,0x8450-0x8453,0x8400-0x840f mem 0xc0004000-0xc00043ff irq 22 at device 18.0 on pci0
atapci0: Reserved 0x10 bytes for rid 0x20 type 4 at 0x8400
ioapic0: routing intpin 22 (PCI IRQ 22) to vector 49
atapci0: [MPSAFE]
atapci0: [ITHREAD]
ata2: <ATA channel 0> on atapci0
atapci0: Reserved 0x8 bytes for rid 0x10 type 4 at 0x8438
atapci0: Reserved 0x4 bytes for rid 0x14 type 4 at 0x8454
ata2: reset tp1 mask=03 ostat0=50 ostat1=00
ata2: stat0=0x50 err=0x01 lsb=0x00 msb=0x00
ata2: stat1=0x00 err=0x00 lsb=0x00 msb=0x00
ata2: reset tp2 stat0=50 stat1=00 devices=0x1<ATA_MASTER>
ata2: [MPSAFE]
ata2: [ITHREAD]
ata3: <ATA channel 1> on atapci0
atapci0: Reserved 0x8 bytes for rid 0x18 type 4 at 0x8430
atapci0: Reserved 0x4 bytes for rid 0x1c type 4 at 0x8450
ata3: reset tp1 mask=03 ostat0=7f ostat1=7f
ata3: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f
ata3: stat1=0x7f err=0x7f lsb=0x7f msb=0x7f
ata3: reset tp2 stat0=ff stat1=ff devices=0x0
ata3: [MPSAFE]
ata3: [ITHREAD]

atapci1: <GENERIC ATA controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x8420-0x842f at device 20.1 on pci0
atapci1: Reserved 0x10 bytes for rid 0x20 type 4 at 0x8420
ata0: <ATA channel 0> on atapci1
atapci1: Reserved 0x8 bytes for rid 0x10 type 4 at 0x1f0
atapci1: Reserved 0x1 bytes for rid 0x14 type 4 at 0x3f6
ata0: reset tp1 mask=03 ostat0=50 ostat1=01
ata0: stat0=0x10 err=0x01 lsb=0x14 msb=0xeb
ata0: stat1=0x01 err=0x04 lsb=0x00 msb=0x00
ata0: reset tp2 stat0=10 stat1=01 devices=0x4<ATAPI_MASTER>
ioapic0: routing intpin 14 (ISA IRQ 14) to vector 54
ata0: [MPSAFE]
ata0: [ITHREAD]
ata1: <ATA channel 1> on atapci1
atapci1: Reserved 0x8 bytes for rid 0x18 type 4 at 0x170
atapci1: Reserved 0x1 bytes for rid 0x1c type 4 at 0x376
ata1: reset tp1 mask=00 ostat0=ff ostat1=ff
ioapic0: routing intpin 15 (ISA IRQ 15) to vector 55
ata1: [MPSAFE]
ata1: [ITHREAD]

ata0-master: pio=PIO4 wdma=WDMA2 udma=UDMA33 cable=40 wire
acd0: <TSSTcorp DVD+/-RW TS-L632D/DE04> DVDR drive at ata0 as master
acd0: read 4134KB/s (4134KB/s) write 172KB/s (4134KB/s), 2048KB buffer, UDMA33
acd0: Reads: CDR, CDRW, CDDA stream, DVDROM, DVDR, packet
acd0: Writes: CDR, CDRW, DVDR, test write, burnproof
acd0: Audio: play, 256 volume levels
acd0: Mechanism: ejectable tray, unlocked
acd0: Medium: no/blank disc

ata2-master: pio=PIO4 wdma=WDMA2 udma=UDMA133 cable=40 wire
ad4: 57231MB <Seagate ST96812AS 8.04> at ata2-master UDMA33
ad4: 117210240 sectors [116280C/16H/63S] 16 sectors/interrupt 1 depth queue


$ atacontrol list
ATA channel 0:
    Master: acd0 <TSSTcorp DVD+/-RW TS-L632D/DE04> ATA/ATAPI revision 0
    Slave:       no device present
ATA channel 1:
    Master:      no device present
    Slave:       no device present
ATA channel 2:
    Master:  ad4 <ST96812AS/8.04> Serial ATA v1.0
    Slave:       no device present
ATA channel 3:
    Master:      no device present
    Slave:       no device present

$ atacontrol mode acd0
current mode = UDMA33

$ atacontrol mode ad4
current mode = UDMA33

-----------------------------------------------------------------------------
After the patch:

atapci0: <ATI IXP600 SATA300 controller> port 0x8438-0x843f,0x8454-0x8457,0x8430-0x8437,0x8450-0x8453,0x8400-0x840f mem 0xc0004000-0xc00043ff irq 22 at device 18.0 on pci0
atapci0: Reserved 0x10 bytes for rid 0x20 type 4 at 0x8400
ioapic0: routing intpin 22 (PCI IRQ 22) to vector 49
atapci0: [MPSAFE]
atapci0: [ITHREAD]
atapci0: Reserved 0x400 bytes for rid 0x24 type 3 at 0xc0004000
atapci0: AHCI Version 01.10 controller with 4 ports detected
ata2: <ATA channel 0> on atapci0
ata2: SATA connect time=0ms
ata2: [MPSAFE]
ata2: [ITHREAD]
ata3: <ATA channel 1> on atapci0
ata3: SATA connect status=00000000
ata3: [MPSAFE]
ata3: [ITHREAD]
ata4: <ATA channel 2> on atapci0
ata4: SATA connect status=00000000
ata4: [MPSAFE]
ata4: [ITHREAD]
ata5: <ATA channel 3> on atapci0
ata5: SATA connect status=00000000
ata5: [MPSAFE]
ata5: [ITHREAD]

atapci1: <ATI IXP600 UDMA133 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x8420-0x842f at device 20.1 on pci0
atapci1: Reserved 0x10 bytes for rid 0x20 type 4 at 0x8420
ata0: <ATA channel 0> on atapci1
atapci1: Reserved 0x8 bytes for rid 0x10 type 4 at 0x1f0
atapci1: Reserved 0x1 bytes for rid 0x14 type 4 at 0x3f6
ata0: reset tp1 mask=03 ostat0=50 ostat1=01
ata0: stat0=0x10 err=0x01 lsb=0x14 msb=0xeb
ata0: stat1=0x01 err=0x04 lsb=0x00 msb=0x00
ata0: reset tp2 stat0=10 stat1=01 devices=0x4<ATAPI_MASTER>
ioapic0: routing intpin 14 (ISA IRQ 14) to vector 54
ata0: [MPSAFE]
ata0: [ITHREAD]
ata1: <ATA channel 1> on atapci1
atapci1: Reserved 0x8 bytes for rid 0x18 type 4 at 0x170
atapci1: Reserved 0x1 bytes for rid 0x1c type 4 at 0x376
ata1: reset tp1 mask=00 ostat0=ff ostat1=ff
ioapic0: routing intpin 15 (ISA IRQ 15) to vector 55
ata1: [MPSAFE]
ata1: [ITHREAD]

ata0-master: pio=PIO4 wdma=WDMA2 udma=UDMA33 cable=40 wire
acd0: setting PIO4 on IXP600 chip
acd0: setting UDMA33 on IXP600 chip
acd0: <TSSTcorp DVD+/-RW TS-L632D/DE04> DVDR drive at ata0 as master
acd0: read 4134KB/s (4134KB/s) write 172KB/s (4134KB/s), 2048KB buffer, UDMA33
acd0: Reads: CDR, CDRW, CDDA stream, DVDROM, DVDR, packet
acd0: Writes: CDR, CDRW, DVDR, test write, burnproof
acd0: Audio: play, 256 volume levels
acd0: Mechanism: ejectable tray, unlocked
acd0: Medium: no/blank disc

ata2-master: pio=PIO4 wdma=WDMA2 udma=UDMA133 cable=40 wire
ad4: 57231MB <Seagate ST96812AS 8.04> at ata2-master SATA150
ad4: 117210240 sectors [116280C/16H/63S] 16 sectors/interrupt 1 depth queue


$ atacontrol list
ATA channel 0:
    Master: acd0 <TSSTcorp DVD+/-RW TS-L632D/DE04> ATA/ATAPI revision 0
    Slave:       no device present
ATA channel 1:
    Master:      no device present
    Slave:       no device present
ATA channel 2:
    Master:  ad4 <ST96812AS/8.04> Serial ATA v1.0
    Slave:       no device present
ATA channel 3:
    Master:      no device present
    Slave:       no device present
ATA channel 4:
    Master:      no device present
    Slave:       no device present
ATA channel 5:
    Master:      no device present
    Slave:       no device present

$ atacontrol mode acd0
current mode = UDMA33

$ atacontrol mode ad4
current mode = SATA150
>How-To-Repeat:

>Fix:
--- sys/dev/ata/ata-pci.h.orig	Sat Mar 10 00:23:39 2007
+++ sys/dev/ata/ata-pci.h	Wed May 30 19:40:45 2007
@@ -102,6 +102,8 @@
 #define ATA_ATI_IXP300_S1       0x436e1002
 #define ATA_ATI_IXP400_S1       0x43791002
 #define ATA_ATI_IXP400_S2       0x437a1002
+#define ATA_ATI_IXP600_S1       0x43801002
+#define ATA_ATI_IXP600          0x438c1002
 
 #define ATA_CENATEK_ID          0x16ca
 #define ATA_CENATEK_ROCKET      0x000116ca
--- sys/dev/ata/ata-chipset.c.orig	Sun Apr  8 22:18:51 2007
+++ sys/dev/ata/ata-chipset.c	Thu May 31 13:48:38 2007
@@ -1261,6 +1261,8 @@
      { ATA_ATI_IXP300_S1, 0x00, SIIMEMIO, 0, ATA_SA150, "IXP300" },
      { ATA_ATI_IXP400_S1, 0x00, SIIMEMIO, 0, ATA_SA150, "IXP400" },
      { ATA_ATI_IXP400_S2, 0x00, SIIMEMIO, 0, ATA_SA150, "IXP400" },
+     { ATA_ATI_IXP600,    0x00, 0,        0, ATA_UDMA6, "IXP600" },
+     { ATA_ATI_IXP600_S1, 0x00, 0,        0, ATA_SA300, "IXP600" },
      { 0, 0, 0, 0, 0, 0}};
     char buffer[64];
 
@@ -1288,7 +1290,20 @@
     if (ata_setup_interrupt(dev))
 	return ENXIO;
 
-    ctlr->setmode = ata_ati_setmode;
+    /* ATI IXP SB600 Serial ATA is actually an AHCI compatible controller */
+    if (ctlr->chip->chipid == ATA_ATI_IXP600_S1) {
+        ctlr->r_type2 = SYS_RES_MEMORY;
+        ctlr->r_rid2 = PCIR_BAR(5);
+        if ((ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2,
+                                                   &ctlr->r_rid2, RF_ACTIVE))) {
+            return ata_ahci_chipinit(dev);
+	}
+	else
+	    return ENXIO;
+    }
+    else
+        ctlr->setmode = ata_ati_setmode;
+
     return 0;
 }
 


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705311250.l4VCoPMj087237>