CVS commit: src/share/man/man9

2017-04-22 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Sun Apr 23 05:56:50 UTC 2017

Modified Files:
src/share/man/man9: file.9

Log Message:
Fix a sentence (remove double negation)
Fix mandoc lint warning (remove Pp before Bd)


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/share/man/man9/file.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/file.9
diff -u src/share/man/man9/file.9:1.15 src/share/man/man9/file.9:1.16
--- src/share/man/man9/file.9:1.15	Sun Apr 23 05:49:00 2017
+++ src/share/man/man9/file.9	Sun Apr 23 05:56:50 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: file.9,v 1.15 2017/04/23 05:49:00 abhinav Exp $
+.\" $NetBSD: file.9,v 1.16 2017/04/23 05:56:50 abhinav Exp $
 .\"
 .\" Copyright (c) 2002, 2005, 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -60,7 +60,6 @@ See
 .Xr filedesc 9
 for details of the file descriptor table.
 Each file entry is given by:
-.Pp
 .Bd -literal
 struct file {
 LIST_ENTRY(file) f_list;/* list of active files */
@@ -224,7 +223,7 @@ Free file entry
 The file entry was created in
 .Xr falloc 9 .
 .It Fn FILE_IS_USABLE "fp"
-Ensure that the file entry is usable by ensuring that neither the
+Ensure that the file entry is usable by ensuring that the
 FIF_WANTCLOSE and FIF_LARVAL flags are not set in
 .Em f_iflags .
 .It Fn FILE_USE "fp"



CVS commit: src/share/man/man9

2017-04-22 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Sun Apr 23 05:49:00 UTC 2017

Modified Files:
src/share/man/man9: file.9

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man9/file.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/file.9
diff -u src/share/man/man9/file.9:1.14 src/share/man/man9/file.9:1.15
--- src/share/man/man9/file.9:1.14	Thu Dec  2 12:54:13 2010
+++ src/share/man/man9/file.9	Sun Apr 23 05:49:00 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: file.9,v 1.14 2010/12/02 12:54:13 wiz Exp $
+.\" $NetBSD: file.9,v 1.15 2017/04/23 05:49:00 abhinav Exp $
 .\"
 .\" Copyright (c) 2002, 2005, 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -224,7 +224,7 @@ Free file entry
 The file entry was created in
 .Xr falloc 9 .
 .It Fn FILE_IS_USABLE "fp"
-Ensure that the file entry is useable by ensuring that neither the
+Ensure that the file entry is usable by ensuring that neither the
 FIF_WANTCLOSE and FIF_LARVAL flags are not set in
 .Em f_iflags .
 .It Fn FILE_USE "fp"



CVS commit: src/lib/libc/gen

2017-04-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 23 01:58:48 UTC 2017

Modified Files:
src/lib/libc/gen: vis.3 vis.c

Log Message:
Add VIS_DQ (for OpenBSD compat)


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/lib/libc/gen/vis.3
cvs rdiff -u -r1.72 -r1.73 src/lib/libc/gen/vis.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/gen/vis.3
diff -u src/lib/libc/gen/vis.3:1.45 src/lib/libc/gen/vis.3:1.46
--- src/lib/libc/gen/vis.3:1.45	Wed Jun  8 11:00:04 2016
+++ src/lib/libc/gen/vis.3	Sat Apr 22 21:58:48 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vis.3,v 1.45 2016/06/08 15:00:04 wiz Exp $
+.\"	$NetBSD: vis.3,v 1.46 2017/04/23 01:58:48 christos Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)vis.3	8.1 (Berkeley) 6/9/93
 .\"
-.Dd January 14, 2015
+.Dd April 22, 2017
 .Dt VIS 3
 .Os
 .Sh NAME
@@ -242,6 +242,8 @@ except space, tab, and newline are encod
 The following flags
 alter this:
 .Bl -tag -width VIS_WHITEX
+.It Dv VIS_DW
+Also encode double quotes
 .It Dv VIS_GLOB
 Also encode the magic characters
 .Ql ( * ,

Index: src/lib/libc/gen/vis.c
diff -u src/lib/libc/gen/vis.c:1.72 src/lib/libc/gen/vis.c:1.73
--- src/lib/libc/gen/vis.c:1.72	Sun Feb 12 17:37:49 2017
+++ src/lib/libc/gen/vis.c	Sat Apr 22 21:58:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vis.c,v 1.72 2017/02/12 22:37:49 christos Exp $	*/
+/*	$NetBSD: vis.c,v 1.73 2017/04/23 01:58:48 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -57,7 +57,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: vis.c,v 1.72 2017/02/12 22:37:49 christos Exp $");
+__RCSID("$NetBSD: vis.c,v 1.73 2017/04/23 01:58:48 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 #ifdef __FBSDID
 __FBSDID("$FreeBSD$");
@@ -377,6 +377,7 @@ makeextralist(int flags, const char *src
 	if (flags & VIS_SP) *d++ = L' ';
 	if (flags & VIS_TAB) *d++ = L'\t';
 	if (flags & VIS_NL) *d++ = L'\n';
+	if (flags & VIS_DQ) *d++ = L'"';
 	if ((flags & VIS_NOSLASH) == 0) *d++ = L'\\';
 	*d = L'\0';
 



CVS commit: src/include

2017-04-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 23 01:57:36 UTC 2017

Modified Files:
src/include: vis.h

Log Message:
Add vis DQ.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/include/vis.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/include/vis.h
diff -u src/include/vis.h:1.24 src/include/vis.h:1.25
--- src/include/vis.h:1.24	Thu Jan 14 15:42:14 2016
+++ src/include/vis.h	Sat Apr 22 21:57:36 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vis.h,v 1.24 2016/01/14 20:42:14 christos Exp $	*/
+/*	$NetBSD: vis.h,v 1.25 2017/04/23 01:57:36 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -51,6 +51,7 @@
 #define	VIS_NL		0x0010	/* also encode newline */
 #define	VIS_WHITE	(VIS_SP | VIS_TAB | VIS_NL)
 #define	VIS_SAFE	0x0020	/* only encode "unsafe" characters */
+#define	VIS_DQ		0x8000	/* also encode double quotes */
 
 /*
  * other



CVS commit: [jdolecek-ncq] src/sys/dev/ata

2017-04-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Apr 23 01:30:30 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: ata.c

Log Message:
Use WDC_QUEUE_DEPTH_MASK to correctly mask the NCQ depth IDENTIFY data.


To generate a diff of this commit:
cvs rdiff -u -r1.132.8.6 -r1.132.8.7 src/sys/dev/ata/ata.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.132.8.6 src/sys/dev/ata/ata.c:1.132.8.7
--- src/sys/dev/ata/ata.c:1.132.8.6	Wed Apr 19 21:42:39 2017
+++ src/sys/dev/ata/ata.c	Sun Apr 23 01:30:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.132.8.6 2017/04/19 21:42:39 jdolecek Exp $	*/
+/*	$NetBSD: ata.c,v 1.132.8.7 2017/04/23 01:30:30 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.6 2017/04/19 21:42:39 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.7 2017/04/23 01:30:30 jakllsch Exp $");
 
 #include "opt_ata.h"
 
@@ -1744,7 +1744,8 @@ ata_probe_caps(struct ata_drive_datas *d
 	if (params.atap_sata_caps & SATA_NATIVE_CMDQ) {
 		if (atac->atac_cap & ATAC_CAP_NCQ)
 			drvp->drive_flags |= ATA_DRIVE_NCQ;
-		drvp->drv_openings = (params.atap_queuedepth & 0x0f) + 1;
+		drvp->drv_openings =
+		(params.atap_queuedepth & WDC_QUEUE_DEPTH_MASK) + 1;
 		aprint_verbose("%s NCQ (%d tags)", sep, drvp->drv_openings);
 		sep = ",";
 	}



CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-04-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Apr 23 01:26:50 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: siisata.c

Log Message:
Fix inverted ata_waitdrain_xfer_check() logic in siisata_atapi_complete().


To generate a diff of this commit:
cvs rdiff -u -r1.30.4.8 -r1.30.4.9 src/sys/dev/ic/siisata.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.30.4.8 src/sys/dev/ic/siisata.c:1.30.4.9
--- src/sys/dev/ic/siisata.c:1.30.4.8	Sat Apr 22 14:08:38 2017
+++ src/sys/dev/ic/siisata.c	Sun Apr 23 01:26:50 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.30.4.8 2017/04/22 14:08:38 jakllsch Exp $ */
+/* $NetBSD: siisata.c,v 1.30.4.9 2017/04/23 01:26:50 jakllsch Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.8 2017/04/22 14:08:38 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.9 2017/04/23 01:26:50 jakllsch Exp $");
 
 #include 
 #include 
@@ -1668,7 +1668,7 @@ siisata_atapi_complete(struct ata_channe
 
 	ata_deactivate_xfer(chp, xfer);
 
-	if (!ata_waitdrain_xfer_check(chp, xfer)) {
+	if (ata_waitdrain_xfer_check(chp, xfer)) {
 		sc_xfer->error = XS_DRIVER_STUFFUP;
 		return 0; /* XXX verify */
 	}



CVS commit: [jdolecek-ncq] src/sys/dev/ata

2017-04-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Apr 23 01:21:04 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: wd.c wdvar.h

Log Message:
Simplify wi_find() with container_of().

No need to search a list of wd_ioctls when the *bp is always going to be within 
the wd_ioctl structure.

Correctly initialize wi->wi_bp.b_dev in the non-data case anyway.

Fixes ATAIOCCOMMAND procesing on driver instances other than wd0.


To generate a diff of this commit:
cvs rdiff -u -r1.428.2.10 -r1.428.2.11 src/sys/dev/ata/wd.c
cvs rdiff -u -r1.43.4.4 -r1.43.4.5 src/sys/dev/ata/wdvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.428.2.10 src/sys/dev/ata/wd.c:1.428.2.11
--- src/sys/dev/ata/wd.c:1.428.2.10	Sat Apr 22 20:07:54 2017
+++ src/sys/dev/ata/wd.c	Sun Apr 23 01:21:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.428.2.10 2017/04/22 20:07:54 jakllsch Exp $ */
+/*	$NetBSD: wd.c,v 1.428.2.11 2017/04/23 01:21:04 jakllsch Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.428.2.10 2017/04/22 20:07:54 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.428.2.11 2017/04/23 01:21:04 jakllsch Exp $");
 
 #include "opt_ata.h"
 
@@ -306,7 +306,6 @@ wdattach(device_t parent, device_t self,
 #ifdef WD_SOFTBADSECT
 	SLIST_INIT(>sc_bslist);
 #endif
-	LIST_INIT(>wi_head);
 	STAILQ_INIT(>xfer_restart);
 	wd->atabus = adev->adev_bustype;
 	wd->drvp = adev->adev_drv_data;
@@ -509,7 +508,6 @@ wddetach(device_t self, int flags)
 	}
 	sc->sc_bscount = 0;
 #endif
-	KASSERT(LIST_EMPTY(>wi_head));
 
 	pmf_device_deregister(self);
 
@@ -1555,7 +1553,7 @@ wdioctl(dev_t dev, u_long xfer, void *ad
 			wi->wi_bp.b_flags = 0;
 			wi->wi_bp.b_data = 0;
 			wi->wi_bp.b_bcount = 0;
-			wi->wi_bp.b_dev = 0;
+			wi->wi_bp.b_dev = dev;
 			wi->wi_bp.b_proc = l->l_proc;
 			wdioctlstrategy(>wi_bp);
 			error1 = wi->wi_bp.b_error;
@@ -2148,10 +2146,6 @@ wi_get(struct wd_softc *wd)
 	wi->wi_softc = wd;
 	buf_init(>wi_bp);
 
-	mutex_enter(>sc_lock);
-	LIST_INSERT_HEAD(>wi_head, wi, wi_list);
-	mutex_exit(>sc_lock);
-
 	return (wi);
 }
 
@@ -2162,11 +2156,6 @@ wi_get(struct wd_softc *wd)
 void
 wi_free(struct wd_ioctl *wi)
 {
-	struct wd_softc *wd = wi->wi_softc;
-
-	mutex_enter(>sc_lock);
-	LIST_REMOVE(wi, wi_list);
-	mutex_exit(>sc_lock);
 	buf_destroy(>wi_bp);
 	free(wi, M_TEMP);
 }
@@ -2178,17 +2167,7 @@ wi_free(struct wd_ioctl *wi)
 struct wd_ioctl *
 wi_find(struct buf *bp)
 {
-	struct wd_softc *wd =
-	device_lookup_private(_cd, WDUNIT(bp->b_dev));
-	struct wd_ioctl *wi;
-
-	mutex_enter(>sc_lock);
-	LIST_FOREACH(wi, >wi_head, wi_list) {
-		if (bp == >wi_bp)
-			break;
-	}
-	mutex_exit(>sc_lock);
-	return (wi);
+	return container_of(bp, struct wd_ioctl, wi_bp);
 }
 
 static uint

Index: src/sys/dev/ata/wdvar.h
diff -u src/sys/dev/ata/wdvar.h:1.43.4.4 src/sys/dev/ata/wdvar.h:1.43.4.5
--- src/sys/dev/ata/wdvar.h:1.43.4.4	Wed Apr 19 20:49:17 2017
+++ src/sys/dev/ata/wdvar.h	Sun Apr 23 01:21:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdvar.h,v 1.43.4.4 2017/04/19 20:49:17 jdolecek Exp $	*/
+/*	$NetBSD: wdvar.h,v 1.43.4.5 2017/04/23 01:21:04 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -69,8 +69,6 @@ struct wd_softc {
 #endif
 	krndsource_t	rnd_source;
 
-	LIST_HEAD(, wd_ioctl) wi_head;
-
 	STAILQ_HEAD(, ata_xfer) xfer_restart;
 };
 



CVS import: src/external/bsd/tmux/dist

2017-04-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 23 00:21:40 UTC 2017

Update of /cvsroot/src/external/bsd/tmux/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv13496

Log Message:
CHANGES FROM 2.3 to 2.4 20 April 2017

Incompatible Changes


* Key tables have undergone major changes. Mode key tables are no longer
  separate from the main key tables. All mode key tables have been removed,
  together with the -t flag to bind-key and unbind-key.

  The emacs-edit, vi-edit, emacs-choose and vi-choose tables have been replaced
  by fixed key bindings in the command prompt and choose modes. The mode-keys
  and status-keys options remain.

  The emacs-copy and vi-copy tables have been replaced by the copy-mode and
  copy-mode-vi tables. Commands are sent using the -X and -N flags to
  send-keys. So the following:

bind -temacs-copy C-Up scroll-up
bind -temacs-copy -R5 WheelUpPane scroll-up

  Becomes:

bind -Tcopy-mode C-Up send -X scroll-up
bind -Tcopy-mode WheelUpPane send -N5 -X scroll-up

  This changes allows the full command parser (including command sequences) and
  command set to be used - for example, the normal command prompt with editing
  and history is now used for searching, jumping, and so on instead of a custom
  one. The default C-r binding is now:

bind -Tcopy-mode C-r command-prompt -p'search up' "send -X search-backward 
'%%'"

  There are also some new commmands available with send -X, such as
  copy-pipe-and-cancel.
* set-remain-on-exit has gone -- can be achieved with hooks instead.
* Hooks: before hooks have been removed and only a selection of commands now
  have after hooks (they are no longer automatic). Additional hooks have been
  added.
* The xterm-keys option now defaults to on.

Normal Changes
==

* Support for mouse double and triple clicks.
* BCE (Background Colour Erase) is now supported.
* All occurrences of a search string in copy mode are now highlighted;
  additionally, the number of search results is displayed. The highlighting
  updates interactively with the default emacs key bindings (incremental
  search).
* source-file now understands glob patterns.
* Formats now have simple comparisons:

#{==:a,b}
#{!=:a,b}

* There are the following new formats:

  - #{version} -- the tmux server version;
  - #{client_termtype} -- the terminal type of the client;
  - #{client_name} -- the name of a client;
  - #{client_written} -- the number of bytes written to the client.

* The configuration file now accepts %if/%endif conditional blocks which are
  processed when it is parsed; the argument is a format string (useful with the
  new format comparison options).
* detach-client now has -E to execute a command replacing the client instead of
  exiting.
* Add support for custom command aliases, this is an array option which
  contains items of the form "alias=command". This is consulted when an
  unknown command is parsed.
* break-pane now has -n to specify the new window name.
* OSC 52 support has been added for programs inside tmux to set a tmux buffer.
* The mouse "all event" mode (1003) is now supported.
* Palette setting is now possible (OSC 4 and 104).
* Strikethrough support (a recent terminfo is required).
* Grouped sessions can now be named (new -t).
* terminal-overrides and update-environment are now array options (the previous
  set -ag syntax should work without change).
* There have been substantial performance improvements.

CHANGES FROM 2.2 to 2.3 29 September 2016

Incompatible Changes


None.

Normal Changes
==

* New option 'pane-border-status' to add text in the pane borders.
* Support for hooks on commands: 'after' and 'before' hooks.
* 'source-file' understands '-q' to suppress errors for nonexistent files.
* Lots of UTF8 improvements, especially on MacOS.
* 'window-status-separator' understands #[] expansions.
* 'split-window' understands '-f' for performing a full-width split.
* Allow report count to be specified when using 'bind-key -R'.
* 'set -a' for appending to user options (@foo) is now supported.
* 'display-panes' can now accept a command to run, rather than always
  selecting the pane.


Status:

Vendor Tag: TMUX
Release Tags:   tmux-2-4

U src/external/bsd/tmux/dist/cmd-bind-key.c
N src/external/bsd/tmux/dist/Makefile.am
N src/external/bsd/tmux/dist/configure
N src/external/bsd/tmux/dist/configure.ac
N src/external/bsd/tmux/dist/aclocal.m4
N src/external/bsd/tmux/dist/Makefile.in
N src/external/bsd/tmux/dist/COPYING
N src/external/bsd/tmux/dist/README
N src/external/bsd/tmux/dist/TODO
U src/external/bsd/tmux/dist/alerts.c
U src/external/bsd/tmux/dist/arguments.c
U src/external/bsd/tmux/dist/attributes.c
U src/external/bsd/tmux/dist/cfg.c
C src/external/bsd/tmux/dist/client.c
U src/external/bsd/tmux/dist/cmd-find.c
N src/external/bsd/tmux/dist/FAQ
C src/external/bsd/tmux/dist/cmd-attach-session.c
U 

CVS commit: src/sys/arch

2017-04-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Apr 22 23:53:24 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: files.tegra soc_tegra124.c tegra_cpufreq.c
tegra_fdt.c tegra_soc.c tegra_var.h
src/sys/arch/evbarm/conf: TEGRA

Log Message:
Get rid of tegra_cpuinit after scanning fdt and attach the cpufreq support
to the /cpus node. Use regulator API instead of poking directly at the I2C
controller to set voltages.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/nvidia/files.tegra
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/nvidia/soc_tegra124.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/nvidia/tegra_cpufreq.c \
src/sys/arch/arm/nvidia/tegra_fdt.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/nvidia/tegra_soc.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/nvidia/tegra_var.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/conf/TEGRA

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nvidia/files.tegra
diff -u src/sys/arch/arm/nvidia/files.tegra:1.31 src/sys/arch/arm/nvidia/files.tegra:1.32
--- src/sys/arch/arm/nvidia/files.tegra:1.31	Fri Apr 21 23:35:29 2017
+++ src/sys/arch/arm/nvidia/files.tegra	Sat Apr 22 23:53:24 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.tegra,v 1.31 2017/04/21 23:35:29 jmcneill Exp $
+#	$NetBSD: files.tegra,v 1.32 2017/04/22 23:53:24 jmcneill Exp $
 #
 # Configuration info for NVIDIA Tegra ARM Peripherals
 #
@@ -13,15 +13,19 @@ file	arch/arm/arm32/irq_dispatch.S
 file	arch/arm/arm32/armv7_generic_space.c
 file	arch/arm/arm/bus_space_a4x.S
 
-file	arch/arm/nvidia/tegra_soc.c
-file	arch/arm/nvidia/tegra_cpufreq.c
-file	arch/arm/nvidia/soc_tegra124.c		soc_tegra124
-
-# On-board I/O
+# Devicetree
 device	tegrafdt : bus_space_generic, fdtbus
 attach	tegrafdt at mainbus with tegra_fdt
 file	arch/arm/nvidia/tegra_fdt.c		tegra_fdt
 
+file	arch/arm/nvidia/tegra_soc.c
+file	arch/arm/nvidia/tegra_cpufreq.c
+
+# Tegra T124 (32-bit K1) support
+device	tegra124cpu
+attach	tegra124cpu at fdt with tegra124_cpu
+file	arch/arm/nvidia/soc_tegra124.c		soc_tegra124 | tegra124_cpu
+
 # Interrupt controller
 device	tegralic
 attach	tegralic at fdt with tegra_lic

Index: src/sys/arch/arm/nvidia/soc_tegra124.c
diff -u src/sys/arch/arm/nvidia/soc_tegra124.c:1.15 src/sys/arch/arm/nvidia/soc_tegra124.c:1.16
--- src/sys/arch/arm/nvidia/soc_tegra124.c:1.15	Mon Apr 17 00:43:42 2017
+++ src/sys/arch/arm/nvidia/soc_tegra124.c	Sat Apr 22 23:53:24 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: soc_tegra124.c,v 1.15 2017/04/17 00:43:42 jmcneill Exp $ */
+/* $NetBSD: soc_tegra124.c,v 1.16 2017/04/22 23:53:24 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -30,7 +30,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: soc_tegra124.c,v 1.15 2017/04/17 00:43:42 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: soc_tegra124.c,v 1.16 2017/04/22 23:53:24 jmcneill Exp $");
 
 #include 
 #include 
@@ -39,8 +39,6 @@ __KERNEL_RCSID(0, "$NetBSD: soc_tegra124
 
 #include 
 
-#include 
-#include 
 #include 
 
 #include 
@@ -71,6 +69,13 @@ static u_int	tegra124_cpufreq_set_rate(u
 static u_int	tegra124_cpufreq_get_rate(void);
 static size_t	tegra124_cpufreq_get_available(u_int *, size_t);
 
+static int	tegra124_cpu_match(device_t, cfdata_t, void *);
+static void	tegra124_cpu_attach(device_t, device_t, void *);
+static void	tegra124_cpu_init_cpufreq(device_t);
+
+CFATTACH_DECL_NEW(tegra124_cpu, 0, tegra124_cpu_match, tegra124_cpu_attach,
+NULL, NULL);
+
 static const struct tegra_cpufreq_func tegra124_cpufreq_func = {
 	.set_rate = tegra124_cpufreq_set_rate,
 	.get_rate = tegra124_cpufreq_get_rate,
@@ -82,16 +87,17 @@ static struct tegra124_cpufreq_rate {
 	u_int divm;
 	u_int divn;
 	u_int divp;
+	u_int uvol;
 } tegra124_cpufreq_rates[] = {
-	{ 2316, 1, 193, 0 },
-	{ 2100, 1, 175, 0 },
-	{ 1896, 1, 158, 0 },
-	{ 1692, 1, 141, 0 },
-	{ 1500, 1, 125, 0 },
-	{ 1296, 1, 108, 0 },
-	{ 1092, 1, 91, 0 },
-	{ 900, 1, 75, 0 },
-	{ 696, 1, 58, 0 }
+	{ 2316, 1, 193, 0, 140 },
+	{ 2100, 1, 175, 0, 140 },
+	{ 1896, 1, 158, 0, 140 },
+	{ 1692, 1, 141, 0, 140 },
+	{ 1500, 1, 125, 0, 140 },
+	{ 1296, 1, 108, 0, 140 },
+	{ 1092, 1, 91,  0, 140 },
+	{ 900,  1, 75,  0, 140 },
+	{ 696,  1, 58,  0, 140 }
 };
 
 static const u_int tegra124_cpufreq_max[] = {
@@ -112,42 +118,46 @@ static struct tegra124_speedo {
 };
 
 static struct clk *tegra124_clk_pllx = NULL;
+static struct fdtbus_regulator *tegra124_reg_vddcpu = NULL;
 
-void
-tegra124_cpuinit(void)
+static int
+tegra124_cpu_match(device_t parent, cfdata_t cf, void *aux)
 {
-	int i2c_node = OF_finddevice("/i2c@7000d000");
-	if (i2c_node == -1)
-		i2c_node = OF_finddevice("/i2c@0,7000d000"); /* old DTB */
-	if (i2c_node == -1) {
-		aprint_error("cpufreq: ERROR: couldn't find i2c@7000d000\n");
-		return;
-	}
-	i2c_tag_t ic = 

CVS commit: src/sys/dev/i2c

2017-04-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Apr 22 23:50:13 UTC 2017

Modified Files:
src/sys/dev/i2c: as3722.c

Log Message:
remove unused field in softc


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/i2c/as3722.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/i2c/as3722.c
diff -u src/sys/dev/i2c/as3722.c:1.8 src/sys/dev/i2c/as3722.c:1.9
--- src/sys/dev/i2c/as3722.c:1.8	Sat Apr 22 23:46:29 2017
+++ src/sys/dev/i2c/as3722.c	Sat Apr 22 23:50:13 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: as3722.c,v 1.8 2017/04/22 23:46:29 jmcneill Exp $ */
+/* $NetBSD: as3722.c,v 1.9 2017/04/22 23:50:13 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_fdt.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.8 2017/04/22 23:46:29 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.9 2017/04/22 23:50:13 jmcneill Exp $");
 
 #include 
 #include 
@@ -104,8 +104,6 @@ struct as3722_softc {
 
 	struct sysmon_wdog sc_smw;
 	struct todr_chip_handle sc_todr;
-
-	uint8_t		sc_fuse[8];
 };
 
 #ifdef FDT



CVS commit: src/sys/dev/i2c

2017-04-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Apr 22 23:46:29 UTC 2017

Modified Files:
src/sys/dev/i2c: as3722.c

Log Message:
Add SD0 regulator.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/i2c/as3722.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/i2c/as3722.c
diff -u src/sys/dev/i2c/as3722.c:1.7 src/sys/dev/i2c/as3722.c:1.8
--- src/sys/dev/i2c/as3722.c:1.7	Sat Apr 22 21:48:56 2017
+++ src/sys/dev/i2c/as3722.c	Sat Apr 22 23:46:29 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: as3722.c,v 1.7 2017/04/22 21:48:56 jmcneill Exp $ */
+/* $NetBSD: as3722.c,v 1.8 2017/04/22 23:46:29 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_fdt.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.7 2017/04/22 21:48:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.8 2017/04/22 23:46:29 jmcneill Exp $");
 
 #include 
 #include 
@@ -53,6 +53,8 @@ __KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1
 
 #define AS3722_START_YEAR		2000
 
+#define AS3722_SD0_VOLTAGE_REG		0x00
+
 #define AS3722_GPIO0_CTRL_REG		0x08
 #define AS3722_GPIO0_CTRL_INVERT	__BIT(7)
 #define AS3722_GPIO0_CTRL_IOSF		__BITS(6,3)
@@ -102,23 +104,37 @@ struct as3722_softc {
 
 	struct sysmon_wdog sc_smw;
 	struct todr_chip_handle sc_todr;
+
+	uint8_t		sc_fuse[8];
 };
 
 #ifdef FDT
+static int	as3722reg_set_voltage_sd0(device_t, u_int, u_int);
+static int	as3722reg_get_voltage_sd0(device_t, u_int *);
+static int	as3722reg_set_voltage_ldo(device_t, u_int, u_int);
+static int	as3722reg_get_voltage_ldo(device_t, u_int *);
+
 static const struct as3722regdef {
 	const char	*name;
 	u_int		vsel_reg;
 	u_int		vsel_mask;
 	u_int		enable_reg;
 	u_int		enable_mask;
-	u_int		n_voltages;
+	int		(*set)(device_t, u_int, u_int);
+	int		(*get)(device_t, u_int *);
 } as3722regdefs[] = {
+	{ .name = "sd0",
+	  .vsel_reg = AS3722_SD0_VOLTAGE_REG,
+	  .vsel_mask = 0x7f,
+	  .set = as3722reg_set_voltage_sd0,
+	  .get = as3722reg_get_voltage_sd0 },
 	{ .name = "ldo6",
 	  .vsel_reg = AS3722_LDO6_VOLTAGE_REG,
 	  .vsel_mask = 0x7f,
 	  .enable_reg = AS3722_LDOCONTROL0_REG,
 	  .enable_mask = 0x40,
-	  .n_voltages = 0x80 },
+	  .set = as3722reg_set_voltage_ldo,
+	  .get = as3722reg_get_voltage_ldo },
 };
 
 struct as3722reg_softc {
@@ -513,6 +529,9 @@ as3722reg_enable(device_t dev, bool enab
 	const int flags = (cold ? I2C_F_POLL : 0);
 	int error;
 
+	if (!regdef->enable_mask)
+		return enable ? 0 : EINVAL;
+
 	iic_acquire_bus(asc->sc_i2c, flags);
 	if (enable)
 		error = as3722_set_clear(asc, regdef->enable_reg,
@@ -526,7 +545,7 @@ as3722reg_enable(device_t dev, bool enab
 }
 
 static int
-as3722reg_set_voltage(device_t dev, u_int min_uvol, u_int max_uvol)
+as3722reg_set_voltage_ldo(device_t dev, u_int min_uvol, u_int max_uvol)
 {
 	struct as3722reg_softc *sc = device_private(dev);
 	struct as3722_softc *asc = device_private(device_parent(dev));
@@ -563,7 +582,7 @@ done:
 }
 
 static int
-as3722reg_get_voltage(device_t dev, u_int *puvol)
+as3722reg_get_voltage_ldo(device_t dev, u_int *puvol)
 {
 	struct as3722reg_softc *sc = device_private(dev);
 	struct as3722_softc *asc = device_private(device_parent(dev));
@@ -591,6 +610,82 @@ as3722reg_get_voltage(device_t dev, u_in
 
 	return 0;
 }
+
+static int
+as3722reg_set_voltage_sd0(device_t dev, u_int min_uvol, u_int max_uvol)
+{
+	struct as3722reg_softc *sc = device_private(dev);
+	struct as3722_softc *asc = device_private(device_parent(dev));
+	const struct as3722regdef *regdef = sc->sc_regdef;
+	const int flags = (cold ? I2C_F_POLL : 0);
+	uint8_t set_v = 0x00;
+	u_int uvol;
+	int error;
+
+	for (uint8_t v = 0x01; v <= 0x5a; v++) {
+		uvol = 60 + (v * 1);
+		if (uvol >= min_uvol && uvol <= max_uvol) {
+			set_v = v;
+			goto done;
+		}
+	}
+	if (set_v == 0)
+		return ERANGE;
+
+done:
+	iic_acquire_bus(asc->sc_i2c, flags);
+	error = as3722_set_clear(asc, regdef->vsel_reg, set_v,
+	regdef->vsel_mask, flags);
+	iic_release_bus(asc->sc_i2c, flags);
+
+	return error;
+}
+
+static int
+as3722reg_get_voltage_sd0(device_t dev, u_int *puvol)
+{
+	struct as3722reg_softc *sc = device_private(dev);
+	struct as3722_softc *asc = device_private(device_parent(dev));
+	const struct as3722regdef *regdef = sc->sc_regdef;
+	const int flags = (cold ? I2C_F_POLL : 0);
+	uint8_t v;
+	int error;
+
+	iic_acquire_bus(asc->sc_i2c, flags);
+	error = as3722_read(asc, regdef->vsel_reg, , flags);
+	iic_release_bus(asc->sc_i2c, flags);
+	if (error != 0)
+		return error;
+
+	v &= regdef->vsel_mask;
+
+	if (v == 0)
+		*puvol = 0;	/* DC/DC powered down */
+	else if (v >= 0x01 && v <= 0x5a)
+		*puvol = 60 + (v * 1);
+	else
+		return EINVAL;
+
+	return 0;
+}
+
+static int
+as3722reg_set_voltage(device_t dev, u_int min_uvol, u_int max_uvol)
+{
+	struct as3722reg_softc *sc = device_private(dev);
+	const struct as3722regdef 

CVS commit: src/bin/kill

2017-04-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 22 23:01:36 UTC 2017

Modified Files:
src/bin/kill: kill.1

Log Message:
Clarify 0


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/bin/kill/kill.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/kill/kill.1
diff -u src/bin/kill/kill.1:1.27 src/bin/kill/kill.1:1.28
--- src/bin/kill/kill.1:1.27	Sat Apr 22 18:42:03 2017
+++ src/bin/kill/kill.1	Sat Apr 22 19:01:36 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kill.1,v 1.27 2017/04/22 22:42:03 riastradh Exp $
+.\"	$NetBSD: kill.1,v 1.28 2017/04/22 23:01:36 christos Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -104,7 +104,8 @@ belonging to the user.
 Some of the more commonly used signals:
 .Bl -tag -width Ds -compact
 .It 0
-do nothing, only test whether process exists
+0 (does not affect the process; can be used to test whether the
+process exists)
 .It 1
 HUP (hang up)
 .It 2



CVS commit: src/bin/kill

2017-04-22 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Apr 22 22:42:03 UTC 2017

Modified Files:
src/bin/kill: kill.1

Log Message:
Clarify `kill -0'.  Note standard exit codes.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/bin/kill/kill.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/kill/kill.1
diff -u src/bin/kill/kill.1:1.26 src/bin/kill/kill.1:1.27
--- src/bin/kill/kill.1:1.26	Sun Oct  2 21:00:54 2016
+++ src/bin/kill/kill.1	Sat Apr 22 22:42:03 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kill.1,v 1.26 2016/10/02 21:00:54 abhinav Exp $
+.\"	$NetBSD: kill.1,v 1.27 2017/04/22 22:42:03 riastradh Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\"	@(#)kill.1	8.2 (Berkeley) 4/28/95
 .\"
-.Dd August 11, 2016
+.Dd April 22, 2017
 .Dt KILL 1
 .Os
 .Sh NAME
@@ -103,6 +103,8 @@ belonging to the user.
 .Pp
 Some of the more commonly used signals:
 .Bl -tag -width Ds -compact
+.It 0
+do nothing, only test whether process exists
 .It 1
 HUP (hang up)
 .It 2
@@ -129,6 +131,8 @@ arguments.
 See
 .Xr csh 1
 for details.
+.Sh DIAGNOSTICS
+.Ex -std
 .Sh SEE ALSO
 .Xr csh 1 ,
 .Xr pgrep 1 ,



CVS commit: src/share/man/man3

2017-04-22 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Sat Apr 22 22:36:00 UTC 2017

Modified Files:
src/share/man/man3: queue.3

Log Message:
Remove comma after the last Nm entry.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/share/man/man3/queue.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man3/queue.3
diff -u src/share/man/man3/queue.3:1.54 src/share/man/man3/queue.3:1.55
--- src/share/man/man3/queue.3:1.54	Sat Oct 15 16:31:16 2016
+++ src/share/man/man3/queue.3	Sat Apr 22 22:36:00 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: queue.3,v 1.54 2016/10/15 16:31:16 jdolecek Exp $
+.\"	$NetBSD: queue.3,v 1.55 2017/04/22 22:36:00 abhinav Exp $
 .\"
 .\" Copyright (c) 2000, 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -138,7 +138,7 @@
 .Nm STAILQ_INSERT_TAIL ,
 .Nm STAILQ_REMOVE_HEAD ,
 .Nm STAILQ_REMOVE ,
-.Nm STAILQ_CONCAT ,
+.Nm STAILQ_CONCAT
 .Nd implementations of singly-linked lists, lists, simple queues, tail queues, and singly-linked tail queues
 .Sh SYNOPSIS
 .In sys/queue.h



CVS commit: src/sys/arch/evbarm/conf

2017-04-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Apr 22 21:50:13 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: TEGRA

Log Message:
add as3722reg


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/conf/TEGRA

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/TEGRA
diff -u src/sys/arch/evbarm/conf/TEGRA:1.15 src/sys/arch/evbarm/conf/TEGRA:1.16
--- src/sys/arch/evbarm/conf/TEGRA:1.15	Fri Apr 21 23:36:57 2017
+++ src/sys/arch/evbarm/conf/TEGRA	Sat Apr 22 21:50:13 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: TEGRA,v 1.15 2017/04/21 23:36:57 jmcneill Exp $
+#	$NetBSD: TEGRA,v 1.16 2017/04/22 21:50:13 jmcneill Exp $
 #
 #	NVIDIA Tegra K1 (T124)
 #
@@ -97,6 +97,7 @@ iic*		at tegrai2c?
 titemp*		at iic?
 seeprom*	at iic?
 as3722pmic*	at iic?
+as3722reg*	at as3722pmic?
 
 # RTC
 tegrartc*	at fdt?			# RTC



CVS commit: src/sys/arch/arm/nvidia

2017-04-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Apr 22 21:50:50 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_sdhc.c

Log Message:
If the "vqmmc-supply" regulator is present, use it to set signal voltage.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/nvidia/tegra_sdhc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_sdhc.c
diff -u src/sys/arch/arm/nvidia/tegra_sdhc.c:1.18 src/sys/arch/arm/nvidia/tegra_sdhc.c:1.19
--- src/sys/arch/arm/nvidia/tegra_sdhc.c:1.18	Sat Apr 22 17:41:20 2017
+++ src/sys/arch/arm/nvidia/tegra_sdhc.c	Sat Apr 22 21:50:49 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_sdhc.c,v 1.18 2017/04/22 17:41:20 jmcneill Exp $ */
+/* $NetBSD: tegra_sdhc.c,v 1.19 2017/04/22 21:50:49 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -31,7 +31,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.18 2017/04/22 17:41:20 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.19 2017/04/22 21:50:49 jmcneill Exp $");
 
 #include 
 #include 
@@ -54,6 +54,7 @@ static void	tegra_sdhc_attach(device_t, 
 
 static int	tegra_sdhc_card_detect(struct sdhc_softc *);
 static int	tegra_sdhc_write_protect(struct sdhc_softc *);
+static int	tegra_sdhc_signal_voltage(struct sdhc_softc *, int);
 
 struct tegra_sdhc_softc {
 	struct sdhc_softc	sc;
@@ -70,6 +71,8 @@ struct tegra_sdhc_softc {
 	struct fdtbus_gpio_pin	*sc_pin_cd;
 	struct fdtbus_gpio_pin	*sc_pin_power;
 	struct fdtbus_gpio_pin	*sc_pin_wp;
+
+	struct fdtbus_regulator	*sc_reg_vqmmc;
 };
 
 CFATTACH_DECL_NEW(tegra_sdhc, sizeof(struct tegra_sdhc_softc),
@@ -154,6 +157,12 @@ tegra_sdhc_attach(device_t parent, devic
 		sc->sc.sc_vendor_write_protect = tegra_sdhc_write_protect;
 	}
 
+	sc->sc_reg_vqmmc = fdtbus_regulator_acquire(faa->faa_phandle,
+	"vqmmc-supply");
+	if (sc->sc_reg_vqmmc) {
+		sc->sc.sc_vendor_signal_voltage = tegra_sdhc_signal_voltage;
+	}
+
 	sc->sc_clk = fdtbus_clock_get_index(faa->faa_phandle, 0);
 	if (sc->sc_clk == NULL) {
 		aprint_error(": couldn't get clock\n");
@@ -235,3 +244,30 @@ tegra_sdhc_write_protect(struct sdhc_sof
 
 	return fdtbus_gpio_read(sc->sc_pin_wp);
 }
+
+static int
+tegra_sdhc_signal_voltage(struct sdhc_softc *ssc, int signal_voltage)
+{
+	struct tegra_sdhc_softc *sc = device_private(ssc->sc_dev);
+	u_int uvol;
+	int error;
+
+	KASSERT(sc->sc_reg_vqmmc != NULL);
+
+	switch (signal_voltage) {
+	case SDMMC_SIGNAL_VOLTAGE_330:
+		uvol = 330;
+		break;
+	case SDMMC_SIGNAL_VOLTAGE_180:
+		uvol = 180;
+		break;
+	default:
+		return EINVAL;
+	}
+
+	error = fdtbus_regulator_set_voltage(sc->sc_reg_vqmmc, uvol, uvol);
+	if (error != 0)
+		return error;
+
+	return fdtbus_regulator_enable(sc->sc_reg_vqmmc);
+}



CVS commit: src/sys/dev/sdmmc

2017-04-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Apr 22 21:49:41 UTC 2017

Modified Files:
src/sys/dev/sdmmc: sdhc.c sdhcvar.h

Log Message:
Add a vendor callback for setting signal voltage.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/dev/sdmmc/sdhc.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/sdmmc/sdhcvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sdmmc/sdhc.c
diff -u src/sys/dev/sdmmc/sdhc.c:1.99 src/sys/dev/sdmmc/sdhc.c:1.100
--- src/sys/dev/sdmmc/sdhc.c:1.99	Fri Feb 17 10:51:48 2017
+++ src/sys/dev/sdmmc/sdhc.c	Sat Apr 22 21:49:41 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc.c,v 1.99 2017/02/17 10:51:48 nonaka Exp $	*/
+/*	$NetBSD: sdhc.c,v 1.100 2017/04/22 21:49:41 jmcneill Exp $	*/
 /*	$OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.99 2017/02/17 10:51:48 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.100 2017/04/22 21:49:41 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -1342,6 +1342,7 @@ static int
 sdhc_signal_voltage(sdmmc_chipset_handle_t sch, int signal_voltage)
 {
 	struct sdhc_host *hp = (struct sdhc_host *)sch;
+	int error = 0;
 
 	if (hp->specver < SDHC_SPEC_VERS_300)
 		return EINVAL;
@@ -1349,19 +1350,32 @@ sdhc_signal_voltage(sdmmc_chipset_handle
 	mutex_enter(>intr_lock);
 	switch (signal_voltage) {
 	case SDMMC_SIGNAL_VOLTAGE_180:
+		if (hp->sc->sc_vendor_signal_voltage != NULL) {
+			error = hp->sc->sc_vendor_signal_voltage(hp->sc,
+			signal_voltage);
+			if (error != 0)
+break;
+		}
 		if (!ISSET(hp->sc->sc_flags, SDHC_FLAG_USDHC))
 			HSET2(hp, SDHC_HOST_CTL2, SDHC_1_8V_SIGNAL_EN);
 		break;
 	case SDMMC_SIGNAL_VOLTAGE_330:
 		if (!ISSET(hp->sc->sc_flags, SDHC_FLAG_USDHC))
 			HCLR2(hp, SDHC_HOST_CTL2, SDHC_1_8V_SIGNAL_EN);
+		if (hp->sc->sc_vendor_signal_voltage != NULL) {
+			error = hp->sc->sc_vendor_signal_voltage(hp->sc,
+			signal_voltage);
+			if (error != 0)
+break;
+		}
 		break;
 	default:
-		return EINVAL;
+		error = EINVAL;
+		break;
 	}
 	mutex_exit(>intr_lock);
 
-	return 0;
+	return error;
 }
 
 /*

Index: src/sys/dev/sdmmc/sdhcvar.h
diff -u src/sys/dev/sdmmc/sdhcvar.h:1.28 src/sys/dev/sdmmc/sdhcvar.h:1.29
--- src/sys/dev/sdmmc/sdhcvar.h:1.28	Fri Feb 17 10:51:48 2017
+++ src/sys/dev/sdmmc/sdhcvar.h	Sat Apr 22 21:49:41 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhcvar.h,v 1.28 2017/02/17 10:51:48 nonaka Exp $	*/
+/*	$NetBSD: sdhcvar.h,v 1.29 2017/04/22 21:49:41 jmcneill Exp $	*/
 /*	$OpenBSD: sdhcvar.h,v 1.3 2007/09/06 08:01:01 jsg Exp $	*/
 
 /*
@@ -74,6 +74,7 @@ struct sdhc_softc {
 	int (*sc_vendor_bus_clock)(struct sdhc_softc *, int);
 	int (*sc_vendor_transfer_data_dma)(struct sdhc_softc *, struct sdmmc_command *);
 	void (*sc_vendor_hw_reset)(struct sdhc_softc *, struct sdhc_host *);
+	int (*sc_vendor_signal_voltage)(struct sdhc_softc *, int);
 };
 
 /* Host controller functions called by the attachment driver. */



CVS commit: src/sys/dev/i2c

2017-04-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Apr 22 21:48:56 UTC 2017

Modified Files:
src/sys/dev/i2c: as3722.c files.i2c

Log Message:
Add LDO6 regulator support.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/as3722.c
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/i2c/files.i2c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/i2c/as3722.c
diff -u src/sys/dev/i2c/as3722.c:1.6 src/sys/dev/i2c/as3722.c:1.7
--- src/sys/dev/i2c/as3722.c:1.6	Sat Apr 22 13:26:05 2017
+++ src/sys/dev/i2c/as3722.c	Sat Apr 22 21:48:56 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: as3722.c,v 1.6 2017/04/22 13:26:05 jmcneill Exp $ */
+/* $NetBSD: as3722.c,v 1.7 2017/04/22 21:48:56 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_fdt.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.6 2017/04/22 13:26:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.7 2017/04/22 21:48:56 jmcneill Exp $");
 
 #include 
 #include 
@@ -61,6 +61,8 @@ __KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1
 #define AS3722_GPIO0_CTRL_MODE		__BITS(2,0)
 #define AS3722_GPIO0_CTRL_MODE_PULLDOWN	5
 
+#define AS3722_LDO6_VOLTAGE_REG		0x16
+
 #define AS3722_RESET_CTRL_REG		0x36
 #define AS3722_RESET_CTRL_POWER_OFF	__BIT(1)
 #define AS3722_RESET_CTRL_FORCE_RESET	__BIT(0)
@@ -76,6 +78,8 @@ __KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1
 #define AS3722_WATCHDOG_SIGNAL_PWM_DIV	__BITS(7,6)
 #define AS3722_WATCHDOG_SIGNAL_SW_SIG	__BIT(0)
 
+#define AS3722_LDOCONTROL0_REG		0x4e
+
 #define AS3722_RTC_CONTROL_REG		0x60
 #define AS3722_RTC_CONTROL_RTC_ON	__BIT(2)
 
@@ -100,6 +104,35 @@ struct as3722_softc {
 	struct todr_chip_handle sc_todr;
 };
 
+#ifdef FDT
+static const struct as3722regdef {
+	const char	*name;
+	u_int		vsel_reg;
+	u_int		vsel_mask;
+	u_int		enable_reg;
+	u_int		enable_mask;
+	u_int		n_voltages;
+} as3722regdefs[] = {
+	{ .name = "ldo6",
+	  .vsel_reg = AS3722_LDO6_VOLTAGE_REG,
+	  .vsel_mask = 0x7f,
+	  .enable_reg = AS3722_LDOCONTROL0_REG,
+	  .enable_mask = 0x40,
+	  .n_voltages = 0x80 },
+};
+
+struct as3722reg_softc {
+	device_t	sc_dev;
+	int		sc_phandle;
+	const struct as3722regdef *sc_regdef;
+};
+
+struct as3722reg_attach_args {
+	const struct as3722regdef *reg_def;
+	int		reg_phandle;
+};
+#endif
+
 #define AS3722_WATCHDOG_DEFAULT_PERIOD	10
 
 static int	as3722_match(device_t, cfdata_t, void *);
@@ -113,6 +146,26 @@ static void	as3722_rtc_attach(struct as3
 static int	as3722_rtc_gettime(todr_chip_handle_t, struct clock_ymdhms *);
 static int	as3722_rtc_settime(todr_chip_handle_t, struct clock_ymdhms *);
 
+#ifdef FDT
+static void	as3722_regulator_attach(struct as3722_softc *);
+static int	as3722reg_match(device_t, cfdata_t, void *);
+static void	as3722reg_attach(device_t, device_t, void *);
+
+static int	as3722reg_acquire(device_t);
+static void	as3722reg_release(device_t);
+static int	as3722reg_enable(device_t, bool);
+static int	as3722reg_set_voltage(device_t, u_int, u_int);
+static int	as3722reg_get_voltage(device_t, u_int *);
+
+static struct fdtbus_regulator_controller_func as3722reg_funcs = {
+	.acquire = as3722reg_acquire,
+	.release = as3722reg_release,
+	.enable = as3722reg_enable,
+	.set_voltage = as3722reg_set_voltage,
+	.get_voltage = as3722reg_get_voltage,
+};
+#endif
+
 static int	as3722_read(struct as3722_softc *, uint8_t, uint8_t *, int);
 static int	as3722_write(struct as3722_softc *, uint8_t, uint8_t, int);
 static int	as3722_set_clear(struct as3722_softc *, uint8_t, uint8_t,
@@ -121,6 +174,11 @@ static int	as3722_set_clear(struct as372
 CFATTACH_DECL_NEW(as3722pmic, sizeof(struct as3722_softc),
 as3722_match, as3722_attach, NULL, NULL);
 
+#ifdef FDT
+CFATTACH_DECL_NEW(as3722reg, sizeof(struct as3722reg_softc),
+as3722reg_match, as3722reg_attach, NULL, NULL);
+#endif
+
 static const char * as3722_compats[] = {
 	"ams,as3722",
 	NULL
@@ -165,6 +223,9 @@ as3722_attach(device_t parent, device_t 
 
 	as3722_wdt_attach(sc);
 	as3722_rtc_attach(sc);
+#ifdef FDT
+	as3722_regulator_attach(sc);
+#endif
 }
 
 static void
@@ -373,6 +434,165 @@ as3722_rtc_settime(todr_chip_handle_t tc
 	return error;
 }
 
+#ifdef FDT
+static void
+as3722_regulator_attach(struct as3722_softc *sc)
+{
+	struct as3722reg_attach_args raa;
+	int phandle, child;
+
+	phandle = of_find_firstchild_byname(sc->sc_phandle, "regulators");
+	if (phandle <= 0)
+		return;
+
+	for (int i = 0; i < __arraycount(as3722regdefs); i++) {
+		const struct as3722regdef *regdef = [i];
+		child = of_find_firstchild_byname(phandle, regdef->name);
+		if (child <= 0)
+			continue;
+		raa.reg_def = regdef;
+		raa.reg_phandle = child;
+		config_found(sc->sc_dev, , NULL);
+	}
+}
+
+static int
+as3722reg_match(device_t parent, cfdata_t match, void *aux)
+{
+	return 1;
+}
+
+static void
+as3722reg_attach(device_t parent, device_t self, void *aux)
+{
+	struct 

CVS commit: src/sys/dev/fdt

2017-04-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Apr 22 21:47:41 UTC 2017

Modified Files:
src/sys/dev/fdt: fdt_regulator.c fdtvar.h

Log Message:
Add regulator APIs for setting and getting voltage.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/fdt_regulator.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/fdt/fdtvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/fdt/fdt_regulator.c
diff -u src/sys/dev/fdt/fdt_regulator.c:1.2 src/sys/dev/fdt/fdt_regulator.c:1.3
--- src/sys/dev/fdt/fdt_regulator.c:1.2	Wed Dec 16 12:17:45 2015
+++ src/sys/dev/fdt/fdt_regulator.c	Sat Apr 22 21:47:41 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_regulator.c,v 1.2 2015/12/16 12:17:45 jmcneill Exp $ */
+/* $NetBSD: fdt_regulator.c,v 1.3 2017/04/22 21:47:41 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_regulator.c,v 1.2 2015/12/16 12:17:45 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_regulator.c,v 1.3 2017/04/22 21:47:41 jmcneill Exp $");
 
 #include 
 #include 
@@ -131,3 +131,26 @@ fdtbus_regulator_disable(struct fdtbus_r
 
 	return rc->rc_funcs->enable(rc->rc_dev, false);
 }
+
+int
+fdtbus_regulator_set_voltage(struct fdtbus_regulator *reg, u_int min_uvol,
+u_int max_uvol)
+{
+	struct fdtbus_regulator_controller *rc = reg->reg_rc;
+
+	if (rc->rc_funcs->set_voltage == NULL)
+		return EINVAL;
+
+	return rc->rc_funcs->set_voltage(rc->rc_dev, min_uvol, max_uvol);
+}
+
+int
+fdtbus_regulator_get_voltage(struct fdtbus_regulator *reg, u_int *puvol)
+{
+	struct fdtbus_regulator_controller *rc = reg->reg_rc;
+
+	if (rc->rc_funcs->set_voltage == NULL)
+		return EINVAL;
+
+	return rc->rc_funcs->get_voltage(rc->rc_dev, puvol);
+}

Index: src/sys/dev/fdt/fdtvar.h
diff -u src/sys/dev/fdt/fdtvar.h:1.11 src/sys/dev/fdt/fdtvar.h:1.12
--- src/sys/dev/fdt/fdtvar.h:1.11	Sat Apr 22 13:24:20 2017
+++ src/sys/dev/fdt/fdtvar.h	Sat Apr 22 21:47:41 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtvar.h,v 1.11 2017/04/22 13:24:20 jmcneill Exp $ */
+/* $NetBSD: fdtvar.h,v 1.12 2017/04/22 21:47:41 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -96,6 +96,8 @@ struct fdtbus_regulator_controller_func 
 	int	(*acquire)(device_t);
 	void	(*release)(device_t);
 	int	(*enable)(device_t, bool);
+	int	(*set_voltage)(device_t, u_int, u_int);
+	int	(*get_voltage)(device_t, u_int *);
 };
 
 struct fdtbus_clock_controller_func {
@@ -151,6 +153,10 @@ struct fdtbus_regulator *fdtbus_regulato
 void		fdtbus_regulator_release(struct fdtbus_regulator *);
 int		fdtbus_regulator_enable(struct fdtbus_regulator *);
 int		fdtbus_regulator_disable(struct fdtbus_regulator *);
+int		fdtbus_regulator_set_voltage(struct fdtbus_regulator *,
+		u_int, u_int);
+int		fdtbus_regulator_get_voltage(struct fdtbus_regulator *,
+		u_int *);
 
 struct clk *	fdtbus_clock_get(int, const char *);
 struct clk *	fdtbus_clock_get_index(int, u_int);



CVS commit: src/sys/arch/mips/mips

2017-04-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 22 20:32:35 UTC 2017

Modified Files:
src/sys/arch/mips/mips: cache.c

Log Message:
Comment indentation


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/mips/mips/cache.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/mips/cache.c
diff -u src/sys/arch/mips/mips/cache.c:1.54 src/sys/arch/mips/mips/cache.c:1.55
--- src/sys/arch/mips/mips/cache.c:1.54	Sun Sep  4 07:30:52 2016
+++ src/sys/arch/mips/mips/cache.c	Sat Apr 22 20:32:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cache.c,v 1.54 2016/09/04 07:30:52 skrll Exp $	*/
+/*	$NetBSD: cache.c,v 1.55 2017/04/22 20:32:35 skrll Exp $	*/
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.54 2016/09/04 07:30:52 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.55 2017/04/22 20:32:35 skrll Exp $");
 
 #include "opt_cputype.h"
 #include "opt_mips_cache.h"
@@ -410,7 +410,7 @@ mips_config_cache_prehistoric(void)
 
 		mips3_get_cache_config(csizebase);
 
-			/* no VCE support if there is no L2 cache */
+		/* no VCE support if there is no L2 cache */
 		if (mci->mci_picache_size > PAGE_SIZE)
 			mci->mci_icache_virtual_alias = true;
 		if (mci->mci_pdcache_size > PAGE_SIZE)



CVS commit: src/sys/uvm/pmap

2017-04-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 22 20:20:19 UTC 2017

Modified Files:
src/sys/uvm/pmap: pmap.c

Log Message:
Improve a comment


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/uvm/pmap/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/pmap/pmap.c
diff -u src/sys/uvm/pmap/pmap.c:1.29 src/sys/uvm/pmap/pmap.c:1.30
--- src/sys/uvm/pmap/pmap.c:1.29	Sat Apr 22 20:19:53 2017
+++ src/sys/uvm/pmap/pmap.c	Sat Apr 22 20:20:19 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.29 2017/04/22 20:19:53 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.30 2017/04/22 20:20:19 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.29 2017/04/22 20:19:53 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.30 2017/04/22 20:20:19 skrll Exp $");
 
 /*
  *	Manages physical address maps.
@@ -1732,8 +1732,8 @@ pmap_pvlist_check(struct vm_page_md *mdp
 #endif
 		}
 #ifdef PMAP_VIRTUAL_CACHE_ALIASES
-		// Assert there if there more than 1 color mapped, that they
-		// are uncached.
+		// Assert that if there is more than 1 color mapped, that the
+		// page is uncached.
 		KASSERTMSG(!pmap_md_virtual_cache_aliasing_p()
 		|| colors == 0 || (colors & (colors-1)) == 0
 		|| VM_PAGEMD_UNCACHED_P(mdpg), "colors=%#x uncached=%u",



CVS commit: src/sys/uvm/pmap

2017-04-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 22 20:19:53 UTC 2017

Modified Files:
src/sys/uvm/pmap: pmap.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/uvm/pmap/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/pmap/pmap.c
diff -u src/sys/uvm/pmap/pmap.c:1.28 src/sys/uvm/pmap/pmap.c:1.29
--- src/sys/uvm/pmap/pmap.c:1.28	Thu Mar  2 20:11:19 2017
+++ src/sys/uvm/pmap/pmap.c	Sat Apr 22 20:19:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.28 2017/03/02 20:11:19 mrg Exp $	*/
+/*	$NetBSD: pmap.c,v 1.29 2017/04/22 20:19:53 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.28 2017/03/02 20:11:19 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.29 2017/04/22 20:19:53 skrll Exp $");
 
 /*
  *	Manages physical address maps.
@@ -502,7 +502,7 @@ pmap_steal_memory(vsize_t size, vaddr_t 
 
 	if (uvm_physseg_valid_p(maybe_bank)) {
 		const uvm_physseg_t bank = maybe_bank;
-		
+
 		/*
 		 * There are enough pages here; steal them!
 		 */



CVS commit: [jdolecek-ncq] src/sys/dev/ata

2017-04-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Apr 22 20:07:54 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: wd.c

Log Message:
Avoid destroying uninitialized xfer on error in wdioctlstrategy().


To generate a diff of this commit:
cvs rdiff -u -r1.428.2.9 -r1.428.2.10 src/sys/dev/ata/wd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.428.2.9 src/sys/dev/ata/wd.c:1.428.2.10
--- src/sys/dev/ata/wd.c:1.428.2.9	Wed Apr 19 21:42:39 2017
+++ src/sys/dev/ata/wd.c	Sat Apr 22 20:07:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.428.2.9 2017/04/19 21:42:39 jdolecek Exp $ */
+/*	$NetBSD: wd.c,v 1.428.2.10 2017/04/22 20:07:54 jakllsch Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.428.2.9 2017/04/19 21:42:39 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.428.2.10 2017/04/22 20:07:54 jakllsch Exp $");
 
 #include "opt_ata.h"
 
@@ -2249,7 +2249,7 @@ wdioctlstrategy(struct buf *bp)
 		printf("wdioctlstrategy: "
 		"No matching ioctl request found in queue\n");
 		error = EINVAL;
-		goto out;
+		goto out2;
 	}
 
 	ata_xfer_init(, true);
@@ -2342,6 +2342,7 @@ wdioctlstrategy(struct buf *bp)
 
 out:
 	ata_xfer_destroy();
+out2:
 	bp->b_error = error;
 	if (error)
 		bp->b_resid = bp->b_bcount;



CVS commit: src/sys/arch/arm/nvidia

2017-04-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Apr 22 19:20:51 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_lic.c

Log Message:
Explicitly initialize interrupt controllers and since we pass through to
GIC, don't include "LIC" in interrupt string.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nvidia/tegra_lic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_lic.c
diff -u src/sys/arch/arm/nvidia/tegra_lic.c:1.3 src/sys/arch/arm/nvidia/tegra_lic.c:1.4
--- src/sys/arch/arm/nvidia/tegra_lic.c:1.3	Tue Jan  5 21:53:48 2016
+++ src/sys/arch/arm/nvidia/tegra_lic.c	Sat Apr 22 19:20:51 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_lic.c,v 1.3 2016/01/05 21:53:48 marty Exp $ */
+/* $NetBSD: tegra_lic.c,v 1.4 2017/04/22 19:20:51 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_lic.c,v 1.3 2016/01/05 21:53:48 marty Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_lic.c,v 1.4 2017/04/22 19:20:51 jmcneill Exp $");
 
 #include 
 #include 
@@ -44,6 +44,9 @@ __KERNEL_RCSID(0, "$NetBSD: tegra_lic.c,
 
 #include 
 
+#define	LIC_CPU_IER_CLR_REG	0x28
+#define	LIC_CPU_IEP_CLASS_REG	0x2c
+
 static int	tegra_lic_match(device_t, cfdata_t, void *);
 static void	tegra_lic_attach(device_t, device_t, void *);
 
@@ -80,7 +83,11 @@ tegra_lic_attach(device_t parent, device
 {
 	struct tegra_lic_softc * const sc = device_private(self);
 	struct fdt_attach_args * const faa = aux;
-	int error;
+	bus_space_tag_t bst;
+	bus_space_handle_t bsh;
+	bus_addr_t addr;
+	bus_size_t size;
+	int error, index;
 
 	sc->sc_dev = self;
 	sc->sc_phandle = faa->faa_phandle;
@@ -94,6 +101,27 @@ tegra_lic_attach(device_t parent, device
 
 	aprint_naive("\n");
 	aprint_normal(": LIC\n");
+
+	bst = faa->faa_bst;
+	for (index = 0; ; index++) {
+		error = fdtbus_get_reg(faa->faa_phandle, index, , );
+		if (error != 0)
+			break;
+		error = bus_space_map(bst, addr, size, 0, );
+		if (error) {
+			aprint_error_dev(self, "can't map IC#%d: %d\n",
+			index, error);
+			continue;
+		}
+
+		/* Clear interrupt enable for CPU */
+		bus_space_write_4(bst, bsh, LIC_CPU_IER_CLR_REG, 0x);
+
+		/* Route to IRQ */
+		bus_space_write_4(bst, bsh, LIC_CPU_IEP_CLASS_REG, 0);
+
+		bus_space_unmap(bst, bsh, size);
+	}
 }
 
 static void *
@@ -133,7 +161,7 @@ tegra_lic_intrstr(device_t dev, u_int *s
 	const u_int intr = be32toh(specifier[1]);
 	const u_int irq = type == 0 ? IRQ_SPI(intr) : IRQ_PPI(intr);
 
-	snprintf(buf, buflen, "LIC irq %d", irq);
+	snprintf(buf, buflen, "irq %d", irq);
 
 	return true;
 }



CVS commit: src/sys/arch/arm/nvidia

2017-04-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Apr 22 17:41:20 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_sdhc.c

Log Message:
Set parent clock rate to 100MHz when SDR104 is disabled


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/nvidia/tegra_sdhc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_sdhc.c
diff -u src/sys/arch/arm/nvidia/tegra_sdhc.c:1.17 src/sys/arch/arm/nvidia/tegra_sdhc.c:1.18
--- src/sys/arch/arm/nvidia/tegra_sdhc.c:1.17	Sun Apr 16 13:27:19 2017
+++ src/sys/arch/arm/nvidia/tegra_sdhc.c	Sat Apr 22 17:41:20 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_sdhc.c,v 1.17 2017/04/16 13:27:19 jmcneill Exp $ */
+/* $NetBSD: tegra_sdhc.c,v 1.18 2017/04/22 17:41:20 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -26,10 +26,12 @@
  * SUCH DAMAGE.
  */
 
+#define	TEGRA_SDHC_NO_SDR104
+
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.17 2017/04/16 13:27:19 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.18 2017/04/22 17:41:20 jmcneill Exp $");
 
 #include 
 #include 
@@ -124,6 +126,7 @@ tegra_sdhc_attach(device_t parent, devic
 	}
 	sc->sc_bsz = size;
 
+#ifdef TEGRA_SDHC_NO_SDR104
 	/* XXX SDR104 requires a custom tuning method on Tegra K1 */
 	sc->sc.sc_flags |= SDHC_FLAG_HOSTCAPS;
 	sc->sc.sc_caps = bus_space_read_4(sc->sc_bst, sc->sc_bsh,
@@ -131,6 +134,7 @@ tegra_sdhc_attach(device_t parent, devic
 	sc->sc.sc_caps2 = bus_space_read_4(sc->sc_bst, sc->sc_bsh,
 	SDHC_CAPABILITIES2);
 	sc->sc.sc_caps2 &= ~SDHC_SDR104_SUPP;
+#endif
 
 	sc->sc_pin_power = fdtbus_gpio_acquire(faa->faa_phandle,
 	"power-gpios", GPIO_PIN_OUTPUT);
@@ -162,7 +166,11 @@ tegra_sdhc_attach(device_t parent, devic
 	}
 
 	fdtbus_reset_assert(sc->sc_rst);
+#ifdef TEGRA_SDHC_NO_SDR104
+	error = clk_set_rate(sc->sc_clk, 1);
+#else
 	error = clk_set_rate(sc->sc_clk, 20400);
+#endif
 	if (error) {
 		aprint_error(": couldn't set frequency: %d\n", error);
 		return;
@@ -177,7 +185,7 @@ tegra_sdhc_attach(device_t parent, devic
 	sc->sc.sc_clkbase = clk_get_rate(sc->sc_clk) / 1000;
 
 	aprint_naive("\n");
-	aprint_normal(": SDMMC\n");
+	aprint_normal(": SDMMC (%u kHz)\n", sc->sc.sc_clkbase);
 
 	if (sc->sc.sc_clkbase == 0) {
 		aprint_error_dev(self, "couldn't determine frequency\n");



CVS commit: src/sys/arch/arm/nvidia

2017-04-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Apr 22 17:40:47 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra124_car.c

Log Message:
Fix fractional divider calculations and round down for sdmmc clocks.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/nvidia/tegra124_car.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nvidia/tegra124_car.c
diff -u src/sys/arch/arm/nvidia/tegra124_car.c:1.10 src/sys/arch/arm/nvidia/tegra124_car.c:1.11
--- src/sys/arch/arm/nvidia/tegra124_car.c:1.10	Sun Apr 16 12:28:21 2017
+++ src/sys/arch/arm/nvidia/tegra124_car.c	Sat Apr 22 17:40:47 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra124_car.c,v 1.10 2017/04/16 12:28:21 jmcneill Exp $ */
+/* $NetBSD: tegra124_car.c,v 1.11 2017/04/22 17:40:47 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.10 2017/04/16 12:28:21 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.11 2017/04/22 17:40:47 jmcneill Exp $");
 
 #include 
 #include 
@@ -1204,6 +1204,16 @@ tegra124_car_clock_get_rate_fixed_div(st
 }
 
 static u_int
+tegra124_car_clock_calc_rate_frac_div(u_int rate, u_int raw_div)
+{
+	raw_div += 2;
+	rate *= 2;
+	rate += raw_div - 1;
+	rate /= raw_div;
+	return rate;
+}
+
+static u_int
 tegra124_car_clock_get_rate_div(struct tegra124_car_softc *sc,
 struct tegra_clk *tclk)
 {
@@ -1235,13 +1245,15 @@ tegra124_car_clock_get_rate_div(struct t
 	case CAR_CLKSRC_UARTC_REG:
 	case CAR_CLKSRC_UARTD_REG:
 		if (v & CAR_CLKSRC_UART_DIV_ENB) {
-			rate = parent_rate * 2 / (raw_div + 2);
+			rate = tegra124_car_clock_calc_rate_frac_div(
+			parent_rate, raw_div);
 		} else {
 			rate = parent_rate;
 		}
 		break;
 	default:
-		rate = parent_rate * 2 / (raw_div + 2);
+		rate = tegra124_car_clock_calc_rate_frac_div(parent_rate,
+		raw_div);
 		break;
 	}
 
@@ -1301,6 +1313,22 @@ tegra124_car_clock_set_rate_div(struct t
 		if (rate)
 			raw_div = parent_rate / rate - 1;
 		break;
+	case CAR_CLKSRC_SDMMC1_REG:
+	case CAR_CLKSRC_SDMMC2_REG:
+	case CAR_CLKSRC_SDMMC3_REG:
+	case CAR_CLKSRC_SDMMC4_REG:
+		if (rate) {
+			for (raw_div = 0x00; raw_div <= 0xff; raw_div++) {
+u_int calc_rate =
+tegra124_car_clock_calc_rate_frac_div(
+	parent_rate, raw_div);
+if (calc_rate <= rate)
+	break;
+			}
+			if (raw_div == 0x100)
+return EINVAL;
+		}
+		break;
 	default:
 		if (rate)
 			raw_div = (parent_rate * 2) / rate - 2;



CVS commit: src/bin/sh

2017-04-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr 22 16:02:39 UTC 2017

Modified Files:
src/bin/sh: main.c redir.c redir.h

Log Message:
Keep track of the biggest fd used by, or available to, the user/script
and use that to control which fd's are examined by a (bare) fdflags
(with no fd args).

Usually this will mean that fdflags will no longer show the shell's
internal use fds, only user fds.

This is only a partial fix however, a user can easily discover the
shell's fd usage (eg: using fstat) and can then still use fdflags to
manipulate those fds (or even send output to them).

The shell needs to monitor its own fd usage better, and keep out of
the way of user fds - coming sometime later...


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/bin/sh/main.c
cvs rdiff -u -r1.52 -r1.53 src/bin/sh/redir.c
cvs rdiff -u -r1.21 -r1.22 src/bin/sh/redir.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/main.c
diff -u src/bin/sh/main.c:1.67 src/bin/sh/main.c:1.68
--- src/bin/sh/main.c:1.67	Mon May  9 21:03:10 2016
+++ src/bin/sh/main.c	Sat Apr 22 16:02:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.67 2016/05/09 21:03:10 kre Exp $	*/
+/*	$NetBSD: main.c,v 1.68 2017/04/22 16:02:39 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.7 (Berkeley) 7/19/95";
 #else
-__RCSID("$NetBSD: main.c,v 1.67 2016/05/09 21:03:10 kre Exp $");
+__RCSID("$NetBSD: main.c,v 1.68 2017/04/22 16:02:39 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -77,11 +77,13 @@ __RCSID("$NetBSD: main.c,v 1.67 2016/05/
 #include "mystring.h"
 #include "exec.h"
 #include "cd.h"
+#include "redir.h"
 
 #define PROFILE 0
 
 int rootpid;
 int rootshell;
+int max_user_fd;
 #if PROFILE
 short profile_buf[16384];
 extern int etext();
@@ -111,6 +113,10 @@ main(int argc, char **argv)
 	uid = getuid();
 	gid = getgid();
 
+	max_user_fd = fcntl(0, F_MAXFD);
+	if (max_user_fd < 2)
+		max_user_fd = 2;
+
 	setlocale(LC_ALL, "");
 
 	posix = getenv("POSIXLY_CORRECT") != NULL;

Index: src/bin/sh/redir.c
diff -u src/bin/sh/redir.c:1.52 src/bin/sh/redir.c:1.53
--- src/bin/sh/redir.c:1.52	Sat Apr 22 15:54:53 2017
+++ src/bin/sh/redir.c	Sat Apr 22 16:02:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: redir.c,v 1.52 2017/04/22 15:54:53 kre Exp $	*/
+/*	$NetBSD: redir.c,v 1.53 2017/04/22 16:02:39 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)redir.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: redir.c,v 1.52 2017/04/22 15:54:53 kre Exp $");
+__RCSID("$NetBSD: redir.c,v 1.53 2017/04/22 16:02:39 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -189,6 +189,8 @@ redirect(union node *redir, int flags)
 	}
 	for (n = redir ; n ; n = n->nfile.next) {
 		fd = n->nfile.fd;
+		if (fd > max_user_fd)
+			max_user_fd = fd;
 		if ((n->nfile.type == NTOFD || n->nfile.type == NFROMFD) &&
 		n->ndup.dupfd == fd) {
 			/* redirect from/to same file descriptor */
@@ -738,22 +740,17 @@ fdflagscmd(int argc, char *argv[])
 		parseflags(setflags, , );
 
 	if (argc == 0) {
-		int maxfd;
+		int i;
 
 		if (setflags)
 			goto msg;
 
 		/*
-		 * XXX  this has to go, maxfd might be 700 (or something)
-		 *
 		 * XXX  we should only ever operate on user defined fds
 		 * XXX  not on sh internal fds that might be open.
 		 * XXX  but for that we need to know their range (later)
 		 */
-		maxfd = fcntl(0, F_MAXFD);
-		if (maxfd == -1)
-			error("Can't get max fd (%s)", strerror(errno));
-		for (int i = 0; i <= maxfd; i++)
+		for (i = 0; i <= max_user_fd; i++)
 			printone(i, 0, verbose, 1);
 		return 0;
 	}

Index: src/bin/sh/redir.h
diff -u src/bin/sh/redir.h:1.21 src/bin/sh/redir.h:1.22
--- src/bin/sh/redir.h:1.21	Thu May 12 13:31:37 2016
+++ src/bin/sh/redir.h	Sat Apr 22 16:02:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: redir.h,v 1.21 2016/05/12 13:31:37 kre Exp $	*/
+/*	$NetBSD: redir.h,v 1.22 2017/04/22 16:02:39 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -47,3 +47,5 @@ int fd0_redirected_p(void);
 void clearredir(int);
 int movefd(int, int);
 int to_upper_fd(int);
+
+int max_user_fd;		/* highest fd used by user */



CVS commit: src/bin/sh

2017-04-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr 22 15:54:53 UTC 2017

Modified Files:
src/bin/sh: redir.c

Log Message:
When verifying the size of the fd arg for fdflags skip leading 0's
(fdflags 01 should work, fdflags 1000 should not)


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/bin/sh/redir.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/redir.c
diff -u src/bin/sh/redir.c:1.51 src/bin/sh/redir.c:1.52
--- src/bin/sh/redir.c:1.51	Fri Feb  3 23:16:38 2017
+++ src/bin/sh/redir.c	Sat Apr 22 15:54:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: redir.c,v 1.51 2017/02/03 23:16:38 kre Exp $	*/
+/*	$NetBSD: redir.c,v 1.52 2017/04/22 15:54:53 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)redir.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: redir.c,v 1.51 2017/02/03 23:16:38 kre Exp $");
+__RCSID("$NetBSD: redir.c,v 1.52 2017/04/22 15:54:53 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -761,6 +761,8 @@ fdflagscmd(int argc, char *argv[])
 	while ((num = *argv++) != NULL) {
 		int fd = number(num);
 
+		while (num[0] == '0' && num[1] != '\0')		/* skip 0's */
+			num++;
 		if (strlen(num) > 5)
 			error("%s too big to be a file descriptor", num);
 



CVS commit: src/bin/sh

2017-04-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr 22 15:53:17 UTC 2017

Modified Files:
src/bin/sh: eval.c

Log Message:
When -x is set, show assignments to the loop variable in a for loop.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/bin/sh/eval.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/eval.c
diff -u src/bin/sh/eval.c:1.130 src/bin/sh/eval.c:1.131
--- src/bin/sh/eval.c:1.130	Thu Feb  2 19:26:37 2017
+++ src/bin/sh/eval.c	Sat Apr 22 15:53:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.130 2017/02/02 19:26:37 christos Exp $	*/
+/*	$NetBSD: eval.c,v 1.131 2017/04/22 15:53:17 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c	8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.130 2017/02/02 19:26:37 christos Exp $");
+__RCSID("$NetBSD: eval.c,v 1.131 2017/04/22 15:53:17 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -419,6 +419,16 @@ evalfor(union node *n, int flags)
 		if (sp->next)
 			f |= EV_MORE;
 
+		if (xflag) {
+			out2str(ps4val());
+			out2str("for ");
+			out2str(n->nfor.var);
+			out2c('=');
+			out2shstr(sp->text);
+			out2c('\n');
+			flushout();
+		}
+
 		setvar(n->nfor.var, sp->text, 0);
 		evaltree(n->nfor.body, f);
 		status = exitstatus;



CVS commit: src/external/bsd/libarchive

2017-04-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 22 15:12:59 UTC 2017

Modified Files:
src/external/bsd/libarchive/include: config_netbsd.h
src/external/bsd/libarchive/lib/libarchive: Makefile

Log Message:
Obey MKCRYPTO.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/libarchive/include/config_netbsd.h
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/libarchive/lib/libarchive/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/libarchive/include/config_netbsd.h
diff -u src/external/bsd/libarchive/include/config_netbsd.h:1.7 src/external/bsd/libarchive/include/config_netbsd.h:1.8
--- src/external/bsd/libarchive/include/config_netbsd.h:1.7	Thu Apr 20 09:11:04 2017
+++ src/external/bsd/libarchive/include/config_netbsd.h	Sat Apr 22 11:12:59 2017
@@ -606,7 +606,7 @@
 /* #undef HAVE_LIBCHARSET */
 
 /* Define to 1 if you have the `crypto' library (-lcrypto). */
-#define HAVE_LIBCRYPTO 1
+/* #undef1 HAVE_LIBCRYPTO */
 
 /* Define to 1 if you have the `eay32' library (-leay32). */
 /* #undef HAVE_LIBEAY32 */

Index: src/external/bsd/libarchive/lib/libarchive/Makefile
diff -u src/external/bsd/libarchive/lib/libarchive/Makefile:1.4 src/external/bsd/libarchive/lib/libarchive/Makefile:1.5
--- src/external/bsd/libarchive/lib/libarchive/Makefile:1.4	Thu Apr 20 09:11:04 2017
+++ src/external/bsd/libarchive/lib/libarchive/Makefile	Sat Apr 22 11:12:59 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2017/04/20 13:11:04 joerg Exp $
+#	$NetBSD: Makefile,v 1.5 2017/04/22 15:12:59 christos Exp $
 
 .include 
 
@@ -6,8 +6,12 @@
 
 LIB=		archive
 
+.if ${MKCRYPTO:Uno} == "yes"
+LIBDPLIBS+=	crypto	${NETBSDSRCDIR}/crypto/external/bsd/openssl/lib/libcrypto
+CPPFLAGS+=	-DHAVE_LIBCRYPTO
+.endif
+
 LIBDPLIBS+=	bz2	${NETBSDSRCDIR}/lib/libbz2 \
-		crypto	${NETBSDSRCDIR}/crypto/external/bsd/openssl/lib/libcrypto \
 		expat	${NETBSDSRCDIR}/external/mit/expat/lib/libexpat \
 		lzma	${NETBSDSRCDIR}/external/public-domain/xz/lib \
 		z	${NETBSDSRCDIR}/lib/libz



CVS commit: src/sys/arch/sparc64/dev

2017-04-22 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Apr 22 15:07:49 UTC 2017

Modified Files:
src/sys/arch/sparc64/dev: ffb.c

Log Message:
- set RI_FULLCLEAR
- clear RI_CURSOR when we clear the screen
no more garbage when switching screens
while there set RI_PREFER_ALPHA


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/sparc64/dev/ffb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc64/dev/ffb.c
diff -u src/sys/arch/sparc64/dev/ffb.c:1.58 src/sys/arch/sparc64/dev/ffb.c:1.59
--- src/sys/arch/sparc64/dev/ffb.c:1.58	Fri Nov  4 16:35:32 2016
+++ src/sys/arch/sparc64/dev/ffb.c	Sat Apr 22 15:07:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffb.c,v 1.58 2016/11/04 16:35:32 macallan Exp $	*/
+/*	$NetBSD: ffb.c,v 1.59 2017/04/22 15:07:49 macallan Exp $	*/
 /*	$OpenBSD: creator.c,v 1.20 2002/07/30 19:48:15 jason Exp $	*/
 
 /*
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.58 2016/11/04 16:35:32 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.59 2017/04/22 15:07:49 macallan Exp $");
 
 #include 
 #include 
@@ -695,6 +695,7 @@ ffb_ras_eraserows(void *cookie, int row,
 		FBC_WRITE(sc, FFB_FBC_BX, 0);
 		FBC_WRITE(sc, FFB_FBC_BH, ri->ri_height);
 		FBC_WRITE(sc, FFB_FBC_BW, ri->ri_width);
+		ri->ri_flg &= ~RI_CURSOR;
 	} else {
 		row *= ri->ri_font->fontheight;
 		FBC_WRITE(sc, FFB_FBC_BY, ri->ri_yorigin + row);
@@ -722,6 +723,7 @@ ffb_ras_erasecols(void *cookie, int row,
 		n = ri->ri_cols - col;
 	if (n <= 0)
 		return;
+
 	n *= ri->ri_font->fontwidth;
 	col *= ri->ri_font->fontwidth;
 	row *= ri->ri_font->fontheight;
@@ -1215,7 +1217,8 @@ ffb_init_screen(void *cookie, struct vco
 	ri->ri_width = sc->sc_width;
 	ri->ri_height = sc->sc_height;
 	ri->ri_stride = sc->sc_linebytes;
-	ri->ri_flg = RI_CENTER | RI_ENABLE_ALPHA;
+	ri->ri_flg = RI_CENTER | RI_ENABLE_ALPHA | RI_PREFER_ALPHA |
+		 RI_FULLCLEAR;
 
 	/*
 	 * we can't accelerate copycols() so instead of falling back to



CVS commit: src/sys/dev/rasops

2017-04-22 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Apr 22 15:05:03 UTC 2017

Modified Files:
src/sys/dev/rasops: rasops.c rasops.h

Log Message:
add RI_PREFER_ALPHA flag, for drivers that can draw such fonts by hardware


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/rasops/rasops.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/rasops/rasops.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/rasops/rasops.c
diff -u src/sys/dev/rasops/rasops.c:1.74 src/sys/dev/rasops/rasops.c:1.75
--- src/sys/dev/rasops/rasops.c:1.74	Thu Feb 23 12:16:30 2017
+++ src/sys/dev/rasops/rasops.c	Sat Apr 22 15:05:02 2017
@@ -1,4 +1,4 @@
-/*	 $NetBSD: rasops.c,v 1.74 2017/02/23 12:16:30 nonaka Exp $	*/
+/*	 $NetBSD: rasops.c,v 1.75 2017/04/22 15:05:02 macallan Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.74 2017/02/23 12:16:30 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.75 2017/04/22 15:05:02 macallan Exp $");
 
 #include "opt_rasops.h"
 #include "rasops_glue.h"
@@ -208,7 +208,8 @@ rasops_init(struct rasops_info *ri, int 
 		flags = WSFONT_FIND_BESTWIDTH | WSFONT_FIND_BITMAP;
 		if ((ri->ri_flg & RI_ENABLE_ALPHA) != 0)
 			flags |= WSFONT_FIND_ALPHA;
-
+		if ((ri->ri_flg & RI_PREFER_ALPHA) != 0)
+			flags |= WSFONT_PREFER_ALPHA;
 		cookie = wsfont_find(NULL,
 			ri->ri_width / wantcols,
 			0,
@@ -376,14 +377,14 @@ rasops_reconfig(struct rasops_info *ri, 
 	if ((ri->ri_delta & 3) != 0)
 		panic("rasops_init: ri_delta not aligned on 32-bit boundary");
 #endif
+	ri->ri_origbits = ri->ri_bits;
+	ri->ri_hworigbits = ri->ri_hwbits;
+
 	/* Clear the entire display */
 	if ((ri->ri_flg & RI_CLEAR) != 0)
 		memset(ri->ri_bits, 0, ri->ri_stride * ri->ri_height);
 
 	/* Now centre our window if needs be */
-	ri->ri_origbits = ri->ri_bits;
-	ri->ri_hworigbits = ri->ri_hwbits;
-
 	if ((ri->ri_flg & RI_CENTER) != 0) {
 		ri->ri_bits += (((ri->ri_width * bpp >> 3) -
 		ri->ri_emustride) >> 1) & ~3;
@@ -1727,7 +1728,7 @@ rasops_make_box_chars_alpha(struct rasop
 		}
 	}
 }
-
+ 
 /*
  * Return a colour map appropriate for the given struct rasops_info in the
  * same form used by rasops_cmap[]

Index: src/sys/dev/rasops/rasops.h
diff -u src/sys/dev/rasops/rasops.h:1.31 src/sys/dev/rasops/rasops.h:1.32
--- src/sys/dev/rasops/rasops.h:1.31	Thu Apr 19 06:57:39 2012
+++ src/sys/dev/rasops/rasops.h	Sat Apr 22 15:05:02 2017
@@ -1,4 +1,4 @@
-/* 	$NetBSD: rasops.h,v 1.31 2012/04/19 06:57:39 macallan Exp $ */
+/* 	$NetBSD: rasops.h,v 1.32 2017/04/22 15:05:02 macallan Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -63,6 +63,11 @@
 #define RI_ENABLE_ALPHA	0x1000
 /* set this in order to use r3g3b2 'true' colour in 8 bit */ 
 #define RI_8BIT_IS_RGB	0x2000
+/*
+ * drivers can set this to tell the font selection code that they'd rather
+ * use alpha fonts
+ */ 
+#define RI_PREFER_ALPHA	0x4000
 
 struct rasops_info {
 	/* These must be filled in by the caller */



CVS commit: src/sys/dev/sdmmc

2017-04-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Apr 22 14:19:36 UTC 2017

Modified Files:
src/sys/dev/sdmmc: ld_sdmmc.c

Log Message:
Ensure that the task is returned to the free task list in an error branch.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/sdmmc/ld_sdmmc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sdmmc/ld_sdmmc.c
diff -u src/sys/dev/sdmmc/ld_sdmmc.c:1.25 src/sys/dev/sdmmc/ld_sdmmc.c:1.26
--- src/sys/dev/sdmmc/ld_sdmmc.c:1.25	Sat Jan  7 16:24:40 2017
+++ src/sys/dev/sdmmc/ld_sdmmc.c	Sat Apr 22 14:19:36 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_sdmmc.c,v 1.25 2017/01/07 16:24:40 martin Exp $	*/
+/*	$NetBSD: ld_sdmmc.c,v 1.26 2017/04/22 14:19:36 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.25 2017/01/07 16:24:40 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.26 2017/04/22 14:19:36 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -248,8 +248,8 @@ ld_sdmmc_dobio(void *arg)
 		bp->b_rawblkno, sc->sc_sf->csd.capacity);
 		bp->b_error = EINVAL;
 		bp->b_resid = bp->b_bcount;
-		lddone(>sc_ld, bp);
-		return;
+
+		goto done;
 	}
 
 	if (bp->b_flags & B_READ)
@@ -277,6 +277,7 @@ ld_sdmmc_dobio(void *arg)
 		bp->b_resid = 0;
 	}
 
+done:
 	TAILQ_INSERT_TAIL(>sc_freeq, >task, next);
 
 	lddone(>sc_ld, bp);



CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-04-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Apr 22 14:08:38 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: siisata.c

Log Message:
Another one missed in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.30.4.7 -r1.30.4.8 src/sys/dev/ic/siisata.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.30.4.7 src/sys/dev/ic/siisata.c:1.30.4.8
--- src/sys/dev/ic/siisata.c:1.30.4.7	Sat Apr 22 13:40:50 2017
+++ src/sys/dev/ic/siisata.c	Sat Apr 22 14:08:38 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.30.4.7 2017/04/22 13:40:50 jakllsch Exp $ */
+/* $NetBSD: siisata.c,v 1.30.4.8 2017/04/22 14:08:38 jakllsch Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.7 2017/04/22 13:40:50 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.8 2017/04/22 14:08:38 jakllsch Exp $");
 
 #include 
 #include 
@@ -1640,11 +1640,12 @@ out:
 
 int
 siisata_atapi_complete(struct ata_channel *chp, struct ata_xfer *xfer,
-int slot)
+int is)
 {
 	struct siisata_softc *sc = (struct siisata_softc *)chp->ch_atac;
 	struct siisata_channel *schp = (struct siisata_channel *)chp;
 	struct scsipi_xfer *sc_xfer = xfer->c_scsipi;
+	int slot = SIISATA_NON_NCQ_SLOT;
 
 	SIISATA_DEBUG_PRINT(
 	("%s: %s()\n", SIISATANAME(sc), __func__), DEBUG_INTR);



CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-04-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Apr 22 13:40:50 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: siisata.c

Log Message:
3rd xfer interrupt argument fix change missed in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.30.4.6 -r1.30.4.7 src/sys/dev/ic/siisata.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.30.4.6 src/sys/dev/ic/siisata.c:1.30.4.7
--- src/sys/dev/ic/siisata.c:1.30.4.6	Sat Apr 22 13:19:28 2017
+++ src/sys/dev/ic/siisata.c	Sat Apr 22 13:40:50 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.30.4.6 2017/04/22 13:19:28 jakllsch Exp $ */
+/* $NetBSD: siisata.c,v 1.30.4.7 2017/04/22 13:40:50 jakllsch Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.6 2017/04/22 13:19:28 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.7 2017/04/22 13:40:50 jakllsch Exp $");
 
 #include 
 #include 
@@ -1054,7 +1054,7 @@ siisata_bio_start(struct ata_channel *ch
 	(ata_bio->flags & ATA_READ) ? BUS_DMA_READ : BUS_DMA_WRITE)) {
 		ata_bio->error = ERR_DMA;
 		ata_bio->r_error = 0;
-		siisata_bio_complete(chp, xfer, slot);
+		siisata_bio_complete(chp, xfer, 0);
 		return;
 	}
 



CVS commit: src/sys/arch/arm/nvidia

2017-04-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Apr 22 13:24:45 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_rtc.c

Log Message:
Use fdtbus_todr_attach


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nvidia/tegra_rtc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_rtc.c
diff -u src/sys/arch/arm/nvidia/tegra_rtc.c:1.2 src/sys/arch/arm/nvidia/tegra_rtc.c:1.3
--- src/sys/arch/arm/nvidia/tegra_rtc.c:1.2	Sun Dec 13 17:39:19 2015
+++ src/sys/arch/arm/nvidia/tegra_rtc.c	Sat Apr 22 13:24:45 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_rtc.c,v 1.2 2015/12/13 17:39:19 jmcneill Exp $ */
+/* $NetBSD: tegra_rtc.c,v 1.3 2017/04/22 13:24:45 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_rtc.c,v 1.2 2015/12/13 17:39:19 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_rtc.c,v 1.3 2017/04/22 13:24:45 jmcneill Exp $");
 
 #include 
 #include 
@@ -104,7 +104,7 @@ tegra_rtc_attach(device_t parent, device
 	sc->sc_todr.todr_gettime = tegra_rtc_gettime;
 	sc->sc_todr.todr_settime = tegra_rtc_settime;
 	sc->sc_todr.cookie = sc;
-	todr_attach(>sc_todr);
+	fdtbus_todr_attach(self, faa->faa_phandle, >sc_todr);
 }
 
 static int



CVS commit: src/sys/dev/fdt

2017-04-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Apr 22 13:24:20 UTC 2017

Modified Files:
src/sys/dev/fdt: fdtvar.h files.fdt
Added Files:
src/sys/dev/fdt: fdt_rtc.c

Log Message:
Add fdtbus_todr_attach.

The kernel will only ever use the first RTC driver to call todr_attach.
When drivers use fdtbus_todr_attach, if an "rtc0" alias exists in the
devicetree, ensure that only that device node calls todr_attach.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/fdt_rtc.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/fdt/fdtvar.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/fdt/files.fdt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/fdt/fdtvar.h
diff -u src/sys/dev/fdt/fdtvar.h:1.10 src/sys/dev/fdt/fdtvar.h:1.11
--- src/sys/dev/fdt/fdtvar.h:1.10	Fri Apr 21 23:35:01 2017
+++ src/sys/dev/fdt/fdtvar.h	Sat Apr 22 13:24:20 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtvar.h,v 1.10 2017/04/21 23:35:01 jmcneill Exp $ */
+/* $NetBSD: fdtvar.h,v 1.11 2017/04/22 13:24:20 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -35,6 +35,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 
 struct fdt_attach_args {
@@ -159,6 +161,8 @@ void		fdtbus_reset_put(struct fdtbus_res
 int		fdtbus_reset_assert(struct fdtbus_reset *);
 int		fdtbus_reset_deassert(struct fdtbus_reset *);
 
+int		fdtbus_todr_attach(device_t, int, todr_chip_handle_t);
+
 bool		fdtbus_set_data(const void *);
 const void *	fdtbus_get_data(void);
 int		fdtbus_phandle2offset(int);

Index: src/sys/dev/fdt/files.fdt
diff -u src/sys/dev/fdt/files.fdt:1.9 src/sys/dev/fdt/files.fdt:1.10
--- src/sys/dev/fdt/files.fdt:1.9	Sun Apr 16 12:29:20 2017
+++ src/sys/dev/fdt/files.fdt	Sat Apr 22 13:24:20 2017
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.9 2017/04/16 12:29:20 jmcneill Exp $
+# $NetBSD: files.fdt,v 1.10 2017/04/22 13:24:20 jmcneill Exp $
 
 include	"external/bsd/libfdt/conf/files.libfdt"
 
@@ -30,4 +30,5 @@ file	dev/fdt/fdt_i2c.c			fdtbus
 file	dev/fdt/fdt_intr.c			fdtbus
 file	dev/fdt/fdt_regulator.c			fdtbus
 file	dev/fdt/fdt_reset.c			fdtbus
+file	dev/fdt/fdt_rtc.c			fdtbus
 file	dev/fdt/fdt_pinctrl.c			fdtbus

Added files:

Index: src/sys/dev/fdt/fdt_rtc.c
diff -u /dev/null src/sys/dev/fdt/fdt_rtc.c:1.1
--- /dev/null	Sat Apr 22 13:24:20 2017
+++ src/sys/dev/fdt/fdt_rtc.c	Sat Apr 22 13:24:20 2017
@@ -0,0 +1,58 @@
+/* $NetBSD: fdt_rtc.c,v 1.1 2017/04/22 13:24:20 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2017 Jared D. McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: fdt_rtc.c,v 1.1 2017/04/22 13:24:20 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+int
+fdtbus_todr_attach(device_t dev, int phandle, todr_chip_handle_t tch)
+{
+	const char *prop;
+
+	/*
+	 * The kernel will only use the first device to register with
+	 * todr_attach. If we have an "rtc0" alias, ensure that it matches
+	 * this phandle and ignore all other RTC devices.
+	 */
+	prop = fdt_get_alias(fdtbus_get_data(), "rtc0");
+	if (prop != NULL && OF_finddevice(prop) != phandle) {
+		device_printf(dev, "disabled\n");
+		return EINVAL;
+	}
+
+	todr_attach(tch);
+
+	return 0;
+}



CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-04-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Apr 22 13:19:28 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: siisata.c

Log Message:
Don't use the third argument of the xfer interrupt functions to pass the slot 
number in siisata(4).

This (abuse) is redundant because we are now storing the slot in the xfer 
structure.


To generate a diff of this commit:
cvs rdiff -u -r1.30.4.5 -r1.30.4.6 src/sys/dev/ic/siisata.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.30.4.5 src/sys/dev/ic/siisata.c:1.30.4.6
--- src/sys/dev/ic/siisata.c:1.30.4.5	Wed Apr 19 20:49:17 2017
+++ src/sys/dev/ic/siisata.c	Sat Apr 22 13:19:28 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.30.4.5 2017/04/19 20:49:17 jdolecek Exp $ */
+/* $NetBSD: siisata.c,v 1.30.4.6 2017/04/22 13:19:28 jakllsch Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.5 2017/04/19 20:49:17 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.6 2017/04/22 13:19:28 jakllsch Exp $");
 
 #include 
 #include 
@@ -538,7 +538,7 @@ siisata_intr_port(struct siisata_channel
 	/* clear some (ok, all) ints */
 	PRWRITE(sc, PRX(chp->ch_channel, PRO_PIS), 0x);
 	if (xfer && xfer->c_intr)
-		xfer->c_intr(chp, xfer, slot);
+		xfer->c_intr(chp, xfer, 0);
 
 	return;
 }
