kern/116125: ata(4) driver: support for ATi IXP600/700 PATA/SATA
added
Pavel Gubin
pg at 2lazy.ru
Wed Sep 5 09:00:10 PDT 2007
>Number: 116125
>Category: kern
>Synopsis: ata(4) driver: support for ATi IXP600/700 PATA/SATA added
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Wed Sep 05 16:00:09 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Pavel Gubin
>Release: 6.2 (patch also apllies to -current)
>Organization:
TUSUR
>Environment:
FreeBSD hammer.2lazy.ru 6.2-RELEASE-p7 FreeBSD 6.2-RELEASE-p7 #3: Wed Sep 5 22:09:15 TSD 2007 pg at hammer.2lazy.ru:/var/data/obj/var/data/6s/src/sys/Hammer i386
>Description:
The current code of ata(4) does not know about new ATi southbridges SB600/700 (IXP600/700), so this patch adds support for them.
Tested on Gigabyte GA-MA69VM-S2 m/b (SB600) and 6.2R and found working.
Also tested that this patch correctly applies (with some offset) to ata code from current.
>How-To-Repeat:
>Fix:
Apply the patch attached.
Patch attached with submission follows:
--- ata-pci.h.orig Sat Sep 30 21:51:49 2006
+++ ata-pci.h Wed Sep 5 22:00:21 2007
@@ -102,6 +102,10 @@
#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_ATI_IXP700_S1 0x43901002
+#define ATA_ATI_IXP700 0x439c1002
#define ATA_CENATEK_ID 0x16ca
#define ATA_CENATEK_ROCKET 0x000116ca
@@ -415,6 +419,7 @@
#define VIABUG 0x0200
#define VIABAR 0x0400
#define VIAAHCI 0x0800
+#define ATISINGLE 0x1000
/* global prototypes ata-pci.c */
--- ata-chipset.c.orig Mon Oct 9 23:01:35 2006
+++ ata-chipset.c Wed Sep 5 22:08:02 2007
@@ -1239,12 +1239,16 @@
struct ata_pci_controller *ctlr = device_get_softc(dev);
struct ata_chip_id *idx;
static struct ata_chip_id ids[] =
- {{ ATA_ATI_IXP200, 0x00, 0, 0, ATA_UDMA5, "IXP200" },
- { ATA_ATI_IXP300, 0x00, 0, 0, ATA_UDMA6, "IXP300" },
- { ATA_ATI_IXP400, 0x00, 0, 0, ATA_UDMA6, "IXP400" },
- { 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_IXP200, 0x00, 0, 0, ATA_UDMA5, "IXP200" },
+ { ATA_ATI_IXP300, 0x00, 0, 0, ATA_UDMA6, "IXP300" },
+ { ATA_ATI_IXP400, 0x00, 0, 0, ATA_UDMA6, "IXP400" },
+ { ATA_ATI_IXP600, 0x00, 0, ATISINGLE, ATA_UDMA6, "IXP600" },
+ { ATA_ATI_IXP700, 0x00, 0, ATISINGLE, ATA_UDMA6, "IXP700" },
+ { 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_S1, 0x00, 0, AHCI, ATA_SA300, "IXP600" },
+ { ATA_ATI_IXP700_S1, 0x00, 0, AHCI, ATA_SA300, "IXP700" },
{ 0, 0, 0, 0, 0, 0}};
char buffer[64];
@@ -1271,6 +1275,18 @@
if (ata_setup_interrupt(dev))
return ENXIO;
+
+ if (ctlr->chip->cfg2 & AHCI) {
+ ctlr->r_rid2 = PCIR_BAR(5);
+ ctlr->r_type2 = SYS_RES_MEMORY;
+ if ((ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2,
+ &ctlr->r_rid2,
+ RF_ACTIVE)))
+ return ata_ahci_chipinit(dev);
+ }
+
+ if (ctlr->chip->cfg2 & ATISINGLE)
+ ctlr->channels = 1;
ctlr->setmode = ata_ati_setmode;
return 0;
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list