diff options
author | Dale S. Rahn <rahnds@cvs.openbsd.org> | 1998-08-22 18:32:01 +0000 |
---|---|---|
committer | Dale S. Rahn <rahnds@cvs.openbsd.org> | 1998-08-22 18:32:01 +0000 |
commit | 060a293d1a09ab519d6430a038d1d58180e490b5 (patch) | |
tree | 47fc5f33d48bde6670af2182423ef0d188cc78e7 /sys/arch/powerpc/pci | |
parent | b14c08b6614b3ddf135f84c2140f08af903e259e (diff) |
Various changes to allow mixing of ofw drivers and real drivers.
NCR driver seems to work.
Major changes are isa can be child of pci or mainbus.
ofroot is child of mainbus not root.
ofw bus configured before pci bus
Note that if a pci device configures accessing of driver will crash
the system. they need to be exclusive.
Diffstat (limited to 'sys/arch/powerpc/pci')
-rw-r--r-- | sys/arch/powerpc/pci/mpcpcibus.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/sys/arch/powerpc/pci/mpcpcibus.c b/sys/arch/powerpc/pci/mpcpcibus.c index 6e263c607c7..ae58a8c1f98 100644 --- a/sys/arch/powerpc/pci/mpcpcibus.c +++ b/sys/arch/powerpc/pci/mpcpcibus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpcpcibus.c,v 1.5 1998/08/06 15:04:00 pefo Exp $ */ +/* $OpenBSD: mpcpcibus.c,v 1.6 1998/08/22 18:31:50 rahnds Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom @@ -45,6 +45,7 @@ #include <vm/vm.h> #include <machine/autoconf.h> +#include <machine/bat.h> #include <dev/isa/isareg.h> #include <dev/isa/isavar.h> @@ -156,6 +157,41 @@ mpcpcibrattach(parent, self, aux) mpc_cfg_read_1(MPC106_PCI_REVID)); mpc_cfg_write_2(MPC106_PCI_STAT, 0xff80); /* Reset status */ break; + case OFWMACH: + case PWRSTK: + lcp = sc->sc_pcibr = &mpc_config; + + addbatmap(0x80000000, 0x80000000, BAT_I); + addbatmap(MPC106_P_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_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_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 %x.\n", + mpc_cfg_read_1(MPC106_PCI_REVID)); + mpc_cfg_write_2(MPC106_PCI_STAT, 0xff80); /* Reset status */ + break; + default: + printf("unknown system_type %d\n",system_type); + return; } pba.pba_busname = "pci"; |