Home | History | Annotate | Download | only in gio
History log of /src/sys/arch/sgimips/gio/gio.c
RevisionDateAuthorComments
 1.38  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.37  24-Apr-2021  thorpej branches: 1.37.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.36  21-Nov-2019  macallan branches: 1.36.10;
ga_iot = 0 -> normal_memt
now a Challenge S should work again
from George Harvey
 1.35  20-Jul-2016  macallan branches: 1.35.16;
use bus_space_map() instead of fudging our own bus_space_handle_t
 1.34  18-Feb-2015  macallan branches: 1.34.2;
switch sgimips to common bus_dma and bus_space in arch/mips/
Tested on O2 and Indy.
Things that are compile-tested only for lack of hardware:
- GIO ethernet cards with PCI bridges
- IP2x hardware not found on Indy
- IP1x
 1.33  27-Oct-2012  chs branches: 1.33.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.32  01-Jul-2011  dyoung branches: 1.32.2; 1.32.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.31  18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.30  10-Feb-2009  rumble Be selective on match, since it makes sense to combine an IP12 and IP6
kernel and IP6 has no GIO bus.
 1.29  22-Feb-2007  thorpej branches: 1.29.46; 1.29.54; 1.29.60;
TRUE -> true, FALSE -> false
 1.28  21-Feb-2007  thorpej Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
 1.27  19-Feb-2007  rumble Support the sq(4) interface on the Challenge S's IOPLUS mezzanine. This
requires us to configure the IOPLUS to use the appropriate DMA channel,
depending on what other expansion cards may be installed. Further, we need
to do a bit more configuration of the sq(4) DMA engine, which apparently
was formerly being configured properly by the PROM. Use the same values,
which appear to work fine.

Also, extend the gio_arb_config interface as needed.

NB: We're currently setting the IOPLUS board to long burst, but it may be
better to use realtime. This will require some experimentation.
 1.26  29-Dec-2006  rumble branches: 1.26.2;
IP12 (and perhaps other systems) appear to be buggy and incapable of
reliably supporting badaddr(). False negatives appear to occur
approximately 1.8 percent of the time, although neither false positives
nor consecutive false negatives occur. We take advantage of the latter
property and always use a wrapper that makes multiple checks.

My IP12 no longer sees occasional ghost devices and related panics during
boot.
 1.25  29-Dec-2006  rumble Enable light(4).
 1.24  29-Dec-2006  rumble Rework GIO probing a bit.

Devices present on the GIO bus needn't always provide a Product
Indentification Word, even if their address space is the same as the
address space of a slot. Separate the handling of probing for slot-based
devices and graphics devices, matching the latter first, and precluding
addresses probed for the former when a graphics device is known to exist
in a slot's space.
 1.23  22-Dec-2006  rumble Indigo and Indigo2 machines have only one shared interrupt for the two
GIO slots. This differs from Indy, which has an interrupt per slot, neither
of which is the same as on the other two machines.

This lets my Phobos G160 run in both slots in my Indigo2 and my E++ adapter
works in both slots in my Indigo.
 1.22  30-Aug-2006  rumble branches: 1.22.2;
Implement the gio_arb_config() interface for changing the machine-specific
gio bus arbiter parameters via imc(4) or pic(4).

Slots are identified by name: GIO_SLOT_GFX, GIO_SLOT_EXP1, GIO_SLOT_EXP2.

Provide some helper functions for establishing interrupts associated with
each slot and obtaining product descriptions.
 1.21  11-Dec-2005  christos branches: 1.21.4; 1.21.8; 1.21.18;
merge ktrace-lwp.
 1.20  26-Aug-2005  drochner s/locdesc_t/int/g
 1.19  30-Jun-2005  drochner branches: 1.19.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.18  28-Jun-2005  drochner convert remaining autoconf bus "submatch" functions to use the new
signature (passing locators), and remove some which obviously don't
serve any purpose
(untested, sorry)
 1.17  29-Sep-2004  sekiya Use ANSI function declarations.
 1.16  06-Jul-2004  sekiya Many fixes to the grtwo wscons driver:

* fills seem to be broken. Avoid filling large vertical regions; instead,
attempt to break it up into managable chunks. This doesn't work perfectly
either, so clear the screen row-by-row (which does work).
* Characters are now right-side-up
* the driver now uses screen coordinates properly.

With the exception of column erases (which fall prey to the fill issue), the
driver is now usable.
 1.15  18-Mar-2004  sekiya Add console attach glue for GR2.
 1.14  11-Jan-2004  sekiya Reinstate symbolic device names -- I completely forgot about their use.
