Home | History | Annotate | Download | only in dev
History log of /src/sys/arch/sparc64/dev/sab.c
RevisionDateAuthorComments
 1.58  26-Oct-2022  riastradh sparc64/sab(4): Convert to ttylock/ttyunlock.
 1.57  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.56  24-Apr-2021  thorpej branches: 1.56.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.55  31-Oct-2017  martin branches: 1.55.18;
As discussed on tech-kern: define a new tty internal state flag: TS_KERN_ONLY

Implement it in a few tty drivers. If this flag is set, the underlying
hardware is used by another driver and userland has no right to open
it. A few uses will appear soon in sys/dev/sun/sun{kbd,ms}.c.
 1.54  15-Nov-2014  christos branches: 1.54.12;
centralize the call unit / dialout macros
 1.53  01-Nov-2014  nakayama Convert sab_shutdown from deprecated shutdownhook_establish(9) API
to PMF(9) framework.

Tested on Ultra 60 with serial console.
 1.52  25-Jul-2014  dholland branches: 1.52.2;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.51  16-Mar-2014  dholland branches: 1.51.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.50  15-Sep-2013  martin Remove unused variable
 1.49  03-Oct-2012  mlelstv branches: 1.49.2;
Only initialize when we are the first opener.
 1.48  02-Jun-2011  christos branches: 1.48.2; 1.48.12;
split auxio, ebus, psycho, sab.
 1.47  24-May-2011  mrg branches: 1.47.2;
also match the fujitsu sab: "FJSV,se" (from openbsd, pointed out by jdc)
 1.46  24-Apr-2011  rmind Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.45  11-Mar-2010  mrg branches: 1.45.2; 1.45.4;
various aprint_* fixes.
 1.44  18-Jan-2010  jdc branches: 1.44.2;
Re-do the previous check for the RSC console:
Do the check in sabtty_console_flags() and set a flag if we are an RSC port.
If we are an RSC port, note that the baud rate is 115200, but don't write a
new value to the baud rate generator register, as this stops the console
working.
 1.43  30-Dec-2009  jdc Check for "ssp-console" and "ssp-control" properties.
If we find them, set the baud rate to 115200.
This allows the RSC to be the console on an E250:

sab1 at ebus0 addr 200000-20007f ipl 35: rev 3.2
sabtty2 at sab1 port 0: console i/o
sabtty3 at sab1 port 1

XXX; We should really check the baud rate properties and use those to set
our rates.
 1.42  11-Jun-2008  cegger branches: 1.42.6; 1.42.14;
use device_lookup_private to get softc
fixes build errors about pointer type mismatches in assignment
 1.41  25-May-2008  ad branches: 1.41.2;
Properly fix the "hanging in tty" bug that was worked around with cv_wakeup()
some time again.
 1.40  28-Nov-2007  ad branches: 1.40.14; 1.40.16; 1.40.18; 1.40.20;
Use the softint API.
 1.39  19-Nov-2007  ad - Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.38  07-Nov-2007  ad Merge tty changes from the vmlocking branch.
 1.37  04-Mar-2007  christos branches: 1.37.2; 1.37.18; 1.37.20; 1.37.24; 1.37.26;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.36  19-Oct-2006  martin branches: 1.36.4;
kgdb support for sabtty
 1.35  01-Oct-2006  elad More from Matt Fleming:

Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
 1.34  01-Oct-2006  elad Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks!
 1.33  01-Oct-2006  martin When setting parameters, we should not only calculate the settings but
better write them back to the chip.
 1.32  01-Oct-2006  martin Use device_xname() accessor
 1.31  28-Jul-2006  hannken branches: 1.31.4; 1.31.6;
Remove 'unused variable p'.
 1.30  23-Jul-2006  ad Use the LWP cached credentials where sane.
 1.29  22-May-2006  christos void casts.
 1.28  14-May-2006  elad branches: 1.28.2;
integrate kauth.
 1.27  18-Apr-2006  martin Invert carrier detect sense, from Jonathan A. Kollasch
 1.26  28-Mar-2006  thorpej Use device_unit().
 1.25  13-Feb-2006  cdi branches: 1.25.2; 1.25.4; 1.25.6;
ANSIfy: u_intN_t -> uintN_t, remove __P(), fix function definitions.
 1.24  11-Dec-2005  christos branches: 1.24.2; 1.24.4; 1.24.6;
