diff -ur -x .* -x*.o -x zImage* -x vmlinu* linuxppc_2_4_devel/arch/ppc/kernel/prep_pci.c linuxppc_2_4_devel-140/arch/ppc/kernel/prep_pci.c
--- linuxppc_2_4_devel/arch/ppc/kernel/prep_pci.c	Sat Sep 22 17:42:31 2001
+++ linuxppc_2_4_devel-140/arch/ppc/kernel/prep_pci.c	Sat Sep 22 19:38:06 2001
@@ -1134,6 +1134,146 @@
 	prep_route_pci_interrupts();
 
 	printk("Setting PCI interrupts for a \"%s\"\n", Motherboard_map_name);
+
+	if (strcmp(Motherboard_map_name, "IBM 43p/140")==0) {
+#define IBM140_MEM_OFFSET (/*0xfeffffff*/0xf7ffffff - 0x7fffffff) /* Add this to mem BARs */
+   		struct resource *res;
+
+   		printk("ibm140_pcibios_fixup: start mem_offset=%x\n", IBM140_MEM_OFFSET);
+   		pci_for_each_dev(dev) {
+			printk("Device %x.%x vendor %04x device %04x\n", dev->bus->number, dev->devfn>>3, dev->vendor, dev->device);
+			printk("  fixup irq %d->%d\n", dev->irq, dev->irq+NUM_8259_INTERRUPTS);
+			dev->irq += NUM_8259_INTERRUPTS;	/* openpic value */
+			/* Move the device's base address registers */
+			for (i = 0; i < 6; i++) {
+				res = dev->resource + i;
+				if (!res->start)
+					continue;
+				if (res->flags & IORESOURCE_IO) {
+					/* I/O BARs are out of range from prep.  Move them. */
+		    			int old_start = res->start; /* for debug */
+		    			int old_end = res->end;
+		    			res->start &= 0xffffff;	/* 16MB I/O space */
+		    			res->end &= 0xffffff;
+		    			printk("  fixup io res, dev: %x.%x, res_start: 0x%x->0x%x, res_end: 0x%x->0x%x\n",
+							dev->bus->number, dev->devfn>>3, old_start,
+						       	res->start, old_end, res->end);
+				       	pci_write_config_dword(dev, PCI_BASE_ADDRESS_0+(i*0x4), res->start);
+			       	} else {
+				       	/* Memory BARs are not quite so bad, but they are
+					 * assigned in the first GB of space.
+					 */ 
+					if ((res->flags & IORESOURCE_MEM)  && (res->start < 0x40000000)) {
+					       	int old_start = res->start; /* for debug */
+					       	int old_end = res->end;
+					       	res->start += IBM140_MEM_OFFSET;
+					       	res->end += IBM140_MEM_OFFSET;
+					       	printk("  fixup mem res, dev: %x.%x, res_start: 0x%x->0x%x, res_end: 0x%x->0x%x\n",
+							       	dev->bus->number, dev->devfn>>3, old_start,
+							       	res->start, old_end, res->end);
+					       	pci_write_config_dword(dev, PCI_BASE_ADDRESS_0+(i*0x4), res->start);
+				       	}
+			       	}
+		       	}
+		       
+			/* Also move the expansion ROM if necessary */
+		       	res = dev->resource + PCI_ROM_RESOURCE;
+		       	if (res && res->start) {
+			       	printk("  need to move expansion rom addr 0x%x->", res->start);
+			       	res->start += IBM140_MEM_OFFSET;
+			       	res->end += IBM140_MEM_OFFSET;
+			       	printk("0x%x\n", res->start);
+			       	pci_write_config_dword(dev, PCI_ROM_ADDRESS, res->start);
+		       	}
+		       	/* Watch for a pci-pci bridge */
+		       	if (dev->hdr_type == 1 && dev->subordinate) {
+			       	struct pci_bus *sub = dev->subordinate;
+			       	int j;
+			       	struct resource *subres;
+			       	unsigned char bval;
+			       	unsigned short sval;
+			       	int needs_reloc = 0;
+
+				printk("  Subordinate bus info:\n");
+			       	for (j = 0; j < 4; j++) {
+				       	subres = sub->resource[j];
+				       	if (subres && subres->start) {
+					       	needs_reloc = 1;
+					       	if (subres->flags & IORESOURCE_IO) {
+						       	printk("    move io resource 0x%x->", subres->start);
+						       	subres->start &= 0xffffff;	/* 16MB I/O space */
+						       	subres->end &= 0xffffff;
+						       	printk("0x%x\n", subres->start);
+					       	} else if (subres->flags & IORESOURCE_MEM) {
+						       	printk("    move mem resource 0x%x->", subres->start);
+						       	subres->start += IBM140_MEM_OFFSET;
+						       	subres->end += IBM140_MEM_OFFSET;
+						       	printk("0x%x\n", subres->start);
+					       	}
+				       	}
+			       	}
+			       	/* Now reprogram config space to reflect the new resources.
+				 * Note that we may not need relocation if linux has already
+				 * found nothing beyond the bridge.  Then it's better to
+				 * just leave it alone.
+				 */
+			       	if (needs_reloc) {
+				       	/* For debug print IO bases.  Shouldn't need to change these. */
+				       	pci_read_config_byte(dev, PCI_IO_BASE, &bval);
+				       	printk("  PCI_IO_BASE=0x%02x\n", bval);
+				       	pci_read_config_byte(dev, PCI_IO_LIMIT, &bval);
+				       	printk("  PCI_IO_LIMIT=0x%02x\n", bval);
+
+					/* The IO upper halfwords need to be updated. */
+				       	pci_read_config_word(dev, PCI_IO_BASE_UPPER16, &sval);
+				       	printk("  PCI_IO_BASE_UPPER16=0x%04x->", sval);
+				       	sval &= ((unsigned)0xffffff >> 16);
+				       	printk("0x%04x\n", sval);
+				       	pci_write_config_word(dev, PCI_IO_BASE_UPPER16, sval);
+
+					pci_read_config_word(dev, PCI_IO_LIMIT_UPPER16, &sval);
+				       	printk("  PCI_IO_LIMIT_UPPER16=0x%04x->", sval);
+				       	sval &= ((unsigned)0xffffff >> 16);
+				       	printk("0x%04x\n", sval);
+				       	pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16, sval);
+
+					/* Slide up memory base to match moved bars. */
+				       	pci_read_config_word(dev, PCI_MEMORY_BASE, &sval);
+				       	printk("  PCI_MEMORY_BASE=0x%04x->", sval);
+				       	sval += ((unsigned)IBM140_MEM_OFFSET >> 16);
+				       	printk("0x%04x\n", sval);
+				       	pci_write_config_word(dev, PCI_MEMORY_BASE, sval);
+
+					pci_read_config_word(dev, PCI_MEMORY_LIMIT, &sval);
+				       	printk("  PCI_MEMORY_LIMIT=0x%04x->", sval);
+				       	sval += ((unsigned)IBM140_MEM_OFFSET >> 16);
+				       	printk("0x%04x\n", sval);
+				       	pci_write_config_word(dev, PCI_MEMORY_LIMIT, sval);
+
+					/* Print these for debug.  They are not defined on the 140 */
+				       	pci_read_config_word(dev, PCI_PREF_MEMORY_BASE, &sval);
+				       	printk("  PCI_PREF_MEMORY_BASE=0x%04x\n", sval);
+				       	pci_read_config_word(dev, PCI_PREF_MEMORY_LIMIT, &sval);
+				       	printk("  PCI_PREF_MEMORY_LIMIT=0x%04x\n", sval);
+			       	}
+		       	}
+			/* printk("  enable this device\n");
+			pci_enable_device(dev); */
+#if 0
+		       	/* Dump device */
+		       	printk("  Dump of device %x.%x\n", dev->bus->number, dev->devfn>>3);
+		       	for (i = 0; i < 100; i += 4) {
+			       	unsigned int val;
+			       	pci_read_config_dword(dev, i, &val);
+				printk("    %03d: %08x\n", i, val);
+		       	}
+#endif
+	       	}
+	       	printk("ibm140_pcibios_fixup: finish\n");
+
+		return;
+	}
+
 	if (OpenPIC_Addr) {
 		/* PCI interrupts are controlled by the OpenPIC */
 		pci_for_each_dev(dev) {