@@ -850,7 +850,7 @@ siisata_cmd_start(struct ata_channel *ch
 	ata_c->bcount,
 	(ata_c->flags & AT_READ) ? BUS_DMA_READ : BUS_DMA_WRITE)) { 
 		ata_c->flags |= AT_DF;
-		siisata_cmd_complete(chp, xfer, slot);
+		siisata_cmd_complete(chp, xfer, 0);
 		return;
 	}
 
@@ -914,12 +914,13 @@ siisata_cmd_kill_xfer(struct ata_channel
 }
 
 int
-siisata_cmd_complete(struct ata_channel *chp, struct ata_xfer *xfer, int slot)
+siisata_cmd_complete(struct ata_channel *chp, struct ata_xfer *xfer, int is)
 {
 	struct ata_command *ata_c = >c_ata_c;
 #ifdef SIISATA_DEBUG
 	struct siisata_softc *sc = (struct siisata_softc *)chp->ch_atac;
 #endif
+	int slot = SIISATA_NON_NCQ_SLOT;
 
 	SIISATA_DEBUG_PRINT(
 	("%s: %s\n", SIISATANAME(sc), __func__), DEBUG_FUNCS|DEBUG_XFERS);
@@ -1121,12 +1122,13 @@ siisata_bio_kill_xfer(struct ata_channel
 }
 
 int
-siisata_bio_complete(struct ata_channel *chp, struct ata_xfer *xfer, int slot)
+siisata_bio_complete(struct ata_channel *chp, struct ata_xfer *xfer, int is)
 {
 	struct siisata_softc *sc = (struct siisata_softc *)chp->ch_atac;
 	struct siisata_channel *schp = (struct siisata_channel *)chp;
 	struct ata_bio *ata_bio = >c_bio;
 	int drive = xfer->c_drive;
+	int slot = SIISATA_NON_NCQ_SLOT;
 
 	schp->sch_active_slots &= ~__BIT(slot);
 	chp->ch_flags &= ~ATACH_IRQ_WAIT;
@@ -1180,13 +1182,12 @@ siisata_timeout(void *v)
 {
 	struct ata_xfer *xfer = v;
 	struct ata_channel *chp = xfer->c_chp;
-	int slot = SIISATA_NON_NCQ_SLOT;
 	int s = splbio();
 	SIISATA_DEBUG_PRINT(("%s: %p\n", __func__, xfer), DEBUG_INTR);
 	siisata_device_reset(chp);
 	if ((chp->ch_flags & ATACH_IRQ_WAIT) != 0) {
 		xfer->c_flags |= C_TIMEOU;
-		xfer->c_intr(chp, xfer, slot);
+		xfer->c_intr(chp, xfer, 0);
 	}
 	splx(s);
 }



CVS commit: src/bin/ln

2017-04-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr 22 12:22:31 UTC 2017

Modified Files:
src/bin/ln: ln.c

Log Message:
When called as "link" (not currently installed that way) always simply
do a link(2) sys call, never use the internal linkit() routine, which
allows for a destination directory and installs the link inside (and more.)

This makes ln's "link" variant comply with its (currently commented out)
section if its manual page, and also makes it identical to /usr/sbin/link.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/bin/ln/ln.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/ln/ln.c
diff -u src/bin/ln/ln.c:1.38 src/bin/ln/ln.c:1.39
--- src/bin/ln/ln.c:1.38	Fri Apr 21 14:46:31 2017
+++ src/bin/ln/ln.c	Sat Apr 22 12:22:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ln.c,v 1.38 2017/04/21 14:46:31 szptvlfn Exp $	*/
+/*	$NetBSD: ln.c,v 1.39 2017/04/22 12:22:31 kre Exp $	*/
 
 /*-
  * Copyright (c) 1987, 1993, 1994
@@ -44,7 +44,7 @@ static char sccsid[] = "@(#)ln.c	8.2 (Be
 #ifdef __FBSDID
 __FBSDID("$FreeBSD: head/bin/ln/ln.c 251261 2013-06-02 17:55:00Z eadler $");
 #endif
-__RCSID("$NetBSD: ln.c,v 1.38 2017/04/21 14:46:31 szptvlfn Exp $");
+__RCSID("$NetBSD: ln.c,v 1.39 2017/04/22 12:22:31 kre Exp $");
 
 #include 
 #include 
@@ -96,7 +96,9 @@ main(int argc, char *argv[])
 		argv += optind;
 		if (argc != 2)
 			usage();
-		exit(linkit(argv[0], argv[1], 0));
+		if (link(argv[0], argv[1]) == -1)
+			err(EXIT_FAILURE, NULL);
+		exit(EXIT_SUCCESS);
 	}
 
 	while ((ch = getopt(argc, argv, "FLPfhinsvw")) != -1)



CVS commit: src/sys/dev

2017-04-22 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Apr 22 10:37:51 UTC 2017

Modified Files:
src/sys/dev: audio.c

Log Message:
If there is no data in the mix ring, insert silence.

This will ensure that the hardware output pointer remains valid.


To generate a diff of this commit:
cvs rdiff -u -r1.326 -r1.327 src/sys/dev/audio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/audio.c
diff -u src/sys/dev/audio.c:1.326 src/sys/dev/audio.c:1.327
--- src/sys/dev/audio.c:1.326	Mon Apr 17 22:40:06 2017
+++ src/sys/dev/audio.c	Sat Apr 22 10:37:51 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.326 2017/04/17 22:40:06 nat Exp $	*/
+/*	$NetBSD: audio.c,v 1.327 2017/04/22 10:37:51 nat Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.326 2017/04/17 22:40:06 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.327 2017/04/22 10:37:51 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -3598,12 +3598,17 @@ audio_pint(void *v)
 		cv_broadcast(>sc_wchan);
 	}
 
-	if (audio_stream_get_used(>sc_pr.s) < blksize)
-		goto wake_mix;
-
 	vc->sc_mpr.s.outp = audio_stream_add_outp(>sc_mpr.s,
 	vc->sc_mpr.s.outp, blksize);
 
+	if (audio_stream_get_used(>sc_pr.s) < blksize) {
+		audio_fill_silence(>sc_pparams, vc->sc_mpr.s.inp,
+		vc->sc_mpr.blksize);
+		vc->sc_mpr.s.inp = audio_stream_add_inp(>sc_mpr.s,
+		vc->sc_mpr.s.inp, blksize);
+		goto wake_mix;
+	}
+
 	mix_write(sc);
 
 wake_mix:



CVS commit: src

2017-04-22 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sat Apr 22 07:48:33 UTC 2017

Modified Files:
src: BUILDING

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/BUILDING

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/BUILDING
diff -u src/BUILDING:1.126 src/BUILDING:1.127
--- src/BUILDING:1.126	Thu Apr 20 09:47:52 2017
+++ src/BUILDING	Sat Apr 22 07:48:33 2017
@@ -717,12 +717,11 @@ BUILDING
 
  install-image
Create a bootable NetBSD installation disk image in the
-   RELEASEDIR/RELEASEMACHINEDIR/installation/installimage
-   directory.  The installation disk image is suitable for
-   copying to bootable USB flash memory sticks, etc., for
-   machines which are able to boot from such devices.  The
-   file system in the bootable disk image will have a layout
-   as described in release(7).
+   RELEASEDIR/images directory.  The installation disk image
+   is suitable for copying to bootable USB flash memory
+   sticks, etc., for machines which are able to boot from such
+   devices.  The file system in the bootable disk image will
+   have a layout as described in release(7).
 
The installation image is bootable, and will automatically
run the sysinst(8) menu-based installation program, which



CVS commit: src/doc

2017-04-22 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sat Apr 22 07:48:19 UTC 2017

Modified Files:
src/doc: BUILDING.mdoc

Log Message:
state correct location for install-image (RELEASEDIR/images)


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/doc/BUILDING.mdoc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/BUILDING.mdoc
diff -u src/doc/BUILDING.mdoc:1.118 src/doc/BUILDING.mdoc:1.119
--- src/doc/BUILDING.mdoc:1.118	Thu Apr 20 09:47:41 2017
+++ src/doc/BUILDING.mdoc	Sat Apr 22 07:48:19 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: BUILDING.mdoc,v 1.118 2017/04/20 09:47:41 wiz Exp $
+.\"	$NetBSD: BUILDING.mdoc,v 1.119 2017/04/22 07:48:19 plunky Exp $
 .\"
 .\" Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -1288,7 +1288,7 @@ but which can be installed from
 Create a bootable
 .Nx
 installation disk image in the
-.Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/installimage
+.Sy RELEASEDIR Ns Pa /images
 directory.
 The installation disk image is suitable for copying to
 bootable USB flash memory sticks, etc., for machines which