[OpenBIOS] r371 - openbios-devel/drivers

svn at openbios.org svn at openbios.org
Wed Jan 7 18:54:25 CET 2009


Author: blueswirl
Date: 2009-01-07 18:54:25 +0100 (Wed, 07 Jan 2009)
New Revision: 371

Modified:
   openbios-devel/drivers/cuda.c
   openbios-devel/drivers/macio.c
   openbios-devel/drivers/pci.c
Log:
Define oldworld property for oldworld hardware (Laurent Vivier)

Modified: openbios-devel/drivers/cuda.c
===================================================================
--- openbios-devel/drivers/cuda.c	2009-01-07 15:58:33 UTC (rev 370)
+++ openbios-devel/drivers/cuda.c	2009-01-07 17:54:25 UTC (rev 371)
@@ -193,10 +193,15 @@
 	props[1] = __cpu_to_be32(IO_CUDA_SIZE);
 
 	set_property(ph, "reg", (char *)&props, sizeof(props));
-	set_int_property(ph, "interrupt-parent", pic_handle);
-	// HEATHROW
+
 	set_int_property(ph, "interrupts", 0x12);
 
+	/* we emulate an oldworld hardware, so we must use
+	 * non-standard oldworld property (needed by linux 2.6.18)
+	 */
+
+	set_int_property(ph, "AAPL,interrupts", 0x12);
+
         bind_func("ppc32-reset-all", ppc32_reset_all);
         push_str("' ppc32-reset-all to reset-all");
         fword("eval");

Modified: openbios-devel/drivers/macio.c
===================================================================
--- openbios-devel/drivers/macio.c	2009-01-07 15:58:33 UTC (rev 370)
+++ openbios-devel/drivers/macio.c	2009-01-07 17:54:25 UTC (rev 371)
@@ -137,26 +137,6 @@
 	aliases = find_dev("/aliases");
 	set_property(aliases, "mac-io", path, strlen(path) + 1);
 
-        snprintf(buf, sizeof(buf), "%s/interrupt-controller", path);
-	REGISTER_NAMED_NODE(ob_intctrl_node, buf);
-
-	ph = find_dev(buf);
-	set_property(ph, "device_type", "interrupt-controller", 21);
-	set_property(ph, "compatible", "heathrow\0mac-risc", 18);
-	set_int_property(ph, "#interrupt-cells", 1);
-	props[0]= 0x00000010;
-	props[1]= 0x00000020;
-        set_property(ph, "reg", (char *)&props, 2 * sizeof(props));
-	set_property(ph, "interrupt-controller", NULL, 0);
-
-	chosen = find_dev("/chosen");
-	push_str(buf);
-	fword("open-dev");
-	ph = POP();
-	set_int_property(chosen, "interrupt-controller", ph);
-
-	pic_handle = ph;
-
 	cuda_init(path, addr);
 	macio_nvram_init(path, addr);
 }

Modified: openbios-devel/drivers/pci.c
===================================================================
--- openbios-devel/drivers/pci.c	2009-01-07 15:58:33 UTC (rev 370)
+++ openbios-devel/drivers/pci.c	2009-01-07 17:54:25 UTC (rev 371)
@@ -267,52 +267,6 @@
         return 0;
 }
 
-static void pci_set_interrupt_map(const pci_config_t *config)
-{
-	phandle_t parent, dev;
-	cell props[4];
-	cell *old_props, *new_props;
-	int ncells;
-	int retlen;
-
-	if (config->irq_line != -1) {
-		dev = get_cur_dev();
-		activate_device(config->path);
-		activate_device("..");
-		parent = get_cur_dev();
-
-		ncells = 0;
-		if (get_property(parent, "interrupt-map-mask", NULL) == 0) {
-			props[ncells++] = 0xF800;
-			props[ncells++] = 0;
-			props[ncells++] = 0;
-			props[ncells++] = 0;
-			set_property(parent, "interrupt-map-mask",
-				     (char*)props, ncells * sizeof(cell));
-		}
-
-		old_props = (cell*)get_property(parent, "interrupt-map", &retlen);
-		if (old_props) {
-			new_props = malloc(retlen + 6 * 4);
-			memcpy(new_props, old_props, retlen);
-		} else {
-			retlen = 0;
-			new_props = malloc(6 * 4);
-		}
-		ncells = retlen / 4;
-		new_props[ncells++] = config->dev & 0xf800;	/* devfn */
-		new_props[ncells++] = 0;
-		new_props[ncells++] = 0;
-		new_props[ncells++] = 0;
-		new_props[ncells++] = 0;
-		new_props[ncells++] = config->irq_line;
-		set_property(parent, "interrupt-map",
-		             (char*)new_props, ncells * sizeof(cell));
-		free(new_props);
-		activate_dev(dev);
-	}
-}
-
 static inline void pci_decode_pci_addr(pci_addr addr, int *flags,
 				       int *space_code, uint32_t *mask)
 {
@@ -540,7 +494,6 @@
 
 	pci_set_reg(config);
 	pci_set_assigned_addresses(config);
-	pci_set_interrupt_map(config);
 
 #ifdef CONFIG_DEBUG_PCI
 	printk("\n");




More information about the OpenBIOS mailing list