Home | History | Annotate | Download | only in tc
History log of /src/sys/dev/tc/tc.c
RevisionDateAuthorComments
 1.60  13-May-2024  msaitoh s/of of/of/ in comment.
 1.59  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.58  07-May-2021  thorpej branches: 1.58.6;
A small bit of const poisoning.
 1.57  24-Apr-2021  thorpej branches: 1.57.2;
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.56  10-Jun-2017  flxd branches: 1.56.22;
Fix missing TC bus speed.
 1.55  09-Jun-2017  flxd Make VAXstation 4000 TURBOchannel adaptor work.
PIO and IRQ tested on VS4000/60 and /96 with TC-USB (slhci) and PMAD-AA (le).
DMA is untested.
vax needs space to be mapped out, so memory space is pre-mapped for TC option
drivers not bus_space'ified yet, also providing custom bus_space methods for
this kludge.
 1.54  12-Dec-2016  flxd branches: 1.54.8;
Clean-up (remove redundant declarations, concentrate checks).
 1.53  19-Jul-2016  christos make the check work with widths other than 4, Felix Deichmann
 1.52  19-Jul-2016  christos PR/50849: Felix Deichmann: Relax TC option ROM header check for ROM widths < 4
 1.51  04-Jun-2011  tsutsui branches: 1.51.12; 1.51.30; 1.51.34;
Split device_t/softc. pmax is tested on GXemul.
Compile test only for alpha and vax.

XXX: alpha/tc/tcasic.c calls tcattach() via config_found(9), but
XXX: pmax/tc/tcbus.c and vax/vsa/tc_vsbus.c calls tcattach() directly.
XXX: It looks horrible...
 1.50  12-May-2009  cegger branches: 1.50.4; 1.50.6; 1.50.10;
struct device * -> device_t, no functional changes intended.
 1.49  12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.48  11-Jun-2008  tsutsui branches: 1.48.10;
Use device_lookup_private() to get softc.
XXX this driver assumes cf_unit is always zero
 1.47  19-Feb-2008  matt branches: 1.47.6; 1.47.8; 1.47.10; 1.47.12; 1.47.14;
Fix TC on VAX. (missed committing these earlier)
 1.46  12-Apr-2007  matt branches: 1.46.8;
Make tc_knowndevs const.
 1.45  31-Mar-2006  thorpej branches: 1.45.14; 1.45.18; 1.45.20;
Use ANSI function decls, apply static.
 1.44  30-Mar-2006  thorpej Use device_private().
 1.43  11-Dec-2005  christos branches: 1.43.4; 1.43.6; 1.43.8; 1.43.10; 1.43.12;
merge ktrace-lwp.
 1.42  26-Aug-2005  drochner kill some more simple submatch() functions, use config_stdsubmatch()
 1.41  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.40  04-Feb-2005  perry branches: 1.40.6;
de-__P
 1.39  26-Aug-2004  drochner branches: 1.39.4; 1.39.6;
some cleanup: use the locator-passing variant of config_found(), get
the macros just hiding cfdata members out of tcvar.h and include
"locators.h" only in the .c file
 1.38  27-Apr-2004  yamt remove redundant function prototypes to make this compilable after
snprintf changes.
 1.37  22-Apr-2004  itojun sprintf -> snprintf
 1.36  26-Sep-2003  tsutsui Remove casts and use %x in printf for tc_offset_t,
which is int32_t on both alpha and pmax.
 1.35  01-Jan-2003  thorpej branches: 1.35.2;
Use aprint_normal() in cfprint routines.
 1.34  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.33  01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.32  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.31  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.30  27-Sep-2002  thorpej Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.29  13-Nov-2001  lukem add/cleanup RCSIDs
 1.28  04-Jun-2000  cgd branches: 1.28.4; 1.28.6;
Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.27  15-Nov-1999  nisimura branches: 1.27.2;
Relocate 'struct tc_softc' and several function declarations useful
to outsides of 'tc.c' into 'tcvar.h'.
 1.26  22-May-1998  thorpej branches: 1.26.14; 1.26.20;
