crossdev on gentoo builds crosscompiler with powerpc-unknown-linux-gnu- prefix
Signed-off-by: Amadeusz Sławiński amade@asmblr.net --- config/scripts/switch-arch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/scripts/switch-arch b/config/scripts/switch-arch index a9c911b..28b3b45 100755 --- a/config/scripts/switch-arch +++ b/config/scripts/switch-arch @@ -97,7 +97,7 @@ archname()
select_prefix() { - for TARGET in ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- + for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- do if type ${TARGET}gcc > /dev/null 2>&1 then
interrupts ans #interrupt-cells are newworld properties
also oldworld interrupts were not properly set, ie second one was always set to 0 instead of correct value
Signed-off-by: Amadeusz Sławiński amade@asmblr.net --- drivers/ide.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/ide.c b/drivers/ide.c index 90138ff..251db65 100644 --- a/drivers/ide.c +++ b/drivers/ide.c @@ -1611,9 +1611,11 @@ int macio_ide_init(const char *path, uint32_t addr, int nb_channels) } props[1] = 0x00000000; /* XXX level triggered on real hw */ props[3] = 0x00000000; - set_property(dnode, "interrupts", - (char *)&props, 4*sizeof(props[0])); - set_int_property(dnode, "#interrupt-cells", 2); + NEWWORLD(set_property(dnode, "interrupts", + (char *)&props, 4*sizeof(props[0]))); + NEWWORLD(set_int_property(dnode, "#interrupt-cells", 2)); + + props[1] = props[2]; OLDWORLD(set_property(dnode, "AAPL,interrupts", (char *)&props, 2*sizeof(props[0])));
based on patch from Andreas Tobler
Signed-off-by: Amadeusz Sławiński amade@asmblr.net CC: Andreas Tobler andreast@fgznet.ch --- drivers/macio.c | 14 +++++++++++++- drivers/pci.c | 6 +++--- 2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/macio.c b/drivers/macio.c index 03d5678..25294e5 100644 --- a/drivers/macio.c +++ b/drivers/macio.c @@ -183,11 +183,23 @@ openpic_init(const char *path, phys_addr_t addr) 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/ata-2"); + 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/via-cuda"); + 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++) { + 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); 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;
Signed-off-by: Amadeusz Sławiński amade@asmblr.net --- drivers/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci.c b/drivers/pci.c index b3be3cd..5c487c1 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -854,7 +854,7 @@ static void ob_pci_add_properties(phandle_t phandle, if (config->irq_pin) { OLDWORLD(set_int_property(dev, "AAPL,interrupts", config->irq_line)); - set_int_property(dev, "interrupts", config->irq_pin); + NEWWORLD(set_int_property(dev, "interrupts", config->irq_pin)); }
set_int_property(dev, "min-grant", pci_config_read8(addr, PCI_MIN_GNT));
openpic_init is only called on newworld machines
Signed-off-by: Amadeusz Sławiński amade@asmblr.net --- drivers/macio.c | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-)
diff --git a/drivers/macio.c b/drivers/macio.c index 25294e5..59ad1f6 100644 --- a/drivers/macio.c +++ b/drivers/macio.c @@ -167,43 +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"); + 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-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/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/ata-1"); + 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/ata-2"); + 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/ata-3"); + 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/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 < 8; 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");