Commit Graph

218 Commits

Author SHA1 Message Date
soda 52e3dc4e56 use I386_PCI_INTERRUPT_LINE_NO_CONNECTION instead of magic number. 2000-07-18 11:24:09 +00:00
soda 663add1b20 use PCI_INTERRUPT_PIN_MAX and I386_PCI_INTERRUPT_LINE_NO_CONNECTION,
instead of magic number
2000-07-18 11:23:28 +00:00
soda 81858d7c01 - Use PCIBIOS_PRINTV().
- Use PCI_INTERRUPT_PIN_MAX and I386_PCI_INTERRUPT_LINE_NO_CONNECTION
   instead of magic number.

the Following changes are
{Modified with,Approved by} UCHIYAMA Yasushi <uch@netbsd.org>:

 - Do not touch a PIRQ router, if the PIRQ is already routed
   by the BIOS, or no appropriate IRQ is found for the PIRQ.
   The latter prevents a panic on the machine of Frank van der Linden.

 - Do not modify a PCI Interrupt Configuration register,
   if it is already set by the BIOS, even if it is inconsistent
   with the PCI IRQ routing table provided by the BIOS.
   (The PCI Interrupt Configuration register seems to be more reliable
    than the PCI IRQ routing table.)
   This is needed to prevent a incorrect header_fixup() caused
   by the incorrect PIR table on a Panasonic Let's Note AL-N2T516J5.

   Provide "options PCIBIOS_INTR_FIXUP_FORCE" to retain
   previous behavior, i.e. believe the PCI IRQ routing table
   and ignore the PCI Interrupt Configuration register.
   Although I'm not sure this is really needed.

 - Do not modify a PCI Interrupt Configuration register,
   if appropriate IRQ is not found for the link.

 - Move a pciintr_icu_getclink() call and a pciintr_icu_get_intr()
   call from pciintr_link_fixup() to pciintr_link_alloc(),
   and only allocate pciintr_link_map if those calls succeeded.
   This reduces number of calls of pciintr_icu_getclink(),
   and also avoid necessity to validate a clink value in
   ICU's {get,set}_{intr,trigger}() functions.
   The sanity checks are not removed yet, though.

 - Fix uninitialized usage of variable `bitmap' on stage 3
   of pciintr_link_fixup().

 - Remove a member variable `old_irq' from struct pciintr_link_map.

 - Always use 0x%02x for printf format of canonical link value.

 - Use DIAGNOSTIC instead of PCIINTR_DEBUG for really weird situation.
2000-07-18 11:22:36 +00:00
soda b01ab37ef6 use PCIBIOS_PRINTV() defined in pcibios.h, instead of homegrown DPRINTF(). 2000-07-18 11:18:04 +00:00
soda 698b2b1173 - define pcibiosverbose here, instead of each C source.
- use PIR_DEVFUNC_{DEVICE,FUNCTION}.
2000-07-18 11:15:25 +00:00
soda 0e8343265b - define PCIBIOS_PRINTV() as pcibiosverbose printf() here,
instead of DPRINTF() in each C source.
 - define PIR_DEVFUNC_{DEVICE,FUNCTION}
2000-07-18 11:14:06 +00:00
soda 2f9cb9c128 add several debug printf which can be enabled by PIIX_DEBUG. 2000-07-18 11:10:22 +00:00
soda 9a7e0d82ac - deal with FIRESTAR_PIR_SELECT_PIRQ case on set/get_trigger(),
to prevent a panic on a Panasonic Let's Note AL-N2T516J5.
 - add several debug printf which can be enabled by FIRESTARDEBUG.
 by UCHIYAMA Yasushi <uch@netbsd.org>

 - use I386_PCI_INTERRUPT_LINE_NO_CONNECTION instead of magic number.
2000-07-18 11:07:20 +00:00
mycroft 4087b4e418 Do the interrupt fixup for all busses, not just bus 0.
This is necessary on some machines with multiple onboard PCI busses.
2000-07-09 00:42:47 +00:00
mrg b564830503 remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h> 2000-06-29 08:44:03 +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
uch a99c8407ab don't destroy PCI bus space extent for rbus_machdep.c 2000-05-31 16:38:55 +00:00
uch b444da72bd Skip fixup phase when system BIOS setting were perfect.
don't write 0 to command register. (it is harmful).
2000-05-17 09:50:34 +00:00
bouyer 9c43539f8f The VIA Technologies VT82C686A SMBus Controller claims to be a PCI/ISA
bridge, ignore it. Should fix kern/10093 by Mark Dohring.
2000-05-12 20:31:22 +00:00
drochner d5d280d015 -attach auxilary PCI buses at the 450NX chipset,
tested by hubertf in a small configuration (1 PXB - 2 PCI buses)
-being here, remove the per-VID/DID matching code which was commented
 out for a while
