New Nforce2 variant doesn't recognize SATA as SATA

security at daemon.jim-liesl.org security at daemon.jim-liesl.org
Sun Mar 13 12:55:14 PST 2005


Quoting Michael Lednev <liettneff at bk.ru>:

> Hello, secmgr.
>
> On 12 ìàðòà 2005 ã., 1:52:50 you wrote:
>
> you can look here http://www.freebsd.org/cgi/query-pr.cgi?pr=75540
> this patch adds support for nforce3 and 4 sata controllers, i think
> with little modification it will do for nforce2
>
Michael,
    Many thanks!  I'll include my diff's below from 5.3 release

diff -Naur sys/dev/ata/ata-pci.h.orig sys/dev/ata/ata-pci.h
--- sys/dev/ata/ata-pci.h.orig  Thu Mar 10 14:02:23 2005
+++ sys/dev/ata/ata-pci.h       Sun Mar 13 12:18:14 2005
@@ -132,6 +132,7 @@
  #define ATA_NFORCE1            0x01bc10de
  #define ATA_NFORCE2            0x006510de
  #define ATA_NFORCE2_MCP                0x008510de
+#define ATA_NFORCE2_MCP_S2     0x008e10de
  #define ATA_NFORCE3            0x00d510de
  #define ATA_NFORCE3_PRO                0x00e510de
  #define ATA_NFORCE3_PRO_S1     0x00e310de


diff -Naur sys/dev/ata/ata-chipset.c.orig sys/dev/ata/ata-chipset.c
--- sys/dev/ata/ata-chipset.c.orig      Sun Mar 13 12:20:03 2005
+++ sys/dev/ata/ata-chipset.c   Sun Mar 13 12:57:03 2005
@@ -1112,6 +1112,7 @@
      {{ 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_S2, 0, AMDNVIDIA, NVIDIA, ATA_SA150, "nVidia nForce2
MCP_S2" },
       { ATA_NFORCE3,     0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce3" },
       { ATA_NFORCE3_PRO, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce3 Pro"
},
       { ATA_NFORCE3_MCP, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce3 MCP"
},
@@ -2861,9 +2862,17 @@
  static int
  ata_check_80pin(struct ata_device *atadev, int mode)
  {
+    device_t parent = device_get_parent(atadev->channel->dev);
+    struct ata_pci_controller *ctlr = device_get_softc(parent);
+
+    if (mode >= ATA_UDMA2 && mode < ATA_SA150 && ctlr->chip->max_dma >=
ATA_SA150) {
+       ata_prtdev(atadev,"DMA set to SA150 for any device attached to SATA
controller\n");
+       return ATA_SA150;
+    }
+
      if (mode > ATA_UDMA2 && !(atadev->param->hwres & ATA_CABLE_ID)) {
         ata_prtdev(atadev,"DMA limited to UDMA33, non-ATA66 cable or 
device\n");
-       mode = ATA_UDMA2;
+       return ATA_UDMA2;
      }
      return mode;
  }





----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the freebsd-stable mailing list