Commit Graph

48 Commits

Author SHA1 Message Date
kleink 7a6f003756 Add a comment describing the previous change. 2000-05-10 08:39:58 +00:00
kleink 05f0b17555 Make pci_get_capability() work correctly on both header type 0 and type 2
devices; both have different Capability List Pointer registers.
2000-05-08 10:52:38 +00:00
augustss 169ac5b3c1 Remove register declarations. 2000-03-30 12:41:09 +00:00
cgd 00f7a2d476 if the PCI_CONFIG_DUMP option is defined, set the patchable
pci_config_dump variable to 1.  otherwise, it gets set to 0.  If
that's set, when configuring PCI devices spew the very verbose
configuration space header dump that was previously "#if 0"'d.
If you use this option, or patch the variable to 1, it's strongly
encouraged that you have used the MSGBUFSIZE option to enlarge the
kernel message buffer.
2000-03-22 00:47:26 +00:00
thorpej 110ac27449 Make sure devices are told they can use rd/line, rd/mult, and wr/inval. 1999-11-04 19:03:00 +00:00
thorpej a4e1bde0b3 Print out if the read {line,multiple} and write/invalidate commands are
okay to use.
1999-11-04 01:03:34 +00:00
thorpej 964b69ec84 Back out previous. Thanks to cgd for pointing out another way to do this. 1999-05-06 01:10:28 +00:00
thorpej 2a4490daa5 Add a `bus' member to the pci_attach_args. This is not normally used,
but some child drivers might need to know this information.
1999-05-06 01:01:19 +00:00
drochner bbe9d71415 add support for "extended capabilities" (new in PCI spec 2.2) 1998-11-07 16:47:22 +00:00
mycroft 6d3d8a1350 Make copyright notices with my name consistent. 1998-08-15 03:02:31 +00:00
thorpej ab548fbb40 Remove the PCI-ISA bridge callback mechanism; it's no longer needed. 1998-06-09 18:48:41 +00:00
cgd 86585ca518 use the new PCI 'quirks' mechanism to help determine the number
of functions on a given device.  Also, clean up the #if 0'd
major-debugging-spew code so that it's all one piece, so that
it's a bit prettier, and so that it prints out quirk information.
1998-05-31 06:05:28 +00:00
cgd 9991233636 add an #if 0'd chunk which will pci_conf_print() every device (spews
lots of data, e.g. ~18k on a PCI system with few add-in devices; use
with MSGBUFSIZE=...).  Useful to have here so that people who want as
much data about the PCI configuration in a machine can get it without
having to craft their own code.  Also, clean up a few of the other
#if 0'd printfs.
1998-05-18 17:28:07 +00:00
mjacob ed8ddb6948 more info (in heavy debugging cases) to print 1998-05-05 22:14:23 +00:00
drochner 928943b2ff Keep all relevant state information in a "pci_softc" so that it is
accessible at runtime (for LKMs in particular).
Remove BROKEN_INDIRECT_CONFIG.
1998-04-17 18:40:31 +00:00
cgd 2f8f14b311 check vendor against PCI_VENDOR_INVALID instead of 0xffff.
Suggested by Soren S. Jorvang.
1998-03-28 02:24:04 +00:00
cgd bd31517508 check only the Vendor ID (rather than both the Vendor ID and the Product
ID) when determining if the Vendor ID is invalid.  The spec says that
Vendor ID of 0xffff is invalid, so, it doesn't _matter_ what the product
ID is in that case.  Treat Vendor ID 0 as invalid because we always have.
1998-03-20 19:56:19 +00:00
thorpej 480445c035 When a PCI bus is attached, print out which bus spaces were enabled
by the parent.
1998-01-31 00:37:39 +00:00
thorpej 06ce220790 Update for config changes. 1998-01-12 09:39:57 +00:00
mycroft 8c578dc960 Pass down bus_dma_tag_t's as appropriate (per Jason's bus_dma code). 1997-08-30 06:53:57 +00:00
mycroft e2bb22033b Remove pci_*_find() from here. 1997-08-30 06:47:44 +00:00
cgd cc93b2c4eb pass memory- and i/o-enabled flags down via the PCI bus and device attach
arguments, so that a device can tell if its memory and I/O spaces are
enabled.  The flags are cleared, depending on the contents of devices CSR
registers, in the machine-independent PCI bus code.
1997-04-10 23:12:16 +00:00
cgd 197d80c63a update these so they compile whether or not __BROKEN_INDIRECT_CONFIG
is defined.
1996-12-05 01:25:23 +00:00
cgd 828f1f3aa1 Provide a routine so that ISA/EISA bridges can set up a callback so
that their child busses can be attached after the PCI bus
autoconfiguration for their parent bus is done.

This works because:
	(1) there can be at most one ISA/EISA bridge per PCI bus, and
	(2) any ISA/EISA bridges must be attached to primary PCI
	    busses (i.e. bus zero).

That boils down to: there can only be one of these outstanding
at a time, it is cleared when configuring PCI bus 0 before any
subdevices have been found, and it is run after all subdevices
of PCI bus 0 have been found.

This (or something like it) is needed because there are some (legacy)
PCI devices which can show up as ISA/EISA devices as well (the prime
example of which are VGA controllers).  If you attach ISA from a
PCI-ISA/EISA bridge, and the bridge is seen before the video board is,
the board can show up as an ISA device, and that can (bogusly)
complicate the PCI device's attach code, or make the PCI device not be
properly attached at all.

This could be done with machine-dependent code, but as more ports
add support for PCI (and PCI-ISA/EISA bridges) more will need it.
The i386 port could (perhaps should) be converted to use it as well.
1996-11-23 21:58:16 +00:00
thorpej 546c8abcee New bus.h implementation/interface:
- No more distinction between i/o-mapped and memory-mapped
	  devices.  It's all "bus space" now, and space tags
	  differentiate the space with finer grain than the
	  bus chipset tag.
	- Add memory barrier methods.
	- Implement space alloc/free methods.
	- Implement region read/write methods (like memcpy to/from
	  bus space).
This interface provides a better abstraction for dealing with
machine-independent chipset drivers.
1996-10-21 22:56:24 +00:00
christos 86373f8cf9 backout kprintf changes 1996-10-13 01:37:04 +00:00
christos 95e30eafe7 printf -> kprintf, sprintf -> ksprintf 1996-10-10 19:58:18 +00:00
cgd 2a73ef60b7 change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
1996-08-27 21:53:46 +00:00
mycroft a2aa46e1c4 Add PCI_MAPREG_{IO,MEM}_SIZE(), and use them. 1996-07-26 07:13:52 +00:00
christos 2d0606e988 remove unused variables 1996-05-03 17:33:49 +00:00
cgd 87328287b7 modify these to provide a new, better-specified PCI interface
(soon to be documented on mailing lists; eventually in section 9 manual
pages), most importantly:
	(1) support interrupt pin swizzling on non-i386 systems with
	    PCI-PCI bridges (per PPB spec; done, but meaningless, on i386).
	(2) provide pci_{io,mem}_find(), to determine what I/O or memory
	    space is described by a given PCI configuration space
	    mapping register.
	(3) provide pci_intr_map(), pci_intr_string(), and
	    pci_intr_{,dis}establish() to manipulate and print info about
	    PCI interrupts.
	(4) make pci functions take as an argument a machine-dependent
	    cookie, to allow more flexibility in implementation.
1996-03-27 04:08:24 +00:00
cgd 72060dc6fa add definitions for the BIST/Header Type/Latency Timer/Cache Line Size
configuration space register, and use it to determine whether or not
a given PCI device uses multiple functions.
1996-03-27 00:13:50 +00:00
thorpej de7c200585 New device attachment scheme:
- split softc size and match/attach out from cfdriver into
	  a new struct cfattach.

	- new "attach" directive for files.*.  May specify the name of
	  the cfattach structure, so that devices may be easily attached
	  to parents with different autoconfiguration semantics.
1996-03-17 00:53:54 +00:00
cgd ba6d1cb2dd These devices don't actually need softc's that are supersets of 'struct
device.'  No point in adding that complexity + space if they're not needed,
so axe them.
1996-03-14 04:02:58 +00:00
cgd 7fda077700 (1) provide #defines for cf_loc[] entries for devices that attach to
pcibus and pci.
(2) remove the #ifdef i386 from pci.c, and provide a machine-dependent
    hook (pci_md_attach_hook()) to do any machine-dependent attachment
    gunk, e.g. on the i386 printing out the configuration mode (if bus 0)
(3) don't pass max device number for a given bus in, use
    PCI_MAX_DEVICE_NUMBER, which can be defined on a per-machine basis.
    (defaults to 32.  on i386, it's 32 if pci conf mode == 1, 16 if 2.)
1996-03-14 02:35:32 +00:00
cgd a38dcb7018 remember the bus_chipset_tag_t given by our parent, and pass it on to
children.
1996-03-08 20:34:25 +00:00
cgd acabb62791 the i386 port no longer attaches isa, eisa, and pci at root. 1996-03-04 03:29:12 +00:00
cgd a4d39f5063 fix uninitialized variable; it shouldn't have been a variable at all.
(when probing to see if a device is there, always probe function 0.)
1996-03-02 02:03:55 +00:00
cgd f1f9317dfb make PCI bus match/attach and sub-device attachment machine-independent. 1996-02-28 01:44:41 +00:00
cgd ae76c070ec oops; forgot this in last commit 1995-06-17 23:06:44 +00:00
cgd bad826164e split single-subdevice lookup & attachment into a subroutine
(pci_attach_subdev()).  remove pciattach() function and the pcicd cfdriver
struct, the former because thre are a lot of attachment actions which really
are machine-dependent (perhaps even "most"), and the latter because now that
both pcimatch() and pciattach() are machine-dependent it's bad style to
declare them here and it gains nothing.
1995-05-23 03:43:06 +00:00
cgd 87ed227cb4 include files from the correct places. 1995-01-27 05:44:29 +00:00
mycroft f8183b2d0e Make a wrapper match function to check the bus and device numbers, rather
than insisting that every driver do it.
1994-11-04 09:42:18 +00:00
mycroft 94cde915db Rename pciprobe() to pcimatch(), and move it to pci_machdep.c. 1994-11-03 22:27:16 +00:00
mycroft e06bd72a85 Always use direct configuration. 1994-11-03 22:15:19 +00:00
cgd 022ee8f7fe new RCS ID format. 1994-10-27 04:14:23 +00:00
mycroft 55b11feb0a Update some comments. 1994-08-10 04:37:52 +00:00
mycroft 6df721be97 Add PCI autoconfiguration support. 1994-08-09 00:47:46 +00:00