Reminder courtesy soren@
 1.13  10-Jan-2004  sekiya Add framework for gio card identification based on product ID. devlist2h.awk
was borrowed from sys/dev/pcmcia.
 1.12  15-Dec-2003  lonewolf Implement direct configuration for GIO devices.

XXX Still needs a way to handle Indigo2 spurious "productid 0x04 revision 0x00"
XXX phantom devices.
 1.11  17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.10  15-Jul-2003  lukem __KERNEL_RCSID()
 1.9  01-Jan-2003  thorpej branches: 1.9.2;
Use aprint_normal() for cfprint routines.
 1.8  09-Nov-2002  thorpej Fix signed/unsigned comparison warnings.
 1.7  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.6  01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.5  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.4  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.3  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.2  13-Mar-2002  simonb Replace lots of 8x<space> with <tabs> and other miscellaneous indentation
fixes.
Wrap a couple of long lines.
Use <return-type>\n<function name> as per KNF in a few places.
 1.1  14-Jun-2000  soren branches: 1.1.4; 1.1.6; 1.1.10; 1.1.14;
Simple GIO glue.
 1.1.14.4  03-Jan-2003  thorpej Sync with HEAD.
 1.1.14.3  11-Nov-2002  nathanw Catch up to -current
 1.1.14.2  18-Oct-2002  nathanw Catch up to -current.
 1.1.14.1  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.10.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.1.10.1  16-Mar-2002  jdolecek Catch up with -current.
 1.1.6.2  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.1.6.1  14-Jun-2000  bouyer file gio.c was added on branch thorpej_scsipi on 2000-11-20 20:23:42 +0000
 1.1.4.2  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1  14-Jun-2000  minoura file gio.c was added on branch minoura-xpg4dl on 2000-06-22 17:03:06 +0000
 1.9.2.5  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.2.4  19-Oct-2004  skrll Sync with HEAD
 1.9.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.9.2.1  03-Aug-2004  skrll Sync with HEAD
 1.19.2.3  26-Feb-2007  yamt sync with head.
 1.19.2.2  30-Dec-2006  yamt sync with head.
 1.19.2.1  21-Jun-2006  yamt sync with head.
 1.21.18.1  10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/arch/sgimips/gio/gio.c: revision 1.22
sys/arch/sgimips/gio/giovar.h: revision 1.7
Implement the gio_arb_config() interface for changing the machine-specific
gio bus arbiter parameters via imc(4) or pic(4).
Slots are identified by name: GIO_SLOT_GFX, GIO_SLOT_EXP1, GIO_SLOT_EXP2.
Provide some helper functions for establishing interrupts associated with
each slot and obtaining product descriptions.
 1.21.8.1  03-Sep-2006  yamt sync with head.
 1.21.4.1  09-Sep-2006  rpaulo sync with head
 1.22.2.1  12-Jan-2007  ad Sync with head.
 1.26.2.1  27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.29.60.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.29.54.2  28-Apr-2009  skrll Sync with HEAD.
 1.29.54.1  03-Mar-2009  skrll Sync with HEAD.
 1.29.46.1  04-May-2009  yamt sync with head.
 1.32.12.2  03-Dec-2017  jdolecek update from HEAD
 1.32.12.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.32.2.1  30-Oct-2012  yamt sync with head
 1.33.14.2  05-Oct-2016  skrll Sync with HEAD
 1.33.14.1  06-Apr-2015  skrll Sync with HEAD
 1.34.2.1  26-Jul-2016  pgoyette Sync with HEAD
 1.35.16.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.36.10.8  05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.36.10.7  05-Apr-2021  thorpej config_match() -> config_probe() for the straight-forward indirect config
cases. There are still a few odd balls using config_match() which should
be sorted out later.
 1.36.10.6  04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.36.10.5  03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.36.10.4  22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.36.10.3  22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.36.10.2  21-Mar-2021  thorpej CFARG_IATTR usage audit:

If a device carries only one interface attribute, there is no need
to specify it when calling config_search(); that specification is
meant only to disambiguate which interface attribute (which is a
proxy for "what kind of attach args are being used") is having
children attached. cfparent_match() will take care of ensuring that
any potential children can attach to one of the parent's iterface
attributes, and if the parent only carries one, no disambiguation is
necessary.
 1.36.10.1  20-Mar-2021  thorpej The proliferation if config_search_*() and config_found_*() combinations
is a little absurd, so begin to tidy this up:

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.37.8.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed