kern/93369: [PATCH] Fix failed detection of Nvidia NForce2 chipset
Alan Amesbury
amesbury at indefi.net
Tue Feb 14 17:50:07 PST 2006
>Number: 93369
>Category: kern
>Synopsis: [PATCH] Fix failed detection of Nvidia NForce2 chipset
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Wed Feb 15 01:50:06 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Alan Amesbury
>Release: FreeBSD 5.4-RELEASE-p11 i386
>Organization:
University of Minnesota
>Environment:
System: FreeBSD modem.oitsec.umn.edu 5.4-RELEASE-p11 FreeBSD 5.4-RELEASE-p11 #5: Tue Feb 14 18:21:41 CST 2006 root at modem.oitsec.umn.edu:/usr/obj/usr/src/sys/OITSEC-5_4-L i386
MSI K7N2 Delta2-LSR motherboard with Nvidia NForce2 chipset (MCP2S).
>Description:
At boot, FreeBSD identifies the SATA chipset as "GENERIC ATA controller"
with mode of UDMA33. This is VERY similar to PR #71321, but not quite
identical; the chip ID reported by 'pciconf' is different, and the
chipset not being identified correctly is SATA, not PATA.
NOTE: The if-else statement in my patch *appears* to work, i.e., I
haven't noticed any instability having applied this patch. Someone who
knows what they're doing should probably take a closer look.
% pciconf -lv
.
.
.
atapci0 at pci0:9:0: class=0x01018a card=0x57001462 chip=0x008510de rev=0xa3 hdr=0x00
vendor = 'NVIDIA Corporation'
device = 'MCP2S Parallel ATA Controller'
class = mass storage
subclass = ATA
atapci1 at pci0:11:0: class=0x010185 card=0x57001462 chip=0x008e10de rev=0xa3 hdr=0x00
vendor = 'NVIDIA Corporation'
device = 'MCP2S Serial ATA Compatible Controller'
class = mass storage
subclass = ATA
.
.
.
% dmesg | grep ata
atapci0: <nVidia nForce2 MCP UDMA133 controller> port 0xf000-0xf00f,0x376,0x170-0x177,0x3f6,0x1f0-0x1f7 at device 9.0 on pci0
ata0: channel #0 on atapci0
ata1: channel #1 on atapci0
atapci1: <nVidia nForce2 MCP2S UDMA133 controller> port 0xbc00-0xbc0f,0xb70-0xb73,0x970-0x977,0xbf0-0xbf3,0x9f0-0x9f7 irq 22 at device 11.0 on pci0
ata2: channel #0 on atapci1
ata3: channel #1 on atapci1
ad0: 57241MB <ST360014A/3.04> [116301/16/63] at ata0-master UDMA100
acd0: CDROM <FX4830T/R02C> at ata1-master PIO4
ata2-master: DMA limited to UDMA33, non-ATA66 cable or device
ad4: 238475MB <ST3250823AS/3.01> [484521/16/63] at ata2-master UDMA33
>How-To-Repeat:
Boot FreeBSD 5.4-RELEASE-p11 on a similarly equipped motherboard.
>Fix:
These patches to files in /sys/dev/ata appear to fix the problem:
% diff -bu ata-chipset.c.orig ata-chipset.c; diff -bu ata-pci.h.orig ata-pci.h
--- ata-chipset.c.orig Tue Feb 14 18:39:36 2006
+++ ata-chipset.c Tue Feb 14 19:34:01 2006
@@ -1216,6 +1216,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_MCP2S, 0, AMDNVIDIA, NVIDIA, ATA_SA150, "nVidia nForce2 MCP2S" },
{ 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" },
@@ -1244,7 +1245,12 @@
/* disable prefetch, postwrite */
pci_write_config(dev, 0x51, pci_read_config(dev, 0x51, 1) & 0x0f, 1);
+ if (ctlr->chip->max_dma < ATA_SA150) {
ctlr->setmode = ata_via_family_setmode;
+ }
+ else {
+ ctlr->setmode = ata_sata_setmode;
+ }
return 0;
}
--- ata-pci.h.orig Tue Feb 14 18:39:43 2006
+++ ata-pci.h Tue Feb 14 18:51:31 2006
@@ -142,6 +142,7 @@
#define ATA_NFORCE1 0x01bc10de
#define ATA_NFORCE2 0x006510de
#define ATA_NFORCE2_MCP 0x008510de
+#define ATA_NFORCE2_MCP2S 0x008e10de
#define ATA_NFORCE3 0x00d510de
#define ATA_NFORCE3_PRO 0x00e510de
#define ATA_NFORCE3_PRO_S1 0x00e310de
Post-boot dmesg info:
% dmesg | grep ata
atapci0: <nVidia nForce2 MCP UDMA133 controller> port 0xf000-0xf00f,0x376,0x170-0x177,0x3f6,0x1f0-0x1f7 at device 9.0 on pci0
ata0: channel #0 on atapci0
ata1: channel #1 on atapci0
atapci1: <nVidia nForce2 MCP2S SATA150 controller> port 0xbc00-0xbc0f,0xb70-0xb73,0x970-0x977,0xbf0-0xbf3,0x9f0-0x9f7 irq 22 at device 11.0 on pci0
ata2: channel #0 on atapci1
ata3: channel #1 on atapci1
ad0: 57241MB <ST360014A/3.04> [116301/16/63] at ata0-master UDMA100
acd0: CDROM <FX4830T/R02C> at ata1-master PIO4
ad4: 238475MB <ST3250823AS/3.01> [484521/16/63] at ata2-master SATA150
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list