[ltp] TP 760 ED BIOS issues?

Tino Keitel linux-thinkpad@linux-thinkpad.org
Fri, 16 Jul 2004 15:43:12 +0200


--0OAP2g/MAC+5xKAE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Jul 15, 2004 at 20:11:32 +0100, Max T. Woodbury wrote:
> Tino Keitel wrote:
> > 
> > See the attachment for a patch against 2.4.22.
> 
> attachment? It seems to be missing...

Argl, sorry. Here it is.

Regards,
Tino

--0OAP2g/MAC+5xKAE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="Linux-2.4.22_IDE-DMA_TP765L.patch"

--- linux-2.4.22/drivers/ide/setup-pci.c	2003-08-25 13:44:41.000000000 +0200
+++ linux/drivers/ide/setup-pci.c	2003-09-14 02:40:44.000000000 +0200
@@ -477,6 +477,14 @@
 	    ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE &&
 	     (dev->class & 0x80))) {
 		unsigned long dma_base = ide_get_or_set_dma_base(hwif);
+
+		if((hwif->index == 0) && (dma_base == 0) &&
+		   (d->device == PCI_DEVICE_ID_INTEL_82371FB_0) && (d->vendor == PCI_VENDOR_ID_INTEL)) {
+			printk("%s: force dma_base to 0xfcf0 to enable DMA transfers\n", d->name);
+			printk("%s: on IBM ThinkPad 765L\n", d->name);
+			dma_base = 0xfcf0;
+		}
+		
 		if (dma_base && !(pcicmd & PCI_COMMAND_MASTER)) {
 			/*
  			 * Set up BM-DMA capability
@@ -643,9 +651,16 @@
 		    (secondpdc++==1) && (port==1))
 			goto controller_ok;
 			
-		if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) ||
-		    (tmp & e->mask) != e->val))
-			continue;	/* port not enabled */
+		if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || 
+			       (tmp & e->mask) != e->val)) {
+			if((port == 0) &&
+			   (d->device == PCI_DEVICE_ID_INTEL_82371FB_0) && (d->vendor == PCI_VENDOR_ID_INTEL)) {
+				printk("%s: ignoring disabled ide0 of my IBM ThinkPad 765L\n", d->name);
+			}
+			else {
+				continue;       /* port not enabled */
+			}
+		}
 controller_ok:
 
 		if (d->channels	<= port)

--0OAP2g/MAC+5xKAE--