Commit Graph

56 Commits

Author SHA1 Message Date
briggs
f06d48126e Bring in some code to deal with devices in the lower slots of a UMAX S900
and perhaps PowerMac 9500.  These slots sit behind a PCI-PCI bridge, and
devices in those slots inherit the PCI-PCI bridge interrupt.  Derived from
a patch submitted in PR port-macppc/26341 by Michael Loreny, who was also
diligent in prodding me to look at it.
2004-12-07 15:42:08 +00:00
briggs
6fec1d4f73 OpenFirmware on machines with the "Grackle" bridge assign an 'AAPL,interrupts'
property instead of 'interrupt-map' and 'interrupt-map-mask' properties.
Adjust for this by checking for the latter, and if they're not present
(and the parent isn't 'pci-bridge'), then look for 'AAPL,interrupts'.

Problem analyzed and patched by Tim Kelly on port-macppc.  I modified the
patch to move the fallback into find_node_intr(), tweaking some previously-
disabled code.
2004-12-07 13:22:51 +00:00
drochner
46289e1fef Phase out the use of a string as first "attach args" member to control
which bustype should be attached with a specific call to config_found()
(from a "mainbus" or a bus bridge).
Do it for isa/eisa/mca and pci/agp for now. These buses all attach to
an mi interface attribute "isabus", "eisabus" etc., and the autoconf
framework now allows to specify an interface attribute on config_found()
and config_search(), which limits the search of matching config data
to these which attach to that specific attribute.
So we basically have to call config_found_ia(..., "foobus", ...) where
such a bus is attached.
As a consequence, where a "mainbus" or alike also attaches other
devices (eg CPUs) which do not attach to a specific attribute yet,
we need at least pass an attribute name (different from "foobus") so
that the foo bus is not found at these places. This made some minor
changes necessary which are not obviously related to the mentioned buses.
2004-08-30 15:05:15 +00:00
itojun
6123043789 pass string length (= boundary info) to pci_devinfo so that we do not run over
the end of memory region
2004-04-23 21:13:05 +00:00
matt
2ce2389229 Deal with OFW trees that have interrupt nodes without an #address-cells
property.  Treat them as if they had such a property but its value was 0.
2004-04-08 23:58:24 +00:00
wiz
85746c6759 Spell interrupt with two rs. From Peter Postma. 2004-02-24 15:16:04 +00:00
matt
a1bba8f344 Relax things so that OFW implementations that don't conform to the OFW PCI
bindings will work.
2003-08-20 14:41:56 +00:00
matt
93b63570a0 Properly walk the OF tree to map a PCI node's interrupt property into the
proper settings for the interrupt-controller.
2003-08-18 07:08:11 +00:00
lukem
4b2744bf35 __KERNEL_RCSID() 2003-07-15 02:43:09 +00:00
fvdl
7dd7f8baa2 Handle 64bit DMA addresses on PCI for platforms that can (currently only
enabled on amd64). Add a dmat64 field to various PCI attach structures,
and pass it down where needed. Implement a simple new function called
pci_dma64_available(pa) to test if 64bit DMA addresses may be used.
This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>,
and there is more than 4G of memory.
2003-06-15 23:08:53 +00:00
thorpej
dbb0f0ebed Use aprint_normal() for cfprint routines. 2003-01-01 01:47:30 +00:00
thorpej
c5e91d447d Use CFATTACH_DECL(). 2002-10-02 04:55:47 +00:00
thorpej
f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
provos
0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
wrstuden
e85eb3093d Enable memory for cards with 64-bit memory mappings in addition to
32-bit memory mappings. Makes Intel GigE card work in my Beige G3.

Patch from thorpej
2002-08-22 22:47:35 +00:00
matt
2df1a9cfb4 Add more host-bridges. 2002-07-09 23:51:15 +00:00
thorpej
204183c0fa * Add "pcitag_t *pba_bridgetag" to pci_attach_args. This is set to
NULL for root PCI busses.  For busses behind a bridge, it points to
  a persistent copy of the bridge's pcitag_t.  This can be very useful
  for machine-dependent PCI bus enumeration code.
* Implement a machine-dependent pci_enumerate_bus() for sparc64 which
  uses OFW device nodes to enumerate the bus.  When a PCI bus that is
  behind a bridge is attached, pci_attach_hook() allocates a new PCI
  chipset tag for the new bus and sets it's "curnode" to the OFW node
  of the bridge.  This is used as a starting point when enumerating
  that bus.  Root busses get the OFW node of the host bridge (psycho).
* Garbage-collect "ofpci" and "ofppb" from the sparc64 port.
2002-05-16 01:01:28 +00:00
nathanw
32b0166603 Return ~0 for all config space reads on devices < 11 on the primary bus,
rather than returning ~0 for PCI_ID_REG and panicing otherwise.
2001-09-14 21:04:58 +00:00
wiz
c5a6be17f4 bcopy -> memcpy, bzero -> memset, bcmp -> memcmp.
Reviewed by Matt Thomas, ok'd by Tsubai Masanari.
2001-07-22 11:29:44 +00:00
simonb
d4bcd9c735 Add/change prototypes so that macpcc builds with -Wstrict-prototypes. 2001-06-19 12:02:55 +00:00
tsubai
1614d87d0e Support the new iBook. 2001-06-17 19:54:47 +00:00
simonb
e5bd00e48d For ports that wire up pciide in compatibility mode, have
them define __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
in pci_machdep.h and pciide_map_compat_intr() only calls
pciide_machdep_compat_intr_establish() if that preprocessor
define exists.

Ports that don't need to do this no longer need to supply a
dummy function.
2001-06-08 04:48:54 +00:00
matt
695e5e7ab5 Changes new pmap, common param.h, vmparam.h, and moved includes. 2001-06-06 17:50:14 +00:00
tsubai
3efddcd88e Configure PCI_INTERRUPT_LINE on the other side of the pci-bridge on OF3 too. 2001-01-09 08:04:53 +00:00
sommerfeld
851de295eb Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q
2000-12-28 22:59:06 +00:00
mrg
28d898391b remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h> 2000-06-29 08:10:45 +00:00
mrg
2f159a1bac remove/move more mach vm header files:
<vm/pglist.h> -> <uvm/uvm_pglist.h>
	<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
	<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
	<vm/vm_object.h> -> nothing
	<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
2000-06-26 14:20:25 +00:00
cgd
cffb580806 Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
2000-06-04 19:14:14 +00:00
tsubai
6bfa70b9c6 Remove an unused variable. 2000-02-04 07:48:11 +00:00
tsubai
a09eb087b6 Treat "chaos" like a bandit. 2000-02-04 03:40:42 +00:00
tsubai
e29a886cd6 * Split bandit and grackle.
* Add UniNorth support.

Now pcibus is attached like:
  bandit0 at mainbus0
  pci0 at bandit0 bus 0
  ...
2000-02-03 19:27:43 +00:00
danw
33051e5117 Use device_register to find the boot device more reliably. Should now work
on anything it's possible to boot from that we have a driver for.
2000-02-01 04:04:17 +00:00
tsubai
05ceaaaad5 Add UniNorth. 2000-01-25 07:19:11 +00:00
thorpej
1de974fc2e Use PCI products defined in pcidevs.h 2000-01-18 20:05:23 +00:00
wrstuden
0df8bcdc46 We need pciidereg.h to compile now. 1999-11-15 23:52:07 +00:00
thorpej
35df607966 Allow pci_init() to be called twice, once just to find the PCI-Host
bridges and determine the "pci chipset" values (for making PCI tags),
and again to actually map the configuration space registers.
1999-05-06 19:16:44 +00:00
tsubai
9042054e51 Fix a small bug to make both IO and MEM enable bits in csr are set. 1999-05-05 08:43:53 +00:00
thorpej
654b0fff46 - Completely rewrite how bus space tags for PCI space are set up. Instead
of hard-coding them, decode the "ranges" property of the PCI bus node in
OpenFirmware.
- Do a little cleanup, and share some more code between the Bandit/Chaos
and MPC106.

XXX The bus_space(9) implementation for macppc really needs to be
rewritten.
1999-05-05 04:37:19 +00:00
thorpej
c448c97f2b - Add come comments.
- Do a little cleanup.
- Protect the entirety of pci_conf_{read,write}() with splhigh()/splx().
1999-05-05 04:32:28 +00:00
wrstuden
9b0e678d51 Fix compilation errors. 1999-04-22 18:48:59 +00:00
thorpej
48a53c250d Add a stub pciide_machdep_compat_intr_establish() for Power Macintosh.
Power Macintoshes with PCI IDE (e.g. the new Blue G3) don't have them
wired to compatibility mode, so just return a NULL cookie.  We still have
to have this routine for the PCI IDE driver to link.
1999-04-16 21:15:29 +00:00
tsubai
7c3a6002b3 Use interrupt-map property rather than hard-coding irqs.
(From Dan Winship <danw@MIT.EDU>. Slightly modified by me)
1999-03-29 12:12:03 +00:00
cgd
284689634e Moved to arch/macppc/include/pci_machdep.h,v 1999-03-19 03:36:19 +00:00
tsubai
79c71e0bae Check the accessibility before reading from configuration space. 1999-03-15 03:03:10 +00:00
tsubai
630abfea00 Add PCI-PCI bridge support for Bandit. 1999-02-04 14:54:00 +00:00
tsubai
bdf1b68276 iMac support (not complete yet). 1998-12-29 06:27:59 +00:00
tsubai
325ecdada1 Use PCI function number correctly. 1998-10-21 08:58:36 +00:00
tsubai
810fcde7eb Set PCI bus number correctly. 1998-10-15 14:39:53 +00:00
mycroft
6d3d8a1350 Make copyright notices with my name consistent. 1998-08-15 03:02:31 +00:00
tsubai
1ca186e04d G3 Macs also needs to fix pci io/mem enable bits. 1998-07-24 20:53:57 +00:00