Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Nov 2007 15:34:34 -0800
From:      Xin LI <delphij@delphij.net>
To:        freebsd-current@freebsd.org
Subject:   ATI SB600/700/800 tester wanted
Message-ID:  <4730FA0A.8020601@delphij.net>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------020302030509000806090307
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Here is a patch that adds ATI SB600/SB700/SB800 (except RAID5, I don't
have taken a look at the support material yet) support to ata(4).  After
this patch the driver is supposed to support the following mode:

	ATA_ATI_SB600 (IDE mode)
	ATA_ATI_SB600 (non-RAID5 mode)
	ATA_ATI_SB700 (All mode except RAID-5)
	ATA_ATI_SB800

Please let me know if you have the hardware and whether the patch works
or not (be sure to include your pciconf -l | grep atapci output and
dmesg.boot).  Thanks!

Cheers,
- --
Xin LI <delphij@delphij.net>	http://www.delphij.net/
FreeBSD - The Power to Serve!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHMPoKhcUczkLqiksRAjtwAJ42o00gszaewJVqsQAYHFZmp5D9GQCg4hS6
hew855Gt9NSIH/71jkmUXWs=
=/R75
-----END PGP SIGNATURE-----

--------------020302030509000806090307
Content-Type: text/x-patch;
 name="ati.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ati.diff"

Index: ata-chipset.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-chipset.c,v
retrieving revision 1.203
diff -u -p -r1.203 ata-chipset.c
--- ata-chipset.c	26 Oct 2007 09:01:06 -0000	1.203
+++ ata-chipset.c	6 Nov 2007 23:24:56 -0000
@@ -1290,12 +1290,20 @@ ata_ati_ident(device_t dev)
     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_SB600,     0x00, 0,        0,         ATA_UDMA6, "SB600 (IDE MODE)" },
+     { ATA_ATI_SB700,     0x00, 0,        0,         ATA_UDMA6, "SB700 (IDE)" },
+     { 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_SB600_S1,  0x00, 0,        ATIAHCI,   ATA_SA300, "SB600 (Non RAID5 SATA)" },
+     { ATA_ATI_SB700_S1,  0x00, 0,        ATIAHCI,   ATA_SA300, "SB700 (IDE MODE)" },
+     { ATA_ATI_SB700_S2,  0x00, 0,        ATIAHCI,   ATA_SA300, "SB700 (IDE MODE)" },
+     { ATA_ATI_SB700_AH,  0x00, 0,        ATIAHCI,   ATA_SA300, "SB700 (AHCI MODE)" },
+     { ATA_ATI_SB700_NR,  0x00, 0,        ATIAHCI,   ATA_SA300, "SB700 (Non RAID5 SATA)" },
+     { ATA_ATI_SB800_AH,  0x00, 0,        ATIAHCI,   ATA_SA300, "SB800 (AHCI MODE)" },
      { 0, 0, 0, 0, 0, 0}};
     char buffer[64];
 
@@ -1323,6 +1331,17 @@ ata_ati_chipinit(device_t dev)
     if (ata_setup_interrupt(dev))
 	return ENXIO;
 
+    if (ctlr->chip->cfg2 & ATIAHCI) {
+	ctlr->r_rid2 = PCIR_BAR(5);
+	ctlr->r_type2 = SYS_RES_MEMORY;
+	ctlr->r_res2 = bus_alloc_resource_any(dev,
+			   ctlr->r_type2, &ctlr->r_rid2, RF_ACTIVE);
+	if (ctlr->r_res2 != NULL)
+	    return ata_ahci_chipinit(dev);
+	else
+	    return ENXIO;
+    }
+
     ctlr->setmode = ata_ati_setmode;
     return 0;
 }
Index: ata-pci.h
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-pci.h,v
retrieving revision 1.81
diff -u -p -r1.81 ata-pci.h
--- ata-pci.h	9 Oct 2007 20:15:09 -0000	1.81
+++ ata-pci.h	6 Nov 2007 23:25:00 -0000
@@ -103,6 +103,14 @@ struct ata_connect_task {
 #define ATA_ATI_IXP300_S1       0x436e1002
 #define ATA_ATI_IXP400_S1       0x43791002
 #define ATA_ATI_IXP400_S2       0x437a1002
+#define ATA_ATI_SB600_S1        0x43801002
+#define ATA_ATI_SB600           0x438c1002
+#define ATA_ATI_SB700_S1        0x43901002
+#define ATA_ATI_SB700_AH        0x43911002
+#define ATA_ATI_SB700_NR        0x43921002
+#define ATA_ATI_SB700_S2        0x43941002
+#define ATA_ATI_SB800_AH        0x43951002
+#define ATA_ATI_SB700           0x439c1002
 
 #define ATA_CENATEK_ID          0x16ca
 #define ATA_CENATEK_ROCKET      0x000116ca
@@ -436,6 +444,7 @@ struct ata_connect_task {
 #define VIABUG          0x0200
 #define VIABAR          0x0400
 #define VIAAHCI         0x0800
+#define ATIAHCI         0x1000
 
 
 /* global prototypes ata-pci.c */

--------------020302030509000806090307--



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