Home | History | Annotate | Download | only in vsa
History log of /src/sys/arch/vax/vsa/vsbus.c
RevisionDateAuthorComments
 1.69  17-Feb-2024  tsutsui Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@. Should be pulled up to netbsd-10 and -9.
 1.68  12-Dec-2022  jakllsch branches: 1.68.2;
vsbus vax: sprinkle volatile for register accesses
 1.67  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.66  24-Apr-2021  thorpej branches: 1.66.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.65  03-Sep-2018  riastradh branches: 1.65.4; 1.65.14;
Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.64  12-Apr-2018  ragge branches: 1.64.2;
Fix bug causing DMA to/from user space fail. Fixes PR#49517.
This bug has been around since 2003.
Thanks to Martin Husemann for providing hardware to debug on!
 1.63  22-May-2017  ragge branches: 1.63.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.62  07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.61  31-May-2015  abs Add missing break - from Felix Deichmann in PR port-vax/49935
 1.60  28-Jun-2012  abs branches: 1.60.2; 1.60.14; 1.60.16;
Define and use VS_REGS_KA49 rather than magic numbers. From OpenBSD.
 1.59  14-Dec-2010  matt branches: 1.59.8; 1.59.14;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.58  21-Nov-2009  rmind branches: 1.58.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.57  26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.56  19-Mar-2009  he Correct a few more bungled bcopy() -> memcpy() conversions.
 1.55  18-Mar-2009  cegger bcopy -> memcpy
 1.54  11-Mar-2008  matt branches: 1.54.4; 1.54.12; 1.54.18;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.53  03-Feb-2008  matt branches: 1.53.2; 1.53.6;
Reorganize a bit to be able to support multiple sgmaps.
 1.52  04-Mar-2007  christos branches: 1.52.20; 1.52.26;
Fix caddr_t fallout.
 1.51  04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.50  11-Dec-2005  christos branches: 1.50.26;
merge ktrace-lwp.
 1.49  26-Aug-2005  drochner s/locdesc_t/int/g
 1.48  30-Jun-2005  drochner branches: 1.48.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.47  01-Apr-2005  yamt merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.46  14-Dec-2004  chs branches: 1.46.2; 1.46.4;
use the generated macros in locators.h rather than hard-coded numbers
to index the cf_loc[] array. reviewed by allen briggs.
 1.45  02-May-2004  ragge Fix bug that were introduced together with the merge of nathanw_sa:
SCSI on VS2k/VS3100 stopped working. Spotted and fixed by Anders Hjalmarsson.
This fixes PR#25307.
 1.44  15-Jul-2003  lukem branches: 1.44.2;
__KERNEL_RCSID()
 1.43  18-Jun-2003  drochner branches: 1.43.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.42  01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.41  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.40  01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.39  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.38  01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.37  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.36  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.35  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.34  25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.33  01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.32  16-May-2001  matt branches: 1.32.2; 1.32.8; 1.32.16;
Add a VAXANY type. Eventually to used in INSTALL / GENERIC to easily
include support for all VAX platforms
 1.31  04-Feb-2001  ragge branches: 1.31.2;
Giant update from Michael Kukat (michael@unixiron.org).
Fixes support for:
MicroVAX 3100m90
MicroVAX 3100m95
VAX 4000/100 (tested)
VAX 4000/105A (tested)
VAX 4000/108
VAX 4000/400 (tested)
VAX 4000/500 (tested)
VAX 4000/600
 1.30  21-Nov-2000  chs eliminate TRUNC_PAGE() and ROUND_PAGE() in favor of their
lowercase counterparts. also, a little misc cleanup.
 1.29  29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.28  27-Jun-2000  mrg remove redundant vm includes.
 1.27  25-Jun-2000  ragge Make the HDC9224 MFM device driver up-to-date; has been not-working
since NetBSD 1.2 (!) It also uses interrupts instead of polling now.
Also fix the DMA area locking between SCSI and MFM disks.
Still missing - floppy support.
 1.26  18-Jun-2000  matt branches: 1.26.2;
We use opt_cputype.h now.
 1.25  26-May-2000  ragge branches: 1.25.2;
If we panic before the vsbus is found, don't panic again.
 1.24  23-Apr-2000  matt Extend asc driver to include support for the VS400/9x.
Add VS4000/9x support vsbus_dma.c
 1.23  08-Mar-2000  matt don't enable sgmap on ka49 yet.
 1.22  04-Mar-2000  matt expunge vm_offset_t and vm_size_t.
add bus_dma support for the vs4000 dma translation map (sgmap).
enhance the vsbus for the lance to work with it.
remove the sgmap init code from ka46/48/49.c
 1.21  24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.20  22-Oct-1999  ragge Add routines to copy to/from a user process from/to the vsbus DMA area.
 1.19  27-Aug-1999  ragge branches: 1.19.2; 1.19.4; 1.19.6;
Rearrange the interrupt detection code to work on the (slightly
different) VAXstation 4000/90.
 1.18  07-Aug-1999  ragge Clean up all bus handling stuff, it has become a mess the latest years.
Add a new bus; "ibus" that is the internal MicroVAX bus.
 1.17  14-Apr-1999  ragge First towards use of bus.h routines on vax. Allocate DMA memory for
LANCE chip on vaxstations.
 1.16  13-Mar-1999  ragge branches: 1.16.4;
Change vsbus to take a locator for all devices.
Figure out interrupt vector/mask on vsbus by forcing all devices to
generate interrupts in the match routine, like on unibus.
 1.15  09-Mar-1999  ragge Basic KA48 (VAXstation 4000 VLC) support.
From Michael Kukat <michael@camaronet.de>
 1.14  02-Feb-1999  ragge Another giant change: Allocate register space dynamic instead of compiled-in.