merge ktrace-lwp.
 1.23  26-Aug-2005  drochner kill some more simple submatch() functions, use config_stdsubmatch()
 1.22  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.21  31-May-2005  christos branches: 1.21.2;
- sprinkle const
- avoid variable shadow
 1.20  13-Sep-2004  drochner clean up the questionable use of sabtty_match() as submatch function
(with no useful contents), and implement a real submatch function instead
 1.19  19-Jul-2004  heas If we are serial console, insert a delay just after switching from prom
i/o functions to talking to the sab directly, allowing any residual prom
output to drain. There does not appear to be a prom "flush" function.

Adresses PR 26226.
 1.18  17-Jul-2004  heas Use aprint_normal consistently.
 1.17  10-Jun-2004  seb Add cnmagic(9) support: previously only <Break> was supported to break
into the debugger or ROM monitor from the console.
Note that <Break> is still the default.

Thanks to martin@ for testing.
Approved by petrov@.
 1.16  21-Mar-2004  pk Use the promlib I/O routines.
 1.15  17-Mar-2004  pk Rename PROM_getprop*() => prom_getprop*().
 1.14  15-Jul-2003  lukem __KERNEL_RCSID()
 1.13  29-Jun-2003  fvdl branches: 1.13.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.12  29-Jun-2003  martin Passing struct lwp * instead of struct proc * to device functions.
 1.11  13-Jun-2003  petrov Pick up from OpenBSD:
