Home | History | Annotate | Download | only in pci
History log of /src/sys/dev/pci/puc.c
RevisionDateAuthorComments
 1.42  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.41  24-Apr-2021  thorpej branches: 1.41.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.40  30-Nov-2018  jmcneill branches: 1.40.14;
Add support for polling com devices when no interrupt is available.
 1.39  07-Jul-2016  msaitoh branches: 1.39.16; 1.39.18;
KNF. Remove extra spaces. No functional change.
 1.38  04-May-2015  ryo PR/49819: Roberto E. Vargas Caballero: Add support for SystemBase SB16C1050 PCI serial card
 1.37  07-Feb-2014  msaitoh branches: 1.37.6;
s/mesage/message/
 1.36  23-Jul-2013  soren Restrict the hack for offset BAR's to x86.
A cleaner fix requires a rewrite of puc.c, but not today.
 1.35  22-Jul-2013  soren Oops.
 1.34  22-Jul-2013  martin Unbreak the build - soren, please review!
 1.33  22-Jul-2013  soren Allow console on com_puc without a compile-time option so that PC servers
can become headless after the first reboot (sadly, e.g. Intel AMT presents
as a com_puc, but doesn't appear in the BIOS serial port table, so you need
a keyboard and monitor to install and set the installboot parameters first).

Fix com_puc console on devices with offset BAR's.
 1.32  28-May-2011  ryo branches: 1.32.4; 1.32.14; 1.32.18; 1.32.26;
Add support for SYSTEMBASE SB16C105x 4-port/8-port serial PCI cards.

- Added initialize code for SB16C105x to puc.c, but
It is better to add a member (*config_function)() to
struct puc_device_description and use it
- It seems SB16C1054 *rev 0x91* has different BAR layout, but not supported yet.
 1.31  09-Jul-2008  joerg branches: 1.31.16; 1.31.22;
- device/softc split
 1.30  10-Apr-2008  cegger branches: 1.30.4; 1.30.6; 1.30.8; 1.30.10;
use aprint_*_dev and device_xname
 1.29  16-Nov-2006  christos branches: 1.29.48;
__unused removal on arguments; approved by core.
 1.28  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.27  11-Dec-2005  christos branches: 1.27.20; 1.27.22;
merge ktrace-lwp.
 1.26  26-Aug-2005  drochner kill some more simple submatch() functions, use config_stdsubmatch()
 1.25  25-Aug-2005  drochner replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
 1.24  28-Jun-2005  thorpej branches: 1.24.2;
Use ANSI function decls and static.
 1.23  27-Feb-2005  perry nuke trailing whitespace
 1.22  04-Feb-2005  perry de-__P
 1.21  13-Sep-2004  drochner branches: 1.21.4; 1.21.6;
a round of autoconf cleanup:
-convert submatch() style functions (passed to config_search() or
config_found_sm()) to the locator passing variants
-pass interface attributes in some cases
-make submatch() functions look uniformly as far as possible
-avoid macros which just hide cfdata members, and reduce dependencies
on "locators.h"
 1.20  03-Feb-2004  fredb Enable the 8X clock on the SIIG Cyberserial serial and combination PCI
cards at attachment time, in order to support bit rates greater than 115K,
as discussed on tech-kern.
 1.19  25-Jan-2004  jdolecek pass the DMA tags to child devices, too
 1.18  19-Mar-2003  christos branches: 1.18.2;
It is not appropriate for pcivar.h to include "locators.h"
The two files that need it, should include it themselves.
 1.17  01-Jan-2003  thorpej Use aprint_normal() in cfprint routines.
 1.16  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.15  30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.14  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.13  27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.12  13-Nov-2001  lukem add RCSID
 1.11  02-Mar-2001  thorpej branches: 1.11.2; 1.11.4;
In the self-describing bogus code block, at least use plausible
subclass IDs.
 1.10  03-Jan-2001  bouyer Add a 'flag' member to struct puc_attach_args and struct port. For
PUC_PORT_TYPE_COM, use it to store the clock frequency (with 8 lower bits
to 0, used for real flags if needed).
Update all descriptions to set flags to 0 for LPT or COM_FREQ for COM.
Add support for the VScom PCI-800H 8 port serial adapter (which uses
a 14.7456 Mhz crystal instead of the standart 1.8432Mhz :)
XXX now that we can pass other frequency than COM_FREQ, the VScom PCI-800
entry could probably be updated to DTRT - does anyone have one ?
 1.9  28-Dec-2000  sommerfeld 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
 1.8  29-Jul-2000  jhawk Whitespace fix (space rather than tab after #ifdef)
 1.7  29-Jul-2000  jlam Make this compile without PUCCN defined.
 1.6  28-Jul-2000  castor Guard the console code in puc.c with the defopt PUCCN so we can
use the puc driver without having the com drivers.
 1.5  25-Jul-2000  jeffs Add code to allow the PCI com serial ports to be used as the system
console. This is not enabled by default, and is turned on with
options PUCCN. Done by castor@netbsd.org.
 1.4  17-Apr-2000  cgd branches: 1.4.4;
#if 0 the (way bogus) PCI_CLASS_COMMUNICATIONS/PCI_SUBCLASS_BRIDGE_PCI (!!!)
match pointed out (again?) by Johan Danielsson, after i repeatedly told
him not to do something similar in com_cardbus.
 1.3  06-Feb-1999  cgd branches: 1.3.8;
add code to cope with multiple ports per BAR, as are found, for instance,
on the 8 port card Simon Gerraty has. In general, cards which have
this lots of ports also have a separate interrupt status register, but
this change is just to talk to the various ports independently. It works,
but it's not optimal. (XXX still need a good name for the card in the
comments, and to update the manual page.)
 1.2  21-Dec-1998  drochner use a symbolic definition for the PCI subsystem ID
 1.1  26-Jun-1998  cgd add a driver for "PCI 'universal' communications" cards, that is, PCI cards
which contain 'standard' com- and lpt-type ports. Some of these present
as PCI simple-communications/serial or simple-communications/parallel
devices, but many do not. (Additionally, there is no document that I can
find that describes the "specific well-konwn register-level" description
of how the 'standard' devices' config space headers shold work.) Eventually,
some of the devices driven by this code should become simple pci attachments
for the 'lpt' and 'com' drivers, but that requires solid documentation.
 1.3.8.3  12-Mar-2001  bouyer Sync with HEAD.
 1.3.8.2  05-Jan-2001  bouyer Sync with HEAD
 1.3.8.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.4.2  22-Mar-2001  he Apply patch (requested by he):
The function puc_find_description() is now external, so make it so.
 1.4.4.1  22-Mar-2001  he Pull up revisions 1.10-1.11 (requested by sommerfeld):
Add support for NetMos NM9835, Titan PCI-800H, Lava 8-port,
Actiontec 56K PCI Master. This also adds a ``flags'' member
to two structs in this driver.
 1.11.4.2  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.11.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.11.2.3  03-Jan-2003  thorpej Sync with HEAD.
 1.11.2.2  18-Oct-2002  nathanw Catch up to -current.
 1.11.2.1  14-Nov-2001  nathanw Catch up to -current.
 1.18.2.6  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.18.2.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.18.2.4  04-Feb-2005  skrll Sync with HEAD.
 1.18.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.18.2.1  03-Aug-2004  skrll Sync with HEAD
 1.21.6.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.21.6.1  12-Feb-2005  yamt sync with head.
 1.21.4.1  29-Apr-2005  kent sync with -current
 1.24.2.2  30-Dec-2006  yamt sync with head.
 1.24.2.1  21-Jun-2006  yamt sync with head.
 1.27.22.2  10-Dec-2006  yamt sync with head.
 1.27.22.1  22-Oct-2006  yamt sync with head
 1.27.20.1  18-Nov-2006  ad Sync with head.
 1.29.48.2  28-Sep-2008  mjf Sync with HEAD.
 1.29.48.1  02-Jun-2008  mjf Sync with HEAD.
 1.30.10.1  19-Oct-2008  haad Sync with HEAD.
 1.30.8.1  18-Jul-2008  simonb Sync with head.
 1.30.6.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.30.4.1  04-May-2009  yamt sync with head.
 1.31.22.1  06-Jun-2011  jruoho Sync with HEAD.
 1.31.16.1  31-May-2011  rmind sync with head
 1.32.26.1  23-Jul-2013  riastradh sync with HEAD
 1.32.18.2  18-May-2014  rmind sync with head
 1.32.18.1  28-Aug-2013  rmind sync with head
 1.32.14.2  03-Dec-2017  jdolecek update from HEAD
 1.32.14.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.32.4.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.37.6.2  09-Jul-2016  skrll Sync with HEAD
 1.37.6.1  06-Jun-2015  skrll Sync with HEAD
 1.39.18.1  10-Jun-2019  christos Sync with HEAD
 1.39.16.1  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.40.14.2  22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.40.14.1  22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.41.8.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed