Skip to contentSkip to conversation

rs/6000 e30 + 240 (doral) support.

PATCH Gustavo Barbieri 1 participant 1 message Jul 13, 2004

lore
Share & tools
lore
#0 lore raw

Hello,

Here are 2 patches to make linux support the old IBM RS/6000 E30 (ppc604e) and 240 (doral). The support was written by Leigh Brown and adapted from the patch present in the website:
http://home.tiscali.be/philipa/rs6000.html

These machines are old, but usable nowadays. Here in brazil we have many universities with them, since they were distributed to some projects between 1999-2001.

These patches are not invasive and easily portable to other kernel versions... so I hope you all will try to support it.

PS: I'm not subscribed to the lists, so please CC me.

--
Gustavo Sverzut Barbieri
---------------------------------------
Computer Engineer 2001 - UNICAMP
GPSL - Grupo Pro Software Livre
Cell..: +55 (19) 9165 8010
Jabber: [email protected]
ICQ#: 17249123
GPG: 0xB640E1A2 @ wwwkeys.pgp.net

arch/ppc/platforms/prep_pci.c +121 -6
diff -Naur linux-2.4.26-old/arch/ppc/platforms/prep_pci.c linux-2.4.26/arch/ppc/platforms/prep_pci.c
@@ -547,6 +547,74 @@
         15,     /* Line 4 */
 };
 
+/*
+ * IBM RS/6000 7043-240  -- Leigh Brown
+ * XXX we should get all this from the residual data
+ */
+static char ibm_doral_pci_IRQ_map[23] __prepdata = {
+        0, /* Slot 0  - unused */
+        3, /* Slot 1  - PCI Slot 1 device 0x08 */
+        5, /* Slot 2  - PCI Slot 3 device 0x10 */
+       11, /* Slot 3  - PCI Slot 5 device 0x18 */
+        2, /* Slot 4  - Integrated PCI device 0x20 */
+        1, /* Slot 5  - Integrated PCI device 0x28 */
+        0, /* Slot 6  - Integrated PCI device 0x30 - no IRQ */
+        0, /* Slot 7  - Integrated PCI device 0x38 - no IRQ */
+        0, /* Slot 8  - unused */
+        0, /* Slot 9  - unused */
+        0, /* Slot 10 - unused */
+        0, /* Slot 11 - unused */
+        0, /* Slot 12 - unused */
+        0, /* Slot 13 - unused */
+        0, /* Slot 14 - unused */
+        0, /* Slot 15 - unused */
+        0, /* Slot 16 - unused */
+        0, /* Slot 17 - unused */
+        0, /* Slot 18 - unused */
+        0, /* Slot 19 - unused */
+        0, /* Slot 20 - unused */
+        0, /* Slot 21 - unused */
+        0, /* Slot 22 - unused */
+};
+
+/*
+ * IBM RS/6000 7024-E30  -- Leigh Brown
+ * XXX we should get all this from the residual data
+ */
+static char ibm_7024e30_pci_IRQ_map[23] __prepdata = {
+        0, /* Slot 0  - unused */
+        0, /* Slot 1  - unused */
+        0, /* Slot 2  - unused */
+        0, /* Slot 3  - unused */
+        0, /* Slot 4  - unused */
+        0, /* Slot 5  - unused */
+        0, /* Slot 6  - unused */
+        0, /* Slot 7  - unused */
+        0, /* Slot 8  - unused */
+        0, /* Slot 9  - unused */
+        0, /* Slot 10 - unused */
+        0, /* Slot 11 - Unknown Integrated PCI device - no IRQ */
+        0, /* Slot 12 - Unknown Integrated PCI device - no IRQ */
+        0, /* Slot 13 - Unknown Integrated PCI device - no IRQ */
+        2, /* Slot 14 - PCI Slot 1 INTA and INTC */
+        4, /* Slot 15 - PCI Slot 2 INTA and INTC */
+        0, /* Slot 16 - unused */
+        0, /* Slot 17 - unused */
+        0, /* Slot 18 - unused */
+        0, /* Slot 19 - unused */
+        0, /* Slot 20 - unused */
+        0, /* Slot 21 - unused */
+        0, /* Slot 22 - unused */
+};
+
+static char ibm_7024e30_pci_IRQ_routes[] __prepdata = {
+        0,      /* Line 0 - unused */
+        15,     /* Line 1 */
+        15,     /* Line 2 */
+        15,     /* Line 3 */
+        15,     /* Line 4 */
+};
+
 /* Motorola PowerPlus architecture PCI IRQ tables */
 /* Interrupt line values for INTA-D on primary/secondary MPIC inputs */
 
@@ -869,6 +937,28 @@
 	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
 }
 
+static void __init
+ibm_7024e30_pci_map_non0(struct pci_dev *dev)
+{
+	unsigned char intpin;
+	int irq;
+	static unsigned char bridge_intrs[5][4] = {
+		{ 1, 0, 0, 0 },
+		{ 8, 9, 8, 9 },
+		{ 10, 11, 10, 11 },
+		{ 12, 13, 12, 13 }
+	};
+
+	if (dev == NULL || PCI_SLOT(dev->devfn) > 4)
+		return;
+	pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &intpin);
+	if (intpin < 1 || intpin > 4)
+		return;
+	irq = bridge_intrs[PCI_SLOT(dev->devfn)][intpin - 1];
+	dev->irq = openpic_to_irq(irq);
+	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
+}
+
 void __init
 prep_sandalfoot_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi)
 {
@@ -911,6 +1001,28 @@
 }
 
 void __init
+prep_doral_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi)
+{
+	Motherboard_map_name = "IBM 7043-240 (Doral)";
+	Motherboard_map = ibm_doral_pci_IRQ_map;
+	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_7024e30_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi)
+{
+	Motherboard_map_name = "IBM 7024-E30";
+	Motherboard_map = ibm_7024e30_pci_IRQ_map;
+	Motherboard_routes = ibm_7024e30_pci_IRQ_routes;
+	Motherboard_non0 = ibm_7024e30_pci_map_non0;
+	*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;
@@ -990,11 +1102,13 @@
 		return;
 	}
 
-	/* Set up mapping from slots */
-	for (i = 1;  i <= 4;  i++)
-		ibc_pirq[i-1] = Motherboard_routes[i];
-	/* Enable PCI interrupts */
-	*ibc_pcicon |= 0x20;
+ 	if (Motherboard_routes) { /* Doral does not like this code */
+	        /* Set up mapping from slots */
+	        for (i = 1;  i <= 4;  i++)
+		        ibc_pirq[i-1] = Motherboard_routes[i];
+		/* Enable PCI interrupts */
+		*ibc_pcicon |= 0x20;
+	}
 }
 
 void __init
@@ -1268,7 +1382,8 @@
 		hostbridge = residual_find_device(PROCESSORDEVICE, NULL,
 			BridgeController, PCIBridge, -1, 0);
 		if (hostbridge &&
-			hostbridge->DeviceId.Interface == PCIBridgeIndirect) {
+			((hostbridge->DeviceId.Interface == PCIBridgeIndirect) ||
+			 (hostbridge->DeviceId.Interface == PCIBridgeRS6K))) {
 			PnP_TAG_PACKET * pkt;
 			pkt = PnP_find_large_vendor_packet(
 				res->DevicePnPHeap+hostbridge->AllocatedOffset,
arch/ppc/platforms/prep_setup.c +36 -7

73 lines not on this page · raw message

arch/ppc/platforms/prep_pci.c +122 -6

152 lines not on this page · raw message

arch/ppc/platforms/prep_setup.c +36 -7

73 lines not on this page · raw message