The sab driver sometimes gets out of sync with the hardware. This can
cause the serial console to hang.
 1.10  11-Jun-2003  petrov Use cdevsw_lookup_major.
 1.9  01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.8  10-Dec-2002  pk Remove the `flags' argument from bus_intr_establish().
 1.7  23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.6  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.5  01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.4  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.3  21-Sep-2002  petrov Use /options instead of /chosen to find out where console is.
(found by Rafal Boni).
 1.2  06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.1  16-Aug-2002  petrov branches: 1.1.2; 1.1.4; 1.1.6;
Port Jason L. Wright's sab82532 driver. From OpenBSD.
 1.1.6.3  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.6.2  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1  16-Aug-2002  jdolecek file sab.c was added on branch kqueue on 2002-09-06 08:41:29 +0000
 1.1.4.4  02-Sep-2002  gehenna machine/conf.h has gone.
 1.1.4.3  31-Aug-2002  gehenna Add character device switch.
 1.1.4.2  31-Aug-2002  gehenna catch up with -current.
 1.1.4.1  16-Aug-2002  gehenna file sab.c was added on branch gehenna-devsw on 2002-08-31 14:52:28 +0000
 1.1.2.7  03-Jan-2003  thorpej Sync with HEAD.
 1.1.2.6  11-Dec-2002  thorpej Sync with HEAD.
 1.1.2.5  11-Nov-2002  nathanw Catch up to -current
 1.1.2.4  18-Oct-2002  nathanw Catch up to -current.
 1.1.2.3  17-Sep-2002  nathanw Catch up to -current.
 1.1.2.2  27-Aug-2002  nathanw Catch up to -current.
 1.1.2.1  16-Aug-2002  nathanw file sab.c was added on branch nathanw_sa on 2002-08-27 23:45:49 +0000
 1.13.2.5  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.13.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.13.2.2  26-Aug-2004  skrll Adapt to branch.

sparc64 GENERIC compiles.
 1.13.2.1  03-Aug-2004  skrll Sync with HEAD
 1.21.2.5  07-Dec-2007  yamt sync with head
 1.21.2.4  15-Nov-2007  yamt sync with head.
 1.21.2.3  03-Sep-2007  yamt sync with head.
 1.21.2.2  30-Dec-2006  yamt sync with head.
 1.21.2.1  21-Jun-2006  yamt sync with head.
 1.24.6.2  01-Jun-2006  kardel Sync with head.
 1.24.6.1  22-Apr-2006  simonb Sync with head.
 1.24.4.1  09-Sep-2006  rpaulo sync with head
 1.24.2.1  18-Feb-2006  yamt sync with head.
 1.25.6.2  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.25.6.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.25.4.4  12-May-2006  elad adapt to kauth kpi, include sys/kauth.h where needed..
 1.25.4.3  19-Apr-2006  elad sync with head - hopefully this will work
 1.25.4.2  10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.25.4.1  08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.25.2.3  11-Aug-2006  yamt sync with head
 1.25.2.2  24-May-2006  yamt sync with head.
 1.25.2.1  01-Apr-2006  yamt sync with head.
 1.28.2.1  19-Jun-2006  chap Sync with head.
 1.31.6.1  22-Oct-2006  yamt sync with head
 1.31.4.1  18-Nov-2006  ad Sync with head.
 1.36.4.1  12-Mar-2007  rmind Sync with HEAD.
 1.37.26.2  08-Dec-2007  mjf Sync with HEAD.
 1.37.26.1  19-Nov-2007  mjf Sync with HEAD.
 1.37.24.2  21-Nov-2007  bouyer Sync with HEAD
 1.37.24.1  13-Nov-2007  bouyer Sync with HEAD
 1.37.20.2  09-Jan-2008  matt sync with HEAD
 1.37.20.1  08-Nov-2007  matt sync with -HEAD
 1.37.18.3  03-Dec-2007  joerg Sync with HEAD.
 1.37.18.2  21-Nov-2007  joerg Sync with HEAD.
 1.37.18.1  11-Nov-2007  joerg Sync with HEAD.
 1.37.2.1  03-Dec-2007  ad Sync with HEAD.
 1.40.20.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.40.18.3  11-Aug-2010  yamt sync with head.
 1.40.18.2  11-Mar-2010  yamt sync with head
 1.40.18.1  04-May-2009  yamt sync with head.
 1.40.16.2  17-Jun-2008  yamt sync with head.
 1.40.16.1  04-Jun-2008  yamt sync with head
 1.40.14.2  29-Jun-2008  mjf Sync with HEAD.
 1.40.14.1  02-Jun-2008  mjf Sync with HEAD.
 1.41.2.1  18-Jun-2008  simonb Sync with head.
 1.42.14.1  21-Apr-2010  matt sync to netbsd-5
 1.42.6.1  14-Feb-2010  bouyer Pull up following revision(s) (requested by jdc in ticket #1297):
etc/etc.sparc64/MAKEDEV.conf: revision 1.14
sys/arch/sparc64/dev/sab.c: revision 1.43, 1.44
share/man/man4/man4.sparc64/sab.4: revision 1.4
Allow the RSC to be the console on an E250, by checking for RSC-specific
properties, and by not changing the port baud rate.
 1.44.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.45.4.1  06-Jun-2011  jruoho Sync with HEAD.
 1.45.2.2  12-Jun-2011  rmind sync with head
 1.45.2.1  31-May-2011  rmind sync with head
 1.47.2.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.48.12.3  03-Dec-2017  jdolecek update from HEAD
 1.48.12.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.48.12.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.48.2.2  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.48.2.1  30-Oct-2012  yamt sync with head
 1.49.2.1  18-May-2014  rmind sync with head
 1.51.2.1  10-Aug-2014  tls Rebase.
 1.52.2.1  07-Nov-2014  snj Pull up following revision(s) (requested by nakayama in ticket #186):
sys/arch/sparc64/dev/sab.c: revision 1.53
Convert sab_shutdown from deprecated shutdownhook_establish(9) API
to PMF(9) framework.
Tested on Ultra 60 with serial console.
 1.54.12.1  06-Nov-2017  snj Pull up following revision(s) (requested by martin in ticket #338):
sys/arch/sparc64/dev/sab.c: revision 1.55
sys/dev/ic/com.c: revision 1.345
sys/dev/ic/z8530tty.c: revision 1.132
sys/dev/sun/sunkbd.c: revision 1.30
sys/dev/sun/sunms.c: revision 1.33
sys/sys/tty.h: revision 1.94
As discussed on tech-kern: define a new tty internal state flag: TS_KERN_ONLY
Implement it in a few tty drivers. If this flag is set, the underlying
hardware is used by another driver and userland has no right to open
it. A few uses will appear soon in sys/dev/sun/sun{kbd,ms}.c.
--
PR port-sparc64/52622: mark the parent device as TS_KERN_ONLY,
so userland will not touch it (and change serial params w/o our
control).
 1.55.18.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.55.18.1  22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.56.8.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed