CVS commit: src/usr.bin/make

2014-09-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Sep 14 04:32:07 UTC 2014

Modified Files:
src/usr.bin/make: make.1

Log Message:
Add some notes on compatibility with other make dialects.

I was originally intending to preserve some of Jarmo Jaakkola's notes
on POSIX make from the PR 49085 changes... but really there's no point
wandering into details about $? and such when the big picture is
"almost everything in this manual works only in BSD make".

Maybe the exact details can be stuffed into a chapter of the mythical
make reference manual if that ever gets (re)written.


To generate a diff of this commit:
cvs rdiff -u -r1.240 -r1.241 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.240 src/usr.bin/make/make.1:1.241
--- src/usr.bin/make/make.1:1.240	Sun Sep 14 03:50:28 2014
+++ src/usr.bin/make/make.1	Sun Sep 14 04:32:07 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.240 2014/09/14 03:50:28 dholland Exp $
+.\"	$NetBSD: make.1,v 1.241 2014/09/14 04:32:07 dholland Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -2149,19 +2149,87 @@ system makefile
 system makefile directory
 .El
 .Sh COMPATIBILITY
-The basic make syntax is compatible between different versions of make,
+The basic make syntax is compatible between different versions of make;
 however the special variables, variable modifiers and conditionals are not.
-.Pp
-The way that parallel makes are scheduled changed in
-.Nx 4.0
-so that .ORDER and .WAIT apply recursively to the dependent nodes.
-The algorithms used may change again in the future.
+.Ss Older versions
+An incomplete list of changes in older versions of
+.Nm :
 .Pp
 The way that .for loop variables are substituted changed after
 .Nx 5.0
 so that they still appear to be variable expansions.
 In particular this stops them being treated as syntax, and removes some
 obscure problems using them in .if statements.
+.Pp
+The way that parallel makes are scheduled changed in
+.Nx 4.0
+so that .ORDER and .WAIT apply recursively to the dependent nodes.
+The algorithms used may change again in the future.
+.Ss Other make dialects
+Other make dialects (GNU make, SVR4 make, POSIX make, etc.) do not
+support most of the features of
+.Nm
+as described in this manual.
+Most notably:
+.Bl -bullet -offset indent
+.It
+The
+.Ic .WAIT
+and
+.Ic .ORDER
+declarations and most functionality pertaining to parallelization.
+(GNU make supports parallelization but lacks these features needed to
+control it effectively.)
+.It
+Directives, including for loops and conditionals and most of the
+forms of include files.
+(GNU make has its own incompatible and less powerful syntax for
+conditionals.)
+.It
+All built-in variables that begin with a dot.
+.It
+Most of the special sources and targets that begin with a dot,
+with the notable exception of
+.Ic .PHONY ,
+.Ic .PRECIOUS ,
+and
+.SUFFIXES .
+.It
+Variable modifiers, except for the
+.Dl :old=new
+string substitution, which does not portably support globbing with
+.Ql %
+and historically only works on declared suffixes.
+.It
+The
+.Ic $>
+variable even in its short form; most makes support this functionality
+but its name varies.
+.El
+.Pp
+Some features are somewhat more portable, such as assignment with
+.Ic += ,
+.Ic ?= ,
+and
+.Ic != .
+The
+.Ic .PATH
+functionality is based on an older feature
+.Ic VPATH
+found in GNU make and many versions of SVR4 make; however,
+historically its behavior is too ill-defined (and too buggy) to rely
+upon.
+.Pp
+The
+.Ic $@
+and
+.Ic $<
+variables are more or less universally portable, as is the
+.Ic $(MAKE)
+variable.
+Basic use of suffix rules (for files only in the current directory,
+not trying to chain transformations together, etc.) is also reasonably
+portable.
 .Sh SEE ALSO
 .Xr mkdep 1
 .Sh HISTORY



CVS commit: src/usr.bin/make

2014-09-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Sep 14 04:32:42 UTC 2014

Modified Files:
src/usr.bin/make: make.1

Log Message:
bump date; I think I'm done for tonight


To generate a diff of this commit:
cvs rdiff -u -r1.241 -r1.242 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.241 src/usr.bin/make/make.1:1.242
--- src/usr.bin/make/make.1:1.241	Sun Sep 14 04:32:07 2014
+++ src/usr.bin/make/make.1	Sun Sep 14 04:32:42 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.241 2014/09/14 04:32:07 dholland Exp $
+.\"	$NetBSD: make.1,v 1.242 2014/09/14 04:32:42 dholland Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	from: @(#)make.1	8.4 (Berkeley) 3/19/94
 .\"
-.Dd September 9, 2014
+.Dd September 13, 2014
 .Dt MAKE 1
 .Os
 .Sh NAME



CVS commit: src/usr.bin/make

2014-09-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Sep 14 03:50:28 UTC 2014

Modified Files:
src/usr.bin/make: make.1

Log Message:
Improve the documentation of rule-local variables. Cherry-picked from
the PR 49085 changes, with some adjustments by me.


To generate a diff of this commit:
cvs rdiff -u -r1.239 -r1.240 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.239 src/usr.bin/make/make.1:1.240
--- src/usr.bin/make/make.1:1.239	Sun Sep 14 03:13:49 2014
+++ src/usr.bin/make/make.1	Sun Sep 14 03:50:28 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.239 2014/09/14 03:13:49 dholland Exp $
+.\"	$NetBSD: make.1,v 1.240 2014/09/14 03:50:28 dholland Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -638,13 +638,19 @@ Variables defined in the makefile or in 
 Variables defined as part of the command line.
 .It Local variables
 Variables that are defined specific to a certain target.
+.El
+.Pp
+Local variables are all built in and their values vary magically from
+target to target.
+It is not currently possible to define new local variables.
 The seven local variables are as follows:
-.Bl -tag -width ".ARCHIVE"
+.Bl -tag -width ".ARCHIVE" -offset indent
 .It Va .ALLSRC
 The list of all sources for this target; also known as
 .Ql Va \&\*[Gt] .
 .It Va .ARCHIVE
-The name of the archive file.
+The name of the archive file; also known as
+.Ql Va \&! .
 .It Va .IMPSRC
 In suffix-transformation rules, the name/path of the source from which the
 target is to be transformed (the
@@ -653,7 +659,8 @@ source); also known as
 .Ql Va \&\*[Lt] .
 It is not defined in explicit rules.
 .It Va .MEMBER
-The name of the archive member.
+The name of the archive member; also known as
+.Ql Va % .
 .It Va .OODATE
 The list of sources for this target that were deemed out-of-date; also
 known as
@@ -662,31 +669,41 @@ known as
 The file prefix of the target, containing only the file portion, no suffix
 or preceding directory components; also known as
 .Ql Va * .
+The suffix must be one of the known suffixes declared with
+.Ic .SUFFIXES
+or it will not be recognized.
 .It Va .TARGET
 The name of the target; also known as
 .Ql Va @ .
 .El
 .Pp
 The shorter forms
-.Ql Va @ ,
+.Ql ( Va \*[Gt] ,
+.Ql Va \&! ,
+.Ql Va \*[Lt] ,
+.Ql Va % ,
 .Ql Va \&? ,
-.Ql Va \&\*[Lt] ,
-.Ql Va \&\*[Gt] ,
+.Ql Va * ,
 and
-.Ql Va *
+.Ql Va @ )
 are permitted for backward
-compatibility with historical makefiles and are not recommended.
-The six variables
-.Ql Va "@F" ,
-.Ql Va "@D" ,
-.Ql Va "\*[Lt]F" ,
-.Ql Va "\*[Lt]D" ,
-.Ql Va "*F" ,
+compatibility with historical makefiles and legacy POSIX make and are
+not recommended.
+.Pp
+Variants of these variables with the punctuation followed immediately by
+.Ql D
+or
+.Ql F ,
+e.g.
+.Ql Va $(@D) ,
+are legacy forms equivalent to using the
+.Ql :H
 and
-.Ql Va "*D"
-are permitted for compatibility with
+.Ql :T
+modifiers.
+These forms are accepted for compatibility with
 .At V
-makefiles and are not recommended.
+makefiles and POSIX but are not recommended.
 .Pp
 Four of the local variables may be used in sources on dependency lines
 because they expand to the proper value for each target on the line.
@@ -696,7 +713,6 @@ These variables are
 .Ql Va .ARCHIVE ,
 and
 .Ql Va .MEMBER .
-.El
 .Ss Additional built-in variables
 In addition,
 .Nm



CVS commit: src/usr.bin/make

2014-09-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Sep 14 03:13:49 UTC 2014

Modified Files:
src/usr.bin/make: make.1

Log Message:
Improvements pertaining to shell commands and chdir. Some of this
appeared in the PR 49085 changes, even though it's not actually
relevant there except tangentially. However, I've reworked most of
that for clarity and added some more.


To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.238 src/usr.bin/make/make.1:1.239
--- src/usr.bin/make/make.1:1.238	Tue Sep  9 06:41:56 2014
+++ src/usr.bin/make/make.1	Sun Sep 14 03:13:49 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.238 2014/09/09 06:41:56 dholland Exp $
+.\"	$NetBSD: make.1,v 1.239 2014/09/14 03:13:49 dholland Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -441,17 +441,29 @@ The value
 need not necessarily be used to describe existing files.
 Expansion is in directory order, not alphabetically as done in the shell.
 .Sh SHELL COMMANDS
-Each target may have associated with it a series of shell commands, normally
+Each target may have associated with it one or more lines of shell
+commands, normally
 used to create the target.
-Each of the commands in this script
+Each of the lines in this script
 .Em must
 be preceded by a tab.
-While any target may appear on a dependency line, only one of these
-dependencies may be followed by a creation script, unless the
+(For historical reasons, spaces are not accepted.)
+While targets can appear in many dependency lines if desired, by
+default only one of these rules may be followed by a creation
+script.
+If the
 .Ql Ic \&::
-operator is used.
+operator is used, however, all rules may include scripts and the
+scripts are executed in the order found.
 .Pp
-If the first characters of the command line are any combination of
+Each line is treated as a separate shell command, unless the end of
+line is escaped with a backslash
+.Pq Ql \e
+in which case that line and the next are combined.
+.\" The escaped newline is retained and passed to the shell, which
+.\" normally ignores it.
+.\" However, the tab at the beginning of the following line is removed.
+If the first characters of the command are any combination of
 .Ql Ic @ ,
 .Ql Ic + ,
 or
@@ -477,43 +489,45 @@ is run in jobs mode with
 .Fl j Ar max_jobs ,
 the entire script for the target is fed to a
 single instance of the shell.
-.Pp
 In compatibility (non-jobs) mode, each command is run in a separate process.
 If the command contains any shell meta characters
 .Pq Ql #=|^(){};&<>*?[]:$`\e\en
-it will be passed to the shell, otherwise
+it will be passed to the shell; otherwise
 .Nm
 will attempt direct execution.
 .Pp
-Since
-.Nm
-will
-.Xr chdir 2
-to
-.Ql Va .OBJDIR
-before executing any targets, each child process
-starts with that as its current working directory.
-.Pp
 Makefiles should be written so that the mode of
 .Nm
 operation does not change their behavior.
 For example, any command which needs to use
 .Dq cd
 or
-.Dq chdir ,
-without side-effect should be put in parenthesis:
+.Dq chdir
+without potentially changing the directory for subsequent commands
+should be put in parentheses so it executes in a subshell.
+To force the use of one shell, escape the line breaks so as to make
+the whole script one command.
+For example:
 .Bd -literal -offset indent
-
 avoid-chdir-side-effects:
 	@echo Building $@ in `pwd`
-	@(cd ${.CURDIR} && ${.MAKE} $@)
+	@(cd ${.CURDIR} && ${MAKE} $@)
 	@echo Back in `pwd`
 
 ensure-one-shell-regardless-of-mode:
 	@echo Building $@ in `pwd`; \\
-	(cd ${.CURDIR} && ${.MAKE} $@); \\
+	(cd ${.CURDIR} && ${MAKE} $@); \\
 	echo Back in `pwd`
 .Ed
+.Pp
+Since
+.Nm
+will
+.Xr chdir 2
+to
+.Ql Va .OBJDIR
+before executing any targets, each child process
+starts with that as its current working directory.
 .Sh VARIABLE ASSIGNMENTS
 Variables in make are much like variables in the shell, and, by tradition,
 consist of all upper-case letters.



CVS commit: src/usr.bin/make

2014-09-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Sep 14 02:32:51 UTC 2014

Modified Files:
src/usr.bin/make: var.c

Log Message:
Fix handling of the silly $(@D) $(@F) etc. vars so modifiers on them
work. This is issue #1 in PR 49085 from Jarmo Jaakkola, but I've used
a different and cleaner patch this time.


To generate a diff of this commit:
cvs rdiff -u -r1.190 -r1.191 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.190 src/usr.bin/make/var.c:1.191
--- src/usr.bin/make/var.c:1.190	Sat Sep 13 23:21:01 2014
+++ src/usr.bin/make/var.c	Sun Sep 14 02:32:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.190 2014/09/13 23:21:01 dholland Exp $	*/
+/*	$NetBSD: var.c,v 1.191 2014/09/14 02:32:51 dholland Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.190 2014/09/13 23:21:01 dholland Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.191 2014/09/14 02:32:51 dholland Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.190 2014/09/13 23:21:01 dholland Exp $");
+__RCSID("$NetBSD: var.c,v 1.191 2014/09/14 02:32:51 dholland Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -3599,14 +3599,13 @@ Var_Parse(const char *str, GNode *ctxt, 
  * expanding it in a non-local context. This
  * is done to support dynamic sources. The
  * result is just the invocation, unaltered */
-Var_Parse_State parsestate; /* Flags passed to helper functions */
+const char *extramodifiers; /* extra modifiers to apply first */
 char	  name[2];
 
 *freePtr = NULL;
+extramodifiers = NULL;
 dynamic = FALSE;
 start = str;
-parsestate.oneBigWord = FALSE;
-parsestate.varSpace = ' ';	/* word separator */
 
 startc = str[1];
 if (startc != PROPEN && startc != BROPEN) {
@@ -3743,29 +3742,12 @@ Var_Parse(const char *str, GNode *ctxt, 
 	v = VarFind(name, ctxt, 0);
 
 	if (v != NULL) {
-		/*
-		 * No need for nested expansion or anything, as we're
-		 * the only one who sets these things and we sure don't
-		 * put nested invocations in them...
-		 */
-		nstr = Buf_GetAll(&v->val, NULL);
-
 		if (str[1] == 'D') {
-		nstr = VarModify(ctxt, &parsestate, nstr, VarHead,
-NULL);
-		} else {
-		nstr = VarModify(ctxt, &parsestate, nstr, VarTail,
-NULL);
+			extramodifiers = "H:";
+		}
+		else { /* F */
+			extramodifiers = "T:";
 		}
-		/*
-		 * Resulting string is dynamically allocated, so
-		 * tell caller to free it.
-		 */
-		*freePtr = nstr;
-		*lengthPtr = tstr-start+1;
-		Buf_Destroy(&buf, TRUE);
-		VarFreeEnv(v, TRUE);
-		return nstr;
 	}
 	}
 
@@ -3860,16 +3842,29 @@ Var_Parse(const char *str, GNode *ctxt, 
 
 v->flags &= ~VAR_IN_USE;
 
-if ((nstr != NULL) && haveModifier) {
+if ((nstr != NULL) && (haveModifier || extramodifiers != NULL)) {
+	void *extraFree;
 	int used;
-	/*
-	 * Skip initial colon.
-	 */
-	tstr++;
 
-	nstr = ApplyModifiers(nstr, tstr, startc, endc,
-			  v, ctxt, errnum, &used, freePtr);
-	tstr += used;
+	extraFree = NULL;
+	if (extramodifiers != NULL) {
+		nstr = ApplyModifiers(nstr, extramodifiers, '(', ')',
+  v, ctxt, errnum, &used, &extraFree);
+	}
+
+	if (haveModifier) {
+		/* Skip initial colon. */
+		tstr++;
+
+		nstr = ApplyModifiers(nstr, tstr, startc, endc,
+  v, ctxt, errnum, &used, freePtr);
+		tstr += used;
+		if (extraFree) {
+			free(extraFree);
+		}
+	} else {
+		*freePtr = extraFree;
+	}
 }
 if (*tstr) {
 	*lengthPtr = tstr - start + 1;



CVS commit: src/usr.bin/make

2014-09-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Sep 13 23:21:01 UTC 2014

Modified Files:
src/usr.bin/make: var.c

Log Message:
Recognize the crazy POSIXisms $(?D) and $(?F); issue 2 in PR 49085
from Jarmo Jaakkola.


To generate a diff of this commit:
cvs rdiff -u -r1.189 -r1.190 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.189 src/usr.bin/make/var.c:1.190
--- src/usr.bin/make/var.c:1.189	Sat Sep 13 23:10:28 2014
+++ src/usr.bin/make/var.c	Sat Sep 13 23:21:01 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.189 2014/09/13 23:10:28 dholland Exp $	*/
+/*	$NetBSD: var.c,v 1.190 2014/09/13 23:21:01 dholland Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.189 2014/09/13 23:10:28 dholland Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.190 2014/09/13 23:21:01 dholland Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.189 2014/09/13 23:10:28 dholland Exp $");
+__RCSID("$NetBSD: var.c,v 1.190 2014/09/13 23:21:01 dholland Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -3734,7 +3734,7 @@ Var_Parse(const char *str, GNode *ctxt, 
 	 */
 	if ((v == NULL) && (ctxt != VAR_CMD) && (ctxt != VAR_GLOBAL) &&
 		(vlen == 2) && (str[1] == 'F' || str[1] == 'D') &&
-		strchr("@%*!<>", str[0]) != NULL) {
+		strchr("@%?*!<>", str[0]) != NULL) {
 	/*
 	 * Well, it's local -- go look for it.
 	 */



CVS commit: src/usr.bin/make

2014-09-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Sep 13 23:10:28 UTC 2014

Modified Files:
src/usr.bin/make: var.c

Log Message:
typo in comment, from the first reverted patch


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.188 src/usr.bin/make/var.c:1.189
--- src/usr.bin/make/var.c:1.188	Sun Sep  7 20:55:34 2014
+++ src/usr.bin/make/var.c	Sat Sep 13 23:10:28 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.188 2014/09/07 20:55:34 joerg Exp $	*/
+/*	$NetBSD: var.c,v 1.189 2014/09/13 23:10:28 dholland Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.188 2014/09/07 20:55:34 joerg Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.189 2014/09/13 23:10:28 dholland Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.188 2014/09/07 20:55:34 joerg Exp $");
+__RCSID("$NetBSD: var.c,v 1.189 2014/09/13 23:10:28 dholland Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -3746,7 +3746,7 @@ Var_Parse(const char *str, GNode *ctxt, 
 		/*
 		 * No need for nested expansion or anything, as we're
 		 * the only one who sets these things and we sure don't
-		 * but nested invocations in them...
+		 * put nested invocations in them...
 		 */
 		nstr = Buf_GetAll(&v->val, NULL);
 



CVS commit: src/sys/dev/usb

2014-09-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 13 19:02:00 UTC 2014

Modified Files:
src/sys/dev/usb: motg.c

Log Message:
if the bus driver supplies a fifo size and dynfifo is true, use it


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/usb/motg.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/usb/motg.c
diff -u src/sys/dev/usb/motg.c:1.11 src/sys/dev/usb/motg.c:1.12
--- src/sys/dev/usb/motg.c:1.11	Sat Sep 13 18:36:39 2014
+++ src/sys/dev/usb/motg.c	Sat Sep 13 19:02:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: motg.c,v 1.11 2014/09/13 18:36:39 jmcneill Exp $	*/
+/*	$NetBSD: motg.c,v 1.12 2014/09/13 19:02:00 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012, 2014 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
 #include "opt_motg.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.11 2014/09/13 18:36:39 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.12 2014/09/13 19:02:00 jmcneill Exp $");
 
 #include 
 #include 
@@ -365,12 +365,16 @@ motg_init(struct motg_softc *sc)
 		i, fifotx_size, fiforx_size, dynfifo));
 
 		if (dynfifo) {
-			if (i < 3) {
-fifo_size = 12;   /* 4K */
-			} else if (i < 10) {
-fifo_size = 10;   /* 1K */
+			if (sc->sc_ep_fifosize) {
+fifo_size = ffs(sc->sc_ep_fifosize) - 1;
 			} else {
-fifo_size = 7;/* 128 bytes */
+if (i < 3) {
+	fifo_size = 12;   /* 4K */
+} else if (i < 10) {
+	fifo_size = 10;   /* 1K */
+} else {
+	fifo_size = 7;/* 128 bytes */
+}
 			}
 			if (fiforx_size && (i <= nrx)) {
 fiforx_size = fifo_size;



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

2014-09-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 13 18:37:16 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_otg.c

Log Message:
set fifosize to 512, and fix swapped intrx/inttx params to motg_intr


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/allwinner/awin_otg.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/allwinner/awin_otg.c
diff -u src/sys/arch/arm/allwinner/awin_otg.c:1.1 src/sys/arch/arm/allwinner/awin_otg.c:1.2
--- src/sys/arch/arm/allwinner/awin_otg.c:1.1	Sat Sep 13 17:48:52 2014
+++ src/sys/arch/arm/allwinner/awin_otg.c	Sat Sep 13 18:37:16 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_otg.c,v 1.1 2014/09/13 17:48:52 jmcneill Exp $ */
+/* $NetBSD: awin_otg.c,v 1.2 2014/09/13 18:37:16 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: awin_otg.c,v 1.1 2014/09/13 17:48:52 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_otg.c,v 1.2 2014/09/13 18:37:16 jmcneill Exp $");
 
 #include 
 #include 
@@ -124,6 +124,7 @@ awin_otg_attach(device_t parent, device_
 
 	sc->sc_motg.sc_mode = MOTG_MODE_HOST;
 	sc->sc_motg.sc_ep_max = 5;
+	sc->sc_motg.sc_ep_fifosize = 512;
 
 	sc->sc_ih = intr_establish(loc->loc_intr, IPL_SCHED, IST_LEVEL,
 	awin_otg_intr, sc);
@@ -201,7 +202,7 @@ awin_otg_intr(void *priv)
 	if (intrx)
 		OTG_WRITE2(sc, MUSB2_REG_INTRX, intrx);
 
-	motg_intr(&sc->sc_motg, inttx, intrx, intusb);
+	motg_intr(&sc->sc_motg, intrx, inttx, intusb);
 
 	mutex_exit(&sc->sc_motg.sc_intr_lock);
 



CVS commit: src/sys/dev/usb

2014-09-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 13 18:36:39 UTC 2014

Modified Files:
src/sys/dev/usb: motg.c motgvar.h

Log Message:
let the bus driver override fifo size


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/usb/motg.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/usb/motgvar.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/usb/motg.c
diff -u src/sys/dev/usb/motg.c:1.10 src/sys/dev/usb/motg.c:1.11
--- src/sys/dev/usb/motg.c:1.10	Sat Sep 13 17:42:48 2014
+++ src/sys/dev/usb/motg.c	Sat Sep 13 18:36:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: motg.c,v 1.10 2014/09/13 17:42:48 jmcneill Exp $	*/
+/*	$NetBSD: motg.c,v 1.11 2014/09/13 18:36:39 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012, 2014 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
 #include "opt_motg.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.10 2014/09/13 17:42:48 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.11 2014/09/13 18:36:39 jmcneill Exp $");
 
 #include 
 #include 
@@ -353,9 +353,13 @@ motg_init(struct motg_softc *sc)
 		/* select endpoint */
 		UWRITE1(sc, MUSB2_REG_EPINDEX, i);
 
-		val = UREAD1(sc, MUSB2_REG_FSIZE);
-		fiforx_size = (val & MUSB2_MASK_RX_FSIZE) >> 4;
-		fifotx_size = (val & MUSB2_MASK_TX_FSIZE);
+		if (sc->sc_ep_fifosize) {
+			fiforx_size = fifotx_size = sc->sc_ep_fifosize;
+		} else {
+			val = UREAD1(sc, MUSB2_REG_FSIZE);
+			fiforx_size = (val & MUSB2_MASK_RX_FSIZE) >> 4;
+			fifotx_size = (val & MUSB2_MASK_TX_FSIZE);
+		}
 
 		DPRINTF(("Endpoint %u FIFO size: IN=%u, OUT=%u, DYN=%d\n",
 		i, fifotx_size, fiforx_size, dynfifo));

Index: src/sys/dev/usb/motgvar.h
diff -u src/sys/dev/usb/motgvar.h:1.3 src/sys/dev/usb/motgvar.h:1.4
--- src/sys/dev/usb/motgvar.h:1.3	Sat Sep 13 14:46:50 2014
+++ src/sys/dev/usb/motgvar.h	Sat Sep 13 18:36:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: motgvar.h,v 1.3 2014/09/13 14:46:50 jmcneill Exp $	*/
+/*	$NetBSD: motgvar.h,v 1.4 2014/09/13 18:36:39 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -76,6 +76,7 @@ struct motg_softc {
 	void (*sc_intr_poll)(void *);
 	void *sc_intr_poll_arg;
 	int sc_ep_max;
+	u_int sc_ep_fifosize;
 
 	uint16_t sc_intr_tx_ep;
 	uint16_t sc_intr_rx_ep;



CVS commit: src/sys/dev/usb

2014-09-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Sep 13 18:36:45 UTC 2014

Modified Files:
src/sys/dev/usb: ehci.c

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.231 -r1.232 src/sys/dev/usb/ehci.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/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.231 src/sys/dev/usb/ehci.c:1.232
--- src/sys/dev/usb/ehci.c:1.231	Sat Sep 13 18:35:57 2014
+++ src/sys/dev/usb/ehci.c	Sat Sep 13 18:36:45 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.231 2014/09/13 18:35:57 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.232 2014/09/13 18:36:45 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.231 2014/09/13 18:35:57 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.232 2014/09/13 18:36:45 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -2979,7 +2979,7 @@ ehci_alloc_sqtd_chain(struct ehci_pipe *
 		cur->len = curlen;
 
 		USBHIST_LOG(ehcidebug, "cbp=0x%08zx end=0x%08zx",
-			(size_t)curoffs, (size_t)(curoffs + curlen), 0, 0);
+		(size_t)curoffs, (size_t)(curoffs + curlen), 0, 0);
 
 		/* adjust the toggle based on the number of packets in this
 		   qtd */



CVS commit: src/sys/dev/usb

2014-09-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Sep 13 18:35:57 UTC 2014

Modified Files:
src/sys/dev/usb: ehci.c

Log Message:
Fix reversed argument to USBHIST_LOG


To generate a diff of this commit:
cvs rdiff -u -r1.230 -r1.231 src/sys/dev/usb/ehci.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/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.230 src/sys/dev/usb/ehci.c:1.231
--- src/sys/dev/usb/ehci.c:1.230	Sat Sep 13 08:15:43 2014
+++ src/sys/dev/usb/ehci.c	Sat Sep 13 18:35:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.230 2014/09/13 08:15:43 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.231 2014/09/13 18:35:57 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.230 2014/09/13 08:15:43 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.231 2014/09/13 18:35:57 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -1616,7 +1616,7 @@ ehci_dump_qtd(ehci_qtd_t *qtd)
 
 	USBHIST_LOGN(ehcidebug, 10,
 	" next = 0x%08x  altnext = 0x%08x  status = 0x%08x",
-	qtd->qtd_altnext, qtd->qtd_next, s, 0);
+	qtd->qtd_next, qtd->qtd_altnext, s, 0);
 	USBHIST_LOGN(ehcidebug, 10,
 	"   toggle = %d ioc = %d bytes = %#x "
 	"c_page = %#x", EHCI_QTD_GET_TOGGLE(s), EHCI_QTD_GET_IOC(s),



CVS commit: src/sys/arch/hpcarm/hpcarm

2014-09-13 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Sep 13 18:09:50 UTC 2014

Modified Files:
src/sys/arch/hpcarm/hpcarm: hpc_machdep.c pxa2x0_hpc_machdep.c
sa11x0_hpc_machdep.c

Log Message:
Use paddr_t for msgbufphys


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/hpcarm/hpcarm/hpc_machdep.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.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/hpcarm/hpcarm/hpc_machdep.c
diff -u src/sys/arch/hpcarm/hpcarm/hpc_machdep.c:1.103 src/sys/arch/hpcarm/hpcarm/hpc_machdep.c:1.104
--- src/sys/arch/hpcarm/hpcarm/hpc_machdep.c:1.103	Sun Mar  2 13:27:38 2014
+++ src/sys/arch/hpcarm/hpcarm/hpc_machdep.c	Sat Sep 13 18:09:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpc_machdep.c,v 1.103 2014/03/02 13:27:38 joerg Exp $	*/
+/*	$NetBSD: hpc_machdep.c,v 1.104 2014/09/13 18:09:50 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hpc_machdep.c,v 1.103 2014/03/02 13:27:38 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpc_machdep.c,v 1.104 2014/09/13 18:09:50 matt Exp $");
 
 #include "opt_cputypes.h"
 #include "opt_kloader.h"
@@ -92,7 +92,7 @@ int max_processes = 64;			/* Default num
 char *boot_args = NULL;
 char boot_file[16];
 
-vaddr_t msgbufphys;
+paddr_t msgbufphys;
 
 /* Prototypes */
 void dumpsys(void);

Index: src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c
diff -u src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c:1.21 src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c:1.22
--- src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c:1.21	Tue Mar 11 04:17:36 2014
+++ src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c	Sat Sep 13 18:09:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_hpc_machdep.c,v 1.21 2014/03/11 04:17:36 ozaki-r Exp $	*/
+/*	$NetBSD: pxa2x0_hpc_machdep.c,v 1.22 2014/09/13 18:09:50 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_hpc_machdep.c,v 1.21 2014/03/11 04:17:36 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_hpc_machdep.c,v 1.22 2014/09/13 18:09:50 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_dram_pages.h"
@@ -113,7 +113,7 @@ extern paddr_t physical_freestart;
 extern paddr_t physical_freeend;
 extern paddr_t physical_end;
 
-extern vaddr_t msgbufphys;
+extern paddr_t msgbufphys;
 
 extern int end;
 

Index: src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c
diff -u src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c:1.9 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c:1.10
--- src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c:1.9	Mon Mar 10 14:51:15 2014
+++ src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c	Sat Sep 13 18:09:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sa11x0_hpc_machdep.c,v 1.9 2014/03/10 14:51:15 skrll Exp $	*/
+/*	$NetBSD: sa11x0_hpc_machdep.c,v 1.10 2014/09/13 18:09:50 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sa11x0_hpc_machdep.c,v 1.9 2014/03/10 14:51:15 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sa11x0_hpc_machdep.c,v 1.10 2014/09/13 18:09:50 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_dram_pages.h"
@@ -105,7 +105,7 @@ extern paddr_t physical_freestart;
 extern paddr_t physical_freeend;
 extern paddr_t physical_end;
 
-extern vaddr_t msgbufphys;
+extern paddr_t msgbufphys;
 
 extern int end;
 



CVS commit: src/sys/arch

2014-09-13 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Sep 13 18:08:40 UTC 2014

Modified Files:
src/sys/arch/acorn26/acorn26: db_interface.c
src/sys/arch/acorn26/include: vmparam.h
src/sys/arch/acorn32/podulebus: esc.c podulebus.c ptsc.c sfas.c
src/sys/arch/arm/at91: at91bus.c
src/sys/arch/arm/footbridge/isa: isa_io.c
src/sys/arch/arm/include: db_machdep.h
src/sys/arch/arm/iomd: vidcaudio.c
src/sys/arch/epoc32/epoc32: machdep.c
src/sys/arch/evbarm/adi_brh: brh_machdep.c
src/sys/arch/evbarm/armadillo: armadillo9_machdep.c
src/sys/arch/evbarm/g42xxeb: g42xxeb_machdep.c
src/sys/arch/evbarm/hdl_g: hdlg_machdep.c
src/sys/arch/evbarm/imx31: imx31lk_machdep.c
src/sys/arch/evbarm/iq80310: iq80310_machdep.c
src/sys/arch/evbarm/iq80321: iq80321_machdep.c
src/sys/arch/evbarm/ixdp425: ixdp425_machdep.c
src/sys/arch/evbarm/ixm1200: ixm1200_machdep.c
src/sys/arch/evbarm/lubbock: lubbock_machdep.c
src/sys/arch/evbarm/mini2440: mini2440_machdep.c
src/sys/arch/evbarm/npwr_fc: npwr_fc_machdep.c
src/sys/arch/evbarm/nslu2: nslu2_machdep.c
src/sys/arch/evbarm/smdk2xx0: smdk2410_machdep.c smdk2800_machdep.c
src/sys/arch/evbarm/tsarm: tsarm_machdep.c
src/sys/arch/evbarm/tsarm/isa: isa_io.c
src/sys/arch/evbarm/viper: viper_machdep.c
src/sys/arch/iyonix/iyonix: iyonix_machdep.c
src/sys/arch/netwinder/netwinder: netwinder_machdep.c

Log Message:
Replace more vm_offset_t, vm_size_t with vaddr_t, vsize_t
Use paddr_t for msgbufphys


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/acorn26/acorn26/db_interface.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/acorn26/include/vmparam.h
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/acorn32/podulebus/esc.c \
src/sys/arch/acorn32/podulebus/podulebus.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/acorn32/podulebus/ptsc.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/acorn32/podulebus/sfas.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/at91/at91bus.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/footbridge/isa/isa_io.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/include/db_machdep.h
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/arm/iomd/vidcaudio.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/epoc32/epoc32/machdep.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/evbarm/adi_brh/brh_machdep.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/evbarm/armadillo/armadillo9_machdep.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbarm/hdl_g/hdlg_machdep.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/evbarm/imx31/imx31lk_machdep.c
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/evbarm/iq80310/iq80310_machdep.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/evbarm/iq80321/iq80321_machdep.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/ixdp425/ixdp425_machdep.c
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/evbarm/ixm1200/ixm1200_machdep.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbarm/lubbock/lubbock_machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/mini2440/mini2440_machdep.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/evbarm/nslu2/nslu2_machdep.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/tsarm/tsarm_machdep.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/tsarm/isa/isa_io.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/evbarm/viper/viper_machdep.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/iyonix/iyonix/iyonix_machdep.c
cvs rdiff -u -r1.82 -r1.83 \
src/sys/arch/netwinder/netwinder/netwinder_machdep.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/acorn26/acorn26/db_interface.c
diff -u src/sys/arch/acorn26/acorn26/db_interface.c:1.20 src/sys/arch/acorn26/acorn26/db_interface.c:1.21
--- src/sys/arch/acorn26/acorn26/db_interface.c:1.20	Sat Mar  8 16:55:38 2014
+++ src/sys/arch/acorn26/acorn26/db_interface.c	Sat Sep 13 18:08:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.20 2014/03/08 16:55:38 skrll Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.21 2014/09/13 18:08:38 matt Exp $	*/
 
 /* 
  * Copyright (c) 1996 Scott K. Stevens
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.20 2014/03/08 16:55:38 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.21 2014/09/13 18:08:38 matt Exp $");
 
 #include "opt_ddb.h"
 
@@ -167,7 +167,7 @@ kdb_trap(int type, db_regs_t *regs)
 volatile bool db_validating, db_faulted;
 
 int
-db_validate_address(vm_offset_t addr)
+db_validate_address(vaddr_t addr)
 {
 
 	db_faulted = false;
@@ -181,7 +181,7 @@ db_validate_address(vm_offset_t addr)
  * Read bytes from kernel addre

CVS commit: [netbsd-6-1] src/doc

2014-09-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Sep 13 17:56:51 UTC 2014

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.5

Log Message:
ticket 1124


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/doc/CHANGES-6.1.5

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

Modified files:

Index: src/doc/CHANGES-6.1.5
diff -u src/doc/CHANGES-6.1.5:1.1.2.24 src/doc/CHANGES-6.1.5:1.1.2.25
--- src/doc/CHANGES-6.1.5:1.1.2.24	Tue Sep  9 08:49:43 2014
+++ src/doc/CHANGES-6.1.5	Sat Sep 13 17:56:51 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.5,v 1.1.2.24 2014/09/09 08:49:43 msaitoh Exp $
+# $NetBSD: CHANGES-6.1.5,v 1.1.2.25 2014/09/13 17:56:51 snj Exp $
 
 A complete list of changes from the NetBSD 6.1.4 release to the NetBSD 6.1.5
 release:
@@ -1304,3 +1304,10 @@ sys/arch/next68k/next68k/pmap_bootstrap.
 	(panic: pmap_enter_ptpage: can't get KPT page), and
 	this is the last possible m68k MD part of this PR.
 	[tsutsui, ticket #1008]
+
+sys/dev/pci/pci_usrreq.c			1.26
+
+	Reject unaligned PCI config register ioctl requests before we
+	kassert.
+	[riastradh, ticket #1124]
+



CVS commit: [netbsd-6-1] src/sys/dev/pci

2014-09-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Sep 13 17:56:25 UTC 2014

Modified Files:
src/sys/dev/pci [netbsd-6-1]: pci_usrreq.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1124):
sys/dev/pci/pci_usrreq.c: revision 1.26
Reject unaligned PCI config register ioctl requests before we kassert.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.16.1 src/sys/dev/pci/pci_usrreq.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/pci/pci_usrreq.c
diff -u src/sys/dev/pci/pci_usrreq.c:1.23 src/sys/dev/pci/pci_usrreq.c:1.23.16.1
--- src/sys/dev/pci/pci_usrreq.c:1.23	Thu Feb 10 12:37:58 2011
+++ src/sys/dev/pci/pci_usrreq.c	Sat Sep 13 17:56:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_usrreq.c,v 1.23 2011/02/10 12:37:58 jmcneill Exp $	*/
+/*	$NetBSD: pci_usrreq.c,v 1.23.16.1 2014/09/13 17:56:25 snj Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_usrreq.c,v 1.23 2011/02/10 12:37:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_usrreq.c,v 1.23.16.1 2014/09/13 17:56:25 snj Exp $");
 
 #include 
 #include 
@@ -83,7 +83,7 @@ pciioctl(dev_t dev, u_long cmd, void *da
 	case PCI_IOC_BDF_CFGWRITE:
 		bdfr = data;
 		if (bdfr->bus > 255 || bdfr->device >= sc->sc_maxndevs ||
-		bdfr->function > 7)
+		bdfr->function > 7 || ISSET(bdfr->cfgreg.reg, 3))
 			return EINVAL;
 		tag = pci_make_tag(sc->sc_pc, bdfr->bus, bdfr->device,
 		bdfr->function);



CVS commit: [netbsd-6-0] src/doc

2014-09-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Sep 13 17:55:10 UTC 2014

Modified Files:
src/doc [netbsd-6-0]: CHANGES-6.0.6

Log Message:
ticket 1124


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/doc/CHANGES-6.0.6

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

Modified files:

Index: src/doc/CHANGES-6.0.6
diff -u src/doc/CHANGES-6.0.6:1.1.2.24 src/doc/CHANGES-6.0.6:1.1.2.25
--- src/doc/CHANGES-6.0.6:1.1.2.24	Tue Sep  9 08:50:06 2014
+++ src/doc/CHANGES-6.0.6	Sat Sep 13 17:55:10 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.6,v 1.1.2.24 2014/09/09 08:50:06 msaitoh Exp $
+# $NetBSD: CHANGES-6.0.6,v 1.1.2.25 2014/09/13 17:55:10 snj Exp $
 
 A complete list of changes from the NetBSD 6.0.5 release to the NetBSD 6.0.6
 release:
@@ -1304,3 +1304,10 @@ sys/arch/next68k/next68k/pmap_bootstrap.
 	(panic: pmap_enter_ptpage: can't get KPT page), and
 	this is the last possible m68k MD part of this PR.
 	[tsutsui, ticket #1008]
+
+sys/dev/pci/pci_usrreq.c			1.26
+
+	Reject unaligned PCI config register ioctl requests before we
+	kassert.
+	[riastradh, ticket #1124]
+



CVS commit: [netbsd-6] src/doc

2014-09-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Sep 13 17:55:23 UTC 2014

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
ticket 1124


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.132 -r1.1.2.133 src/doc/CHANGES-6.2

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

Modified files:

Index: src/doc/CHANGES-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.132 src/doc/CHANGES-6.2:1.1.2.133
--- src/doc/CHANGES-6.2:1.1.2.132	Tue Sep  9 08:49:13 2014
+++ src/doc/CHANGES-6.2	Sat Sep 13 17:55:23 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.132 2014/09/09 08:49:13 msaitoh Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.133 2014/09/13 17:55:23 snj Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -3738,3 +3738,9 @@ sys/arch/sparc/sparc/autoconf.c			1.258
 	Add device name mapping for "qfe" (quad hme) cards.
 	Fix PR port-sparc/49103 from MOCHIDA Shuji.
 	[martin, ticket #1110]
+
+sys/dev/pci/pci_usrreq.c			1.26
+
+	Reject unaligned PCI config register ioctl requests before we kassert.
+	[riastradh, ticket #1124]
+



CVS commit: [netbsd-6-0] src/sys/dev/pci

2014-09-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Sep 13 17:54:26 UTC 2014

Modified Files:
src/sys/dev/pci [netbsd-6-0]: pci_usrreq.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1124):
sys/dev/pci/pci_usrreq.c: revision 1.26
Reject unaligned PCI config register ioctl requests before we kassert.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.14.1 src/sys/dev/pci/pci_usrreq.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/pci/pci_usrreq.c
diff -u src/sys/dev/pci/pci_usrreq.c:1.23 src/sys/dev/pci/pci_usrreq.c:1.23.14.1
--- src/sys/dev/pci/pci_usrreq.c:1.23	Thu Feb 10 12:37:58 2011
+++ src/sys/dev/pci/pci_usrreq.c	Sat Sep 13 17:54:26 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_usrreq.c,v 1.23 2011/02/10 12:37:58 jmcneill Exp $	*/
+/*	$NetBSD: pci_usrreq.c,v 1.23.14.1 2014/09/13 17:54:26 snj Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_usrreq.c,v 1.23 2011/02/10 12:37:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_usrreq.c,v 1.23.14.1 2014/09/13 17:54:26 snj Exp $");
 
 #include 
 #include 
@@ -83,7 +83,7 @@ pciioctl(dev_t dev, u_long cmd, void *da
 	case PCI_IOC_BDF_CFGWRITE:
 		bdfr = data;
 		if (bdfr->bus > 255 || bdfr->device >= sc->sc_maxndevs ||
-		bdfr->function > 7)
+		bdfr->function > 7 || ISSET(bdfr->cfgreg.reg, 3))
 			return EINVAL;
 		tag = pci_make_tag(sc->sc_pc, bdfr->bus, bdfr->device,
 		bdfr->function);



CVS commit: [netbsd-6] src/sys/dev/pci

2014-09-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Sep 13 17:53:15 UTC 2014

Modified Files:
src/sys/dev/pci [netbsd-6]: pci_usrreq.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1124):
sys/dev/pci/pci_usrreq.c: revision 1.26
Reject unaligned PCI config register ioctl requests before we kassert.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.10.1 src/sys/dev/pci/pci_usrreq.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/pci/pci_usrreq.c
diff -u src/sys/dev/pci/pci_usrreq.c:1.23 src/sys/dev/pci/pci_usrreq.c:1.23.10.1
--- src/sys/dev/pci/pci_usrreq.c:1.23	Thu Feb 10 12:37:58 2011
+++ src/sys/dev/pci/pci_usrreq.c	Sat Sep 13 17:53:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_usrreq.c,v 1.23 2011/02/10 12:37:58 jmcneill Exp $	*/
+/*	$NetBSD: pci_usrreq.c,v 1.23.10.1 2014/09/13 17:53:15 snj Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_usrreq.c,v 1.23 2011/02/10 12:37:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_usrreq.c,v 1.23.10.1 2014/09/13 17:53:15 snj Exp $");
 
 #include 
 #include 
@@ -83,7 +83,7 @@ pciioctl(dev_t dev, u_long cmd, void *da
 	case PCI_IOC_BDF_CFGWRITE:
 		bdfr = data;
 		if (bdfr->bus > 255 || bdfr->device >= sc->sc_maxndevs ||
-		bdfr->function > 7)
+		bdfr->function > 7 || ISSET(bdfr->cfgreg.reg, 3))
 			return EINVAL;
 		tag = pci_make_tag(sc->sc_pc, bdfr->bus, bdfr->device,
 		bdfr->function);



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

2014-09-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 13 17:50:27 UTC 2014

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

Log Message:
add motg (commented out)


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbarm/conf/CUBIEBOARD

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/CUBIEBOARD
diff -u src/sys/arch/evbarm/conf/CUBIEBOARD:1.25 src/sys/arch/evbarm/conf/CUBIEBOARD:1.26
--- src/sys/arch/evbarm/conf/CUBIEBOARD:1.25	Tue Sep  9 22:49:20 2014
+++ src/sys/arch/evbarm/conf/CUBIEBOARD	Sat Sep 13 17:50:27 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: CUBIEBOARD,v 1.25 2014/09/09 22:49:20 jmcneill Exp $
+#	$NetBSD: CUBIEBOARD,v 1.26 2014/09/13 17:50:27 jmcneill Exp $
 #
 #	CUBIEBOARD -- Allwinner A10/A20 Eval Board Kernel
 #
@@ -278,6 +278,10 @@ ehci*		at awinusb?
 usb*		at ohci?
 usb*		at ehci?
 
+# USB OTG
+#motg0		at awinio0
+#usb*		at motg?
+
 # SATA
 ahcisata*	at awinio0
 atabus*		at ata?



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

2014-09-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 13 17:48:52 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_otgreg.h files.awin
Added Files:
src/sys/arch/arm/allwinner: awin_otg.c

Log Message:
motg glue (host mode) for allwinner, not quite working yet


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/allwinner/awin_otg.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/allwinner/awin_otgreg.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/allwinner/files.awin

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/allwinner/awin_otgreg.h
diff -u src/sys/arch/arm/allwinner/awin_otgreg.h:1.1 src/sys/arch/arm/allwinner/awin_otgreg.h:1.2
--- src/sys/arch/arm/allwinner/awin_otgreg.h:1.1	Sat Sep 13 17:42:48 2014
+++ src/sys/arch/arm/allwinner/awin_otgreg.h	Sat Sep 13 17:48:52 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_otgreg.h,v 1.1 2014/09/13 17:42:48 jmcneill Exp $ */
+/* $NetBSD: awin_otgreg.h,v 1.2 2014/09/13 17:48:52 jmcneill Exp $ */
 /* FreeBSD: head/sys/dev/usb/controller/musb_otg.h 267122 2014-06-05 18:23:51Z hselasky */
 /*-
  * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
@@ -287,4 +287,8 @@
 
 #define	MUSB2_EP_MAX 16			/* maximum number of endpoints */
 
+#define MUSB2_REG_AWIN_VEND0 0x0043
+#define MUSB2_REG_AWIN_VEND1 0x007d
+#define MUSB2_REG_AWIN_VEND3 0x007e
+
 #endif	/* _MUSB2_OTG_H_ */

Index: src/sys/arch/arm/allwinner/files.awin
diff -u src/sys/arch/arm/allwinner/files.awin:1.13 src/sys/arch/arm/allwinner/files.awin:1.14
--- src/sys/arch/arm/allwinner/files.awin:1.13	Thu Sep 11 02:21:19 2014
+++ src/sys/arch/arm/allwinner/files.awin	Sat Sep 13 17:48:52 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.awin,v 1.13 2014/09/11 02:21:19 jmcneill Exp $
+#	$NetBSD: files.awin,v 1.14 2014/09/13 17:48:52 jmcneill Exp $
 #
 # Configuration info for Allwinner ARM Peripherals
 #
@@ -91,6 +91,10 @@ file	arch/arm/allwinner/awin_eth.c		awin
 attach	awge at awinio with awin_gige
 file	arch/arm/allwinner/awin_gige.c		awin_gige
 
+# USB2 OTG Controller
+attach	motg at awinio with awin_otg
+file	arch/arm/allwinner/awin_otg.c		awin_otg
+
 # USB2 Host Controller (EHCI/OHCI)
 device	awinusb { }
 attach	awinusb at awinio with awin_usb

Added files:

Index: src/sys/arch/arm/allwinner/awin_otg.c
diff -u /dev/null src/sys/arch/arm/allwinner/awin_otg.c:1.1
--- /dev/null	Sat Sep 13 17:48:52 2014
+++ src/sys/arch/arm/allwinner/awin_otg.c	Sat Sep 13 17:48:52 2014
@@ -0,0 +1,252 @@
+/* $NetBSD: awin_otg.c,v 1.1 2014/09/13 17:48:52 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2014 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: awin_otg.c,v 1.1 2014/09/13 17:48:52 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct awin_otg_softc {
+	struct motg_softc sc_motg;
+	void *sc_ih;
+	struct awin_gpio_pindata sc_drv_pin;
+};
+
+#define OTG_READ1(sc, reg) \
+bus_space_read_1((sc)->sc_motg.sc_iot, (sc)->sc_motg.sc_ioh, (reg))
+#define OTG_WRITE1(sc, reg, val) \
+bus_space_write_1((sc)->sc_motg.sc_iot, (sc)->sc_motg.sc_ioh, (reg), (val))
+#define OTG_READ2(sc, reg) \
+bus_space_read_2((sc)->sc_motg.sc_iot, (sc)->sc_motg.sc_ioh, (reg))
+#define OTG_WRITE2(sc, reg, val) \
+bus_space_write_2((sc)->sc_motg.sc_iot, (sc)->sc_motg.sc_ioh, (reg), (val))
+#define OTG_READ4(sc, reg) \
+bus_space_read_4((sc)->sc_motg.sc_iot, (sc)->sc_motg.sc_ioh, (reg))
+#define OTG_WRITE4(sc, reg, val) \
+bus_space_write_4((sc

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

2014-09-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 13 17:48:00 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_reg.h awin_usb.c

Log Message:
add some more usb regs


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/allwinner/awin_reg.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/allwinner/awin_usb.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/allwinner/awin_reg.h
diff -u src/sys/arch/arm/allwinner/awin_reg.h:1.24 src/sys/arch/arm/allwinner/awin_reg.h:1.25
--- src/sys/arch/arm/allwinner/awin_reg.h:1.24	Thu Sep 11 00:50:39 2014
+++ src/sys/arch/arm/allwinner/awin_reg.h	Sat Sep 13 17:48:00 2014
@@ -160,6 +160,9 @@
 
 #define AWIN_SRAM_CTL1_A3_A4		__BITS(5,4)
 #define AWIN_SRAM_CTL1_A3_A4_EMAC	1
+#define AWIN_SRAM_CTL1_SRAMD_MAP	__BIT(0)
+#define AWIN_SRAM_CTL1_SRAMD_MAP_CPUDMA	0
+#define AWIN_SRAM_CTL1_SRAMD_MAP_USB0	1
 
 #define AWIN_SRAM_VER_KEY_FIELD		__BITS(31,16)
 #define AWIN_SRAM_VER_R_EN		__BIT(15)
@@ -1025,18 +1028,44 @@ struct awin_mmc_idma_descriptor {
 #define AWIN_CLK_OUT_SRC_FACTOR_M	__BITS(12,8)
 
 /* USB device offsets */
-#define AWIN_USB0_PHY_CSR_REG		0x0404
+#define AWIN_USB0_PHY_CSR_REG		0x0400
+#define AWIN_USB0_PHY_CTL_REG		0x0404
 #define AWIN_EHCI_OFFSET		0x
 #define AWIN_EHCI_SIZE			0x0400
 #define AWIN_OHCI_OFFSET		0x0400
 #define AWIN_OHCI_SIZE			0x0400
 #define AWIN_USB_PMU_IRQ_REG		0x0800
 
-#define AWIN_USB0_PHY_CSR_ADDR		__BITS(15,8)
-#define AWIN_USB0_PHY_CSR_DAT		__BIT(7)
-#define AWIN_USB0_PHY_CSR_CLK2		__BIT(2)
-#define AWIN_USB0_PHY_CSR_CLK1		__BIT(1)
-#define AWIN_USB0_PHY_CSR_CLK0		__BIT(0)
+#define AWIN_USB0_PHY_CSR_VBUS_VALID_DATA	__BIT(30)
+#define AWIN_USB0_PHY_CSR_VBUS_VALID_VBUS	__BIT(29)
+#define AWIN_USB0_PHY_CSR_EXT_ID_STATUS		__BIT(28)
+#define AWIN_USB0_PHY_CSR_EXT_DM_STATUS		__BIT(27)
+#define AWIN_USB0_PHY_CSR_EXT_DP_STATUS		__BIT(26)
+#define AWIN_USB0_PHY_CSR_MERGED_VBUS_STATUS	__BIT(25)
+#define AWIN_USB0_PHY_CSR_MERGED_ID_STATUS	__BIT(24)
+#define AWIN_USB0_PHY_CSR_ID_PULLUP_EN		__BIT(17)
+#define AWIN_USB0_PHY_CSR_DPDM_PULLUP_EN	__BIT(16)
+#define AWIN_USB0_PHY_CSR_FORCE_ID		__BITS(15,14)
+#define AWIN_USB0_PHY_CSR_FORCE_ID_LOW		2
+#define AWIN_USB0_PHY_CSR_FORCE_ID_HIGH		3
+#define AWIN_USB0_PHY_CSR_FORCE_VBUS_VALID	__BITS(13,12)
+#define AWIN_USB0_PHY_CSR_FORCE_VBUS_VALID_LOW	2
+#define AWIN_USB0_PHY_CSR_FORCE_VBUS_VALID_HIGH	3
+#define AWIN_USB0_PHY_CSR_VBUS_VALID_SRC	__BITS(11,10)
+#define AWIN_USB0_PHY_CSR_HOSC_EN		__BIT(7)
+#define AWIN_USB0_PHY_CSR_VBUS_CHANGE_DET	__BIT(6)
+#define AWIN_USB0_PHY_CSR_ID_CHANGE_DET		__BIT(5)
+#define AWIN_USB0_PHY_CSR_DPDM_CHANGE_DET	__BIT(4)
+#define AWIN_USB0_PHY_CSR_IRQ_EN		__BIT(3)
+#define AWIN_USB0_PHY_CSR_VBUS_CHANGE_DET_EN	__BIT(2)
+#define AWIN_USB0_PHY_CSR_ID_CHANGE_DET_EN	__BIT(1)
+#define AWIN_USB0_PHY_CSR_DPDM_CHANGE_DET_EN	__BIT(0)
+
+#define AWIN_USB0_PHY_CTL_ADDR		__BITS(15,8)
+#define AWIN_USB0_PHY_CTL_DAT		__BIT(7)
+#define AWIN_USB0_PHY_CTL_CLK2		__BIT(2)
+#define AWIN_USB0_PHY_CTL_CLK1		__BIT(1)
+#define AWIN_USB0_PHY_CTL_CLK0		__BIT(0)
 
 #define AWIN_USB_PMU_IRQ_AHB_INCR8	__BIT(10)
 #define AWIN_USB_PMU_IRQ_AHB_INCR4	__BIT(9)

Index: src/sys/arch/arm/allwinner/awin_usb.c
diff -u src/sys/arch/arm/allwinner/awin_usb.c:1.12 src/sys/arch/arm/allwinner/awin_usb.c:1.13
--- src/sys/arch/arm/allwinner/awin_usb.c:1.12	Tue Jun 24 05:07:31 2014
+++ src/sys/arch/arm/allwinner/awin_usb.c	Sat Sep 13 17:48:00 2014
@@ -34,7 +34,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: awin_usb.c,v 1.12 2014/06/24 05:07:31 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_usb.c,v 1.13 2014/09/13 17:48:00 jmcneill Exp $");
 
 #include 
 #include 
@@ -236,33 +236,33 @@ awin_usb_phy_write(struct awinusb_softc 
 {
 	bus_space_tag_t bst = usbsc->usbsc_bst;
 	bus_space_handle_t bsh = usbsc->usbsc_usb0_phy_csr_bsh;
-	uint32_t clk = AWIN_USB0_PHY_CSR_CLK0 << usbsc->usbsc_number;
+	uint32_t clk = AWIN_USB0_PHY_CTL_CLK0 << usbsc->usbsc_number;
 
 	uint32_t v = bus_space_read_4(bst, bsh, 0);
 
-	KASSERT((v & AWIN_USB0_PHY_CSR_CLK0) == 0);
-	KASSERT((v & AWIN_USB0_PHY_CSR_CLK1) == 0);
-	KASSERT((v & AWIN_USB0_PHY_CSR_CLK2) == 0);
+	KASSERT((v & AWIN_USB0_PHY_CTL_CLK0) == 0);
+	KASSERT((v & AWIN_USB0_PHY_CTL_CLK1) == 0);
+	KASSERT((v & AWIN_USB0_PHY_CTL_CLK2) == 0);
 
-	v &= ~AWIN_USB0_PHY_CSR_ADDR;
-	v &= ~AWIN_USB0_PHY_CSR_DAT;
+	v &= ~AWIN_USB0_PHY_CTL_ADDR;
+	v &= ~AWIN_USB0_PHY_CTL_DAT;
 
-	v |= __SHIFTIN(bit_addr, AWIN_USB0_PHY_CSR_ADDR);
+	v |= __SHIFTIN(bit_addr, AWIN_USB0_PHY_CTL_ADDR);
 
 	/*
 	 * Bitbang the data to the phy, bit by bit, incrementing bit address
 	 * as we go.
 	 */
 	for (; len > 0; bit_addr++, bits >>= 1, len--) {
-		v |= __SHIFTIN(bits & 1, AWIN_USB0_PHY_CSR_DAT);
+		v |= __SHIFTIN(bits & 1, AWIN_USB0_PHY_CTL_DAT);
 		bus_space_write_4(bst, bsh, 0, v);
 		delay(1);
 		bus_space_write_4(bst, bsh, 0, v | clk);
 		delay(1);
 		b

CVS commit: src/sys

2014-09-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 13 17:42:49 UTC 2014

Modified Files:
src/sys/dev/usb: motg.c motgreg.h
Added Files:
src/sys/arch/arm/allwinner: awin_otgreg.h

Log Message:
Instead of polluting motgreg.h with AllWinner specific registers (things
were getting out of hand), move the AllWinner reg definitions to
arch/arm/allwinner/awin_otgreg.h and include that instead of
dev/usb/motgreg.h when MOTG_ALLWINNER is defined.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/allwinner/awin_otgreg.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/motg.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/usb/motgreg.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/usb/motg.c
diff -u src/sys/dev/usb/motg.c:1.9 src/sys/dev/usb/motg.c:1.10
--- src/sys/dev/usb/motg.c:1.9	Sat Sep 13 14:46:50 2014
+++ src/sys/dev/usb/motg.c	Sat Sep 13 17:42:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: motg.c,v 1.9 2014/09/13 14:46:50 jmcneill Exp $	*/
+/*	$NetBSD: motg.c,v 1.10 2014/09/13 17:42:48 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012, 2014 The NetBSD Foundation, Inc.
@@ -39,8 +39,10 @@
  * NOTE: The current implementation only supports Device Side Mode!
  */
 
+#include "opt_motg.h"
+
 #include 
-__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.9 2014/09/13 14:46:50 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.10 2014/09/13 17:42:48 jmcneill Exp $");
 
 #include 
 #include 
@@ -62,7 +64,12 @@ __KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.9
 #include 
 #include 
 
+#ifdef MOTG_ALLWINNER
+#include 
+#else
 #include 
+#endif
+
 #include 
 #include 
 
@@ -261,9 +268,11 @@ motg_init(struct motg_softc *sc)
 
 	musbotg_pull_common(sc, 0);
 
+#ifdef MUSB2_REG_RXDBDIS
 	/* disable double packet buffering XXX what's this ? */
 	UWRITE2(sc, MUSB2_REG_RXDBDIS, 0x);
 	UWRITE2(sc, MUSB2_REG_TXDBDIS, 0x);
+#endif
 
 	/* enable HighSpeed and ISO Update flags */
 
@@ -288,9 +297,11 @@ motg_init(struct motg_softc *sc)
 
 	UWRITE1(sc, MUSB2_REG_TESTMODE, 0);
 
+#ifdef MUSB2_REG_MISC
 	/* set default value */
 
 	UWRITE1(sc, MUSB2_REG_MISC, 0);
+#endif
 
 	/* select endpoint index 0 */
 
@@ -647,7 +658,7 @@ motg_softintr(void *v)
 	tx_status |= UREAD2(sc, MUSB2_REG_INTTX);
 
 	if (rx_status & 0x01)
-		panic("ctrl_rx");
+		panic("ctrl_rx %08x", rx_status);
 	if (tx_status & 0x01)
 		motg_device_ctrl_intr_tx(sc);
 	for (i = 1; i <= sc->sc_ep_max; i++) {

Index: src/sys/dev/usb/motgreg.h
diff -u src/sys/dev/usb/motgreg.h:1.2 src/sys/dev/usb/motgreg.h:1.3
--- src/sys/dev/usb/motgreg.h:1.2	Sat Sep 13 14:47:35 2014
+++ src/sys/dev/usb/motgreg.h	Sat Sep 13 17:42:48 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: motgreg.h,v 1.2 2014/09/13 14:47:35 jmcneill Exp $ */
+/* $NetBSD: motgreg.h,v 1.3 2014/09/13 17:42:48 jmcneill Exp $ */
 /* FreeBSD: head/sys/dev/usb/controller/musb_otg.h 267122 2014-06-05 18:23:51Z hselasky */
 /*-
  * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
@@ -33,8 +33,6 @@
 #ifndef _MUSB2_OTG_H_
 #define	_MUSB2_OTG_H_
 
-#include "opt_motg.h"
-
 #define	MUSB2_MAX_DEVICES USB_MAX_DEVICES
 
 /* Common registers */
@@ -285,55 +283,4 @@
 
 #define	MUSB2_EP_MAX 16			/* maximum number of endpoints */
 
-#ifdef MOTG_ALLWINNER
-/*
- * AllWinner SoCs have an MOTG with shuffled registers
- */ 
-#undef MUSB2_REG_FADDR
-#define MUSB2_REG_FADDR 0x0098
-
-#undef MUSB2_REG_POWER
-#define MUSB2_REG_POWER 0x0040
-
-#undef MUSB2_REG_DEVCTL
-#define MUSB2_REG_DEVCTL 0x0041
-
-#undef MUSB2_REG_EPINDEX
-#define MUSB2_REG_EPINDEX 0x0042
-
-#undef MUSB2_REG_INTTX
-#define MUSB2_REG_INTTX 0x0044
-
-#undef MUSB2_REG_INTRX
-#define MUSB2_REG_INTRX 0x0046
-
-#undef MUSB2_REG_INTTXE
-#define MUSB2_REG_INTTXE 0x0048
-
-#undef MUSB2_REG_INTRXE
-#define MUSB2_REG_INTRXE 0x004a
-
-#undef MUSB2_REG_INTUSB
-#define MUSB2_REG_INTUSB 0x004c
-
-#undef MUSB2_REG_INTUSBE
-#define MUSB2_REG_INTUSBE 0x0050
-
-#undef MUSB2_REG_FRAME
-#define MUSB2_REG_FRAME 0x0054
-
-#undef MUSB2_REG_TXFIFOSZ
-#define MUSB2_REG_TXFIFOSZ 0x0090
-
-#undef MUSB2_REG_RXFIFOSZ
-#define MUSB2_REG_RXFIFOSZ 0x0094
-
-#undef MUSB2_REG_TXFIFOADD
-#define MUSB2_REG_TXFIFOADD 0x0064
-
-#undef MUSB2_REG_RXFIFOADD
-#define MUSB2_REG_RXFIFOADD 0x0066
-
-#endif /* !MOTG_ALLWINNER */
-
 #endif	/* _MUSB2_OTG_H_ */

Added files:

Index: src/sys/arch/arm/allwinner/awin_otgreg.h
diff -u /dev/null src/sys/arch/arm/allwinner/awin_otgreg.h:1.1
--- /dev/null	Sat Sep 13 17:42:49 2014
+++ src/sys/arch/arm/allwinner/awin_otgreg.h	Sat Sep 13 17:42:48 2014
@@ -0,0 +1,290 @@
+/* $NetBSD: awin_otgreg.h,v 1.1 2014/09/13 17:42:48 jmcneill Exp $ */
+/* FreeBSD: head/sys/dev/usb/controller/musb_otg.h 267122 2014-06-05 18:23:51Z hselasky */
+/*-
+ * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions

CVS commit: src/sys/arch/netwinder/netwinder

2014-09-13 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Sep 13 17:42:07 UTC 2014

Modified Files:
src/sys/arch/netwinder/netwinder: netwinder_machdep.c

Log Message:
vm_offset_t -> vaddr_t, vm_size_t -> vsize_t


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 \
src/sys/arch/netwinder/netwinder/netwinder_machdep.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/netwinder/netwinder/netwinder_machdep.c
diff -u src/sys/arch/netwinder/netwinder/netwinder_machdep.c:1.81 src/sys/arch/netwinder/netwinder/netwinder_machdep.c:1.82
--- src/sys/arch/netwinder/netwinder/netwinder_machdep.c:1.81	Sun Aug 18 21:42:16 2013
+++ src/sys/arch/netwinder/netwinder/netwinder_machdep.c	Sat Sep 13 17:42:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: netwinder_machdep.c,v 1.81 2013/08/18 21:42:16 matt Exp $	*/
+/*	$NetBSD: netwinder_machdep.c,v 1.82 2014/09/13 17:42:07 matt Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netwinder_machdep.c,v 1.81 2013/08/18 21:42:16 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netwinder_machdep.c,v 1.82 2014/09/13 17:42:07 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pmap_debug.h"
@@ -316,9 +316,9 @@ netwinder_reset(void)
  * time with section mappings.
  */
 struct l1_sec_map {
-	vm_offset_t	va;
-	vm_offset_t	pa;
-	vm_size_t	size;
+	vaddr_t		va;
+	vaddr_t		pa;
+	vsize_t		size;
 	vm_prot_t	prot;
 	int		cache;
 } l1_sec_table[] = {
@@ -646,7 +646,7 @@ initarm(void *arg)
 	 */
 	loop = 0;
 	while (l1_sec_table[loop].size) {
-		vm_size_t sz;
+		vsize_t sz;
 
 #ifdef VERBOSE_INIT_ARM
 		printf("%08lx -> %08lx @ %08lx\n", l1_sec_table[loop].pa,



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

2014-09-13 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Sep 13 17:41:03 UTC 2014

Modified Files:
src/sys/arch/arm/include: cpufunc_proto.h ofw.h types.h

Log Message:
vm_offset_t -> vaddr_t, vm_size_t -> vsize_t
nuke vm_offset_t and vm_size_t


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/include/cpufunc_proto.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/include/ofw.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/include/types.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/arch/arm/include/cpufunc_proto.h
diff -u src/sys/arch/arm/include/cpufunc_proto.h:1.2 src/sys/arch/arm/include/cpufunc_proto.h:1.3
--- src/sys/arch/arm/include/cpufunc_proto.h:1.2	Sat Apr 19 00:33:24 2014
+++ src/sys/arch/arm/include/cpufunc_proto.h	Sat Sep 13 17:41:03 2014
@@ -333,11 +333,11 @@ void	pj4b_context_switch(u_int);
 void	pj4b_tlb_flushID(void);
 void	pj4b_tlb_flushID_SE(vaddr_t);
 
-void	pj4b_icache_sync_range(vm_offset_t, vm_size_t);
-void	pj4b_idcache_wbinv_range(vm_offset_t, vm_size_t);
-void	pj4b_dcache_wbinv_range(vm_offset_t, vm_size_t);
-void	pj4b_dcache_inv_range(vm_offset_t, vm_size_t);
-void	pj4b_dcache_wb_range(vm_offset_t, vm_size_t);
+void	pj4b_icache_sync_range(vaddr_t, vsize_t);
+void	pj4b_idcache_wbinv_range(vaddr_t, vsize_t);
+void	pj4b_dcache_wbinv_range(vaddr_t, vsize_t);
+void	pj4b_dcache_inv_range(vaddr_t, vsize_t);
+void	pj4b_dcache_wb_range(vaddr_t, vsize_t);
 
 void	pj4b_drain_writebuf(void);
 void	pj4b_drain_readbuf(void);

Index: src/sys/arch/arm/include/ofw.h
diff -u src/sys/arch/arm/include/ofw.h:1.4 src/sys/arch/arm/include/ofw.h:1.5
--- src/sys/arch/arm/include/ofw.h:1.4	Wed Jan 29 00:42:15 2014
+++ src/sys/arch/arm/include/ofw.h	Sat Sep 13 17:41:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw.h,v 1.4 2014/01/29 00:42:15 matt Exp $	*/
+/*	$NetBSD: ofw.h,v 1.5 2014/09/13 17:41:03 matt Exp $	*/
 
 /*
  * Copyright 1997
@@ -52,13 +52,12 @@ void ofw_init(ofw_handle_t);
 void ofw_boot(int, char *);
 void ofw_getbootinfo(char **, char **);
 void ofw_configmem(void);
-void ofw_configisa(vm_offset_t *, vm_offset_t *);
-void ofw_configisadma(vm_offset_t *);
-int  ofw_isadmarangeintersect(vm_offset_t, vm_offset_t,
-   vm_offset_t *, vm_offset_t *);
-vm_offset_t ofw_gettranslation(vm_offset_t);
-vm_offset_t ofw_map(vm_offset_t, vm_size_t, int);
-vm_offset_t ofw_getcleaninfo(void);
+void ofw_configisa(vaddr_t *, vaddr_t *);
+void ofw_configisadma(vaddr_t *);
+int  ofw_isadmarangeintersect(vaddr_t, vaddr_t, vaddr_t *, vaddr_t *);
+vaddr_t ofw_gettranslation(vaddr_t);
+vaddr_t ofw_map(vaddr_t, vsize_t, int);
+vaddr_t ofw_getcleaninfo(void);
 
 #ifdef	OFWGENCFG
 /* Implemented in  */

Index: src/sys/arch/arm/include/types.h
diff -u src/sys/arch/arm/include/types.h:1.28 src/sys/arch/arm/include/types.h:1.29
--- src/sys/arch/arm/include/types.h:1.28	Tue Aug  5 06:24:56 2014
+++ src/sys/arch/arm/include/types.h	Sat Sep 13 17:41:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.28 2014/08/05 06:24:56 skrll Exp $	*/
+/*	$NetBSD: types.h,v 1.29 2014/09/13 17:41:03 matt Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -46,9 +46,6 @@ typedef struct label_t {	/* Used by setj
  
 /* NB: This should probably be if defined(_KERNEL) */
 #if defined(_NETBSD_SOURCE)
-typedef	unsigned long	vm_offset_t;	/* depreciated */
-typedef	unsigned long	vm_size_t;	/* depreciated */
-
 typedef unsigned long	paddr_t;
 typedef unsigned long	psize_t;
 typedef unsigned long	vaddr_t;



CVS commit: src/sys/arch/acorn32

2014-09-13 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Sep 13 17:36:42 UTC 2014

Modified Files:
src/sys/arch/acorn32/acorn32: rpc_machdep.c
src/sys/arch/acorn32/eb7500atx: eb7500atx_machdep.c

Log Message:
vm_size_t -> vsize_t


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/acorn32/acorn32/rpc_machdep.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.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/acorn32/acorn32/rpc_machdep.c
diff -u src/sys/arch/acorn32/acorn32/rpc_machdep.c:1.88 src/sys/arch/acorn32/acorn32/rpc_machdep.c:1.89
--- src/sys/arch/acorn32/acorn32/rpc_machdep.c:1.88	Sat Feb 22 19:03:06 2014
+++ src/sys/arch/acorn32/acorn32/rpc_machdep.c	Sat Sep 13 17:36:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rpc_machdep.c,v 1.88 2014/02/22 19:03:06 matt Exp $	*/
+/*	$NetBSD: rpc_machdep.c,v 1.89 2014/09/13 17:36:41 matt Exp $	*/
 
 /*
  * Copyright (c) 2000-2002 Reinoud Zandijk.
@@ -55,7 +55,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: rpc_machdep.c,v 1.88 2014/02/22 19:03:06 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rpc_machdep.c,v 1.89 2014/09/13 17:36:41 matt Exp $");
 
 #include 
 #include 
@@ -767,7 +767,7 @@ initarm(void *cookie)
 	/* Map the core memory needed before autoconfig */
 	loop = 0;
 	while (l1_sec_table[loop].size) {
-		vm_size_t sz;
+		vsize_t sz;
 
 #ifdef VERBOSE_INIT_ARM
 		printf("%08lx -> %08lx @ %08lx\n", l1_sec_table[loop].pa,

Index: src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c
diff -u src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c:1.26 src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c:1.27
--- src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c:1.26	Sun Aug 18 21:42:16 2013
+++ src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c	Sat Sep 13 17:36:42 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: eb7500atx_machdep.c,v 1.26 2013/08/18 21:42:16 matt Exp $	*/
+/*	$NetBSD: eb7500atx_machdep.c,v 1.27 2014/09/13 17:36:42 matt Exp $	*/
 
 /*
  * Copyright (c) 2000-2002 Reinoud Zandijk.
@@ -55,7 +55,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: eb7500atx_machdep.c,v 1.26 2013/08/18 21:42:16 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: eb7500atx_machdep.c,v 1.27 2014/09/13 17:36:42 matt Exp $");
 
 #include 
 #include 
@@ -709,7 +709,7 @@ initarm(void *cookie)
 	/* Map the core memory needed before autoconfig */
 	loop = 0;
 	while (l1_sec_table[loop].size) {
-		vm_size_t sz;
+		vsize_t sz;
 
 #ifdef VERBOSE_INIT_ARM
 		printf("%08lx -> %08lx @ %08lx\n", l1_sec_table[loop].pa,



CVS commit: src/usr.sbin/sysinst

2014-09-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 13 17:22:22 UTC 2014

Modified Files:
src/usr.sbin/sysinst: net.c

Log Message:
For the benefit of gcc 4.5, rename a local "nl" variable to "nline",
so it doesn't collide with the global curses nl() function.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/sysinst/net.c

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

Modified files:

Index: src/usr.sbin/sysinst/net.c
diff -u src/usr.sbin/sysinst/net.c:1.14 src/usr.sbin/sysinst/net.c:1.15
--- src/usr.sbin/sysinst/net.c:1.14	Sat Sep 13 09:46:12 2014
+++ src/usr.sbin/sysinst/net.c	Sat Sep 13 17:22:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: net.c,v 1.14 2014/09/13 09:46:12 roy Exp $	*/
+/*	$NetBSD: net.c,v 1.15 2014/09/13 17:22:22 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -602,7 +602,7 @@ again:
 		/* try a dhcp configuration */
 		dhcp_config = config_dhcp(net_dev);
 		if (dhcp_config) {
-			char *nl;
+			char *nline;
 
 			/* Get newly configured data off interface. */
 			get_ifinterface_info();
@@ -624,8 +624,8 @@ again:
 strlcpy(net_defroute, textbuf,
 sizeof net_defroute);
 			free(textbuf);
-			if ((nl = strchr(net_defroute, '\n')))
-*nl = '\0';
+			if ((nline = strchr(net_defroute, '\n')))
+*nline = '\0';
 
 			/* pull nameserver info out of /etc/resolv.conf */
 			if (collect(T_OUTPUT, &textbuf,
@@ -637,8 +637,8 @@ again:
 strlcpy(net_namesvr, textbuf,
 sizeof net_namesvr);
 			free(textbuf);
-			if ((nl = strchr(net_namesvr, '\n')))
-*nl = '\0';
+			if ((nline = strchr(net_namesvr, '\n')))
+*nline = '\0';
 			if (net_namesvr[0] != '\0')
 net_dhcpconf |= DHCPCONF_NAMESVR;
 
@@ -664,8 +664,8 @@ again:
 	sizeof net_domain);
 free(textbuf);
 			}
-			if ((nl = strchr(net_domain, '\n')))
-*nl = '\0';
+			if ((nline = strchr(net_domain, '\n')))
+*nline = '\0';
 			if (net_domain[0] != '\0')
 net_dhcpconf |= DHCPCONF_DOMAIN;
 



CVS commit: src/sys/net

2014-09-13 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sat Sep 13 17:18:45 UTC 2014

Modified Files:
src/sys/net: bpf.c

Log Message:
PR/49190: bpf_deliver: set scratch memory store in bpf_args_t.


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/sys/net/bpf.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/net/bpf.c
diff -u src/sys/net/bpf.c:1.188 src/sys/net/bpf.c:1.189
--- src/sys/net/bpf.c:1.188	Fri Sep  5 09:22:22 2014
+++ src/sys/net/bpf.c	Sat Sep 13 17:18:45 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.188 2014/09/05 09:22:22 matt Exp $	*/
+/*	$NetBSD: bpf.c,v 1.189 2014/09/13 17:18:45 rmind Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.188 2014/09/05 09:22:22 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.189 2014/09/13 17:18:45 rmind Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_bpf.h"
@@ -1388,25 +1388,24 @@ static inline void
 bpf_deliver(struct bpf_if *bp, void *(*cpfn)(void *, const void *, size_t),
 void *pkt, u_int pktlen, u_int buflen, const bool rcv)
 {
-	struct timespec ts;
+	const bpf_ctx_t *bc = NULL;
+	uint32_t mem[BPF_MEMWORDS];
 	bpf_args_t args = {
 		.pkt = (const uint8_t *)pkt,
 		.wirelen = pktlen,
 		.buflen = buflen,
-		.mem = NULL,
+		.mem = mem,
 		.arg = NULL
 	};
-	struct bpf_d *d;
-
-	const bpf_ctx_t *bc = NULL;
 	bool gottime = false;
+	struct timespec ts;
 
 	/*
 	 * Note that the IPL does not have to be raised at this point.
 	 * The only problem that could arise here is that if two different
 	 * interfaces shared any data.  This is not the case.
 	 */
-	for (d = bp->bif_dlist; d != NULL; d = d->bd_next) {
+	for (struct bpf_d *d = bp->bif_dlist; d != NULL; d = d->bd_next) {
 		u_int slen;
 
 		if (!d->bd_seesent && !rcv) {



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

2014-09-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 13 14:48:02 UTC 2014

Modified Files:
src/sys/arch/evbarm/conf: std.awin

Log Message:
options MOTG_ALLWINNER


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/std.awin

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/std.awin
diff -u src/sys/arch/evbarm/conf/std.awin:1.2 src/sys/arch/evbarm/conf/std.awin:1.3
--- src/sys/arch/evbarm/conf/std.awin:1.2	Wed Sep 10 09:55:09 2014
+++ src/sys/arch/evbarm/conf/std.awin	Sat Sep 13 14:48:02 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: std.awin,v 1.2 2014/09/10 09:55:09 matt Exp $
+#	$NetBSD: std.awin,v 1.3 2014/09/13 14:48:02 jmcneill Exp $
 #
 # standard NetBSD/evbarm for Allwinner based options
 
@@ -20,6 +20,7 @@ options 	TPIDRPRW_IS_CURCPU
 options 	KERNEL_BASE_EXT=0x8000
 options 	FPU_VFP
 options 	GTTWSI_ALLWINNER
+options 	MOTG_ALLWINNER
 
 makeoptions	KERNEL_BASE_PHYS="0x40007800"
 makeoptions	KERNEL_BASE_VIRT="0x80007800"



CVS commit: src/sys

2014-09-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 13 14:47:35 UTC 2014

Modified Files:
src/sys/conf: files
src/sys/dev/usb: motgreg.h

Log Message:
options MOTG_ALLWINNER to select the awin specific reg layout


To generate a diff of this commit:
cvs rdiff -u -r1.1103 -r1.1104 src/sys/conf/files
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/usb/motgreg.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/conf/files
diff -u src/sys/conf/files:1.1103 src/sys/conf/files:1.1104
--- src/sys/conf/files:1.1103	Mon Sep  8 14:26:16 2014
+++ src/sys/conf/files	Sat Sep 13 14:47:35 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1103 2014/09/08 14:26:16 martin Exp $
+#	$NetBSD: files,v 1.1104 2014/09/13 14:47:35 jmcneill Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20140824
@@ -1246,6 +1246,7 @@ device	xhci: usbus, usbroothub, usb_dma
 file	dev/usb/xhci.c			xhci			needs-flag
 
 # Mentor graphics OTG IP
+defflag	opt_motg.h	MOTG_ALLWINNER
 device	motg: usbus, usbroothub, usb_dma
 file	dev/usb/motg.c			motg			needs-flag
 

Index: src/sys/dev/usb/motgreg.h
diff -u src/sys/dev/usb/motgreg.h:1.1 src/sys/dev/usb/motgreg.h:1.2
--- src/sys/dev/usb/motgreg.h:1.1	Wed Jul 16 18:22:23 2014
+++ src/sys/dev/usb/motgreg.h	Sat Sep 13 14:47:35 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: motgreg.h,v 1.1 2014/07/16 18:22:23 bouyer Exp $ */
+/* $NetBSD: motgreg.h,v 1.2 2014/09/13 14:47:35 jmcneill Exp $ */
 /* FreeBSD: head/sys/dev/usb/controller/musb_otg.h 267122 2014-06-05 18:23:51Z hselasky */
 /*-
  * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
@@ -33,6 +33,8 @@
 #ifndef _MUSB2_OTG_H_
 #define	_MUSB2_OTG_H_
 
+#include "opt_motg.h"
+
 #define	MUSB2_MAX_DEVICES USB_MAX_DEVICES
 
 /* Common registers */
@@ -283,4 +285,55 @@
 
 #define	MUSB2_EP_MAX 16			/* maximum number of endpoints */
 
+#ifdef MOTG_ALLWINNER
+/*
+ * AllWinner SoCs have an MOTG with shuffled registers
+ */ 
+#undef MUSB2_REG_FADDR
+#define MUSB2_REG_FADDR 0x0098
+
+#undef MUSB2_REG_POWER
+#define MUSB2_REG_POWER 0x0040
+
+#undef MUSB2_REG_DEVCTL
+#define MUSB2_REG_DEVCTL 0x0041
+
+#undef MUSB2_REG_EPINDEX
+#define MUSB2_REG_EPINDEX 0x0042
+
+#undef MUSB2_REG_INTTX
+#define MUSB2_REG_INTTX 0x0044
+
+#undef MUSB2_REG_INTRX
+#define MUSB2_REG_INTRX 0x0046
+
+#undef MUSB2_REG_INTTXE
+#define MUSB2_REG_INTTXE 0x0048
+
+#undef MUSB2_REG_INTRXE
+#define MUSB2_REG_INTRXE 0x004a
+
+#undef MUSB2_REG_INTUSB
+#define MUSB2_REG_INTUSB 0x004c
+
+#undef MUSB2_REG_INTUSBE
+#define MUSB2_REG_INTUSBE 0x0050
+
+#undef MUSB2_REG_FRAME
+#define MUSB2_REG_FRAME 0x0054
+
+#undef MUSB2_REG_TXFIFOSZ
+#define MUSB2_REG_TXFIFOSZ 0x0090
+
+#undef MUSB2_REG_RXFIFOSZ
+#define MUSB2_REG_RXFIFOSZ 0x0094
+
+#undef MUSB2_REG_TXFIFOADD
+#define MUSB2_REG_TXFIFOADD 0x0064
+
+#undef MUSB2_REG_RXFIFOADD
+#define MUSB2_REG_RXFIFOADD 0x0066
+
+#endif /* !MOTG_ALLWINNER */
+
 #endif	/* _MUSB2_OTG_H_ */



CVS commit: src/sys/dev/usb

2014-09-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 13 14:46:50 UTC 2014

Modified Files:
src/sys/dev/usb: motg.c motgvar.h

Log Message:
allow attachment glue to override the number of endpoints


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/motg.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/usb/motgvar.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/usb/motg.c
diff -u src/sys/dev/usb/motg.c:1.8 src/sys/dev/usb/motg.c:1.9
--- src/sys/dev/usb/motg.c:1.8	Tue Aug 12 08:06:46 2014
+++ src/sys/dev/usb/motg.c	Sat Sep 13 14:46:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: motg.c,v 1.8 2014/08/12 08:06:46 skrll Exp $	*/
+/*	$NetBSD: motg.c,v 1.9 2014/09/13 14:46:50 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012, 2014 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.8 2014/08/12 08:06:46 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.9 2014/09/13 14:46:50 jmcneill Exp $");
 
 #include 
 #include 
@@ -296,16 +296,20 @@ motg_init(struct motg_softc *sc)
 
 	UWRITE1(sc, MUSB2_REG_EPINDEX, 0);
 
-	/* read out number of endpoints */
-	nrx = (UREAD1(sc, MUSB2_REG_EPINFO) / 16);
+	if (sc->sc_ep_max == 0) {
+		/* read out number of endpoints */
+		nrx = (UREAD1(sc, MUSB2_REG_EPINFO) / 16);
 
-	ntx = (UREAD1(sc, MUSB2_REG_EPINFO) % 16);
+		ntx = (UREAD1(sc, MUSB2_REG_EPINFO) % 16);
 
-	/* these numbers exclude the control endpoint */
+		/* these numbers exclude the control endpoint */
 
-	DPRINTF(("RX/TX endpoints: %u/%u\n", nrx, ntx));
+		DPRINTF(("RX/TX endpoints: %u/%u\n", nrx, ntx));
 
-	sc->sc_ep_max = MAX(nrx, ntx);
+		sc->sc_ep_max = MAX(nrx, ntx);
+	} else {
+		nrx = ntx = sc->sc_ep_max;
+	}
 	if (sc->sc_ep_max == 0) {
 		aprint_error_dev(sc->sc_dev, " no endpoints\n");
 		return USBD_INVAL;

Index: src/sys/dev/usb/motgvar.h
diff -u src/sys/dev/usb/motgvar.h:1.2 src/sys/dev/usb/motgvar.h:1.3
--- src/sys/dev/usb/motgvar.h:1.2	Thu Jul 17 19:58:18 2014
+++ src/sys/dev/usb/motgvar.h	Sat Sep 13 14:46:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: motgvar.h,v 1.2 2014/07/17 19:58:18 bouyer Exp $	*/
+/*	$NetBSD: motgvar.h,v 1.3 2014/09/13 14:46:50 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -75,12 +75,12 @@ struct motg_softc {
 #define MOTG_MODE_DEVICE 1
 	void (*sc_intr_poll)(void *);
 	void *sc_intr_poll_arg;
+	int sc_ep_max;
 
 	uint16_t sc_intr_tx_ep;
 	uint16_t sc_intr_rx_ep;
 	uint8_t  sc_intr_ctrl;
 
-	int sc_ep_max;
 	struct motg_hw_ep sc_in_ep[MOTG_MAX_HW_EP];
 	struct motg_hw_ep sc_out_ep[MOTG_MAX_HW_EP];
 



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

2014-09-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Sep 13 13:20:38 UTC 2014

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_emmc.c

Log Message:
Fix typo in previous


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/broadcom/bcm2835_emmc.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/broadcom/bcm2835_emmc.c
diff -u src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.14 src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.15
--- src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.14	Sat Sep 13 08:08:24 2014
+++ src/sys/arch/arm/broadcom/bcm2835_emmc.c	Sat Sep 13 13:20:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_emmc.c,v 1.14 2014/09/13 08:08:24 skrll Exp $	*/
+/*	$NetBSD: bcm2835_emmc.c,v 1.15 2014/09/13 13:20:38 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.14 2014/09/13 08:08:24 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.15 2014/09/13 13:20:38 skrll Exp $");
 
 #include "bcmdmac.h"
 
@@ -81,7 +81,7 @@ struct bcmemmc_softc {
 static int bcmemmc_match(device_t, struct cfdata *, void *);
 static void bcmemmc_attach(device_t, device_t, void *);
 static void bcmemmc_attach_i(device_t);
-#if BCMDMAC > 0
+#if NBCMDMAC > 0
 static int bcmemmc_xfer_data_dma(struct sdhc_host *, struct sdmmc_command *);
 static void bcmemmc_dma_done(void *);
 #endif
@@ -153,7 +153,7 @@ bcmemmc_attach(device_t parent, device_t
 	}
 	aprint_normal_dev(self, "interrupting on intr %d\n", aaa->aaa_intr);
 
-#if BCMDMAC > 0
+#if NBCMDMAC > 0
 	sc->sc_dmac = bcm_dmac_alloc(BCM_DMAC_TYPE_NORMAL, IPL_SDMMC,
 	bcmemmc_dma_done, sc);
 	if (sc->sc_dmac == NULL)
@@ -237,7 +237,7 @@ fail:
 	bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_ios);
 }
 
-#if BCMDMAC > 0
+#if NBCMDMAC > 0
 static int
 bcmemmc_xfer_data_dma(struct sdhc_host *hp, struct sdmmc_command *cmd)
 {



CVS commit: src/etc/defaults

2014-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Sep 13 11:07:08 UTC 2014

Modified Files:
src/etc/defaults: rc.conf

Log Message:
rtsol has gone.


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/etc/defaults/rc.conf

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

Modified files:

Index: src/etc/defaults/rc.conf
diff -u src/etc/defaults/rc.conf:1.125 src/etc/defaults/rc.conf:1.126
--- src/etc/defaults/rc.conf:1.125	Sat Sep 13 11:06:42 2014
+++ src/etc/defaults/rc.conf	Sat Sep 13 11:07:08 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: rc.conf,v 1.125 2014/09/13 11:06:42 roy Exp $
+#	$NetBSD: rc.conf,v 1.126 2014/09/13 11:07:08 roy Exp $
 #
 # /etc/defaults/rc.conf --
 #	default configuration of /etc/rc.conf
@@ -182,7 +182,6 @@ ntpdate=NO  		ntpdate_flags="-b -s"	# Ma
 ppp=YES			ppp_peers=""		# /etc/ppp/peers to call
 ip6mode=host	# host, autohost or router
 ip6uniquelocal=NO# IPv6 unique-local forwarding
-rtsol=NO		rtsol_flags="-a"	# for ip6mode=autohost only
 
 # Special treatment for interfaces that need to be downed on
 # shutdown (because they might cause unnecessary costs or block resources



CVS commit: src/etc/defaults

2014-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Sep 13 11:06:42 UTC 2014

Modified Files:
src/etc/defaults: rc.conf

Log Message:
Add the -M flag to dhcpcd so it stays in master mode even for one
interface. Suggested by apb@


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/etc/defaults/rc.conf

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

Modified files:

Index: src/etc/defaults/rc.conf
diff -u src/etc/defaults/rc.conf:1.124 src/etc/defaults/rc.conf:1.125
--- src/etc/defaults/rc.conf:1.124	Thu Sep 11 13:10:03 2014
+++ src/etc/defaults/rc.conf	Sat Sep 13 11:06:42 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: rc.conf,v 1.124 2014/09/11 13:10:03 roy Exp $
+#	$NetBSD: rc.conf,v 1.125 2014/09/13 11:06:42 roy Exp $
 #
 # /etc/defaults/rc.conf --
 #	default configuration of /etc/rc.conf
@@ -175,7 +175,7 @@ auto_ifconfig=YES# config all avail.
 net_interfaces=""# used only if above is NO
 flushroutes=YES	# flush routes in netstart
 dhcpcd=NO
-dhcpcd_flags="-q"# For ifconfig_XXX=dhcp.
+			dhcpcd_flags="-qM"	# For ifconfig_XXX=dhcp.
 dhclient=NO	# behave as a DHCP client
 			dhclient_flags=""	# blank: config all interfaces
 ntpdate=NO  		ntpdate_flags="-b -s"	# May need '-u' thru firewall



CVS commit: src/distrib

2014-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Sep 13 10:18:24 UTC 2014

Modified Files:
src/distrib/amd64/cdroms: Makefile.cdrom
src/distrib/amd64/installimage: Makefile spec.inst
src/distrib/i386/cdroms: Makefile.cdrom
src/distrib/i386/installimage: Makefile spec.inst
src/distrib/sparc64/cdroms/installcd: Makefile
src/distrib/vax/cdroms/installcd: Makefile

Log Message:
Punt custom dhcpcd hooks in favour up upstream hooks


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/distrib/amd64/cdroms/Makefile.cdrom
cvs rdiff -u -r1.4 -r1.5 src/distrib/amd64/installimage/Makefile
cvs rdiff -u -r1.1 -r1.2 src/distrib/amd64/installimage/spec.inst
cvs rdiff -u -r1.31 -r1.32 src/distrib/i386/cdroms/Makefile.cdrom
cvs rdiff -u -r1.4 -r1.5 src/distrib/i386/installimage/Makefile
cvs rdiff -u -r1.1 -r1.2 src/distrib/i386/installimage/spec.inst
cvs rdiff -u -r1.19 -r1.20 src/distrib/sparc64/cdroms/installcd/Makefile
cvs rdiff -u -r1.9 -r1.10 src/distrib/vax/cdroms/installcd/Makefile

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

Modified files:

Index: src/distrib/amd64/cdroms/Makefile.cdrom
diff -u src/distrib/amd64/cdroms/Makefile.cdrom:1.11 src/distrib/amd64/cdroms/Makefile.cdrom:1.12
--- src/distrib/amd64/cdroms/Makefile.cdrom:1.11	Thu Aug 14 16:27:17 2014
+++ src/distrib/amd64/cdroms/Makefile.cdrom	Sat Sep 13 10:18:24 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.cdrom,v 1.11 2014/08/14 16:27:17 riastradh Exp $
+# $NetBSD: Makefile.cdrom,v 1.12 2014/09/13 10:18:24 roy Exp $
 
 .include 
 
@@ -65,9 +65,6 @@ CDRUNTIME+=	./usr/share/misc/terminfo.cd
 CDRUNTIME+=	./usr/share/locale
 
 image_md_pre:
-	${MKDIR} cdrom/libexec/dhcpcd-hooks
-	${INSTALL} ${COPY} ${.CURDIR}/../../../common/10-resolv.conf cdrom/libexec/dhcpcd-hooks
-	${INSTALL} ${COPY} ${.CURDIR}/../../../common/99-print-sysinst cdrom/libexec/dhcpcd-hooks
 	${MKDIR} cdrom/etc
 	${HOST_LN} -fs /tmp/gettytab cdrom/etc/gettytab
 	${INSTALL} ${COPY} ${.CURDIR}/../etc.ttys cdrom/etc/ttys

Index: src/distrib/amd64/installimage/Makefile
diff -u src/distrib/amd64/installimage/Makefile:1.4 src/distrib/amd64/installimage/Makefile:1.5
--- src/distrib/amd64/installimage/Makefile:1.4	Sat Jul 26 19:34:08 2014
+++ src/distrib/amd64/installimage/Makefile	Sat Sep 13 10:18:24 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2014/07/26 19:34:08 dholland Exp $
+#	$NetBSD: Makefile,v 1.5 2014/09/13 10:18:24 roy Exp $
 
 .include 
 
@@ -26,8 +26,6 @@ SYSINSTDIR!= cd ${.CURDIR}/../../../usr.
 
 SPEC_EXTRA=		${.CURDIR}/spec.inst
 IMGFILE_EXTRA=\
-	${DISTRIBDIR}/common/10-resolv.conf	libexec/dhcpcd-hooks	\
-	${DISTRIBDIR}/common/99-print-sysinst	libexec/dhcpcd-hooks	\
 	${.CURDIR}/etc.ttys		etc/ttys			\
 	${.CURDIR}/etc.rc		etc/rc\
 	${.CURDIR}/install.sh		.\

Index: src/distrib/amd64/installimage/spec.inst
diff -u src/distrib/amd64/installimage/spec.inst:1.1 src/distrib/amd64/installimage/spec.inst:1.2
--- src/distrib/amd64/installimage/spec.inst:1.1	Sun Jan 22 03:53:29 2012
+++ src/distrib/amd64/installimage/spec.inst	Sat Sep 13 10:18:24 2014
@@ -1,10 +1,7 @@
-# $NetBSD: spec.inst,v 1.1 2012/01/22 03:53:29 tsutsui Exp $
+# $NetBSD: spec.inst,v 1.2 2014/09/13 10:18:24 roy Exp $
 ./mnt2			type=dir mode=0755 uname=root gname=wheel
 ./targetroot		type=dir mode=0755 uname=root gname=wheel
 
-./libexec/dhcpcd-hooks/10-resolv.conf	type=file mode=0444 uname=root gname=wheel
-./libexec/dhcpcd-hooks/99-print-sysinst	type=file mode=0444 uname=root gname=wheel
-
 ./install.sh		type=file mode=0755 uname=root gname=wheel
 ./sysinst		type=file mode=0755 uname=root gname=wheel
 ./sysinstmsgs.de	type=file mode=0444 uname=root gname=wheel

Index: src/distrib/i386/cdroms/Makefile.cdrom
diff -u src/distrib/i386/cdroms/Makefile.cdrom:1.31 src/distrib/i386/cdroms/Makefile.cdrom:1.32
--- src/distrib/i386/cdroms/Makefile.cdrom:1.31	Thu Aug 14 16:27:18 2014
+++ src/distrib/i386/cdroms/Makefile.cdrom	Sat Sep 13 10:18:24 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.cdrom,v 1.31 2014/08/14 16:27:18 riastradh Exp $
+# $NetBSD: Makefile.cdrom,v 1.32 2014/09/13 10:18:24 roy Exp $
 
 .include 
 
@@ -65,9 +65,6 @@ CDRUNTIME+=	./usr/share/misc/terminfo.cd
 CDRUNTIME+=	./usr/share/locale
 
 image_md_pre:
-	${MKDIR} cdrom/libexec/dhcpcd-hooks
-	${INSTALL} ${COPY} ${.CURDIR}/../../../common/10-resolv.conf cdrom/libexec/dhcpcd-hooks
-	${INSTALL} ${COPY} ${.CURDIR}/../../../common/99-print-sysinst cdrom/libexec/dhcpcd-hooks
 	${MKDIR} cdrom/etc
 	${HOST_LN} -fs /tmp/gettytab cdrom/etc/gettytab
 	${INSTALL} ${COPY} ${.CURDIR}/../etc.ttys cdrom/etc/ttys

Index: src/distrib/i386/installimage/Makefile
diff -u src/distrib/i386/installimage/Makefile:1.4 src/distrib/i386/installimage/Makefile:1.5
--- src/distrib/i386/installimage/Makefile:1.4	Sat Jul 26 19:34:08 2014
+++ src/distrib/i386/installimage/Makefile	Sat Sep 13 10:18:24 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2014

CVS commit: src/usr.sbin/sysinst

2014-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Sep 13 09:46:12 UTC 2014

Modified Files:
src/usr.sbin/sysinst: net.c

Log Message:
Fix a bogus gcc warning: dhcp_config may be used uninitialized


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/sysinst/net.c

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

Modified files:

Index: src/usr.sbin/sysinst/net.c
diff -u src/usr.sbin/sysinst/net.c:1.13 src/usr.sbin/sysinst/net.c:1.14
--- src/usr.sbin/sysinst/net.c:1.13	Sat Sep 13 09:38:43 2014
+++ src/usr.sbin/sysinst/net.c	Sat Sep 13 09:46:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: net.c,v 1.13 2014/09/13 09:38:43 roy Exp $	*/
+/*	$NetBSD: net.c,v 1.14 2014/09/13 09:46:12 roy Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -532,6 +532,7 @@ again:
 	return 0;
 
 	network_up = 1;
+	dhcp_config = 0;
 
 	strncpy(net_dev, net_devs[selected_net].if_dev, STRSIZE);
 
@@ -544,13 +545,10 @@ again:
 	/* If root is on NFS do not reconfigure the interface. */
 	if (statvfs("/", &sb) == 0 && strcmp(sb.f_fstypename, "nfs") == 0) {
 		nfs_root = 1;
-		dhcp_config = 0;
 		get_ifinterface_info();
 		get_if6interface_info();
 		get_host_info();
-	} else if (slip) {
-		dhcp_config = 0;
-	} else {
+	} else if (!slip) {
 		/* Preload any defaults we can find */
 		get_ifinterface_info();
 		get_if6interface_info();



CVS commit: src/usr.sbin/sysinst

2014-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Sep 13 09:38:43 UTC 2014

Modified Files:
src/usr.sbin/sysinst: net.c

Log Message:
Show the IP6 address instead of yes


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/net.c

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

Modified files:

Index: src/usr.sbin/sysinst/net.c
diff -u src/usr.sbin/sysinst/net.c:1.12 src/usr.sbin/sysinst/net.c:1.13
--- src/usr.sbin/sysinst/net.c:1.12	Sat Sep 13 09:30:30 2014
+++ src/usr.sbin/sysinst/net.c	Sat Sep 13 09:38:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: net.c,v 1.12 2014/09/13 09:30:30 roy Exp $	*/
+/*	$NetBSD: net.c,v 1.13 2014/09/13 09:38:43 roy Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -747,8 +747,7 @@ again:
 		*net_defroute == '\0' ? "" : net_defroute);
 #ifdef INET6
 	msg_display_add(MSG_netokv6,
-		 !is_v6kernel() ? "" :
-			(v6config ? "yes" : "no"));
+		 !is_v6kernel() ? "" : net_ip6);
 #endif
 done:
 	process_menu(MENU_yesno, deconst(MSG_netok_ok));



CVS commit: src/usr.sbin/sysinst

2014-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Sep 13 09:30:30 UTC 2014

Modified Files:
src/usr.sbin/sysinst: net.c

Log Message:
Strip newline from the gateway correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/net.c

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

Modified files:

Index: src/usr.sbin/sysinst/net.c
diff -u src/usr.sbin/sysinst/net.c:1.11 src/usr.sbin/sysinst/net.c:1.12
--- src/usr.sbin/sysinst/net.c:1.11	Sat Sep 13 01:11:58 2014
+++ src/usr.sbin/sysinst/net.c	Sat Sep 13 09:30:30 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: net.c,v 1.11 2014/09/13 01:11:58 roy Exp $	*/
+/*	$NetBSD: net.c,v 1.12 2014/09/13 09:30:30 roy Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -626,7 +626,7 @@ again:
 strlcpy(net_defroute, textbuf,
 sizeof net_defroute);
 			free(textbuf);
-			if ((nl = strchr(net_namesvr, '\n')))
+			if ((nl = strchr(net_defroute, '\n')))
 *nl = '\0';
 
 			/* pull nameserver info out of /etc/resolv.conf */



CVS commit: src/sys/dev/usb

2014-09-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Sep 13 08:15:43 UTC 2014

Modified Files:
src/sys/dev/usb: ehci.c

Log Message:
Fix build when USB_DEBUG is defined and EHCI_DEBUG isn't. The converse is
always true.

PR/49201 (broken build with options USB_DEBUG (latest current))


To generate a diff of this commit:
cvs rdiff -u -r1.229 -r1.230 src/sys/dev/usb/ehci.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/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.229 src/sys/dev/usb/ehci.c:1.230
--- src/sys/dev/usb/ehci.c:1.229	Fri Sep 12 16:40:38 2014
+++ src/sys/dev/usb/ehci.c	Sat Sep 13 08:15:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.229 2014/09/12 16:40:38 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.230 2014/09/13 08:15:43 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.229 2014/09/12 16:40:38 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.230 2014/09/13 08:15:43 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -86,7 +86,11 @@ __KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.2
 #include 
 #include 
 
-#ifdef EHCI_DEBUG
+
+#ifdef USB_DEBUG
+#ifndef EHCI_DEBUG
+#define ehcidebug 0
+#else
 static int ehcidebug = 0;
 
 SYSCTL_SETUP(sysctl_hw_ehci_setup, "sysctl hw.ehci setup")
@@ -117,6 +121,7 @@ fail:
 }
 
 #endif /* EHCI_DEBUG */
+#endif /* USB_DEBUG */
 
 struct ehci_pipe {
 	struct usbd_pipe pipe;



CVS commit: src/sys/arch

2014-09-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Sep 13 08:08:24 UTC 2014

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_emmc.c files.bcm2835
src/sys/arch/evbarm/conf: RPI

Log Message:
Make emmc use of dma controller optional and disable the bcmdmac for now.

It doesn't work for me.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/broadcom/bcm2835_emmc.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/broadcom/files.bcm2835
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/evbarm/conf/RPI

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/broadcom/bcm2835_emmc.c
diff -u src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.13 src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.14
--- src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.13	Fri Sep 12 21:00:11 2014
+++ src/sys/arch/arm/broadcom/bcm2835_emmc.c	Sat Sep 13 08:08:24 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_emmc.c,v 1.13 2014/09/12 21:00:11 jmcneill Exp $	*/
+/*	$NetBSD: bcm2835_emmc.c,v 1.14 2014/09/13 08:08:24 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.13 2014/09/12 21:00:11 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.14 2014/09/13 08:08:24 skrll Exp $");
+
+#include "bcmdmac.h"
 
 #include 
 #include 
@@ -79,8 +81,10 @@ struct bcmemmc_softc {
 static int bcmemmc_match(device_t, struct cfdata *, void *);
 static void bcmemmc_attach(device_t, device_t, void *);
 static void bcmemmc_attach_i(device_t);
+#if BCMDMAC > 0
 static int bcmemmc_xfer_data_dma(struct sdhc_host *, struct sdmmc_command *);
 static void bcmemmc_dma_done(void *);
+#endif
 
 CFATTACH_DECL_NEW(bcmemmc, sizeof(struct bcmemmc_softc),
 bcmemmc_match, bcmemmc_attach, NULL, NULL);
@@ -106,7 +110,6 @@ bcmemmc_attach(device_t parent, device_t
 	struct amba_attach_args *aaa = aux;
 	prop_number_t frequency;
 	int error;
-	int rseg;
 
 	sc->sc.sc_dev = self;
  	sc->sc.sc_dmat = aaa->aaa_dmat;
@@ -116,14 +119,10 @@ bcmemmc_attach(device_t parent, device_t
 	sc->sc.sc_flags |= SDHC_FLAG_NO_HS_BIT;
 	sc->sc.sc_caps = SDHC_VOLTAGE_SUPP_3_3V | SDHC_HIGH_SPEED_SUPP |
 	SDHC_MAX_BLK_LEN_1024;
- 	sc->sc.sc_flags |= SDHC_FLAG_USE_DMA;
-	sc->sc.sc_flags |= SDHC_FLAG_EXTERNAL_DMA;
-	sc->sc.sc_caps |= SDHC_DMA_SUPPORT;
 
 	sc->sc.sc_host = sc->sc_hosts;
 	sc->sc.sc_clkbase = 5;	/* Default to 50MHz */
 	sc->sc_iot = aaa->aaa_iot;
-	sc->sc.sc_vendor_transfer_data_dma = bcmemmc_xfer_data_dma;
 
 	/* Fetch the EMMC clock frequency from property if set. */
 	frequency = prop_dictionary_get(dict, "frequency");
@@ -154,15 +153,22 @@ bcmemmc_attach(device_t parent, device_t
 	}
 	aprint_normal_dev(self, "interrupting on intr %d\n", aaa->aaa_intr);
 
+#if BCMDMAC > 0
 	sc->sc_dmac = bcm_dmac_alloc(BCM_DMAC_TYPE_NORMAL, IPL_SDMMC,
 	bcmemmc_dma_done, sc);
 	if (sc->sc_dmac == NULL)
-		goto fail;
+		goto done;
+
+ 	sc->sc.sc_flags |= SDHC_FLAG_USE_DMA;
+	sc->sc.sc_flags |= SDHC_FLAG_EXTERNAL_DMA;
+	sc->sc.sc_caps |= SDHC_DMA_SUPPORT;
+	sc->sc.sc_vendor_transfer_data_dma = bcmemmc_xfer_data_dma;
 
 	sc->sc_state = EMMC_DMA_STATE_IDLE;
 	mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_SDMMC);
 	cv_init(&sc->sc_cv, "bcmemmcdma");
 
+	int rseg;
 	error = bus_dmamem_alloc(sc->sc.sc_dmat, PAGE_SIZE, PAGE_SIZE,
 	 PAGE_SIZE, sc->sc_segs, 1, &rseg, BUS_DMA_WAITOK);
 	if (error) {
@@ -194,6 +200,8 @@ bcmemmc_attach(device_t parent, device_t
 		goto fail;
 	}
 
+done:
+#endif
 	config_interrupts(self, bcmemmc_attach_i);
 	return;
 
@@ -229,6 +237,7 @@ fail:
 	bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_ios);
 }
 
+#if BCMDMAC > 0
 static int
 bcmemmc_xfer_data_dma(struct sdhc_host *hp, struct sdmmc_command *cmd)
 {
@@ -315,3 +324,4 @@ bcmemmc_dma_done(void *arg)
 	mutex_exit(&sc->sc_lock);
 
 }
+#endif

Index: src/sys/arch/arm/broadcom/files.bcm2835
diff -u src/sys/arch/arm/broadcom/files.bcm2835:1.22 src/sys/arch/arm/broadcom/files.bcm2835:1.23
--- src/sys/arch/arm/broadcom/files.bcm2835:1.22	Sun Sep  7 14:16:44 2014
+++ src/sys/arch/arm/broadcom/files.bcm2835	Sat Sep 13 08:08:24 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.bcm2835,v 1.22 2014/09/07 14:16:44 jmcneill Exp $
+#	$NetBSD: files.bcm2835,v 1.23 2014/09/13 08:08:24 skrll Exp $
 #
 # Configuration info for Broadcom BCM2835 ARM Peripherals
 #
@@ -57,7 +57,7 @@ file	arch/arm/broadcom/bcm2835_emmc.c	bc
 # DMA Controller (BCM2835_DMA0_BASE)
 device	bcmdmac
 attach	bcmdmac at obio with bcmdmac_amba
-file	arch/arm/broadcom/bcm2835_dmac.c	bcmdmac
+file	arch/arm/broadcom/bcm2835_dmac.c	bcmdmac		needs-flag
 
 # USB (BCM2835_USB_BASE)
 attach dwctwo at obio with bcmdwctwo

Index: src/sys/arch/evbarm/conf/RPI
diff -u src/sys/arch/evbarm/conf/RPI:1.52 src/sys/arch/evbarm/conf/RPI:1.53
--- src/sys/arch/evbarm/conf/RPI:1.52	Fri Sep 12 20:51:21 2014
+++ src/sys/arch/evbarm/conf/RPI	Sat Sep 13 08:08:24