2000-05-11 16:44:14 +00:00
uch cc30f00dd3 PCI I/O address fixup routine.
When BIOS don't asign PCI I/O address space to device,
        allocate it without conflict and write to PCI configuration header.
2000-04-28 17:19:10 +00:00
uch e3c3882828 PCIBIOS_IRQS changed to PCIBIOS_IRQS_HINT. PCIBIOS_IRQS_HINT is
used when no IRQ guess. when at least 1 PCI device configured
        correctly, unused.
2000-04-28 17:15:15 +00:00
uch 298fbbd162 fix VP3_CFG_INTR_MASK 2000-04-22 15:00:41 +00:00
martin 0a1221cb28 Added a PCI frontend for the legacy ISA joystick driver.
Some PCI soundcards don't seem to use the generic gameport function with
interface 0x10 used here, but have either an own BAR dedicated to this
(i.e. Sonic Vibes or ESS Solo-1) or specify their own device (see
PCI_PRODUCT_CREATIVELABS_SBJOY in sys/dev/pci/pcidevs.h).
Probably these use a similar simple sheme and adding a frontend for them would
be trivial, but I don't own any of these cards, so I didn't.
2000-03-26 15:36:48 +00:00
soren c70220f2a2 Move PCIIDE_CHANNEL_NAME macro to pciidereg.h. 2000-03-09 20:26:31 +00:00
augustss 0acef2fd69 Allow the set of PCI irqs to be overridden. 2000-01-25 17:20:47 +00:00
uch 46fb1c9fce initialize pciirq. 1999-12-13 15:42:05 +00:00
thorpej 2128a07943 Put an interrupt-safe mutex around PCI configuration space access. 1999-12-11 20:48:25 +00:00
thorpej 7f28924acc If we see a bogus $PIR table entry, just ignore it. The MPIIX has
entries for the IRQs used by the IDE controller, which aren't really
PCI IRQs (they're ISA compat IRQs), and thus have link values that
don't make a lot of sense.
1999-11-17 18:55:15 +00:00
thorpej 0d79886ad5 Fix up the PCI bus numbering after fixing up interrupts. 1999-11-17 07:33:41 +00:00
thorpej f4b4d4508a Code from UCHIYAMA Yasushi's PCI BIOS patches to renumber the PCI
busses.
1999-11-17 07:32:58 +00:00
thorpej d6d9fbe240 Interrupt router drivers from UCHIYAMA Yasushi's PCI BIOS patches,
cleaned up and reworked a bit be me.
1999-11-17 01:21:20 +00:00
thorpej 2026e5f71b PCI interrupt routing fixup code, from UCHIYAMA Yasushi's PCI BIOS
patches, cleaned up and heavily reworked by me.  Basic algorithm is
the same, although the code structure is now quite different.

Main differences:
- Initialization path is totally different.
- We use the `compat router' information, if present, to determine which
  PCI ICU driver we should use.
- Fixup configuration headers on devices not on bus 0.
1999-11-17 01:20:38 +00:00
thorpej e345f0f17c Basic interface to the PCI BIOS and PCI Interrupt Routing table, separated
out from UCHIYAMA Yasushi's PCI BIOS patches, and fairly heavily reworked
by me.

Main differences:
- Only use the PCI BIOS to get the config mechanism and interrupt routing
  info for now.  No need to use the BIOS for PCI config access right now,
  since the old mechanism works fine, and this keeps the code smaller.
- PCI BIOS initialization code path is much different.
- Always use the $PIR table if it exists, and only fallback to the
  PCI BIOS 2.1 GetInterruptRouting call if it's not there.

This module does not include any of the fixup code; that is coming
in separate commits.
1999-11-17 01:16:36 +00:00
drochner 2576aadde3 add missing break, spotted by Wolfgang Solfrank 1999-09-20 16:07:45 +00:00
drochner 8137f06eac recognize SIS 85C503 as PCI-ISA bridge, from Gregory McGarry per PR
port-i386/7972
1999-07-14 09:18:20 +00:00
cgd 6d371b2fa9 Moved to arch/i386/include/pci_machdep.h,v 1999-03-19 03:36:14 +00:00
mycroft 59e2f9373d Indicate which IRQ is being used for compatibility interrupts. 1999-02-19 18:01:27 +00:00
drochner c6ca838916 defopt PCI_CONF_MODE 1999-01-28 12:43:13 +00:00
nathanw 788ff053de Fix up support for PCI attachments of pcic devices on i386 in general,
and the Cirrus Logic CL-PD6729 in particular.

From danw@mit.edu in PR port-i386/6436.
1998-12-20 17:53:28 +00:00
enami 92d5be6614 Explicitly test Intel 82371AB PCI-ISA bridge since *some* of them
identify themselves as miscellaneous bridge rather than isa bridge.
1998-10-26 03:47:19 +00:00
enami c8a28ce872 Cosmetic change; use tab for basic indentation rather than four space. 1998-10-26 03:43:52 +00:00
drochner ff455e77b6 Match pchb by class/subclass, like pcib.
Add a note about this strange Pequr host bridge in Compaq machines.
1998-10-10 14:12:21 +00:00
thorpej 67b94a13ed Add the Intel 82443BX PCI host bus adapter. From Soren S. Jorvang, PR #6250. 1998-10-08 20:04:32 +00:00
drochner 06753678d5 Remove the chips which are known to identify properly out of the
old "match" function - more or less for documentation.
Proposed by "Soren S. Jorvang" <soren@t.dk>.
1998-09-18 11:57:57 +00:00
drochner 1d34097b60 Take the Intel SIO into the special case list - it identifies itself
as "prehistoric". From John Kohl.
1998-09-18 11:13:10 +00:00
drochner 103b7e7b17 The Intel 82371MX identifies itself erroneously as a miscellaneous bridge.
(from "Johnny C. Lam" <lamj@stat.cmu.edu> per PR kern/6021)
1998-08-24 19:27:05 +00:00
mycroft 6d3d8a1350 Make copyright notices with my name consistent. 1998-08-15 03:02:31 +00:00
thorpej 330d142f16 vm_offset_t -> {vaddr_t,paddr_t}, vm_size_t -> vsize_t 1998-08-13 21:36:02 +00:00
drochner 026fbbe2db Match PCI-ISA bridges on class/subclass instead of vendor/device.
2 reasons:
-no need to keep a list of all known parts
-there is at least 1 bridge (ACC micro 2051) which reports the same
 device ID for its various subfunctions; this would require an additional
 check in the match function
(keep the old list inside #if 0 in case one of the historical bridges
doesn't report the right class/subclass - I can't check them all)
1998-08-07 10:15:32 +00:00
perry 584757c02b bzero->memset 1998-08-05 02:11:00 +00:00
mark 0756290d3f Recognise the ALI M1543 in order to support ALI Aladdin V chipset
motherboards.
1998-07-13 03:31:57 +00:00
mark 7778b00444 Recognise the ALI M1541 in order to support motherboards with the
ALI Aladdin V chipset.
1998-07-13 03:30:52 +00:00
drochner d1da31d671 redo the PCI configuration mode detection - should make some less
standard compliant PCI chipsets work (Compaq, Connectix emulated Triton)
fix the bug reported in PR port-i386/5727 (soda@sra.co.jp)
1998-07-09 20:19:52 +00:00
bouyer 9a862172cb PCI_PRODUCT_VIATECH_VT82C586 is now PCI_PRODUCT_VIATECH_VT82C586_ISA. 1998-06-15 20:10:31 +00:00
thorpej 02182100df Use config_defer(). 1998-06-09 18:49:33 +00:00
thorpej ec7941bba2 Nuke __BROKEN_INDIRECT_CONFIG. 1998-06-08 06:45:55 +00:00
thorpej 66f9322f5f EISA and PCI do not require bouncing; specify a bounce threshold of 0. 1998-06-03 06:35:49 +00:00
thorpej c099eb3a4a Add a function, pci_bus_flags(), that determines which flags (for memory
and i/o enabled) should be passed to the primary PCI bus's autconfiguration
node.  Use this function to detect broken PCI-Host bridges, which have
problems with memory-mapped access.  Add the SIS 85C496 to this list.
1998-05-04 18:49:07 +00:00
thorpej ff701f8abb Garbage-collect the DMA tag's "_cookie" member; it's not used for anything. 1998-04-26 22:37:20 +00:00
cgd 7fa109343c cope with name fixup in pcidevs 1998-03-28 02:12:02 +00:00
cgd ccdea2d9c8 machine-dependent bits (for compat interrupt mapping) of PCI IDE driver. 1998-03-04 06:35:47 +00:00
thorpej 424e1858c4 Use __BROKEN_INDIRECT_CONFIG where appropriate. 1998-02-06 08:00:52 +00:00
thorpej e56b1d0b2d Add an autoconfig node for PCI-EISA bridges. Configures EISA and ISA
bridges via callback.
1998-02-06 07:50:07 +00:00
thorpej 36760d9d94 Update for changes to config. 1998-01-12 18:59:04 +00:00
perry aceff90d16 add yet another PCI brige -- from pr 4780 from Nathan J. Williams 1998-01-10 01:15:14 +00:00
fvdl 83ef3d4928 Switch off CPU-PCI write posting for the Saturn chipset; it is known
to cause problems with PCI busmasters.
1998-01-09 22:34:58 +00:00
jtc 1bcecdd613 Fix tipo inherited from old version of TNF copyright template. 1997-10-09 08:48:33 +00:00
drochner e125082627 adapt to changed device names 1997-10-01 18:13:19 +00:00
thorpej 75a4512f7f Notify drivers that we "prefer" I/O mapped space, per discussion with
Chris Demetriou and Matt Thomas, some two or three months ago.  (This hint
is used by the latest "de" driver.)
1997-08-26 03:14:06 +00:00
fvdl 62e9894c48 Recognize some more chipsets. 1997-08-03 23:42:05 +00:00
perry 10838cb3ff Add another bridge ID, from pr 3926 submitted by Soren S. Jorvang 1997-07-30 21:25:00 +00:00
thorpej 9fefca0657 Update for repaired Triton MX PCI ID. 1997-06-24 06:21:22 +00:00
thorpej 63bad43fa4 Pull thorpej-bus-dma branch into mainline. 1997-06-06 23:28:40 +00:00
thorpej 14078d838d Remove comment about bus dma tag. I've been convinced otherwise. 1997-05-18 23:14:03 +00:00
thorpej 5e447974cb Add a comment about why the bus dma tag is not provided to the child
bus attaching to the bridge.
1997-05-18 05:30:34 +00:00
thorpej 2b8a15aed4 Add a comment about why the bus dma tag is not forwarded from parent
to child if an auxillary PCI bus is attached to the bridge.  Also,
remove an extra ';'.
1997-05-18 05:29:24 +00:00
jtk 86bf57701c add support for dual PCI bus Intel host/PCI bridge. Thanks to Chris Demetriou for his assistance in educating me about the vagaries of PCI and its configuration model. 1997-05-13 22:47:30 +00:00
mycroft 0b3a169a66 This is no longer needed. 1997-04-24 20:45:10 +00:00
jtk 4ed6c3b834 add support for ACC Micro host bridges 1997-04-13 22:48:27 +00:00
thorpej 01daecba3a Implement pci_decompose_tag(). 1996-12-17 01:55:56 +00:00
thorpej 35a40fda4b Implement a simple generic PCI-ISA bridge driver. This driver exists
primarily to nicely print version information about your PCI chipset
(try with "options PCIVERBOSE").  Eventually, it may be used to
enable/disable features/bugs of a given PCI chipset.  In addition, this
driver uses the PCI-ISA bridge callback mechanism to logically attach the
ISA bus to the PCI-ISA bridge.
1996-11-28 02:53:45 +00:00
thorpej 30612943e3 Implement a simple generic PCI-Host bridge driver. At the moment, this
driver is a place-holder, which will nicely print version information
about your PCI chipset (try with "options PCIVERBOSE").  Eventually,
this can be used to enable/disable features/bugs of individual PCI
chipsets.
1996-11-28 02:49:01 +00:00
fvdl 753949629e Make this compile again if PCI_CONF_MODE is defined (unused label). 1996-10-24 12:32:29 +00:00
thorpej 16c4c5af26 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:24:37 +00:00
christos bd73314ed9 backout previous kprintf changes 1996-10-13 03:19:38 +00:00
christos 06555645c2 printf -> kprintf, sprintf -> ksprintf 1996-10-11 00:24:36 +00:00
cgd 79e0a8a2b9 update for addition of a machine-dependent cookie as the first argument
to isa_intr_{,dis}establish().
1996-04-11 22:15:08 +00:00
mycroft 30c174cdcf Use a more standard and more sane error cleanup convention... 1996-03-27 06:49:54 +00:00
cgd da3136aba8 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) deprecate the pci_map_* functions, and provide them only
	    as compatibility interfaces (in pci_compat.c) which will
	    eventually go away, implemented as wrappers around
	    the functions described above.
	(5) make pci functions take as an argument a machine-dependent
	    cookie, to allow more flexibility in implementation.
1996-03-27 04:01:10 +00:00
cgd 0926920201 (1) 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)
(2) 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:37:59 +00:00
cgd c8487c701e reorganize mapping register definitions 1996-03-04 19:30:50 +00:00
cgd 591c6fd2cd make PCI bus match/attach and sub-device attachment machine-independent.
(remove that code from this file.)
1996-02-28 01:50:02 +00:00
mycroft 3da4b2a160 The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
1995-12-24 02:29:35 +00:00
cgd 0d41f58879 fix a pasto 1995-07-27 21:39:59 +00:00
mycroft fc427776a7 Add stuff for I/O mapping. 1995-07-27 00:29:02 +00:00
cgd 3722386a41 use new pcireg.h macros 1995-06-18 02:36:41 +00:00
mycroft 1922f9e648 Use the memory mapping set up by the BIOS. 1995-06-05 03:07:34 +00:00
cgd 471cfd3fc5 define pcicd, pciattach() here now. 1995-05-23 03:43:58 +00:00
cgd 8a640328ed clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration.  more work still needs to be done,
but it's getting better...
1995-04-17 12:06:30 +00:00
mycroft e25c1817cf kernel_pmap --> pmap_kernel() 1995-04-10 13:08:28 +00:00
mycroft 38c309142a Clean up deleted files. 1995-01-27 05:46:40 +00:00
cgd 249527c4f1 move mi pci files to /sys/dev 1995-01-27 05:46:39 +00:00
mycroft 52f079131b Incorporate recent changes from Wolfgang. Recognize the 815. 1995-01-16 21:48:35 +00:00
mycroft 290ed068ab Remove many of the `static's, to facilitate debugging. 1995-01-04 09:02:32 +00:00
mycroft 93a0c4a258 Add interrupt sharing types. 1995-01-03 01:42:11 +00:00
mycroft ff315ba9a4 Don't turn on the SCE bit in the enable register. 1994-12-28 19:45:41 +00:00
mycroft 8fd135209c Numerous changes. Many bugs fixed, better autoconfig, a few new features. 1994-12-28 19:42:47 +00:00
mycroft 35cdd801e6 Convert port, IRQ, and DRQ numbers to ints. 1994-11-18 21:57:40 +00:00
mycroft 29414c5a0a Change all of the uses of IRQ{0-15} and bit masks to use plain numbers
rather than bit shifting.
1994-11-04 18:34:50 +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
andrew 5a13863a4b Default to decent performance. 1994-10-27 02:04:18 +00:00
andrew fc67924047 Merge changes from Wolfgang Stanglmeier's 941012 release. 1994-10-27 02:02:00 +00:00
mycroft 6ddbe860c2 Update from Wolfgang Stanglemeier. 1994-10-01 06:27:56 +00:00
mycroft e4bc47c9fc Remove bogus attempt to map the interrupt pins here. The BIOS is supposed to
do it anyway.
1994-09-06 01:25:22 +00:00
mycroft 3c3258eb6d Make this work. 1994-08-11 04:54:13 +00:00
mycroft 55b11feb0a Update some comments. 1994-08-10 04:37:52 +00:00
mycroft 8dbfcf9e2e Add NCR 53c8XX driver, originally from Wolfgang Stanglmeier. 1994-08-09 22:20:44 +00:00
mycroft 6df721be97 Add PCI autoconfiguration support. 1994-08-09 00:47:46 +00:00