aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ahci
diff options
context:
space:
mode:
authorSteven Hartland <smh@FreeBSD.org>2015-02-01 20:00:08 +0000
committerSteven Hartland <smh@FreeBSD.org>2015-02-01 20:00:08 +0000
commitb1877a0b397cfb5e96d8b3d319e80e68d04f7950 (patch)
treea86fe4659cb37f83ee6e66e2de7376efb9e48f89 /sys/dev/ahci
parent59f8cb6368a6a5ae6459813a176aa4ffecaad7dc (diff)
Notes
Diffstat (limited to 'sys/dev/ahci')
-rw-r--r--sys/dev/ahci/ahci.h40
-rw-r--r--sys/dev/ahci/ahci_pci.c24
2 files changed, 37 insertions, 27 deletions
diff --git a/sys/dev/ahci/ahci.h b/sys/dev/ahci/ahci.h
index 79b8a5695d5e..755fdc594eb8 100644
--- a/sys/dev/ahci/ahci.h
+++ b/sys/dev/ahci/ahci.h
@@ -556,26 +556,27 @@ enum ahci_err_type {
bus_write_multi_stream_4((res), (offset), (addr), (count))
-#define AHCI_Q_NOFORCE 1
-#define AHCI_Q_NOPMP 2
-#define AHCI_Q_NONCQ 4
-#define AHCI_Q_1CH 8
-#define AHCI_Q_2CH 0x10
-#define AHCI_Q_4CH 0x20
-#define AHCI_Q_EDGEIS 0x40
-#define AHCI_Q_SATA2 0x80
-#define AHCI_Q_NOBSYRES 0x100
-#define AHCI_Q_NOAA 0x200
-#define AHCI_Q_NOCOUNT 0x400
-#define AHCI_Q_ALTSIG 0x800
-#define AHCI_Q_NOMSI 0x1000
-#define AHCI_Q_ATI_PMP_BUG 0x2000
-#define AHCI_Q_MAXIO_64K 0x4000
-#define AHCI_Q_SATA1_UNIT0 0x8000 /* need better method for this */
-#define AHCI_Q_ABAR0 0x10000
+#define AHCI_Q_NOFORCE 0x00000001
+#define AHCI_Q_NOPMP 0x00000002
+#define AHCI_Q_NONCQ 0x00000004
+#define AHCI_Q_1CH 0x00000008
+#define AHCI_Q_2CH 0x00000010
+#define AHCI_Q_4CH 0x00000020
+#define AHCI_Q_EDGEIS 0x00000040
+#define AHCI_Q_SATA2 0x00000080
+#define AHCI_Q_NOBSYRES 0x00000100
+#define AHCI_Q_NOAA 0x00000200
+#define AHCI_Q_NOCOUNT 0x00000400
+#define AHCI_Q_ALTSIG 0x00000800
+#define AHCI_Q_NOMSI 0x00001000
+#define AHCI_Q_ATI_PMP_BUG 0x00002000
+#define AHCI_Q_MAXIO_64K 0x00004000
+#define AHCI_Q_SATA1_UNIT0 0x00008000 /* need better method for this */
+#define AHCI_Q_ABAR0 0x00010000
+#define AHCI_Q_1MSI 0x00020000
#define AHCI_Q_BIT_STRING \
- "\020" \
+ "\021" \
"\001NOFORCE" \
"\002NOPMP" \
"\003NONCQ" \
@@ -592,7 +593,8 @@ enum ahci_err_type {
"\016ATI_PMP_BUG" \
"\017MAXIO_64K" \
"\020SATA1_UNIT0" \
- "\021ABAR0"
+ "\021ABAR0" \
+ "\0221MSI"
int ahci_attach(device_t dev);
int ahci_detach(device_t dev);
diff --git a/sys/dev/ahci/ahci_pci.c b/sys/dev/ahci/ahci_pci.c
index 8574e47a7741..acde18dd29b2 100644
--- a/sys/dev/ahci/ahci_pci.c
+++ b/sys/dev/ahci/ahci_pci.c
@@ -55,12 +55,17 @@ static const struct {
int quirks;
} ahci_ids[] = {
{0x43801002, 0x00, "AMD SB600",
- AHCI_Q_NOMSI | AHCI_Q_ATI_PMP_BUG | AHCI_Q_MAXIO_64K},
- {0x43901002, 0x00, "AMD SB7x0/SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG},
- {0x43911002, 0x00, "AMD SB7x0/SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG},
- {0x43921002, 0x00, "AMD SB7x0/SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG},
- {0x43931002, 0x00, "AMD SB7x0/SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG},
- {0x43941002, 0x00, "AMD SB7x0/SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG},
+ AHCI_Q_NOMSI | AHCI_Q_ATI_PMP_BUG | AHCI_Q_MAXIO_64K},
+ {0x43901002, 0x00, "AMD SB7x0/SB8x0/SB9x0",
+ AHCI_Q_ATI_PMP_BUG | AHCI_Q_1MSI},
+ {0x43911002, 0x00, "AMD SB7x0/SB8x0/SB9x0",
+ AHCI_Q_ATI_PMP_BUG | AHCI_Q_1MSI},
+ {0x43921002, 0x00, "AMD SB7x0/SB8x0/SB9x0",
+ AHCI_Q_ATI_PMP_BUG | AHCI_Q_1MSI},
+ {0x43931002, 0x00, "AMD SB7x0/SB8x0/SB9x0",
+ AHCI_Q_ATI_PMP_BUG | AHCI_Q_1MSI},
+ {0x43941002, 0x00, "AMD SB7x0/SB8x0/SB9x0",
+ AHCI_Q_ATI_PMP_BUG | AHCI_Q_1MSI},
/* Not sure SB8x0/SB9x0 needs this quirk. Be conservative though */
{0x43951002, 0x00, "AMD SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG},
{0x78001022, 0x00, "AMD Hudson-2", 0},
@@ -137,7 +142,7 @@ static const struct {
{0x1f378086, 0x00, "Intel Avoton (RAID)", 0},
{0x1f3e8086, 0x00, "Intel Avoton (RAID)", 0},
{0x1f3f8086, 0x00, "Intel Avoton (RAID)", 0},
- {0x23a38086, 0x00, "Intel Coleto Creek", 0},
+ {0x23a38086, 0x00, "Intel Coleto Creek", 0},
{0x28238086, 0x00, "Intel Wellsburg (RAID)", 0},
{0x28278086, 0x00, "Intel Wellsburg (RAID)", 0},
{0x8c028086, 0x00, "Intel Lynx Point", 0},
@@ -410,10 +415,13 @@ ahci_pci_attach(device_t dev)
/* Setup interrupts. */
/* Setup MSI register parameters */
- ctlr->msi = 2;
/* Process hints. */
if (ctlr->quirks & AHCI_Q_NOMSI)
ctlr->msi = 0;
+ else if (ctlr->quirks & AHCI_Q_1MSI)
+ ctlr->msi = 1;
+ else
+ ctlr->msi = 2;
resource_int_value(device_get_name(dev),
device_get_unit(dev), "msi", &ctlr->msi);
ctlr->numirqs = 1;