This is done on a physical page size basis, instead of virtual (as the
(on vax yet non-existing) bus_* routines does). This is similar to the
way uba allocation is done.
 1.13  06-Dec-1998  ragge Search for NCR controllers, but not on VS4000/60.
 1.12  10-Aug-1998  ragge Support for VS4000/60.
 1.11  04-Jun-1998  ragge Rudimentary support for the VS3100 builtin graphics console.
 1.10  21-May-1998  ragge Rewrite the autoconf code for VS3000's.
XXX - no support for any disks at all yet.
 1.9  24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.8  12-Jan-1998  thorpej Update for changes to config.
 1.7  03-Jan-1998  thorpej Grab the PCB directly from the u-area, not by indirecting through VM
structures.
 1.6  22-Mar-1997  ragge Update address struct to recognize KA420 motherboard.
 1.5  15-Mar-1997  ragge Add a forgotten #ifdef. Remove debug printout.
 1.4  13-Oct-1996  christos backout previous kprintf change
 1.3  11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2  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.1  20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.16.4.1  21-Jun-1999  thorpej Sync w/ -current.
 1.19.6.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.19.4.1  15-Nov-1999  fvdl Sync with -current
 1.19.2.3  11-Feb-2001  bouyer Sync with HEAD.
 1.19.2.2  22-Nov-2000  bouyer Sync with HEAD.
 1.19.2.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.25.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.26.2.1  31-Jul-2000  ragge Pull up revision 1.26-1.27 (requested by ragge):
Fixes broken MFM support + DMA area queueing.
(Approved a long time ago, but forgot to check it in :-)
 1.31.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.32.16.1  15-Jul-2002  gehenna catch up with -current.
 1.32.8.5  03-Jan-2003  thorpej Sync with HEAD.
 1.32.8.4  18-Oct-2002  nathanw Catch up to -current.
 1.32.8.3  20-Jun-2002  nathanw Catch up to -current.
 1.32.8.2  29-Mar-2002  ragge Initial nathanw_sa kernel support for vax.
 1.32.8.1  16-May-2001  ragge file vsbus.c was added on branch nathanw_sa on 2002-03-29 23:32:16 +0000
 1.32.2.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.32.2.1  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.43.2.6  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.43.2.5  01-Apr-2005  skrll Sync with HEAD.
 1.43.2.4  18-Dec-2004  skrll Sync with HEAD.
 1.43.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.43.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.43.2.1  03-Aug-2004  skrll Sync with HEAD
 1.44.2.1  05-May-2004  tron Pull up revision 1.45 (requested by ragge in ticket #245):
Fix bug that were introduced together with the merge of nathanw_sa:
SCSI on VS2k/VS3100 stopped working. Spotted and fixed by Anders Hjalmarsson.
This fixes PR#25307.
 1.46.4.1  12-Feb-2005  yamt use new apis.
 1.46.2.1  29-Apr-2005  kent sync with -current
 1.48.2.4  17-Mar-2008  yamt sync with head.
 1.48.2.3  04-Feb-2008  yamt sync with head.
 1.48.2.2  03-Sep-2007  yamt sync with head.
 1.48.2.1  21-Jun-2006  yamt sync with head.
 1.50.26.1  12-Mar-2007  rmind Sync with HEAD.
 1.52.26.1  18-Feb-2008  mjf Sync with HEAD.
 1.52.20.1  23-Mar-2008  matt sync with HEAD
 1.53.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.53.2.1  24-Mar-2008  keiichi sync with head.
 1.54.18.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.54.12.1  28-Apr-2009  skrll Sync with HEAD.
 1.54.4.2  11-Mar-2010  yamt sync with head
 1.54.4.1  04-May-2009  yamt sync with head.
 1.58.4.1  05-Mar-2011  rmind sync with head
 1.59.14.1  19-Jun-2015  snj Pull up following revision(s) (requested by abs in ticket #1303):
sys/arch/vax/vsa/vsbus.c: revision 1.61
Add missing break - from Felix Deichmann in PR port-vax/49935
 1.59.8.1  30-Oct-2012  yamt sync with head
 1.60.16.3  28-Aug-2017  skrll Sync with HEAD
 1.60.16.2  09-Jul-2016  skrll Sync with HEAD
 1.60.16.1  06-Jun-2015  skrll Sync with HEAD
 1.60.14.1  02-Jun-2015  sborrill Pull up the following revisions(s) (requested by abs in ticket #817):
sys/arch/vax/vsa/vsbus.c: revision 1.61

Fix VAX46 and VAX48 vsbus attach config. Addresses PR port-vax/49935.
 1.60.2.1  03-Dec-2017  jdolecek update from HEAD
 1.63.8.2  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.63.8.1  16-Apr-2018  pgoyette Sync with HEAD, resolve some conflicts
 1.64.2.1  10-Jun-2019  christos Sync with HEAD
 1.65.14.5  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.65.14.4  04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.65.14.3  03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.65.14.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.65.14.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.65.4.1  19-Feb-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #1800):

sys/arch/vax/vsa/vsbus.c: revision 1.69 (patch)
sys/arch/vax/vsa/ncr.c: revision 1.52

Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@.
 1.66.8.1  04-Aug-2021  thorpej Adapt to CFARGS().
 1.68.2.1  19-Feb-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #601):

sys/arch/vax/vsa/vsbus.c: revision 1.69
sys/arch/vax/vsa/ncr.c: revision 1.52

Fix SCSI tranfer corruption on VAXstation 3100/m30 (KA420) on netboot.

See my post on port-vax@ for details:
https://mail-index.netbsd.org/port-vax/2024/02/16/msg004866.html
and "go ahead!" from ragge@.

RSS XML Feed