based on patch from Andreas Tobler also remove unneeded check for newworld, as function setting them is only called on neworld machines
Signed-off-by: Amadeusz Sławiński amade@asmblr.net CC: Andreas Tobler andreast@fgznet.ch --- drivers/macio.c | 46 ++++++++++++++++++++++++++++------------------ drivers/pci.c | 6 +++--- 2 files changed, 31 insertions(+), 21 deletions(-)
diff --git a/drivers/macio.c b/drivers/macio.c index 03d5678..59ad1f6 100644 --- a/drivers/macio.c +++ b/drivers/macio.c @@ -167,31 +167,41 @@ openpic_init(const char *path, phys_addr_t addr)
fword("finish-device");
- if (is_newworld()) { - u32 *interrupt_map; - int len, i; + u32 *interrupt_map; + int len, i;
- /* patch in interrupt parent */ - dnode = find_dev(buf); + /* patch in interrupt parent */ + dnode = find_dev(buf); + + target_node = find_dev("/pci/mac-io"); + set_int_property(target_node, "interrupt-parent", dnode); + + target_node = find_dev("/pci/mac-io/escc/ch-a"); + set_int_property(target_node, "interrupt-parent", dnode); + + target_node = find_dev("/pci/mac-io/escc/ch-b"); + set_int_property(target_node, "interrupt-parent", dnode); + + target_node = find_dev("/pci/mac-io/ata-1"); + set_int_property(target_node, "interrupt-parent", dnode);
- target_node = find_dev("/pci/mac-io"); - set_int_property(target_node, "interrupt-parent", dnode); + target_node = find_dev("/pci/mac-io/ata-2"); + set_int_property(target_node, "interrupt-parent", dnode);
- target_node = find_dev("/pci/mac-io/escc/ch-a"); - set_int_property(target_node, "interrupt-parent", dnode); + target_node = find_dev("/pci/mac-io/ata-3"); + set_int_property(target_node, "interrupt-parent", dnode);
- target_node = find_dev("/pci/mac-io/escc/ch-b"); - set_int_property(target_node, "interrupt-parent", dnode); + target_node = find_dev("/pci/mac-io/via-cuda"); + set_int_property(target_node, "interrupt-parent", dnode);
- target_node = find_dev("/pci"); - set_int_property(target_node, "interrupt-parent", dnode); + target_node = find_dev("/pci"); + set_int_property(target_node, "interrupt-parent", dnode);
- interrupt_map = (u32 *)get_property(target_node, "interrupt-map", &len); - for (i = 0; i < 4; i++) { - interrupt_map[(i * 7) + PCI_INT_MAP_PIC_HANDLE] = (u32)dnode; - } - set_property(target_node, "interrupt-map", (char *)interrupt_map, len); + interrupt_map = (u32 *)get_property(target_node, "interrupt-map", &len); + for (i = 0; i < 8; i++) { + interrupt_map[(i * 7) + PCI_INT_MAP_PIC_HANDLE] = (u32)dnode; } + set_property(target_node, "interrupt-map", (char *)interrupt_map, len); }
DECLARE_NODE(ob_macio, INSTALL_OPEN, sizeof(int), "Tmac-io"); diff --git a/drivers/pci.c b/drivers/pci.c index d6c5e51..b3be3cd 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -375,7 +375,7 @@ static void pci_host_set_interrupt_map(const pci_config_t *config) */ #if defined(CONFIG_PPC) phandle_t dev = get_cur_dev(); - u32 props[7 * 4]; + u32 props[7 * 8]; int i;
#if defined(CONFIG_PPC) @@ -384,7 +384,7 @@ static void pci_host_set_interrupt_map(const pci_config_t *config) return; #endif
- for (i = 0; i < (7*4); i+=7) { + for (i = 0; i < (7*8); i+=7) { props[i+PCI_INT_MAP_PCI0] = 0; props[i+PCI_INT_MAP_PCI1] = 0; props[i+PCI_INT_MAP_PCI2] = 0; @@ -393,7 +393,7 @@ static void pci_host_set_interrupt_map(const pci_config_t *config) props[i+PCI_INT_MAP_PIC_INT] = arch->irqs[i / 7]; props[i+PCI_INT_MAP_PIC_POL] = 3; } - set_property(dev, "interrupt-map", (char *)props, 7 * 4 * sizeof(props[0])); + set_property(dev, "interrupt-map", (char *)props, 7 * 8 * sizeof(props[0]));
props[PCI_INT_MAP_PCI0] = 0; props[PCI_INT_MAP_PCI1] = 0;