[OpenBIOS] [commit] r1326 - trunk/openbios-devel/drivers
repository service
svn at openbios.org
Fri Nov 14 20:17:46 CET 2014
Author: mcayland
Date: Fri Nov 14 20:17:45 2014
New Revision: 1326
URL: http://tracker.coreboot.org/trac/openbios/changeset/1326
Log:
pci.c: move SPARC64 PCI interrupt mapping to post-PCI-bus scan
Move the PCI interrupt mapping from the pre-scan
pci_host_set_interrupt_map() to the post-scan ob_pci_host_set_interrupt_map()
function.
As a consequence of this we can remove pci_host_set_interrupt_map() since it
is now now longer used.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
Modified:
trunk/openbios-devel/drivers/pci.c
Modified: trunk/openbios-devel/drivers/pci.c
==============================================================================
--- trunk/openbios-devel/drivers/pci.c Fri Nov 14 20:17:43 2014 (r1325)
+++ trunk/openbios-devel/drivers/pci.c Fri Nov 14 20:17:45 2014 (r1326)
@@ -421,41 +421,6 @@
#define SUN4U_INTERRUPT(dev, irq_pin) \
((((dev >> 11) << 2) + irq_pin - 1) & 0x1f)
-static void pci_host_set_interrupt_map(phandle_t dev)
-{
-/* XXX We currently have a hook in the MPIC init code to fill in its handle.
- * If you want to have interrupt maps for your PCI host bus, add your
- * architecture to the #if and make your bridge detect code fill in its
- * handle too.
- *
- * It would be great if someone clever could come up with a more universal
- * mechanism here.
- */
-#if defined(CONFIG_SPARC64)
- uint32_t props[12];
- int ncells, device, i;
-
- /* Set interrupt-map for devices 4 (NE2000) and 5 (CMD646) */
- ncells = 0;
- for (i = 4; i <= 5; i++) {
- device = i << 11;
-
- ncells += pci_encode_phys_addr(props + ncells, 0, 0, device, 0, 0);
- props[ncells++] = 1;
- props[ncells++] = dev;
- props[ncells++] = SUN4U_INTERRUPT(device, 1);
- }
-
- set_property(dev, "interrupt-map", (char *)props, ncells * sizeof(props[0]));
-
- props[0] = 0x0000f800;
- props[1] = 0x0;
- props[2] = 0x0;
- props[3] = 7;
- set_property(dev, "interrupt-map-mask", (char *)props, 4 * sizeof(props[0]));
-#endif
-}
-
static void pci_host_set_reg(phandle_t phandle)
{
phandle_t dev = phandle;
@@ -522,7 +487,6 @@
//XXX this overrides "reg" property
pci_host_set_reg(get_cur_dev());
pci_host_set_ranges(config);
- pci_host_set_interrupt_map(get_cur_dev());
return 0;
}
@@ -1472,6 +1436,28 @@
set_property(host, "interrupt-map-mask", (char *)props, 4 * sizeof(props[0]));
}
+#elif defined(CONFIG_SPARC64)
+ uint32_t props[12];
+ int ncells, device, i;
+
+ /* Set interrupt-map for devices 4 (NE2000) and 5 (CMD646) */
+ ncells = 0;
+ for (i = 4; i <= 5; i++) {
+ device = i << 11;
+
+ ncells += pci_encode_phys_addr(props + ncells, 0, 0, device, 0, 0);
+ props[ncells++] = 1;
+ props[ncells++] = host;
+ props[ncells++] = SUN4U_INTERRUPT(device, 1);
+ }
+
+ set_property(host, "interrupt-map", (char *)props, ncells * sizeof(props[0]));
+
+ props[0] = 0x0000f800;
+ props[1] = 0x0;
+ props[2] = 0x0;
+ props[3] = 7;
+ set_property(host, "interrupt-map-mask", (char *)props, 4 * sizeof(props[0]));
#endif
}
More information about the OpenBIOS
mailing list