summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2005-04-10 10:20:25 +0000
committersos <sos@FreeBSD.org>2005-04-10 10:20:25 +0000
commit88401dacc6b4256511dcf9a03810797c242b0972 (patch)
tree5b938778a67d7148dcfcf971fa3ca5e15b1f0c0b /sys
parentebd6b162f88b784455e9995a341013d78332cbc0 (diff)
downloadFreeBSD-src-88401dacc6b4256511dcf9a03810797c242b0972.zip
FreeBSD-src-88401dacc6b4256511dcf9a03810797c242b0972.tar.gz
Refine the SATA PHY code so the time consumed during probe is reduced.
Add the older nVidia nForce2 SATA chip to supported HW.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ata/ata-all.h2
-rw-r--r--sys/dev/ata/ata-chipset.c22
-rw-r--r--sys/dev/ata/ata-pci.h1
3 files changed, 15 insertions, 10 deletions
diff --git a/sys/dev/ata/ata-all.h b/sys/dev/ata/ata-all.h
index 0e794de..c749d74 100644
--- a/sys/dev/ata/ata-all.h
+++ b/sys/dev/ata/ata-all.h
@@ -149,7 +149,7 @@
#define ATA_SCONTROL 15
#define ATA_SC_DET_MASK 0x0000000f
-#define ATA_SC_DET_NO_DEVICE 0x00000000
+#define ATA_SC_DET_IDLE 0x00000000
#define ATA_SC_DET_RESET 0x00000001
#define ATA_SC_DET_DISABLE 0x00000004
diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c
index 2150867..a880c73 100644
--- a/sys/dev/ata/ata-chipset.c
+++ b/sys/dev/ata/ata-chipset.c
@@ -255,26 +255,29 @@ ata_sata_phy_enable(struct ata_channel *ch)
{
int loop, retry;
- if ((ATA_IDX_INL(ch, ATA_SCONTROL) & ATA_SC_DET_MASK) == 0 &&
- ata_sata_connect(ch))
+ if ((ATA_IDX_INL(ch, ATA_SCONTROL) &
+ ATA_SC_DET_MASK) == ATA_SC_DET_IDLE) {
+ ata_sata_connect(ch);
return;
+ }
for (retry = 0; retry < 10; retry++) {
for (loop = 0; loop < 10; loop++) {
- ATA_IDX_OUTL(ch, ATA_SCONTROL, 1);
+ ATA_IDX_OUTL(ch, ATA_SCONTROL, ATA_SC_DET_RESET);
ata_udelay(100);
- if ((ATA_IDX_INL(ch, ATA_SCONTROL) & ATA_SC_DET_MASK) == 1)
+ if ((ATA_IDX_INL(ch, ATA_SCONTROL) &
+ ATA_SC_DET_MASK) == ATA_SC_DET_RESET)
break;
}
ata_udelay(5000);
for (loop = 0; loop < 10; loop++) {
- ATA_IDX_OUTL(ch, ATA_SCONTROL, 0);
+ ATA_IDX_OUTL(ch, ATA_SCONTROL, ATA_SC_DET_IDLE);
ata_udelay(100);
- if ((ATA_IDX_INL(ch, ATA_SCONTROL) & ATA_SC_DET_MASK) == 0)
- break;
+ if ((ATA_IDX_INL(ch, ATA_SCONTROL) & ATA_SC_DET_MASK) == 0) {
+ ata_sata_connect(ch);
+ return;
+ }
}
- if (ata_sata_connect(ch))
- break;
}
}
@@ -1416,6 +1419,7 @@ ata_nvidia_ident(device_t dev)
{{ ATA_NFORCE1, 0, AMDNVIDIA, NVIDIA, ATA_UDMA5, "nVidia nForce" },
{ ATA_NFORCE2, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce2" },
{ ATA_NFORCE2_MCP, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce2 MCP" },
+ { ATA_NFORCE2_MCP_S1, 0, 0, 0, ATA_SA150, "nVidia nForce2 MCP" },
{ ATA_NFORCE3, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce3" },
{ ATA_NFORCE3_PRO, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce3 Pro" },
{ ATA_NFORCE3_PRO_S1, 0, 0, 0, ATA_SA150, "nVidia nForce3 Pro" },
diff --git a/sys/dev/ata/ata-pci.h b/sys/dev/ata/ata-pci.h
index e777f7f..c8ae582 100644
--- a/sys/dev/ata/ata-pci.h
+++ b/sys/dev/ata/ata-pci.h
@@ -155,6 +155,7 @@ struct ata_connect_task {
#define ATA_NFORCE1 0x01bc10de
#define ATA_NFORCE2 0x006510de
#define ATA_NFORCE2_MCP 0x008510de
+#define ATA_NFORCE2_MCP_S1 0x008e10de
#define ATA_NFORCE3 0x00d510de
#define ATA_NFORCE3_PRO 0x00e510de
#define ATA_NFORCE3_PRO_S1 0x00e310de
OpenPOWER on IntegriCloud