diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2001-06-29 06:55:37 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2001-06-29 06:55:37 +0000 |
commit | 6ddcdf4c2e6e51c475a7b20340fae90dad5bac74 (patch) | |
tree | a18926eb570c06705848c9dbe69b1314583dc26e | |
parent | e3fc1deb1dbfa7d532f9321734ced074852b6ac3 (diff) |
Include/header cleanup. More.
-rw-r--r-- | sys/arch/powerpc/mac/adb.c | 1 | ||||
-rw-r--r-- | sys/arch/powerpc/mac/adb_direct.c | 7 | ||||
-rw-r--r-- | sys/arch/powerpc/mac/adbvar.h | 2 | ||||
-rw-r--r-- | sys/arch/powerpc/mac/akbd.c | 2 | ||||
-rw-r--r-- | sys/arch/powerpc/mac/macintr.c | 5 | ||||
-rw-r--r-- | sys/arch/powerpc/mac/openpic.c | 4 | ||||
-rw-r--r-- | sys/arch/powerpc/mac/uni_n.c | 4 | ||||
-rw-r--r-- | sys/arch/powerpc/pci/mpcpcibus.c | 91 |
8 files changed, 23 insertions, 93 deletions
diff --git a/sys/arch/powerpc/mac/adb.c b/sys/arch/powerpc/mac/adb.c index a7bcc3477cd..fe08ba77634 100644 --- a/sys/arch/powerpc/mac/adb.c +++ b/sys/arch/powerpc/mac/adb.c @@ -125,7 +125,6 @@ adbattach(parent, self, aux) int totaladbs; int adbindex, adbaddr; - extern adb_intr(); extern volatile u_char *Via1Base; ca->ca_reg[0] += ca->ca_baseaddr; diff --git a/sys/arch/powerpc/mac/adb_direct.c b/sys/arch/powerpc/mac/adb_direct.c index 20fdd9df9dd..4983542784e 100644 --- a/sys/arch/powerpc/mac/adb_direct.c +++ b/sys/arch/powerpc/mac/adb_direct.c @@ -259,7 +259,6 @@ void pm_init_adb_device __P((void)); #ifdef ADB_DEBUG void print_single __P((u_char *)); #endif -void adb_intr __P((void)); void adb_intr_II __P((void)); void adb_intr_IIsi __P((void)); void adb_intr_cuda __P((void)); @@ -290,6 +289,7 @@ int adb_prog_switch_enable __P((void)); int adb_prog_switch_disable __P((void)); /* we should create this and it will be the public version */ int send_adb __P((u_char *, void *, void *)); +int setsoftadb __P((void)); #ifdef ADB_DEBUG /* @@ -742,8 +742,8 @@ adb_guess_next_device(void) * This routine simply transfers control over to the appropriate * code for the machine we are running on. */ -void -adb_intr(void) +int +adb_intr(void *arg) { switch (adbHardware) { case ADB_HW_II: @@ -765,6 +765,7 @@ adb_intr(void) case ADB_HW_UNKNOWN: break; } + return 1; } diff --git a/sys/arch/powerpc/mac/adbvar.h b/sys/arch/powerpc/mac/adbvar.h index 329ba24e919..76ea05a9b29 100644 --- a/sys/arch/powerpc/mac/adbvar.h +++ b/sys/arch/powerpc/mac/adbvar.h @@ -127,3 +127,5 @@ int SetADBInfo __P((ADBSetInfoBlock * info, int adbAddr)); int ADBOp __P((Ptr buffer, Ptr compRout, Ptr data, short commandNum)); int adb_read_date_time __P((unsigned long *t)); int adb_set_date_time __P((unsigned long t)); +int adb_intr __P((void *arg)); +void adb_cuda_autopoll __P((void)); diff --git a/sys/arch/powerpc/mac/akbd.c b/sys/arch/powerpc/mac/akbd.c index 26f59cbb01d..08483ea8b44 100644 --- a/sys/arch/powerpc/mac/akbd.c +++ b/sys/arch/powerpc/mac/akbd.c @@ -521,7 +521,7 @@ akbd_cngetc(v, type, data) adb_polling = 1; while (polledkey == -1) { - adb_intr(); + adb_intr(NULL); /* adb does not use the argument */ DELAY(10000); /* XXX */ } diff --git a/sys/arch/powerpc/mac/macintr.c b/sys/arch/powerpc/mac/macintr.c index 28037d52c34..49248d4ca25 100644 --- a/sys/arch/powerpc/mac/macintr.c +++ b/sys/arch/powerpc/mac/macintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: macintr.c,v 1.12 2001/06/27 04:37:18 art Exp $ */ +/* $OpenBSD: macintr.c,v 1.13 2001/06/29 06:55:36 drahn Exp $ */ /*- * Copyright (c) 1995 Per Fogelstrom @@ -54,6 +54,9 @@ #include <machine/intr.h> #include <machine/psl.h> #include <machine/pio.h> +#include <machine/powerpc.h> + +#include <dev/ofw/openfirm.h> #define ICU_LEN 64 #define LEGAL_IRQ(x) ((x >= 0) && (x < ICU_LEN)) diff --git a/sys/arch/powerpc/mac/openpic.c b/sys/arch/powerpc/mac/openpic.c index 2fd11d9ef74..76ef7a6b10c 100644 --- a/sys/arch/powerpc/mac/openpic.c +++ b/sys/arch/powerpc/mac/openpic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: openpic.c,v 1.14 2001/06/27 04:37:19 art Exp $ */ +/* $OpenBSD: openpic.c,v 1.15 2001/06/29 06:55:36 drahn Exp $ */ /*- * Copyright (c) 1995 Per Fogelstrom @@ -54,7 +54,9 @@ #include <machine/intr.h> #include <machine/psl.h> #include <machine/pio.h> +#include <machine/powerpc.h> #include <powerpc/mac/openpicreg.h> +#include <dev/ofw/openfirm.h> #define ICU_LEN 128 #define LEGAL_IRQ(x) ((x >= 0) && (x < ICU_LEN)) diff --git a/sys/arch/powerpc/mac/uni_n.c b/sys/arch/powerpc/mac/uni_n.c index 1ec4e4b9537..d1089e8c2ae 100644 --- a/sys/arch/powerpc/mac/uni_n.c +++ b/sys/arch/powerpc/mac/uni_n.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uni_n.c,v 1.4 2001/06/25 23:29:57 drahn Exp $ */ +/* $OpenBSD: uni_n.c,v 1.5 2001/06/29 06:55:36 drahn Exp $ */ /* * Copyright (c) 1998-2001 Dale Rahn. All rights reserved. @@ -32,6 +32,8 @@ #include <sys/param.h> #include <sys/device.h> +#include <sys/systm.h> + #include <machine/bus.h> #include <machine/autoconf.h> diff --git a/sys/arch/powerpc/pci/mpcpcibus.c b/sys/arch/powerpc/pci/mpcpcibus.c index 641dbb978b8..48220391436 100644 --- a/sys/arch/powerpc/pci/mpcpcibus.c +++ b/sys/arch/powerpc/pci/mpcpcibus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpcpcibus.c,v 1.30 2001/06/26 18:19:43 drahn Exp $ */ +/* $OpenBSD: mpcpcibus.c,v 1.31 2001/06/29 06:55:36 drahn Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom @@ -47,6 +47,7 @@ #include <machine/autoconf.h> #include <machine/bat.h> +#include <machine/powerpc.h> #if 0 #include <dev/isa/isareg.h> @@ -60,8 +61,8 @@ #include <powerpc/pci/pcibrvar.h> #include <powerpc/pci/mpc106reg.h> +#include <dev/ofw/openfirm.h> extern vm_map_t phys_map; -extern ofw_eth_addr[]; int mpcpcibrmatch __P((struct device *, void *, void *)); void mpcpcibrattach __P((struct device *, struct device *, void *)); @@ -184,42 +185,6 @@ mpcpcibrattach(parent, self, aux) int of_node = 0; switch(system_type) { - case POWER4e: - lcp = sc->sc_pcibr = &mpc_config; - - addbatmap(MPC106_V_PCI_MEM_SPACE, - MPC106_P_PCI_MEM_SPACE, BAT_I); - - sc->sc_membus_space.bus_base = MPC106_V_PCI_MEM_SPACE; - sc->sc_membus_space.bus_reverse = 1; - sc->sc_iobus_space.bus_base = MPC106_V_PCI_IO_SPACE; - sc->sc_iobus_space.bus_reverse = 1; - - 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(": MPC106, Revision 0x%x.\n", - mpc_cfg_read_1(lcp, MPC106_PCI_REVID)); -#if 0 - mpc_cfg_write_2(lcp, MPC106_PCI_STAT, 0xff80); /* Reset status */ -#endif - bridge = "MPC106"; - break; - case OFWMACH: case PWRSTK: { @@ -383,7 +348,7 @@ mpcpcibrattach(parent, self, aux) printf("range lookup failed, node %x\n", ca->ca_node); } - /* translate byte(s) into item count/*/ + /* translate byte(s) into item count*/ rangelen /= sizeof(struct ranges_new); lcp = sc->sc_pcibr = &sc->pcibr_config; @@ -848,7 +813,8 @@ mpc_gen_config_reg(cpv, tag, offset) } } else { /* config mechanism #2, type 0 - /* standard cf8/cfc config */ + * standard cf8/cfc config + */ reg = 0x80000000 | tag | offset; } @@ -973,51 +939,6 @@ mpc_intr_map(lcv, bustag, buspin, line, ihp) error = 1; } -#if 0 - /* this hack belongs elsewhere */ - if(system_type == POWER4e) { - pci_decompose_tag(pc, bustag, NULL, &device, NULL); - route = in32rb(MPC106_PCI_CONF_SPACE + 0x860); - switch(device) { - case 1: /* SCSI */ - line = 6; - route &= ~0x0000ff00; - route |= line << 8; - break; - - case 2: /* Ethernet */ - line = 14; - route &= ~0x00ff0000; - route |= line << 16; - break; - - case 3: /* Tundra VME */ - line = 15; - route &= ~0xff000000; - route |= line << 24; - break; - - case 4: /* PMC Slot */ - line = 9; - route &= ~0x000000ff; - route |= line; - break; - - default: - printf("mpc_intr_map: bad dev slot %d!\n", device); - error = 1; - break; - } - - lvl = isa_inb(0x04d0); - lvl |= isa_inb(0x04d1) << 8; - lvl |= 1L << line; - isa_outb(0x04d0, lvl); - isa_outb(0x04d1, lvl >> 8); - out32rb(MPC106_PCI_CONF_SPACE + 0x860, route); - } -#endif - if(!error) *ihp = line; return error; |