DECstation now provides bus_space and bus_dma data structures to us.
 1.25  19-Jan-1998  thorpej On the Alpha, pass down per-slot DMA tags to children.
 1.24  12-Jan-1998  thorpej Adjust for changes in config.
 1.23  13-Sep-1997  enami Declare TCVERBOSE by defopt in files.tc. Include opt_tcverbose.h in tc.c.
 1.22  22-Jul-1997  jonathan branches: 1.22.2;
Garbage-collect __BROKEN_INDIRECT_CONFIG from /sys/dev/tc
 1.21  05-Dec-1996  cgd update these so they compile whether or not __BROKEN_INDIRECT_CONFIG
is defined.
 1.20  22-Oct-1996  cgd update for new bus.h
 1.19  13-Oct-1996  christos backout kprintf changes
 1.18  10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.17  27-Aug-1996  cgd 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).
 1.16  17-May-1996  cgd (on the alpha) pass the bus_chipset_tag_t given to the bus down to the
devices.
 1.15  29-Apr-1996  cgd fix printf bogon (need : and space)
 1.14  18-Apr-1996  cgd remove unnecessary header inclusion (machine/autoconf.h) and now-bogus comment.
also, trim spaces at ends of lines, etc.
 1.13  09-Apr-1996  jonathan Fixes for -Wall -Wmissing-prototypes:
include <sys/systm.h> to get a prototyped declaration of printf().
include <machine/autoconf.h> for port-specific typedefs.
Remove unused variables.
 1.12  17-Mar-1996  jonathan Additional fixes to complete the NetBSD/1.1B config changes:

change tc_submatch() to compile with the new device-attach scheme:
the TC bus uses a 'submatch' function which checks device locators
and then calls a match function.
Instead of calling cf->cf_driver->cd_match(), we now need to call
cf->cf_attach->ca_match().
 1.11  17-Mar-1996  thorpej 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.
 1.10  05-Mar-1996  cgd split device info into driver name and human readable description.
 1.9  02-Mar-1996  cgd change printing of unknown device names when not (BUS)VERBOSE slightly
 1.8  02-Mar-1996  cgd add ability to define TCVERBOSE, and get "human names" about "known"
but unconfigured (or unsupported) devices printed at boot time.
The device list is woefully incomplete, because i didn't put much time
in it, and because i don't know good "human names" for many TC devices.
 1.7  27-Feb-1996  cgd use config_found_sm(), rather than config_search+config_attach()+glue, to
attach subdevices.
 1.6  27-Feb-1996  cgd fix first args in tcprint() invocations. Fix for this (and several previous
commits) from Jonathan. This is why one (I) shouldn't commit code w/o
having any sane way to test it.
 1.5  27-Feb-1996  cgd one more minor oops; print our name, not parent's, when doing unconfigured dev
 1.4  27-Feb-1996  cgd fix bug in previous commits. also, do submatch checking for all devices,
not just option slot devices.
 1.3  27-Feb-1996  cgd use #defines for bus speed constants, print speed on attach
 1.2  26-Feb-1996  cgd (1) rename some structures & structure members, for consistency with
planned changes in other sections of code.
(2) expands the use of config_found() in tcattach() in-line, so that
tcsubmatch can be invoked there, rather than being invoked by
individual drivers.
(3) tcbus_attach_args now includes a turbochannel speed flag.
(4) compare a string in tcbus_attach_args against tc bus driver name,
to better allow attachment of multiple busses to the same parent.
 1.1  20-Dec-1995  cgd machine-independent TurboChannel bus configuration. These files
deal with stuff like:
(1) configuring built-in devices,
(2) looking at TC slots configuring any devices found.
The lists of slots, slot locations, etc. and built-in devices
are provided by machine-dependent code. Interrupt handling
is also provided by machine-dependent code, but the MD code provides
hooks so that standard names for 'establish' and 'disestablish'
can be used in drivers.

This code requires <machine/tc_machdep.h>, which defines some
portability types specific to the TurboChannel bus code.
 1.22.2.1  16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.26.20.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.26.14.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.27.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.28.6.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.28.6.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.28.4.3  03-Jan-2003  thorpej Sync with HEAD.
 1.28.4.2  18-Oct-2002  nathanw Catch up to -current.
 1.28.4.1  14-Nov-2001  nathanw Catch up to -current.
 1.35.2.6  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.35.2.5  04-Feb-2005  skrll Sync with HEAD.
 1.35.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.35.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.35.2.2  03-Sep-2004  skrll Sync with HEAD
 1.35.2.1  03-Aug-2004  skrll Sync with HEAD
 1.39.6.1  12-Feb-2005  yamt sync with head.
 1.39.4.1  29-Apr-2005  kent sync with -current
 1.40.6.3  27-Feb-2008  yamt sync with head.
 1.40.6.2  03-Sep-2007  yamt sync with head.
 1.40.6.1  21-Jun-2006  yamt sync with head.
 1.43.12.2  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.43.12.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.43.10.1  19-Apr-2006  elad sync with head.
 1.43.8.1  01-Apr-2006  yamt sync with head.
 1.43.6.1  22-Apr-2006  simonb Sync with head.
 1.43.4.1  09-Sep-2006  rpaulo sync with head
 1.45.20.1  11-Jul-2007  mjf Sync with head.
 1.45.18.1  27-May-2007  ad Sync with head.
 1.45.14.1  15-Apr-2007  yamt sync with head.
 1.46.8.1  23-Mar-2008  matt sync with HEAD
 1.47.14.1  18-Jun-2008  simonb Sync with head.
 1.47.12.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.47.10.2  16-May-2009  yamt sync with head
 1.47.10.1  04-May-2009  yamt sync with head.
 1.47.8.1  17-Jun-2008  yamt sync with head.
 1.47.6.1  29-Jun-2008  mjf Sync with HEAD.
 1.48.10.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.50.10.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.50.6.1  06-Jun-2011  jruoho Sync with HEAD.
 1.50.4.1  12-Jun-2011  rmind sync with head
 1.51.34.2  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.51.34.1  26-Jul-2016  pgoyette Sync with HEAD
 1.51.30.3  28-Aug-2017  skrll Sync with HEAD
 1.51.30.2  05-Feb-2017  skrll Sync with HEAD
 1.51.30.1  05-Oct-2016  skrll Sync with HEAD
 1.51.12.1  03-Dec-2017  jdolecek update from HEAD
 1.54.8.2  01-Jul-2017  snj Pull up following revision(s) (requested by flxd in ticket #66):
sys/dev/tc/tc.c: revision 1.56
Fix missing TC bus speed.
 1.54.8.1  01-Jul-2017  snj Pull up following revision(s) (requested by flxd in ticket #65):
share/man/man4/tc.4: revision 1.7
sys/arch/alpha/tc/tcasic.c: revision 1.46
sys/arch/pmax/tc/tcbus.c: revision 1.33
sys/arch/vax/conf/files.vax: revision 1.121
sys/arch/vax/vsa/tc_vsbus.c: revision 1.8, 1.9
sys/dev/tc/tc.c: revision 1.55
sys/dev/tc/tcvar.h: revision 1.27
Make VAXstation 4000 TURBOchannel adaptor work.
PIO and IRQ tested on VS4000/60 and /96 with TC-USB (slhci) and PMAD-AA (le).
DMA is untested.
vax needs space to be mapped out, so memory space is pre-mapped for TC option
drivers not bus_space'ified yet, also providing custom bus_space methods for
this kludge.
--
whitespace
--
Add vax.
 1.56.22.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.56.22.1  22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.57.2.1  13-May-2021  thorpej Sync with HEAD.
 1.58.6.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed