diff -urNX /home/leigh/.diffex prev_linux-2.4.21-rc3/arch/ppc/platforms/prep_pci.c linux-2.4.21-rc3/arch/ppc/platforms/prep_pci.c
--- prev_linux-2.4.21-rc3/arch/ppc/platforms/prep_pci.c	2003-05-24 13:37:46.000000000 +0100
+++ linux-2.4.21-rc3/arch/ppc/platforms/prep_pci.c	2003-05-24 13:42:33.000000000 +0100
@@ -27,6 +27,7 @@
 #define MAX_DEVNR 22
 
 extern void (*setup_ibm_pci)(char *irq_lo, char *irq_hi);
+extern int residual_pcidev_irq(struct pci_dev *dev);
 
 /* Which PCI interrupt line does a given device [slot] use? */
 /* Note: This really should be two dimensional based in slot/pin used */
@@ -1046,6 +1047,17 @@
 }
 
 void __init
+prep_7025f40_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi)
+{
+	Motherboard_map_name = "IBM 7025-F40";
+	Motherboard_map = NULL;
+	Motherboard_routes = NULL;
+	Motherboard_non0 = NULL;
+	*irq_edge_mask_lo = 0x00; /* irq's 0-7 all edge-triggered */
+	*irq_edge_mask_hi = 0xA0; /* irq's 13, 15 level-triggered */
+}
+
+void __init
 prep_route_pci_interrupts(void)
 {
 	unsigned char *ibc_pirq = (unsigned char *)0x80800860;
@@ -1287,6 +1299,12 @@
 	printk("Setting PCI interrupts for a \"%s\"\n", Motherboard_map_name);
 	if (OpenPIC_Addr) {
 		/* PCI interrupts are controlled by the OpenPIC */
+#ifdef CONFIG_PREP_RESIDUAL
+		pci_for_each_dev(dev) {
+			dev->irq = openpic_to_irq(residual_pcidev_irq(dev));
+				pcibios_write_config_byte(dev->bus->number, dev->devfn, PCI_INTERRUPT_LINE, dev->irq);
+		}
+#else
 		pci_for_each_dev(dev) {
 			if (dev->bus->number == 0) {
                        		dev->irq = openpic_to_irq(Motherboard_map[PCI_SLOT(dev->devfn)]);
@@ -1296,7 +1314,7 @@
 					Motherboard_non0(dev);
 			}
 		}
-
+#endif
 		/* Setup the Winbond or Via PIB */
 		prep_pib_init();
 
diff -urNX /home/leigh/.diffex prev_linux-2.4.21-rc3/arch/ppc/platforms/prep_setup.c linux-2.4.21-rc3/arch/ppc/platforms/prep_setup.c
--- prev_linux-2.4.21-rc3/arch/ppc/platforms/prep_setup.c	2003-05-24 13:40:47.000000000 +0100
+++ linux-2.4.21-rc3/arch/ppc/platforms/prep_setup.c	2003-05-24 14:14:07.000000000 +0100
@@ -96,7 +96,7 @@
 extern void prep_tiger1_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi);
 extern void prep_doral_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi);
 extern void prep_7024e30_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi);
-
+extern void prep_7025f40_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi);
 
 #define cached_21	(((char *)(ppc_cached_irq_mask))[3])
 #define cached_A1	(((char *)(ppc_cached_irq_mask))[2])
@@ -158,10 +158,28 @@
 #define PREP_IBM_TIGER1_333		0xd5 /* missing from Tiger Tech Spec */
 /* 7024-E30 */
 #define PREP_IBM_7024E30		0x95
+/* Numbers from 0x100 are used for models with no planar id */
+/* Thinkpad */
+#define PREP_IBM_THINKPAD		0x100
+/* 7043-240 (Doral) */
+#define PREP_IBM_7043240		0x101
+/* 7025-F40 */
+#define PREP_IBM_7025F40		0x102
 
 /* Residual data model strings */
-#define PREP_IBM_MODEL_TIGER1	"IBM Model 7042/7043 (ED)"
-#define PREP_IBM_MODEL_DORAL	"IBM PPS Model 7043 (ED)"
+/* #define PREP_IBM_MODEL_TIGER1 "IBM Model 7042/7043 (ED)" Not required */
+#define PREP_IBM_MODEL_7043240	"IBM PPS Model 7043 (ED)"
+#define PREP_IBM_MODEL_7025F40	"IBM PPS Model 7025 (ED)"
+
+/* Model table for models with no planar id */
+struct model {
+	char *model;
+	unsigned int id;
+};
+static struct model model_table[] = {
+	{ PREP_IBM_MODEL_7043240, PREP_IBM_7043240 },
+	{ PREP_IBM_MODEL_7025F40, PREP_IBM_7025F40 },
+};
 
 /* setup_ibm_pci:
  * 	set Motherboard_map_name, Motherboard_map, Motherboard_routes.
@@ -817,11 +835,43 @@
 }
 #endif /* CONFIG_PREP_RESIDUAL */
 
+static int __init
+prep_ibm_planar(void)
+{
+	unsigned int id, i;
+
+	id = inb(PREP_IBM_PLANAR);
+
+	if (id != PREP_IBM_NO_PLANAR_ID)
+		goto out;
+
+#ifdef CONFIG_PREP_RESIDUAL
+	if (!res) {
+		/* assume thinkpad if no residual data */
+		id = PREP_IBM_THINKPAD;
+		goto out;
+	}
+
+	for (i = 0; i < sizeof(model_table) / sizeof(model_table[0]); ++i) {
+		if (strcmp(res->VitalProductData.PrintableModel,
+			    model_table[i].model) == 0) {
+			id = model_table[i].id;
+			goto out;
+		}
+	}
+#endif
+	/* No planar id and no residual data - assume thinkpad */
+	id = PREP_IBM_THINKPAD;
+out:
+	return id;
+}
+
 static void __init
 prep_setup_arch(void)
 {
 	unsigned char reg;
 	int is_ide=0;
+	unsigned int id;
 
 	/* init to some ~sane value until calibrate_delay() runs */
 	loops_per_jiffy = 50000000;
@@ -839,35 +889,20 @@
 	switch ( _prep_type )
 	{
 	case _PREP_IBM:
-		reg = inb(PREP_IBM_PLANAR);
-		printk(KERN_INFO "IBM planar ID: %02x", reg);
-		switch (reg) {
+		id = prep_ibm_planar();
+		printk(KERN_INFO "IBM planar ID: %04x", id);
+		switch (id) {
 			case PREP_IBM_SANDALFOOT:
 				prep_gen_enable_l2();
 				setup_ibm_pci = prep_sandalfoot_setup_pci;
 				ppc_md.power_off = prep_sig750_poweroff;
 				ppc_md.show_cpuinfo = prep_sandalfoot_cpuinfo;
 				break;
-			case PREP_IBM_NO_PLANAR_ID:
-#ifdef CONFIG_PREP_RESIDUAL
-				if (res &&
-				    strcmp(res->VitalProductData.PrintableModel,
-					    PREP_IBM_MODEL_DORAL) == 0) {
-					prep_carolina_enable_l2();
-					setup_ibm_pci = prep_doral_setup_pci;
-					ppc_md.power_off = prep_sig750_poweroff;
-					ppc_md.show_cpuinfo = prep_tiger1_cpuinfo;
-				}
-				else {
-#else /* !CONFIG_PREP_RESIDUAL */
-				{
-#endif /* CONFIG_PREP_RESIDUAL */
-					/* Assume it is a thinkpad */
-					prep_gen_enable_l2();
-					setup_ibm_pci = prep_thinkpad_setup_pci;
-					ppc_md.power_off = prep_carrera_poweroff;
-					ppc_md.show_cpuinfo = prep_thinkpad_cpuinfo;
-				}
+			case PREP_IBM_THINKPAD:
+				prep_gen_enable_l2();
+				setup_ibm_pci = prep_thinkpad_setup_pci;
+				ppc_md.power_off = prep_carrera_poweroff;
+				ppc_md.show_cpuinfo = prep_thinkpad_cpuinfo;
 				break;
 			default:
 				printk(" -- unknown! Assuming Carolina");
@@ -900,6 +935,18 @@
 				ppc_md.power_off = prep_sig750_poweroff;
 				ppc_md.show_cpuinfo = prep_carolina_cpuinfo;
 				break;
+			case PREP_IBM_7043240:
+				prep_carolina_enable_l2();
+				setup_ibm_pci = prep_doral_setup_pci;
+				ppc_md.power_off = prep_sig750_poweroff;
+				ppc_md.show_cpuinfo = prep_tiger1_cpuinfo;
+				break;
+			case PREP_IBM_7025F40:
+				prep_carolina_enable_l2();
+				setup_ibm_pci = prep_7025f40_setup_pci;
+				ppc_md.power_off = prep_sig750_poweroff;
+				ppc_md.show_cpuinfo = prep_tiger1_cpuinfo;
+				break;
 		}
 		printk("\n");
 
@@ -1145,6 +1192,48 @@
 	}
 }
 
+#ifdef CONFIG_PREP_RESIDUAL
+static unsigned int __init
+res_isapic_addr(void)
+{
+	PPC_DEVICE *isapic;
+	PnP_TAG_PACKET *pkt;
+	unsigned int addr;
+
+	isapic = residual_find_device(~0, NULL, SystemPeripheral,
+				      ProgrammableInterruptController,
+				      ISA_PIC, 0);
+	if (!isapic)
+		goto unknown;
+
+	pkt = PnP_find_large_vendor_packet(res->DevicePnPHeap +
+			isapic->AllocatedOffset, 9, 0);
+	if (!pkt)
+		goto unknown;
+
+#define p pkt->L4_Pack.L4_Data.L4_PPCPack
+	/* Must be 32-bit memory address */
+	if (!((p.PPCData[0] == 2) && (p.PPCData[1] == 32)))
+		goto unknown;
+
+	/* It doesn't seem to work where length != 1 */
+	if (ld_le32((unsigned int *)(p.PPCData + 12)) != 1)
+		goto unknown;
+
+	addr = ld_le32((unsigned int *) (p.PPCData + 4));
+	return addr;
+unknown:
+	/* polled mode */
+	return 0;
+}
+#else /* !CONFIG_PREP_RESIDUAL */
+static unsigned int __init
+res_isapic_addr(void)
+{
+	return 0xbffffff0;
+}
+#endif /* CONFIG_PREP_RESIDUAL */
+
 static void __init
 prep_init_IRQ(void)
 {
@@ -1159,18 +1248,9 @@
 	}
 	for (i = 0; i < NUM_8259_INTERRUPTS; i++)
 		irq_desc[i].handler = &i8259_pic;
-	 /* If we have a Raven PCI bridge or a Hawk PCI bridge / Memory
-	  * controller, we poll (as they have a different int-ack address). */
-	early_read_config_dword(0, 0, 0, PCI_VENDOR_ID, &pci_viddid);
-	pci_did = (pci_viddid & 0xffff0000) >> 16;
-	if (((pci_viddid & 0xffff) == PCI_VENDOR_ID_MOTOROLA)
-			&& ((pci_did == PCI_DEVICE_ID_MOTOROLA_RAVEN)
-				|| (pci_did == PCI_DEVICE_ID_MOTOROLA_HAWK)))
-		i8259_init(0);
-	else
-		/* PCI interrupt ack address given in section 6.1.8 of the
-		 * PReP specification. */
-		i8259_init(0xbffffff0);
+
+  	/* Get PCI interrupt ack address from residual data */
+  	i8259_init(res_isapic_addr());
 }
 
 #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
diff -urNX /home/leigh/.diffex prev_linux-2.4.21-rc3/arch/ppc/platforms/residual.c linux-2.4.21-rc3/arch/ppc/platforms/residual.c
--- prev_linux-2.4.21-rc3/arch/ppc/platforms/residual.c	2003-05-24 13:10:48.000000000 +0100
+++ linux-2.4.21-rc3/arch/ppc/platforms/residual.c	2003-05-24 13:42:34.000000000 +0100
@@ -827,6 +827,66 @@
 	return 0;
 }
 
