

Patch from James Curbo <phoenix@sandwich.net>

The amd74xx IDE driver in 2.5.59 has support for the nforce IDE controller,
but not explicitly for the nforce2 IDE controller (which has a different PCI
ID, which is in the kernel already).  I'm not sure if the nforce and nforce2
controllers are identical, but I made a small patch that made the amd74xx
driver recognize the nforce2 IDE, and it boots for me, seems to work fine, as
my drives were tuned to their highest transfer rate automatically (udma5).  

I don't know if this patch is proper or correct, but it Works for Me [tm]. 
Patch is attached.

Vojtech has acked this change.


 ide/pci/amd74xx.c |    3 ++-
 ide/pci/amd74xx.h |   14 ++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff -puN drivers/ide/pci/amd74xx.c~nforce2-support drivers/ide/pci/amd74xx.c
--- 25/drivers/ide/pci/amd74xx.c~nforce2-support	2003-02-07 00:07:12.000000000 -0800
+++ 25-akpm/drivers/ide/pci/amd74xx.c	2003-02-07 00:07:12.000000000 -0800
@@ -60,7 +60,7 @@ static struct amd_ide_chip {
 	{ PCI_DEVICE_ID_AMD_OPUS_7441, 0x00, 0x40, AMD_UDMA_100 },			/* AMD-768 Opus */
 	{ PCI_DEVICE_ID_AMD_8111_IDE,  0x00, 0x40, AMD_UDMA_100 },			/* AMD-8111 */
         { PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, 0x00, 0x50, AMD_UDMA_100 },                  /* nVidia nForce */
-
+	{ PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, 0x00, 0x50, AMD_UDMA_100 },			/* nVidia nForce 2 */
 	{ 0 }
 };
 
@@ -446,6 +446,7 @@ static struct pci_device_id amd74xx_pci_
 	{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_OPUS_7441,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
 	{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_IDE, 	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5},
+	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6},
 	{ 0, },
 };
 
diff -puN drivers/ide/pci/amd74xx.h~nforce2-support drivers/ide/pci/amd74xx.h
--- 25/drivers/ide/pci/amd74xx.h~nforce2-support	2003-02-07 00:07:12.000000000 -0800
+++ 25-akpm/drivers/ide/pci/amd74xx.h	2003-02-07 00:07:12.000000000 -0800
@@ -110,6 +110,20 @@ static ide_pci_device_t amd74xx_chipsets
 		.bootable	= ON_BOARD,
 		.extra		= 0,
 	},
+	{	/* 6 */
+		.vendor		= PCI_VENDOR_ID_NVIDIA,
+		.device		= PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE,
+		.name		= "NFORCE2",
+		.init_chipset	= init_chipset_amd74xx,
+		.init_iops	= NULL,
+		.init_hwif	= init_hwif_amd74xx,
+		.init_dma	= init_dma_amd74xx,
+		.channels	= 2,
+		.autodma	= AUTODMA,
+		.enablebits	= {{0x50,0x01,0x01}, {0x50,0x02,0x02}},
+		.bootable	= ON_BOARD,
+		.extra		= 0,
+	},
 	{
 		.vendor		= 0,
 		.device		= 0,

_
