diff options
Diffstat (limited to 'sys/arch/powerpc')
-rw-r--r-- | sys/arch/powerpc/pci/macobio.c | 21 | ||||
-rw-r--r-- | sys/arch/powerpc/pci/mpcpcibus.c | 59 |
2 files changed, 56 insertions, 24 deletions
diff --git a/sys/arch/powerpc/pci/macobio.c b/sys/arch/powerpc/pci/macobio.c index 38b6416b0ed..dcfcf887458 100644 --- a/sys/arch/powerpc/pci/macobio.c +++ b/sys/arch/powerpc/pci/macobio.c @@ -103,6 +103,7 @@ obio_attach(parent, self, aux) u_int32_t reg[20]; int32_t intr[5]; char name[32]; + int need_interrupt_controller = 0; printf("obio ver %x", (PCI_PRODUCT(pa->pa_id))); @@ -111,10 +112,12 @@ obio_attach(parent, self, aux) /* XXX should not use name */ case 0x02: node = OF_finddevice("/bandit/gc"); + need_interrupt_controller = 1; break; case 0x07: node = OF_finddevice("/bandit/ohare"); + need_interrupt_controller = 1; break; case 0x10: /* heathrow */ @@ -155,6 +158,24 @@ obio_attach(parent, self, aux) printf(": addr 0x%x\n", ca.ca_baseaddr); + /* + * This might be a hack, but it makes the interrupt controller + * attach as expected if a device node existed in the OF tree. + */ + if (need_interrupt_controller) { + /* force attachment of legacy interrupt controllers */ + ca.ca_name = "interrupt-controller"; + ca.ca_node = 0; + + ca.ca_nreg = 0; + ca.ca_nintr = 0; + + ca.ca_reg = 0; + ca.ca_intr = 0; + + config_found(self, &ca, obio_print); + } + for (child = OF_child(node); child; child = OF_peer(child)) { namelen = OF_getprop(child, "name", name, sizeof(name)); if (namelen < 0) diff --git a/sys/arch/powerpc/pci/mpcpcibus.c b/sys/arch/powerpc/pci/mpcpcibus.c index 869f0f1e78d..0e645c67e4e 100644 --- a/sys/arch/powerpc/pci/mpcpcibus.c +++ b/sys/arch/powerpc/pci/mpcpcibus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpcpcibus.c,v 1.18 2000/07/08 19:36:01 rahnds Exp $ */ +/* $OpenBSD: mpcpcibus.c,v 1.19 2000/07/28 13:06:15 rahnds Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom @@ -109,6 +109,7 @@ struct { int config_type; } config_offsets[] = { {"grackle", 0x00c00cf8, 0x00e00cfc, 0 }, + {"bandit", 0x00c00cf8, 0x00e00cfc, 0 }, {"uni-north", 0x00800000, 0x00c00000, 3 }, {"legacy", 0x00000cf8, 0x00000cfc, 0 }, {"IBM,27-82660", 0x00000cf8, 0x00000cfc, 0 }, @@ -356,11 +357,21 @@ mpcpcibrattach(parent, self, aux) len=OF_getprop(ca->ca_node, "compatible", compat, sizeof (compat)); if (len <= 0 ) { - printf(" compatible not found\n"); - return; + len=OF_getprop(ca->ca_node, "name", compat, + sizeof (compat)); + if (len <= 0) { + printf(" compatible and name not" + " found\n"); + return; + } + compat[len] = 0; + if (strcmp (compat, "bandit") != 0) { + printf(" compatible not found and name" + " %s found\n", compat); + return; + } } compat[len] = 0; - if ((rangelen = OF_getprop(ca->ca_node, "ranges", range_store, sizeof (range_store))) <= 0) @@ -462,28 +473,28 @@ mpcpcibrattach(parent, self, aux) panic("mpcpcibus: unable to map self\n"); } of_node = ca->ca_node; - } - - - lcp->lc_pc.pc_conf_v = lcp; - lcp->lc_pc.pc_attach_hook = mpc_attach_hook; - lcp->lc_pc.pc_bus_maxdevs = mpc_bus_maxdevs; - lcp->lc_pc.pc_make_tag = mpc_make_tag; - lcp->lc_pc.pc_decompose_tag = mpc_decompose_tag; - lcp->lc_pc.pc_conf_read = mpc_conf_read; - lcp->lc_pc.pc_conf_write = mpc_conf_write; - lcp->lc_pc.pc_ether_hw_addr = mpc_ether_hw_addr; - lcp->lc_iot = &sc->sc_iobus_space; - lcp->lc_memt = &sc->sc_membus_space; - lcp->lc_pc.pc_intr_v = lcp; - lcp->lc_pc.pc_intr_map = mpc_intr_map; - lcp->lc_pc.pc_intr_string = mpc_intr_string; - lcp->lc_pc.pc_intr_establish = mpc_intr_establish; - lcp->lc_pc.pc_intr_disestablish = mpc_intr_disestablish; - printf(": %s, Revision %x. ", bridge, - mpc_cfg_read_1(lcp, MPC106_PCI_REVID)); + lcp->lc_pc.pc_conf_v = lcp; + lcp->lc_pc.pc_attach_hook = mpc_attach_hook; + lcp->lc_pc.pc_bus_maxdevs = mpc_bus_maxdevs; + lcp->lc_pc.pc_make_tag = mpc_make_tag; + lcp->lc_pc.pc_decompose_tag = mpc_decompose_tag; + lcp->lc_pc.pc_conf_read = mpc_conf_read; + lcp->lc_pc.pc_conf_write = mpc_conf_write; + lcp->lc_pc.pc_ether_hw_addr = mpc_ether_hw_addr; + lcp->lc_iot = &sc->sc_iobus_space; + lcp->lc_memt = &sc->sc_membus_space; + + lcp->lc_pc.pc_intr_v = lcp; + lcp->lc_pc.pc_intr_map = mpc_intr_map; + lcp->lc_pc.pc_intr_string = mpc_intr_string; + lcp->lc_pc.pc_intr_establish = mpc_intr_establish; + lcp->lc_pc.pc_intr_disestablish = mpc_intr_disestablish; + + printf(": %s, Revision %x. ", compat, + mpc_cfg_read_1(lcp, MPC106_PCI_REVID)); + } break; default: |