+static int __init
+residual_scan_pcibridge(PnP_TAG_PACKET * pkt, struct pci_dev *dev)
+{
+	int irq = -1;
+
+#define data pkt->L4_Pack.L4_Data.L4_PPCPack.PPCData
+	if (dev->bus->number == data[16]) {
+		int i, size;
+
+		size = 3 + ld_le16((u_short *) (&pkt->L4_Pack.Count0));
+		for (i = 20; i < size - 4; i += 12) {
+			unsigned char pin;
+			int line_irq;
+
+			if (dev->devfn != data[i + 1])
+				continue;
+
+			pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
+			if (pin) {
+				line_irq = ld_le16((unsigned short *)
+						(&data[i + 4 + 2 * (pin - 1)]));
+				irq = (line_irq == 0xffff) ? 0
+							   : line_irq & 0x7fff;
+			} else
+				irq = 0;
+
+			break;
+		}
+	}
+#undef data
+
+	return irq;
+}
+
+int __init
+residual_pcidev_irq(struct pci_dev *dev)
+{
+	int i = 0;
+	int irq = -1;
+	PPC_DEVICE *bridge;
+
+	while ((bridge = residual_find_device
+	       (-1, NULL, BridgeController, PCIBridge, -1, i++))) {
+
+		PnP_TAG_PACKET *pkt;
+		if (bridge->AllocatedOffset) {
+			pkt = PnP_find_large_vendor_packet(res->DevicePnPHeap +
+					   bridge->AllocatedOffset, 3, 0);
+			if (!pkt)
+				continue;
+
+			irq = residual_scan_pcibridge(pkt, dev);
+			if (irq != -1)
+				break;
+		}
+	}
+
+	return (irq < 0) ? 0 : irq;
+}
+
 PnP_TAG_PACKET *PnP_find_packet(unsigned char *p,
 				unsigned packet_tag,
 				int n)
