CVS commit: src/usr.bin/make

2014-09-09 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue Sep  9 06:18:17 UTC 2014

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

Log Message:
Restore apb's 20140820 commit (-r1.228 of main.c):
It should not be an error to have VAR != command that prints no output

Joerg reverted a bit too enthusiastically.


To generate a diff of this commit:
cvs rdiff -u -r1.230 -r1.231 src/usr.bin/make/main.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/main.c
diff -u src/usr.bin/make/main.c:1.230 src/usr.bin/make/main.c:1.231
--- src/usr.bin/make/main.c:1.230	Sun Sep  7 20:55:34 2014
+++ src/usr.bin/make/main.c	Tue Sep  9 06:18:17 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.230 2014/09/07 20:55:34 joerg Exp $	*/
+/*	$NetBSD: main.c,v 1.231 2014/09/09 06:18:17 dholland Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = $NetBSD: main.c,v 1.230 2014/09/07 20:55:34 joerg Exp $;
+static char rcsid[] = $NetBSD: main.c,v 1.231 2014/09/09 06:18:17 dholland Exp $;
 #else
 #include sys/cdefs.h
 #ifndef lint
@@ -81,7 +81,7 @@ __COPYRIGHT(@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = @(#)main.c	8.3 (Berkeley) 3/19/94;
 #else
-__RCSID($NetBSD: main.c,v 1.230 2014/09/07 20:55:34 joerg Exp $);
+__RCSID($NetBSD: main.c,v 1.231 2014/09/09 06:18:17 dholland Exp $);
 #endif
 #endif /* not lint */
 #endif
@@ -1488,10 +1488,12 @@ Cmd_Exec(const char *cmd, const char **e
 int		status;		/* command exit status */
 Buffer	buf;		/* buffer to store the result */
 char	*cp;
-int		cc;
+int		cc;		/* bytes read, or -1 */
+int		savederr;	/* saved errno */
 
 
 *errnum = NULL;
+savederr = 0;
 
 if (!shellName)
 	Shell_Init();
@@ -1554,6 +1556,8 @@ Cmd_Exec(const char *cmd, const char **e
 		Buf_AddBytes(buf, cc, result);
 	}
 	while (cc  0 || (cc == -1  errno == EINTR));
+	if (cc == -1)
+	savederr = errno;
 
 	/*
 	 * Close the input side of the pipe.
@@ -1570,7 +1574,7 @@ Cmd_Exec(const char *cmd, const char **e
 	cc = Buf_Size(buf);
 	res = Buf_Destroy(buf, FALSE);
 
-	if (cc == 0)
+	if (savederr != 0)
 	*errnum = Couldn't read shell's output for \%s\;
 
 	if (WIFSIGNALED(status))



CVS commit: src/sbin/gpt

2014-09-09 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Tue Sep  9 06:30:09 UTC 2014

Modified Files:
src/sbin/gpt: backup.c

Log Message:
- record the sector size of the disk
- correct confusion with end_cylinder and end_sector in MBRs


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/gpt/backup.c

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

Modified files:

Index: src/sbin/gpt/backup.c
diff -u src/sbin/gpt/backup.c:1.1 src/sbin/gpt/backup.c:1.2
--- src/sbin/gpt/backup.c:1.1	Thu Dec 19 06:46:51 2013
+++ src/sbin/gpt/backup.c	Tue Sep  9 06:30:09 2014
@@ -29,7 +29,7 @@
 __FBSDID($FreeBSD: src/sbin/gpt/show.c,v 1.14 2006/06/22 22:22:32 marcel Exp $);
 #endif
 #ifdef __RCSID
-__RCSID($NetBSD: backup.c,v 1.1 2013/12/19 06:46:51 jnemeth Exp $);
+__RCSID($NetBSD: backup.c,v 1.2 2014/09/09 06:30:09 jnemeth Exp $);
 #endif
 
 #include sys/bootblock.h
@@ -82,6 +82,10 @@ backup(void)
 
 	props = prop_dictionary_create();
 	PROP_ERR(props);
+	propnum = prop_number_create_integer(secsz);
+	PROP_ERR(propnum);
+	rc = prop_dictionary_set(props, sector_size, propnum);
+	PROP_ERR(rc);
 	m = map_first();
 	while (m != NULL) {
 		switch (m-map_type) {
@@ -139,6 +143,11 @@ backup(void)
 	propnum = prop_number_create_unsigned_integer(mbr-mbr_part[i].part_esect);
 	PROP_ERR(propnum);
 	rc = prop_dictionary_set(mbr_dict,
+	end_sector, propnum);
+	PROP_ERR(rc);
+	propnum = prop_number_create_unsigned_integer(mbr-mbr_part[i].part_ecyl);
+	PROP_ERR(propnum);
+	rc = prop_dictionary_set(mbr_dict,
 	end_cylinder, propnum);
 	PROP_ERR(rc);
 	propnum = prop_number_create_unsigned_integer(le16toh(mbr-mbr_part[i].part_start_lo));



CVS commit: src/sys/arch/i386/pci

2014-09-09 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Tue Sep  9 06:38:33 UTC 2014

Modified Files:
src/sys/arch/i386/pci: pci_intr_fixup.c

Log Message:
__USE(id) in the !PCIBIOSVERBOSE case.
Fixes PR 49181.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/i386/pci/pci_intr_fixup.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/i386/pci/pci_intr_fixup.c
diff -u src/sys/arch/i386/pci/pci_intr_fixup.c:1.49 src/sys/arch/i386/pci/pci_intr_fixup.c:1.50
--- src/sys/arch/i386/pci/pci_intr_fixup.c:1.49	Fri Jul  1 17:37:26 2011
+++ src/sys/arch/i386/pci/pci_intr_fixup.c	Tue Sep  9 06:38:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_intr_fixup.c,v 1.49 2011/07/01 17:37:26 dyoung Exp $	*/
+/*	$NetBSD: pci_intr_fixup.c,v 1.50 2014/09/09 06:38:33 apb Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pci_intr_fixup.c,v 1.49 2011/07/01 17:37:26 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: pci_intr_fixup.c,v 1.50 2014/09/09 06:38:33 apb Exp $);
 
 #include opt_pcibios.h
 #include opt_pcifixup.h
@@ -719,6 +719,8 @@ pciintr_do_header_fixup(pci_chipset_tag_
 			PCIBIOS_PRINTV(( %3d, l-irq));
 		PCIBIOS_PRINTV((  %d   , l-fixup_stage));
 	}
+#else
+	__USE(id);
 #endif
 	
 	/*



CVS commit: src/usr.bin/make

2014-09-09 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue Sep  9 06:39:59 UTC 2014

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

Log Message:
Revert the man page as well. (hi joerg)

Revert it to 20140823 (-r1.230), before the controversial commits,
which changed it a good deal.


To generate a diff of this commit:
cvs rdiff -u -r1.236 -r1.237 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.236 src/usr.bin/make/make.1:1.237
--- src/usr.bin/make/make.1:1.236	Fri Sep  5 06:57:20 2014
+++ src/usr.bin/make/make.1	Tue Sep  9 06:39:59 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: make.1,v 1.236 2014/09/05 06:57:20 wiz Exp $
+.\	$NetBSD: make.1,v 1.237 2014/09/09 06:39:59 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 4, 2014
+.Dd February 14, 2014
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -209,6 +209,8 @@ Force the
 option to print raw values of variables.
 .It Ar v
 Print debugging information about variable assignment.
+.It Ar w
+Print entering and leaving directory messages, pre and post processing.
 .It Ar x
 Run shell commands with
 .Fl x
@@ -350,8 +352,6 @@ contains a
 then the value will be expanded before printing.
 .It Fl W
 Treat any warnings during makefile parsing as errors.
-.It Fl w
-Print entering and leaving directory messages, pre and post processing.
 .It Fl X
 Don't export variables passed on the command line to the environment
 individually.
@@ -382,27 +382,17 @@ conditional directives, for loops, and c
 In general, lines may be continued from one line to the next by ending
 them with a backslash
 .Pq Ql \e .
-For any line that is not a shell command line (i.e. it does not begin
-with a tab), the backslash, the following newline character, and initial
-whitespace on the following line are compressed into a single space.
-On command lines the backslash and the newline are left intact and
-if the following line begins with tab(s), the first one is removed.
+The trailing newline character and initial whitespace on the following
+line are compressed into a single space.
 .Sh FILE DEPENDENCY SPECIFICATIONS
-Dependency lines consist of one or more targets, an operator, zero
-or more sources, and an optional semicolon followed by a command.
+Dependency lines consist of one or more targets, an operator, and zero
+or more sources.
 This creates a relationship where the targets
 .Dq depend
 on the sources
 and are usually created from them.
-.Bd -literal -offset indent
-target [target...]: [source...] [;command]
-.Ed
-.Pp
 The exact relationship between the target and the source is determined
-by the operator, presented by a colon in the example, that separates
-them.
-A target may only appear on the left hand side of one type of operator
-in a single makefile.
+by the operator that separates them.
 The three operators are as follows:
 .Bl -tag -width flag
 .It Ic \:
@@ -413,7 +403,6 @@ is used.
 The target is removed if
 .Nm
 is interrupted.
-This is the only operator available in POSIX compatible makefiles.
 .It Ic \!
 Targets are always re-created, but not until all sources have been
 examined and re-created as necessary.
@@ -427,22 +416,12 @@ If no sources are specified, the target 
 Otherwise, a target is considered out-of-date if any of its sources has
 been modified more recently than the target.
 Sources for a target do not accumulate over dependency lines when this
-operator is used, only the depencies in the first rule encountered are
-used.
-The commands from the rules do accumulate and are executed in the order
-the rules were defined if the target needs to be updated.
+operator is used.
 The target will not be removed if
 .Nm
 is interrupted.
 .El
 .Pp
-The optional semicolon separated command in the dependency line is
-strongly discouraged except to specify an empty rule to nullify
-an existing suffix transformation rule (see
-.Ic .SUFFIXES ) .
-More information on commands is in the section
-.Sx SHELL COMMANDS .
-.Pp
 Targets and sources may contain the shell wildcard values
 .Ql \? ,
 .Ql * ,
@@ -461,124 +440,16 @@ The value
 .Ql {}
 need not necessarily be used to describe existing files.
 Expansion is in directory order, not alphabetically as done in the shell.
-.Ss Suffix transformation rules
-Suffix transformation rules allow
-.Nm
-to infer the commands used to bring targets up to date based on their
-suffixes.
-These are also known as inference rules or just suffix rules.
-A suffix transformation rule is a rule whose dependency line has either
-of these forms:
-.Bd -literal -compact -offset indent
-\.s1.s2: [source...]
-\.s1: [source...]
-.Ed
-Additionally, both
-.Pa .s1
-and
-.Pa .s2
-need to be defined as dependencies on the special target
-.Ic .SUFFIXES .
-.Pp
-A 

CVS commit: src/usr.bin/make

2014-09-09 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue Sep  9 06:41:56 UTC 2014

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

Log Message:
Restore -r1.234 of make.1, which was an unrelated fix from sjg pertaining
to the docs for the -w option.


To generate a diff of this commit:
cvs rdiff -u -r1.237 -r1.238 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.237 src/usr.bin/make/make.1:1.238
--- src/usr.bin/make/make.1:1.237	Tue Sep  9 06:39:59 2014
+++ src/usr.bin/make/make.1	Tue Sep  9 06:41:56 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: make.1,v 1.237 2014/09/09 06:39:59 dholland Exp $
+.\	$NetBSD: make.1,v 1.238 2014/09/09 06:41:56 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 February 14, 2014
+.Dd September 9, 2014
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -209,8 +209,6 @@ Force the
 option to print raw values of variables.
 .It Ar v
 Print debugging information about variable assignment.
-.It Ar w
-Print entering and leaving directory messages, pre and post processing.
 .It Ar x
 Run shell commands with
 .Fl x
@@ -352,6 +350,8 @@ contains a
 then the value will be expanded before printing.
 .It Fl W
 Treat any warnings during makefile parsing as errors.
+.It Fl w
+Print entering and leaving directory messages, pre and post processing.
 .It Fl X
 Don't export variables passed on the command line to the environment
 individually.



CVS commit: src/tests/fs/vfs

2014-09-09 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Sep  9 06:51:01 UTC 2014

Modified Files:
src/tests/fs/vfs: t_vnops.c

Log Message:
Mark v7fs_lstat_symlink as an expected failure, referencing PR kern/48864.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/tests/fs/vfs/t_vnops.c

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

Modified files:

Index: src/tests/fs/vfs/t_vnops.c
diff -u src/tests/fs/vfs/t_vnops.c:1.42 src/tests/fs/vfs/t_vnops.c:1.43
--- src/tests/fs/vfs/t_vnops.c:1.42	Sun Sep  7 09:10:09 2014
+++ src/tests/fs/vfs/t_vnops.c	Tue Sep  9 06:51:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_vnops.c,v 1.42 2014/09/07 09:10:09 gson Exp $	*/
+/*	$NetBSD: t_vnops.c,v 1.43 2014/09/09 06:51:00 gson Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -931,6 +931,10 @@ lstat_symlink(const atf_tc_t *tc, const 
 	struct stat st;
 
 	USES_SYMLINKS;
+
+	if (FSTYPE_V7FS(tc))
+		atf_tc_expect_fail(PR kern/48864);
+
 	FSTEST_ENTER();
 
 	src = source;



CVS commit: src/sys/dev/ic

2014-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep  9 07:18:35 UTC 2014

Modified Files:
src/sys/dev/ic: dwc_gmac.c

Log Message:
Fix MII setup and interrupt handling, from Robert Swindell.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ic/dwc_gmac.c

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

Modified files:

Index: src/sys/dev/ic/dwc_gmac.c
diff -u src/sys/dev/ic/dwc_gmac.c:1.1 src/sys/dev/ic/dwc_gmac.c:1.2
--- src/sys/dev/ic/dwc_gmac.c:1.1	Mon Sep  8 14:24:32 2014
+++ src/sys/dev/ic/dwc_gmac.c	Tue Sep  9 07:18:35 2014
@@ -39,7 +39,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: dwc_gmac.c,v 1.1 2014/09/08 14:24:32 martin Exp $);
+__KERNEL_RCSID(1, $NetBSD: dwc_gmac.c,v 1.2 2014/09/09 07:18:35 martin Exp $);
 
 #include opt_inet.h
 
@@ -162,6 +162,7 @@ dwc_gmac_attach(struct dwc_gmac_softc *s
 	/*
 	 * Attach MII subdevices
 	 */
+	sc-sc_ec.ec_mii = sc-sc_mii;
 	ifmedia_init(mii-mii_media, 0, ether_mediachange, ether_mediastatus);
 mii-mii_ifp = ifp;
 mii-mii_readreg = dwc_gmac_miibus_read_reg;
@@ -793,9 +794,11 @@ dwc_gmac_intr(struct dwc_gmac_softc *sc)
 	uint32_t status, dma_status;
 
 	status = bus_space_read_4(sc-sc_bst, sc-sc_bsh, AWIN_GMAC_MAC_INTR);
-	if (status  AWIN_GMAC_MII_IRQ)
+	if (status  AWIN_GMAC_MII_IRQ) {
 		(void)bus_space_read_4(sc-sc_bst, sc-sc_bsh,
 		AWIN_GMAC_MII_STATUS);
+		mii_pollstat(sc-sc_mii);
+	}
 
 	dma_status = bus_space_read_4(sc-sc_bst, sc-sc_bsh,
 	AWIN_GMAC_DMA_STATUS);



CVS commit: [netbsd-6] src/usr.sbin/ypbind

2014-09-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Sep  9 08:24:29 UTC 2014

Modified Files:
src/usr.sbin/ypbind [netbsd-6]: ypbind.8 ypbind.c

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1083):
usr.sbin/ypbind/ypbind.c: revision 1.91
usr.sbin/ypbind/ypbind.c: revision 1.92
usr.sbin/ypbind/ypbind.c: revision 1.93
usr.sbin/ypbind/ypbind.c: revision 1.94
usr.sbin/ypbind/ypbind.c: revision 1.95
usr.sbin/ypbind/ypbind.c: revision 1.96
usr.sbin/ypbind/ypbind.c: revision 1.97
usr.sbin/ypbind/ypbind.c: revision 1.98
usr.sbin/ypbind/ypbind.8: revision 1.20
usr.sbin/ypbind/ypbind.8: revision 1.19
Don't store the default domain name in a global. While running we
really don't care which domain is the system's default domain.
Factor out some rpc validation code.
While there are times it's appropriate to call a state variable
evil, this isn't one of them. Since the logic involved is to wait
until the default domain binds before backgrounding, call the variable
started instead.
Don't rake up the default domain until after processing arguments.
Processing arguments just sets flags -- may as well do it first, and
this way detection of silly errors isn't contingent on having things
fully configured and operating.
Load up with comments.
Instead of using magic numbers in what looks like a boolean
(dom_alive), create a state enumeration (domainstates) and use it
instead.
Instead of three states (new, alive, and, effectively, 'troubled') go
to five: new, alive, pinging, lost, and dead.
Domains start in the NEW state. When we get a reply from a server, the
state goes to ALIVE. The state is set to PINGING when we ping the
server (once a minute normally) and if the ping times out, it goes to
LOST. If we stay lost for a minute, go to DEAD, and in DEAD, do
exponential backoff of nag_servers calls.
Getting rid of the broken logic attached to the 'troubled' state fixes
PR 15355 (ypbind defeats disk idle spindown) -- it will now only
rewrite the binding file when the binding changes.
Also, fix the HEURISTIC code so it doesn't trigger except in ALIVE
state. I think this was the source of a lot of the spamming behavior
seen in PR 32519, which is now fixed.
Might also fix PR 23135 (broadcast ypbind sometimes fails to find
servers).
Add a SIGHUP handler; upon SIGHUP do an extra nag_servers on any
domain that's in DEAD state. This lets you explicitly rescue ypbind
from its exponential backoff when you know the world's back up.
Log state transitions.
Don't store the default domain name in a global. While running we
really don't care which domain is the system's default domain.
Factor out some rpc validation code.
While there are times it's appropriate to call a state variable
evil, this isn't one of them. Since the logic involved is to wait
until the default domain binds before backgrounding, call the variable
started instead.
Don't rake up the default domain until after processing arguments.
Processing arguments just sets flags -- may as well do it first, and
this way detection of silly errors isn't contingent on having things
fully configured and operating.
Load up with comments.
Instead of using magic numbers in what looks like a boolean
(dom_alive), create a state enumeration (domainstates) and use it
instead.
Instead of three states (new, alive, and, effectively, 'troubled') go
to five: new, alive, pinging, lost, and dead.
Domains start in the NEW state. When we get a reply from a server, the
state goes to ALIVE. The state is set to PINGING when we ping the
server (once a minute normally) and if the ping times out, it goes to
LOST. If we stay lost for a minute, go to DEAD, and in DEAD, do
exponential backoff of nag_servers calls.
Getting rid of the broken logic attached to the 'troubled' state fixes
PR 15355 (ypbind defeats disk idle spindown) -- it will now only
rewrite the binding file when the binding changes.
Also, fix the HEURISTIC code so it doesn't trigger except in ALIVE
state. I think this was the source of a lot of the spamming behavior
seen in PR 32519, which is now fixed.
Might also fix PR 23135 (broadcast ypbind sometimes fails to find
servers).
Add a SIGHUP handler; upon SIGHUP do an extra nag_servers on any
domain that's in DEAD state. This lets you explicitly rescue ypbind
from its exponential backoff when you know the world's back up.
Log state transitions.
Document exponential backoff behavior and SIGHUP support, plus a couple
other minor edits.
Use more markup.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.22.1 src/usr.sbin/ypbind/ypbind.8
cvs rdiff -u -r1.90 -r1.90.4.1 src/usr.sbin/ypbind/ypbind.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/ypbind/ypbind.8
diff -u src/usr.sbin/ypbind/ypbind.8:1.18 src/usr.sbin/ypbind/ypbind.8:1.18.22.1
--- 

CVS commit: [netbsd-6] src/external/gpl2/xcvs/dist/src

2014-09-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Sep  9 08:28:32 UTC 2014

Modified Files:
src/external/gpl2/xcvs/dist/src [netbsd-6]: server.c

Log Message:
Pull up following revision(s) (requested by tls in ticket #1108):
external/gpl2/xcvs/dist/src/server.c: revision 1.6
Relax arbitrary limit of 10,000 changed files per commit idiotically
introduced in CVS 1.11.17.


To generate a diff of this commit:
cvs rdiff -u -r1.3.10.1 -r1.3.10.2 src/external/gpl2/xcvs/dist/src/server.c

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

Modified files:

Index: src/external/gpl2/xcvs/dist/src/server.c
diff -u src/external/gpl2/xcvs/dist/src/server.c:1.3.10.1 src/external/gpl2/xcvs/dist/src/server.c:1.3.10.2
--- src/external/gpl2/xcvs/dist/src/server.c:1.3.10.1	Mon Jun  3 02:45:24 2013
+++ src/external/gpl2/xcvs/dist/src/server.c	Tue Sep  9 08:28:32 2014
@@ -1130,7 +1130,7 @@ serve_max_dotdot (char *arg)
 if (proxy_log) return;
 #endif /* PROXY_SUPPORT */
 
-if (lim  0 || lim  1)
+if (lim  0 || lim  100)
 	return;
 p = xmalloc (strlen (server_temp_dir) + 2 * lim + 10);
 if (p == NULL)
@@ -2989,7 +2989,7 @@ serve_argument (char *arg)
 
 if (error_pending()) return;
 
-if (argument_count = 1)
+if (argument_count = 100)
 {
 	if (alloc_pending (80))
 	sprintf (pending_error_text, 



CVS commit: [netbsd-6] src/external/gpl2/xcvs/dist/src

2014-09-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Sep  9 08:29:53 UTC 2014

Modified Files:
src/external/gpl2/xcvs/dist/src [netbsd-6]: server.c

Log Message:
Pull up following revision(s) (requested by tls in ticket #1109):
external/gpl2/xcvs/dist/src/server.c: revision 1.7
Move the arbitrary limit on number of files per commit into
100 earlier today.


To generate a diff of this commit:
cvs rdiff -u -r1.3.10.2 -r1.3.10.3 src/external/gpl2/xcvs/dist/src/server.c

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

Modified files:

Index: src/external/gpl2/xcvs/dist/src/server.c
diff -u src/external/gpl2/xcvs/dist/src/server.c:1.3.10.2 src/external/gpl2/xcvs/dist/src/server.c:1.3.10.3
--- src/external/gpl2/xcvs/dist/src/server.c:1.3.10.2	Tue Sep  9 08:28:32 2014
+++ src/external/gpl2/xcvs/dist/src/server.c	Tue Sep  9 08:29:53 2014
@@ -153,6 +153,8 @@ static int argument_count;
 static char **argument_vector;
 static int argument_vector_size;
 
+#define MAXARGS 100		/* arbitrary limit */
+
 /*
  * This is where we stash stuff we are going to use.  Format string
  * which expects a single directory within it, starting with a slash.
@@ -1130,7 +1132,7 @@ serve_max_dotdot (char *arg)
 if (proxy_log) return;
 #endif /* PROXY_SUPPORT */
 
-if (lim  0 || lim  100)
+if (lim  0 || lim  MAXARGS)
 	return;
 p = xmalloc (strlen (server_temp_dir) + 2 * lim + 10);
 if (p == NULL)
@@ -2989,7 +2991,7 @@ serve_argument (char *arg)
 
 if (error_pending()) return;
 
-if (argument_count = 100)
+if (argument_count = MAXARGS)
 {
 	if (alloc_pending (80))
 	sprintf (pending_error_text, 



CVS commit: [netbsd-6] src/sys/arch/sparc/sparc

2014-09-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Sep  9 08:35:50 UTC 2014

Modified Files:
src/sys/arch/sparc/sparc [netbsd-6]: autoconf.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1110):
sys/arch/sparc/sparc/autoconf.c: revision 1.258
PR port-sparc/49103: add device name mapping for qfe (quad hme) cards.
From MOCHIDA Shuji.


To generate a diff of this commit:
cvs rdiff -u -r1.242.8.2 -r1.242.8.3 src/sys/arch/sparc/sparc/autoconf.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/sparc/sparc/autoconf.c
diff -u src/sys/arch/sparc/sparc/autoconf.c:1.242.8.2 src/sys/arch/sparc/sparc/autoconf.c:1.242.8.3
--- src/sys/arch/sparc/sparc/autoconf.c:1.242.8.2	Wed Aug  8 15:51:11 2012
+++ src/sys/arch/sparc/sparc/autoconf.c	Tue Sep  9 08:35:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.242.8.2 2012/08/08 15:51:11 martin Exp $ */
+/*	$NetBSD: autoconf.c,v 1.242.8.3 2014/09/09 08:35:50 msaitoh Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.242.8.2 2012/08/08 15:51:11 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.242.8.3 2014/09/09 08:35:50 msaitoh Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -1545,6 +1545,7 @@ static struct {
 	{ SUNW,fdtwo,	fdc },
 	{ network,	hme }, /* Krups */
 	{ SUNW,hme,   hme },
+	{ SUNW,qfe,   hme },
 };
 
 static const char *



CVS commit: [netbsd-6] src/doc

2014-09-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Sep  9 08:49:14 UTC 2014

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

Log Message:
Ticket 1083, 1108-1110.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.131 -r1.1.2.132 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.131 src/doc/CHANGES-6.2:1.1.2.132
--- src/doc/CHANGES-6.2:1.1.2.131	Wed Aug 27 15:09:57 2014
+++ src/doc/CHANGES-6.2	Tue Sep  9 08:49:13 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.131 2014/08/27 15:09:57 msaitoh Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.132 2014/09/09 08:49:13 msaitoh Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -3711,3 +3711,30 @@ sys/compat/osf1/osf1_file.c			1.42
 	Fix a bug that a local user could crash the system by making the
 	kernel perform a zero-sized memory allocation in osf1.
 	[maxv, ticket #1141]
+
+usr.sbin/ypbind/ypbind.8			1.19-1.20
+usr.sbin/ypbind/ypbind.c			1.91-1.98
+
+	State handling fixes and cleanups in ypbind; it no longer churns the
+	disk, spams syslogd when the server goes down, or gets confused about
+	its binding state. PRs 15355, 32519.
+	[dholland, ticket #1083]
+
+external/gpl2/xcvs/dist/src/server.c		1.6
+
+	Relax arbitrary limit of 10,000 changed files per commit idiotically
+	introduced in CVS 1.11.17.
+	[tls, ticket #1108]
+
+external/gpl2/xcvs/dist/src/server.c		1.7
+
+	Move the arbitrary limit on number of files per commit into
+	#define MAXARGS.  The limit used to be 1, but was changed to
+	100 earlier today.
+	[tls, ticket #1109]
+
+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]



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

2014-09-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Sep  9 08:49:43 UTC 2014

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

Log Message:
Ticket 1008.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.23 -r1.1.2.24 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.23 src/doc/CHANGES-6.1.5:1.1.2.24
--- src/doc/CHANGES-6.1.5:1.1.2.23	Wed Aug 27 15:10:59 2014
+++ src/doc/CHANGES-6.1.5	Tue Sep  9 08:49:43 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.5,v 1.1.2.23 2014/08/27 15:10:59 msaitoh Exp $
+# $NetBSD: CHANGES-6.1.5,v 1.1.2.24 2014/09/09 08:49:43 msaitoh Exp $
 
 A complete list of changes from the NetBSD 6.1.4 release to the NetBSD 6.1.5
 release:
@@ -1296,3 +1296,11 @@ sys/compat/osf1/osf1_file.c			1.42
 	Fix a bug that a local user could crash the system by making the
 	kernel perform a zero-sized memory allocation in osf1.
 	[maxv, ticket #1141]
+
+sys/arch/next68k/next68k/pmap_bootstrap.c	1.43
+
+	Move physmem calculations before nptpage initialization.
+	Should fix next68k specific part of PR port-m68k/45915
+	(panic: pmap_enter_ptpage: can't get KPT page), and
+	this is the last possible m68k MD part of this PR.
+	[tsutsui, ticket #1008]



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

2014-09-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Sep  9 08:50:06 UTC 2014

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

Log Message:
Ticket 1008.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.23 -r1.1.2.24 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.23 src/doc/CHANGES-6.0.6:1.1.2.24
--- src/doc/CHANGES-6.0.6:1.1.2.23	Wed Aug 27 15:11:19 2014
+++ src/doc/CHANGES-6.0.6	Tue Sep  9 08:50:06 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.6,v 1.1.2.23 2014/08/27 15:11:19 msaitoh Exp $
+# $NetBSD: CHANGES-6.0.6,v 1.1.2.24 2014/09/09 08:50:06 msaitoh Exp $
 
 A complete list of changes from the NetBSD 6.0.5 release to the NetBSD 6.0.6
 release:
@@ -1296,3 +1296,11 @@ sys/compat/osf1/osf1_file.c			1.42
 	Fix a bug that a local user could crash the system by making the
 	kernel perform a zero-sized memory allocation in osf1.
 	[maxv, ticket #1141]
+
+sys/arch/next68k/next68k/pmap_bootstrap.c	1.43
+
+	Move physmem calculations before nptpage initialization.
+	Should fix next68k specific part of PR port-m68k/45915
+	(panic: pmap_enter_ptpage: can't get KPT page), and
+	this is the last possible m68k MD part of this PR.
+	[tsutsui, ticket #1008]



CVS commit: src/sys/dev/ic

2014-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep  9 10:04:19 UTC 2014

Modified Files:
src/sys/dev/ic: dwc_gmac.c dwc_gmac_reg.h dwc_gmac_var.h

Log Message:
Make the MII clock variable and passed in from the frontend.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/dwc_gmac.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ic/dwc_gmac_reg.h \
src/sys/dev/ic/dwc_gmac_var.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/ic/dwc_gmac.c
diff -u src/sys/dev/ic/dwc_gmac.c:1.2 src/sys/dev/ic/dwc_gmac.c:1.3
--- src/sys/dev/ic/dwc_gmac.c:1.2	Tue Sep  9 07:18:35 2014
+++ src/sys/dev/ic/dwc_gmac.c	Tue Sep  9 10:04:19 2014
@@ -39,7 +39,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: dwc_gmac.c,v 1.2 2014/09/09 07:18:35 martin Exp $);
+__KERNEL_RCSID(1, $NetBSD: dwc_gmac.c,v 1.3 2014/09/09 10:04:19 martin Exp $);
 
 #include opt_inet.h
 
@@ -92,7 +92,7 @@ static int dwc_gmac_ioctl(struct ifnet *
 #define RX_DESC_OFFSET(N)	((N)*sizeof(struct dwc_gmac_dev_dmadesc))
 
 void
-dwc_gmac_attach(struct dwc_gmac_softc *sc, uint8_t *ep)
+dwc_gmac_attach(struct dwc_gmac_softc *sc, uint8_t *ep, uint32_t mii_clk)
 {
 	uint8_t enaddr[ETHER_ADDR_LEN];
 	uint32_t maclo, machi;
@@ -100,6 +100,7 @@ dwc_gmac_attach(struct dwc_gmac_softc *s
 	struct ifnet * const ifp = sc-sc_ec.ec_if;
 
 	mutex_init(sc-sc_mdio_lock, MUTEX_DEFAULT, IPL_NET);
+	sc-sc_mii_clk = mii_clk  7;
 
 	/*
 	 * If the frontend did not pass in a pre-configured ethernet mac
@@ -241,13 +242,14 @@ dwc_gmac_miibus_read_reg(device_t self, 
 		| ((reg  GMAC_MII_REG_SHIFT)  GMAC_MII_REG_MASK);
 
 	mutex_enter(sc-sc_mdio_lock);
-	bus_space_write_4(sc-sc_bst, sc-sc_bsh, AWIN_GMAC_MAC_MIIADDR, miiaddr
-	| GMAC_MII_CLK_150_250M | GMAC_MII_BUSY);
+	bus_space_write_4(sc-sc_bst, sc-sc_bsh, AWIN_GMAC_MAC_MIIADDR,
+	miiaddr | GMAC_MII_BUSY | (sc-sc_mii_clk  2));
 
 	for (cnt = 0; cnt  1000; cnt++) {
-		if (!(bus_space_read_4(sc-sc_bst, sc-sc_bsh, AWIN_GMAC_MAC_MIIADDR)
-		 GMAC_MII_BUSY)) {
-			rv = bus_space_read_4(sc-sc_bst, sc-sc_bsh, AWIN_GMAC_MAC_MIIDATA);
+		if (!(bus_space_read_4(sc-sc_bst, sc-sc_bsh,
+		AWIN_GMAC_MAC_MIIADDR)  GMAC_MII_BUSY)) {
+			rv = bus_space_read_4(sc-sc_bst, sc-sc_bsh,
+			AWIN_GMAC_MAC_MIIDATA);
 			break;
 		}
 		delay(10);
@@ -267,15 +269,16 @@ dwc_gmac_miibus_write_reg(device_t self,
 
 	miiaddr = ((phy  GMAC_MII_PHY_SHIFT)  GMAC_MII_PHY_MASK)
 		| ((reg  GMAC_MII_REG_SHIFT)  GMAC_MII_REG_MASK)
-		| GMAC_MII_BUSY | GMAC_MII_WRITE;
+		| GMAC_MII_BUSY | GMAC_MII_WRITE | (sc-sc_mii_clk  2);
 
 	mutex_enter(sc-sc_mdio_lock);
 	bus_space_write_4(sc-sc_bst, sc-sc_bsh, AWIN_GMAC_MAC_MIIDATA, val);
-	bus_space_write_4(sc-sc_bst, sc-sc_bsh, AWIN_GMAC_MAC_MIIADDR, miiaddr);
+	bus_space_write_4(sc-sc_bst, sc-sc_bsh, AWIN_GMAC_MAC_MIIADDR,
+	miiaddr);
 
 	for (cnt = 0; cnt  1000; cnt++) {
-		if (!(bus_space_read_4(sc-sc_bst, sc-sc_bsh, AWIN_GMAC_MAC_MIIADDR)
-		 GMAC_MII_BUSY))
+		if (!(bus_space_read_4(sc-sc_bst, sc-sc_bsh,
+		AWIN_GMAC_MAC_MIIADDR)  GMAC_MII_BUSY))
 			break;
 		delay(10);
 	}

Index: src/sys/dev/ic/dwc_gmac_reg.h
diff -u src/sys/dev/ic/dwc_gmac_reg.h:1.1 src/sys/dev/ic/dwc_gmac_reg.h:1.2
--- src/sys/dev/ic/dwc_gmac_reg.h:1.1	Mon Sep  8 14:24:32 2014
+++ src/sys/dev/ic/dwc_gmac_reg.h	Tue Sep  9 10:04:19 2014
@@ -62,7 +62,6 @@
 
 #define	GMAC_MII_BUSY			1
 #define	GMAC_MII_WRITE			2
-#define	GMAC_MII_CLK_150_250M		0x10
 
 #define	GMAC_BUSMODE_RESET		1
 
Index: src/sys/dev/ic/dwc_gmac_var.h
diff -u src/sys/dev/ic/dwc_gmac_var.h:1.1 src/sys/dev/ic/dwc_gmac_var.h:1.2
--- src/sys/dev/ic/dwc_gmac_var.h:1.1	Mon Sep  8 14:24:32 2014
+++ src/sys/dev/ic/dwc_gmac_var.h	Tue Sep  9 10:04:19 2014
@@ -84,7 +84,8 @@ struct dwc_gmac_softc {
 	bus_dma_segment_t sc_dma_ring_seg;	/* and TX ring */
 	struct dwc_gmac_rx_ring sc_rxq;
 	struct dwc_gmac_tx_ring sc_txq;
+	uint16_t sc_mii_clk;
 };
 
-void dwc_gmac_attach(struct dwc_gmac_softc*, uint8_t*);
+void dwc_gmac_attach(struct dwc_gmac_softc*, uint8_t*, uint32_t);
 int dwc_gmac_intr(struct dwc_gmac_softc*);



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

2014-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep  9 10:03:43 UTC 2014

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

Log Message:
Better safe than sorry: do the full clock setup, and pass the MII clock
used (depending on board configuration, we use RGMII mode) to the
core attach function.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/allwinner/awin_gige.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_gige.c
diff -u src/sys/arch/arm/allwinner/awin_gige.c:1.5 src/sys/arch/arm/allwinner/awin_gige.c:1.6
--- src/sys/arch/arm/allwinner/awin_gige.c:1.5	Mon Sep  8 14:26:16 2014
+++ src/sys/arch/arm/allwinner/awin_gige.c	Tue Sep  9 10:03:43 2014
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: awin_gige.c,v 1.5 2014/09/08 14:26:16 martin Exp $);
+__KERNEL_RCSID(1, $NetBSD: awin_gige.c,v 1.6 2014/09/09 10:03:43 martin Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -129,7 +129,20 @@ awin_gige_attach(device_t parent, device
 	aprint_normal_dev(self, interrupting on irq %d\n,
 	 loc-loc_intr);
 
-	dwc_gmac_attach(sc-sc_core, ep);
+	/*
+	 * Enable GMAC clock
+	 */
+	awin_reg_set_clear(aio-aio_core_bst, aio-aio_ccm_bsh,
+	AWIN_AHB_GATING1_REG, AWIN_AHB_GATING1_GMAC, 0);
+	/*
+	 * We use RGMII phy mode, set up clock accordingly
+	 */
+	awin_reg_set_clear(aio-aio_core_bst, aio-aio_ccm_bsh,
+	AWIN_GMAC_CLK_REG, 4, 3);
+	awin_reg_set_clear(aio-aio_core_bst, aio-aio_ccm_bsh,
+	AWIN_GMAC_CLK_REG, 2, 0);
+
+	dwc_gmac_attach(sc-sc_core, ep, 2);
 }
 
 



CVS commit: src/sys/dev/ic

2014-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep  9 10:06:47 UTC 2014

Modified Files:
src/sys/dev/ic: dwc_gmac.c

Log Message:
Remove debug printf, now that MII status changes work


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/dwc_gmac.c

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

Modified files:

Index: src/sys/dev/ic/dwc_gmac.c
diff -u src/sys/dev/ic/dwc_gmac.c:1.3 src/sys/dev/ic/dwc_gmac.c:1.4
--- src/sys/dev/ic/dwc_gmac.c:1.3	Tue Sep  9 10:04:19 2014
+++ src/sys/dev/ic/dwc_gmac.c	Tue Sep  9 10:06:47 2014
@@ -39,7 +39,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: dwc_gmac.c,v 1.3 2014/09/09 10:04:19 martin Exp $);
+__KERNEL_RCSID(1, $NetBSD: dwc_gmac.c,v 1.4 2014/09/09 10:06:47 martin Exp $);
 
 #include opt_inet.h
 
@@ -603,8 +603,6 @@ dwc_gmac_miibus_statchg(struct ifnet *if
 	struct dwc_gmac_softc * const sc = ifp-if_softc;
 	struct mii_data * const mii = sc-sc_mii;
 
-printf(dwc_gmac_miibus_statchg called\n);
-
 	/*
 	 * Set MII or GMII interface based on the speed
 	 * negotiated by the PHY.   



CVS commit: src/usr.bin/make/unit-tests

2014-09-09 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Tue Sep  9 10:11:20 UTC 2014

Modified Files:
src/usr.bin/make/unit-tests: escape.exp escape.mk

Log Message:
Change @echo to echo in several places in escape.mk,
to make it easier to spot changes in what make sends to the shell.
Adjust escape.out to match.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/escape.exp
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/escape.mk

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/unit-tests/escape.exp
diff -u src/usr.bin/make/unit-tests/escape.exp:1.5 src/usr.bin/make/unit-tests/escape.exp:1.6
--- src/usr.bin/make/unit-tests/escape.exp:1.5	Sun Aug 24 16:47:12 2014
+++ src/usr.bin/make/unit-tests/escape.exp	Tue Sep  9 10:11:20 2014
@@ -1,4 +1,5 @@
 var-1bs
+printf %s=:%s:\n VAR1BS 111\\111;   printf %s=:%s:\n VAR1BSa 111\\aaa;   printf %s=:%s:\n VAR1BSA 111\\aaa;   printf %s=:%s:\n VAR1BSda 111\\\$\{a\};   printf %s=:%s:\n VAR1BSdA 111\\\$\{A\};   printf %s=:%s:\n VAR1BSc 111\#\ backslash\ escapes\ comment\ char,\ so\ this\ is\ part\ of\ the\ value;   printf %s=:%s:\n VAR1BSsc 111\\\ ; 
 VAR1BS=:111\111:
 VAR1BSa=:111\aaa:
 VAR1BSA=:111\aaa:
@@ -7,6 +8,7 @@ VAR1BSdA=:111\${A}:
 VAR1BSc=:111# backslash escapes comment char, so this is part of the value:
 VAR1BSsc=:111\ :
 var-2bs
+printf %s=:%s:\n VAR2BS 222222;   printf %s=:%s:\n VAR2BSa 222aaa;   printf %s=:%s:\n VAR2BSA 222aaa;   printf %s=:%s:\n VAR2BSda 222\$\{a\};   printf %s=:%s:\n VAR2BSdA 222\$\{A\};   printf %s=:%s:\n VAR2BSc 222;   printf %s=:%s:\n VAR2BSsc 222; 
 VAR2BS=:222\\222:
 VAR2BSa=:222\\aaa:
 VAR2BSA=:222\\aaa:
@@ -15,6 +17,7 @@ VAR2BSdA=:222\\${A}:
 VAR2BSc=:222\\:
 VAR2BSsc=:222\\:
 var-1bsnl
+printf %s=:%s:\n VAR1BSNL 111\ 111;   printf %s=:%s:\n VAR1BSNLa 111\ aaa;   printf %s=:%s:\n VAR1BSNLA 111\ aaa;   printf %s=:%s:\n VAR1BSNLda 111\ \$\{a\};   printf %s=:%s:\n VAR1BSNLdA 111\ \$\{A\};   printf %s=:%s:\n VAR1BSNLc 111;   printf %s=:%s:\n VAR1BSNLsc 111; 
 VAR1BSNL=:111 111:
 VAR1BSNLa=:111 aaa:
 VAR1BSNLA=:111 aaa:
@@ -23,6 +26,7 @@ VAR1BSNLdA=:111 ${A}:
 VAR1BSNLc=:111:
 VAR1BSNLsc=:111:
 var-2bsnl
+printf %s=:%s:\n VAR2BSNL 222;   printf %s=:%s:\n VAR2BSNLa 222;   printf %s=:%s:\n VAR2BSNLA 222;   printf %s=:%s:\n VAR2BSNLda 222;   printf %s=:%s:\n VAR2BSNLdA 222;   printf %s=:%s:\n VAR2BSNLc 222;   printf %s=:%s:\n VAR2BSNLsc 222; 
 VAR2BSNL=:222\\:
 VAR2BSNLa=:222\\:
 VAR2BSNLA=:222\\:
@@ -31,6 +35,7 @@ VAR2BSNLdA=:222\\:
 VAR2BSNLc=:222\\:
 VAR2BSNLsc=:222\\:
 var-3bsnl
+printf %s=:%s:\n VAR3BSNL 333\ 333=;   printf %s=:%s:\n VAR3BSNLa 333\ aaa=;   printf %s=:%s:\n VAR3BSNLA 333\ aaa=;   printf %s=:%s:\n VAR3BSNLda 333\ \$\{a\}=;   printf %s=:%s:\n VAR3BSNLdA 333\ \$\{A\}=;   printf %s=:%s:\n VAR3BSNLc 333;   printf %s=:%s:\n VAR3BSNLsc 333; 
 VAR3BSNL=:333\\ 333=:
 VAR3BSNLa=:333\\ aaa=:
 VAR3BSNLA=:333\\ aaa=:
@@ -39,6 +44,7 @@ VAR3BSNLdA=:333\\ ${A}=:
 VAR3BSNLc=:333\\:
 VAR3BSNLsc=:333\\:
 var-1bsnl-space
+printf %s=:%s:\n VAR1BSNL00 first\ line;   printf %s=:%s:\n VAR1BSNL0 first\ line\ no\ space\ on\ second\ line;   printf %s=:%s:\n VAR1BSNLs first\ line\ one\ space\ on\ second\ line;   printf %s=:%s:\n VAR1BSNLss first\ line\ two\ spaces\ on\ second\ line;   printf %s=:%s:\n VAR1BSNLt first\ line\ one\ tab\ on\ second\ line;   printf %s=:%s:\n VAR1BSNLtt first\ line\ two\ tabs\ on\ second\ line;   printf %s=:%s:\n VAR1BSNLxx first\ line\ many\ spaces\ and\ tabs\ \[\ \ \	\ \]\ on\ second\ line; 
 VAR1BSNL00=:first line:
 VAR1BSNL0=:first line no space on second line:
 VAR1BSNLs=:first line one space on second line:
@@ -47,27 +53,48 @@ VAR1BSNLt=:first line one tab on second 
 VAR1BSNLtt=:first line two tabs on second line:
 VAR1BSNLxx=:first line many spaces and tabs [  	 ] on second line:
 cmd-1bsnl
+echo :'first line\
+#second line without space\
+third line':
 :first line\
 #second line without space\
 third line:
+echo :'first line\
+ second line spaces should be retained':
 :first line\
  second line spaces should be retained:
+echo :'first line\
+second line tab should be elided':
 :first line\
 second line tab should be elided:
+echo :'first line\
+	only one tab should be elided, second tab remains'
 :first line\
 	only one tab should be elided, second tab remains
 cmd-2bsnl
+echo take one\\
 take one\
+echo take two\\
 take two\
+echo take three\\
 take three\
 cmd-3bsnl
+echo :'first line\\\
+#second line without space\\\
+third line':
 :first line\\\
 #second line without space\\\
 third line:
+echo :'first line\\\
+ second line spaces should be retained':
 :first line\\\
  second line spaces should be retained:
+echo :'first line\\\
+second line tab should be elided':
 :first line\\\
 second line tab should be elided:
+echo :'first line\\\
+	only one tab 

CVS commit: src/usr.bin/make/unit-tests

2014-09-09 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Tue Sep  9 10:22:27 UTC 2014

Modified Files:
src/usr.bin/make/unit-tests: escape.exp escape.mk

Log Message:
Add a test for backslash-newline at the very end of a command script.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/escape.exp
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/escape.mk

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/unit-tests/escape.exp
diff -u src/usr.bin/make/unit-tests/escape.exp:1.6 src/usr.bin/make/unit-tests/escape.exp:1.7
--- src/usr.bin/make/unit-tests/escape.exp:1.6	Tue Sep  9 10:11:20 2014
+++ src/usr.bin/make/unit-tests/escape.exp	Tue Sep  9 10:22:27 2014
@@ -71,6 +71,10 @@ echo :'first line\
 	only one tab should be elided, second tab remains'
 :first line\
 	only one tab should be elided, second tab remains
+cmd-1bsnl-eof
+echo :'command ending with backslash-newline'; \
+
+:command ending with backslash-newline
 cmd-2bsnl
 echo take one\\
 take one\

Index: src/usr.bin/make/unit-tests/escape.mk
diff -u src/usr.bin/make/unit-tests/escape.mk:1.9 src/usr.bin/make/unit-tests/escape.mk:1.10
--- src/usr.bin/make/unit-tests/escape.mk:1.9	Tue Sep  9 10:11:20 2014
+++ src/usr.bin/make/unit-tests/escape.mk	Tue Sep  9 10:22:27 2014
@@ -1,4 +1,4 @@
-# $Id: escape.mk,v 1.9 2014/09/09 10:11:20 apb Exp $
+# $Id: escape.mk,v 1.10 2014/09/09 10:22:27 apb Exp $
 #
 # Test backslash escaping.
 
@@ -204,6 +204,17 @@ third line':
 	echo :'first line\
 		only one tab should be elided, second tab remains'
 
+# When backslash-newline appears at the end of a command script,
+# both the backslash and the newline should be passed to the shell.
+# The shell should elide the backslash-newline.
+#
+all: cmd-1bsnl-eof
+cmd-1bsnl-eof:
+	@echo ${.TARGET}
+	echo :'command ending with backslash-newline'; \
+
+# above line must be blank
+
 # Double-backslash-newline in a command.
 # Both backslashes are retained, but the newline is not escaped.
 # XXX: This may differ from POSIX, but matches gmake.



CVS commit: src/doc

2014-09-09 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Sep  9 10:34:36 UTC 2014

Modified Files:
src/doc: CHANGES.prev

Log Message:
Mention ossaudio(3) inital OSSv4 support from May.
This commit was approved by wiz@


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/doc/CHANGES.prev

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.prev
diff -u src/doc/CHANGES.prev:1.120 src/doc/CHANGES.prev:1.121
--- src/doc/CHANGES.prev:1.120	Mon Aug 11 10:28:38 2014
+++ src/doc/CHANGES.prev	Tue Sep  9 10:34:36 2014
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			$Revision: 1.120 $
+LIST OF CHANGES FROM PREVIOUS RELEASES:			$Revision: 1.121 $
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -11614,6 +11614,7 @@ Changes from NetBSD 6.0 to NetBSD 7.0:
 		install kernels. [tsutsui 20140430]
 	libc: Update to tzcode2014c. [christos 20140513]
 	zoneinfo: Import tzdata2014c. [apb 20140515]
+	ossaudio(3): Add initial OSSv4 support. [nat 20140517]
 	hythygtemp(4): Add HYT-221/271/939 humidity/temperature iic sensor
 		driver.	[kardel 20140518]
 	envsys(4): Add %rH (relative Humidity) to sensor framework. 



CVS commit: src/lib/libossaudio

2014-09-09 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Sep  9 10:45:18 UTC 2014

Modified Files:
src/lib/libossaudio: ossaudio.c soundcard.h

Log Message:
Add missing defines for 16, 24 and 32 bit NE and OE formats.
Add the ability to set 24 and 32 bit precision.

This commit was approved by wiz@


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libossaudio/ossaudio.c
cvs rdiff -u -r1.23 -r1.24 src/lib/libossaudio/soundcard.h

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

Modified files:

Index: src/lib/libossaudio/ossaudio.c
diff -u src/lib/libossaudio/ossaudio.c:1.29 src/lib/libossaudio/ossaudio.c:1.30
--- src/lib/libossaudio/ossaudio.c:1.29	Sat May 17 12:38:42 2014
+++ src/lib/libossaudio/ossaudio.c	Tue Sep  9 10:45:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ossaudio.c,v 1.29 2014/05/17 12:38:42 nat Exp $	*/
+/*	$NetBSD: ossaudio.c,v 1.30 2014/09/09 10:45:18 nat Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: ossaudio.c,v 1.29 2014/05/17 12:38:42 nat Exp $);
+__RCSID($NetBSD: ossaudio.c,v 1.30 2014/09/09 10:45:18 nat Exp $);
 
 /*
  * This is an OSS (Linux) sound API emulator.
@@ -204,6 +204,30 @@ audio_ioctl(int fd, unsigned long com, v
 			tmpinfo.play.encoding =
 			tmpinfo.record.encoding = AUDIO_ENCODING_ULINEAR_BE;
 			break;
+		case AFMT_S24_LE:
+			tmpinfo.play.precision =
+			tmpinfo.record.precision = 24;
+			tmpinfo.play.encoding =
+			tmpinfo.record.encoding = AUDIO_ENCODING_SLINEAR_LE;
+			break;
+		case AFMT_S24_BE:
+			tmpinfo.play.precision =
+			tmpinfo.record.precision = 24;
+			tmpinfo.play.encoding =
+			tmpinfo.record.encoding = AUDIO_ENCODING_SLINEAR_BE;
+			break;
+		case AFMT_S32_LE:
+			tmpinfo.play.precision =
+			tmpinfo.record.precision = 32;
+			tmpinfo.play.encoding =
+			tmpinfo.record.encoding = AUDIO_ENCODING_SLINEAR_LE;
+			break;
+		case AFMT_S32_BE:
+			tmpinfo.play.precision =
+			tmpinfo.record.precision = 32;
+			tmpinfo.play.encoding =
+			tmpinfo.record.encoding = AUDIO_ENCODING_SLINEAR_BE;
+			break;
 		case AFMT_AC3:
 			tmpinfo.play.precision =
 			tmpinfo.record.precision = 16;
@@ -227,13 +251,21 @@ audio_ioctl(int fd, unsigned long com, v
 			idat = AFMT_A_LAW;
 			break;
 		case AUDIO_ENCODING_SLINEAR_LE:
-			if (tmpinfo.play.precision == 16)
+			if (tmpinfo.play.precision == 32)
+idat = AFMT_S32_LE;
+			else if (tmpinfo.play.precision == 24)
+idat = AFMT_S24_LE;
+			else if (tmpinfo.play.precision == 16)
 idat = AFMT_S16_LE;
 			else
 idat = AFMT_S8;
 			break;
 		case AUDIO_ENCODING_SLINEAR_BE:
-			if (tmpinfo.play.precision == 16)
+			if (tmpinfo.play.precision == 32)
+idat = AFMT_S32_BE;
+			else if (tmpinfo.play.precision == 24)
+idat = AFMT_S24_BE;
+			else if (tmpinfo.play.precision == 16)
 idat = AFMT_S16_BE;
 			else
 idat = AFMT_S8;

Index: src/lib/libossaudio/soundcard.h
diff -u src/lib/libossaudio/soundcard.h:1.23 src/lib/libossaudio/soundcard.h:1.24
--- src/lib/libossaudio/soundcard.h:1.23	Sat May 17 12:38:42 2014
+++ src/lib/libossaudio/soundcard.h	Tue Sep  9 10:45:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: soundcard.h,v 1.23 2014/05/17 12:38:42 nat Exp $	*/
+/*	$NetBSD: soundcard.h,v 1.24 2014/09/09 10:45:18 nat Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -66,7 +66,6 @@
 #define	 AFMT_S24_BE			0x1000
 #define	 AFMT_S32_LE			0x2000
 #define	 AFMT_S32_BE			0x4000
-#define	 AFMT_S32_NE			0x8000
 #define SNDCTL_DSP_SAMPLESIZE		SNDCTL_DSP_SETFMT
 #define	SOUND_PCM_READ_BITS		_IOR ('P', 5, int)
 #define	SNDCTL_DSP_CHANNELS		_IOWR('P', 6, int)
@@ -113,8 +112,18 @@
 #include machine/endian_machdep.h
 #if _BYTE_ORDER == _LITTLE_ENDIAN
 #define  AFMT_S16_NE AFMT_S16_LE
+#define  AFMT_S16_OE AFMT_S16_BE
+#define  AFMT_S24_NE AFMT_S24_LE
+#define  AFMT_S24_OE AFMT_S24_BE
+#define  AFMT_S32_NE AFMT_S32_LE
+#define  AFMT_S32_OE AFMT_S32_BE
 #else
 #define  AFMT_S16_NE AFMT_S16_BE
+#define  AFMT_S16_OE AFMT_S16_LE
+#define  AFMT_S24_NE AFMT_S24_BE
+#define  AFMT_S24_OE AFMT_S24_LE
+#define  AFMT_S32_NE AFMT_S32_BE
+#define  AFMT_S32_OE AFMT_S32_LE
 #endif
 
 /* Aliases */



CVS commit: src/distrib/utils/embedded/conf

2014-09-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Sep  9 13:02:25 UTC 2014

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
turn on ntpd


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/distrib/utils/embedded/conf/evbarm.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.15 src/distrib/utils/embedded/conf/evbarm.conf:1.16
--- src/distrib/utils/embedded/conf/evbarm.conf:1.15	Mon Mar 31 17:05:03 2014
+++ src/distrib/utils/embedded/conf/evbarm.conf	Tue Sep  9 13:02:25 2014
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.15 2014/03/31 17:05:03 christos Exp $
+# $NetBSD: evbarm.conf,v 1.16 2014/09/09 13:02:25 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -122,6 +122,8 @@ rc_configured=YES
 hostname=${board}
 sshd=YES
 dhcpcd=YES
+ntpd=YES
+ntpd_flags=-g
 EOF
 	if [ ! -f ${release}/dev/MAKEDEV ]; then
 		echo ${PROG}: Missing ${release}/dev/MAKEDEV 12



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

2014-09-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Sep  9 13:56:30 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_io.c awin_var.h

Log Message:
initial A31 support


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/allwinner/awin_io.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/allwinner/awin_var.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/allwinner/awin_io.c
diff -u src/sys/arch/arm/allwinner/awin_io.c:1.12 src/sys/arch/arm/allwinner/awin_io.c:1.13
--- src/sys/arch/arm/allwinner/awin_io.c:1.12	Sun Sep  7 22:22:35 2014
+++ src/sys/arch/arm/allwinner/awin_io.c	Tue Sep  9 13:56:30 2014
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: awin_io.c,v 1.12 2014/09/07 22:22:35 jmcneill Exp $);
+__KERNEL_RCSID(1, $NetBSD: awin_io.c,v 1.13 2014/09/09 13:56:30 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -88,6 +88,7 @@ awinio_print(void *aux, const char *pnp)
 #define	AANY	0
 #define	A10	AWINIO_ONLY_A10
 #define	A20	AWINIO_ONLY_A20
+#define	A31	AWINIO_ONLY_A31
 #define	REQ	AWINIO_REQUIRED
 
 static const struct awin_locators awin_locators[] = {
@@ -123,7 +124,7 @@ static const struct awin_locators awin_l
 	{ spi, OFFANDSIZE(SPI2), 1, AWIN_IRQ_SPI2, AANY },
 	{ spi, OFFANDSIZE(SPI3), 3, AWIN_IRQ_SPI3, AANY },
 	{ awe, OFFANDSIZE(EMAC), NOPORT, AWIN_IRQ_EMAC, AANY },
-	{ awge, AWIN_GMAC_OFFSET, AWIN_GMAC_SIZE, NOPORT, AWIN_IRQ_GMAC, A20 },
+	{ awge, OFFANDSIZE(GMAC), NOPORT, AWIN_IRQ_GMAC, A20|A31 },
 	{ awincrypto, OFFANDSIZE(SS), NOPORT, AWIN_IRQ_SS, AANY },
 	{ awinac, OFFANDSIZE(AC), NOPORT, AWIN_IRQ_AC, AANY },
 };
@@ -150,6 +151,7 @@ awinio_attach(device_t parent, device_t 
 	const char *chip_name = awin_chip_name();
 	const bool a10_p = chip_id == AWIN_CHIP_ID_A10;
 	const bool a20_p = chip_id == AWIN_CHIP_ID_A20;
+	const bool a31_p = chip_id == AWIN_CHIP_ID_A31;
 	prop_dictionary_t dict = device_properties(self);
 
 	sc-sc_dev = self;
@@ -186,6 +188,8 @@ awinio_attach(device_t parent, device_t 
 continue;
 			if (a20_p  !(loc-loc_flags  AWINIO_ONLY_A20))
 continue;
+			if (a31_p  !(loc-loc_flags  AWINIO_ONLY_A31))
+continue;
 		}
 
 		struct awinio_attach_args aio = {

Index: src/sys/arch/arm/allwinner/awin_var.h
diff -u src/sys/arch/arm/allwinner/awin_var.h:1.14 src/sys/arch/arm/allwinner/awin_var.h:1.15
--- src/sys/arch/arm/allwinner/awin_var.h:1.14	Sun Sep  7 22:21:36 2014
+++ src/sys/arch/arm/allwinner/awin_var.h	Tue Sep  9 13:56:30 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_var.h,v 1.14 2014/09/07 22:21:36 jmcneill Exp $ */
+/* $NetBSD: awin_var.h,v 1.15 2014/09/09 13:56:30 jmcneill Exp $ */
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -47,6 +47,7 @@ struct awin_locators {
 	int loc_flags;
 #define	AWINIO_REQUIRED		__BIT(8)
 #define	AWINIO_ONLY		__BITS(7,0)
+#define	AWINIO_ONLY_A31		__BIT(2)
 #define	AWINIO_ONLY_A20		__BIT(1)
 #define	AWINIO_ONLY_A10		__BIT(0)
 };



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

2014-09-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Sep  9 13:57:03 UTC 2014

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

Log Message:
add motg


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/allwinner/awin_io.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_io.c
diff -u src/sys/arch/arm/allwinner/awin_io.c:1.13 src/sys/arch/arm/allwinner/awin_io.c:1.14
--- src/sys/arch/arm/allwinner/awin_io.c:1.13	Tue Sep  9 13:56:30 2014
+++ src/sys/arch/arm/allwinner/awin_io.c	Tue Sep  9 13:57:03 2014
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: awin_io.c,v 1.13 2014/09/09 13:56:30 jmcneill Exp $);
+__KERNEL_RCSID(1, $NetBSD: awin_io.c,v 1.14 2014/09/09 13:57:03 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -108,6 +108,7 @@ static const struct awin_locators awin_l
 	{ awinrtc, OFFANDSIZE(TMR), NOPORT, NOINTR, AANY },
 	{ awinusb, OFFANDSIZE(USB1), 0, NOINTR, AANY },
 	{ awinusb, OFFANDSIZE(USB2), 1, NOINTR, AANY },
+	{ motg, OFFANDSIZE(USB0), NOPORT, AWIN_IRQ_USB0, AANY },
 	{ awinmmc, OFFANDSIZE(SDMMC0), 0, AWIN_IRQ_SDMMC0, AANY },
 	{ awinmmc, OFFANDSIZE(SDMMC1), 1, AWIN_IRQ_SDMMC1, AANY },
 	{ awinmmc, OFFANDSIZE(SDMMC2), 2, AWIN_IRQ_SDMMC2, AANY },



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

2014-09-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Sep  9 15:09:16 UTC 2014

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
Update CPUID(EAX=0x0d, ECXD=1) from Intel SDM:
- XSAVEC(bit1)
- XGETBV(bit2)
- XSAVES(bit3)


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/x86/include/specialreg.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/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.78 src/sys/arch/x86/include/specialreg.h:1.79
--- src/sys/arch/x86/include/specialreg.h:1.78	Tue Feb 25 22:11:11 2014
+++ src/sys/arch/x86/include/specialreg.h	Tue Sep  9 15:09:16 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.78 2014/02/25 22:11:11 dsl Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.79 2014/09/09 15:09:16 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -355,9 +355,12 @@
  */
 
 #define	CPUID_PES1_XSAVEOPT	0x0001	/* xsaveopt instruction */
+#define	CPUID_PES1_XSAVEC	0x0002	/* xsavec  compacted XRSTOR */
+#define	CPUID_PES1_XGETBV	0x0004	/* xgetbv with ECX = 1 */
+#define	CPUID_PES1_XSAVES	0x0008	/* xsaves/xrstors, IA32_XSS */
 
 #define CPUID_PES1_FLAGS	\20 \
-	\1 XSAVEOPT
+	\1 XSAVEOPT	\2 XSAVEC	\3 XINUSE	\4 XSAVES
 
 /* Intel Fn8001 extended features - %edx */
 #define CPUID_SYSCALL	0x0800	/* SYSCALL/SYSRET */



CVS commit: src/usr.sbin/cpuctl/arch

2014-09-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Sep  9 15:14:39 UTC 2014

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
Update CPUID signature values from the latest Intel SDM.
- Core M-5xxx
- Core i7 extreme
- Future Core (0x4e)
- Future Xeon (0x56)


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/cpuctl/arch/i386.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/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.58 src/usr.sbin/cpuctl/arch/i386.c:1.59
--- src/usr.sbin/cpuctl/arch/i386.c:1.58	Fri Jul 25 14:18:49 2014
+++ src/usr.sbin/cpuctl/arch/i386.c	Tue Sep  9 15:14:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.58 2014/07/25 14:18:49 msaitoh Exp $	*/
+/*	$NetBSD: i386.c,v 1.59 2014/09/09 15:14:39 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: i386.c,v 1.58 2014/07/25 14:18:49 msaitoh Exp $);
+__RCSID($NetBSD: i386.c,v 1.59 2014/09/09 15:14:39 msaitoh Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -353,15 +353,19 @@ const struct cpu_cpuid_nameclass i386_cp
 	 Ivy Bridge,
 [0x3c] = 4th gen Core, Xeon E3-12xx v3 
 	 (Haswell),
-[0x3d] = Core M based on Broadwell,
-[0x3e] = Xeon E5/E7, Ivy Bridge-EP,
-[0x3f] = Next gen Xeon based on Haswell,
+[0x3d] = Core M-5xxx (Broadwell),
+[0x3e] = Xeon E5/E7 v2 (Ivy Bridge-E), 
+	 Core i7-49xx Extreme,
+[0x3f] = Xeon E5-2600/1600 v3 (Haswell-E), 
+	 Core i7-59xx Extreme,
 [0x45] = 4th gen Core, Xeon E3-12xx v3 
 	 (Haswell),
 [0x46] = 4th gen Core, Xeon E3-12xx v3 
 	 (Haswell),
 [0x4a] = Future Atom E3000, Z3000,
 [0x4d] = Atom C2000,
+[0x4e] = Future Core,
+[0x56] = Future Xeon,
 [0x5a] = Future Atom E3000, Z3000,
 [0x5d] = Future Atom E3000, Z3000,
 			},



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

2014-09-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Sep  9 15:11:33 UTC 2014

Modified Files:
src/sys/arch/x86/include: cacheinfo.h

Log Message:
Add new cache descriptor (0xc3) from the latest Intel SDM.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/x86/include/cacheinfo.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/x86/include/cacheinfo.h
diff -u src/sys/arch/x86/include/cacheinfo.h:1.18 src/sys/arch/x86/include/cacheinfo.h:1.19
--- src/sys/arch/x86/include/cacheinfo.h:1.18	Thu Jul  3 17:24:33 2014
+++ src/sys/arch/x86/include/cacheinfo.h	Tue Sep  9 15:11:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cacheinfo.h,v 1.18 2014/07/03 17:24:33 msaitoh Exp $	*/
+/*	$NetBSD: cacheinfo.h,v 1.19 2014/09/09 15:11:33 msaitoh Exp $	*/
 
 #ifndef _X86_CACHEINFO_H_
 #define _X86_CACHEINFO_H_
@@ -247,6 +247,7 @@ __CI_TBL(CAI_DTLB, 0xba,4, 64,  
 __CI_TBL(CAI_DTLB2,0xc0,4,  8,4 * 1024, 4K/4M: 8 entries), \
 __CI_TBL(CAI_L2_STLB2, 0xc1,8,1024,   4 * 1024, 4K/2M: 1024 entries), \
 __CI_TBL(CAI_DTLB2,0xc2,4, 16,4 * 1024, 4K/2M: 16 entries), \
+__CI_TBL(CAI_L2_STLB,  0xc3,6,1536,   4 * 1024, NULL), \
 __CI_TBL(CAI_L2_STLB,  0xca,4,512,4 * 1024, NULL), \
 __CI_TBL(CAI_ICACHE,   0x06,4,8 * 1024, 32, NULL), \
 __CI_TBL(CAI_ICACHE,   0x08,4,   16 * 1024, 32, NULL), \



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

2014-09-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Sep  9 19:23:46 UTC 2014

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

Log Message:
do BUS_DMASYNC_POSTWRITE after transfer completes


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/allwinner/awin_mmc.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_mmc.c
diff -u src/sys/arch/arm/allwinner/awin_mmc.c:1.7 src/sys/arch/arm/allwinner/awin_mmc.c:1.8
--- src/sys/arch/arm/allwinner/awin_mmc.c:1.7	Mon Sep  8 23:51:48 2014
+++ src/sys/arch/arm/allwinner/awin_mmc.c	Tue Sep  9 19:23:46 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_mmc.c,v 1.7 2014/09/08 23:51:48 jmcneill Exp $ */
+/* $NetBSD: awin_mmc.c,v 1.8 2014/09/09 19:23:46 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill jmcne...@invisible.ca
@@ -29,7 +29,7 @@
 #include locators.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: awin_mmc.c,v 1.7 2014/09/08 23:51:48 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: awin_mmc.c,v 1.8 2014/09/09 19:23:46 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -631,6 +631,13 @@ awin_mmc_dma_prepare(struct awin_mmc_sof
 }
 
 static void
+awin_mmc_dma_complete(struct awin_mmc_softc *sc)
+{
+	bus_dmamap_sync(sc-sc_dmat, sc-sc_idma_map, 0,
+	sc-sc_idma_size, BUS_DMASYNC_POSTWRITE);
+}
+
+static void
 awin_mmc_exec_command(sdmmc_chipset_handle_t sch, struct sdmmc_command *cmd)
 {
 	struct awin_mmc_softc *sc = sch;
@@ -693,6 +700,7 @@ awin_mmc_exec_command(sdmmc_chipset_hand
 			cmd-c_error = cv_timedwait(sc-sc_idst_cv,
 			sc-sc_intr_lock, hz*10);
 		}
+		awin_mmc_dma_complete(sc);
 		if (sc-sc_idma_idst  AWIN_MMC_IDST_ERROR) {
 			cmd-c_error = EIO;
 		} else if (!(sc-sc_idma_idst  AWIN_MMC_IDST_COMPLETE)) {



CVS commit: src/sys

2014-09-09 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Tue Sep  9 20:16:12 UTC 2014

Modified Files:
src/sys/net: if.c if.h route.c
src/sys/netatalk: at_control.c
src/sys/netinet: in.c
src/sys/netinet6: in6.c in6_ifattach.c mld6.c nd6_nbr.c

Log Message:
Eliminate IFAREF() and IFAFREE() macros in favour of functions.


To generate a diff of this commit:
cvs rdiff -u -r1.290 -r1.291 src/sys/net/if.c
cvs rdiff -u -r1.174 -r1.175 src/sys/net/if.h
cvs rdiff -u -r1.132 -r1.133 src/sys/net/route.c
cvs rdiff -u -r1.35 -r1.36 src/sys/netatalk/at_control.c
cvs rdiff -u -r1.147 -r1.148 src/sys/netinet/in.c
cvs rdiff -u -r1.175 -r1.176 src/sys/netinet6/in6.c
cvs rdiff -u -r1.92 -r1.93 src/sys/netinet6/in6_ifattach.c
cvs rdiff -u -r1.59 -r1.60 src/sys/netinet6/mld6.c
cvs rdiff -u -r1.100 -r1.101 src/sys/netinet6/nd6_nbr.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/if.c
diff -u src/sys/net/if.c:1.290 src/sys/net/if.c:1.291
--- src/sys/net/if.c:1.290	Sat Aug  9 05:33:01 2014
+++ src/sys/net/if.c	Tue Sep  9 20:16:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.290 2014/08/09 05:33:01 rtr Exp $	*/
+/*	$NetBSD: if.c,v 1.291 2014/09/09 20:16:12 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if.c,v 1.290 2014/08/09 05:33:01 rtr Exp $);
+__KERNEL_RCSID(0, $NetBSD: if.c,v 1.291 2014/09/09 20:16:12 rmind Exp $);
 
 #include opt_inet.h
 
@@ -362,7 +362,7 @@ if_set_sadl(struct ifnet *ifp, const voi
 	(void)sockaddr_dl_setaddr(sdl, sdl-sdl_len, lla, ifp-if_addrlen);
 	if (factory) {
 		ifp-if_hwdl = ifp-if_dl;
-		IFAREF(ifp-if_hwdl);
+		ifaref(ifp-if_hwdl);
 	}
 	/* TBD routing socket */
 }
@@ -402,9 +402,9 @@ if_sadl_setrefs(struct ifnet *ifp, struc
 {
 	const struct sockaddr_dl *sdl;
 	ifnet_addrs[ifp-if_index] = ifa;
-	IFAREF(ifa);
+	ifaref(ifa);
 	ifp-if_dl = ifa;
-	IFAREF(ifa);
+	ifaref(ifa);
 	sdl = satosdl(ifa-ifa_addr);
 	ifp-if_sadl = sdl;
 }
@@ -447,9 +447,9 @@ if_deactivate_sadl(struct ifnet *ifp)
 	ifp-if_sadl = NULL;
 
 	ifnet_addrs[ifp-if_index] = NULL;
-	IFAFREE(ifa);
+	ifafree(ifa);
 	ifp-if_dl = NULL;
-	IFAFREE(ifa);
+	ifafree(ifa);
 }
 
 void
@@ -494,7 +494,7 @@ if_free_sadl(struct ifnet *ifp)
 	ifa_remove(ifp, ifa);
 	if_deactivate_sadl(ifp);
 	if (ifp-if_hwdl == ifa) {
-		IFAFREE(ifa);
+		ifafree(ifa);
 		ifp-if_hwdl = NULL;
 	}
 	splx(s);
@@ -1101,11 +1101,28 @@ if_clone_list(struct if_clonereq *ifcr)
 }
 
 void
+ifaref(struct ifaddr *ifa)
+{
+	ifa-ifa_refcnt++;
+}
+
+void
+ifafree(struct ifaddr *ifa)
+{
+	KASSERT(ifa != NULL);
+	KASSERT(ifa-ifa_refcnt  0);
+
+	if (--ifa-ifa_refcnt == 0) {
+		free(ifa, M_IFADDR);
+	}
+}
+
+void
 ifa_insert(struct ifnet *ifp, struct ifaddr *ifa)
 {
 	ifa-ifa_ifp = ifp;
 	TAILQ_INSERT_TAIL(ifp-if_addrlist, ifa, ifa_list);
-	IFAREF(ifa);
+	ifaref(ifa);
 }
 
 void
@@ -1113,7 +1130,7 @@ ifa_remove(struct ifnet *ifp, struct ifa
 {
 	KASSERT(ifa-ifa_ifp == ifp);
 	TAILQ_REMOVE(ifp-if_addrlist, ifa, ifa_list);
-	IFAFREE(ifa);
+	ifafree(ifa);
 }
 
 static inline int

Index: src/sys/net/if.h
diff -u src/sys/net/if.h:1.174 src/sys/net/if.h:1.175
--- src/sys/net/if.h:1.174	Thu Jul 31 06:35:47 2014
+++ src/sys/net/if.h	Tue Sep  9 20:16:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.h,v 1.174 2014/07/31 06:35:47 ozaki-r Exp $	*/
+/*	$NetBSD: if.h,v 1.175 2014/09/09 20:16:12 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -718,44 +718,6 @@ struct if_addrprefreq {
 #endif /* _NETBSD_SOURCE */
 
 #ifdef _KERNEL
-#ifdef IFAREF_DEBUG
-#define	IFAREF(ifa)			\
-do {	\
-	printf(IFAREF: %s:%d %p - %d\n, __FILE__, __LINE__,		\
-	(ifa), ++(ifa)-ifa_refcnt);\
-} while (/*CONSTCOND*/ 0)
-
-#define	IFAFREE(ifa)			\
-do {	\
-	if ((ifa)-ifa_refcnt = 0)	\
-		panic(%s:%d: %p ifa_refcnt = 0, __FILE__,		\
-		__LINE__, (ifa));	\
-	printf(IFAFREE: %s:%d %p - %d\n, __FILE__, __LINE__,		\
-	(ifa), --(ifa)-ifa_refcnt);\
-	if ((ifa)-ifa_refcnt == 0)	\
-		ifafree(ifa);		\
-} while (/*CONSTCOND*/ 0)
-#else
-#define	IFAREF(ifa)	(ifa)-ifa_refcnt++
-
-#ifdef DIAGNOSTIC
-#define	IFAFREE(ifa)			\
-do {	\
-	if ((ifa)-ifa_refcnt = 0)	\
-		panic(%s:%d: %p ifa_refcnt = 0, __FILE__,		\
-		__LINE__, (ifa));	\
-	if (--(ifa)-ifa_refcnt == 0)	\
-		ifafree(ifa);		\
-} while (/*CONSTCOND*/ 0)
-#else
-#define	IFAFREE(ifa)			\
-do {	\
-	if (--(ifa)-ifa_refcnt == 0)	\
-		ifafree(ifa);		\
-} while (/*CONSTCOND*/ 0)
-#endif /* DIAGNOSTIC */
-#endif /* IFAREF_DEBUG */
-
 #ifdef ALTQ
 #define	ALTQ_DECL(x)		x
 #define ALTQ_COMMA		,
@@ -922,6 +884,9 @@ int	if_flags_set(struct ifnet *, const s
 void ifa_insert(struct ifnet *, struct ifaddr *);
 void ifa_remove(struct ifnet *, struct ifaddr *);
 
+void	ifaref(struct ifaddr *);
+void	ifafree(struct 

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

2014-09-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Sep  9 20:39:52 UTC 2014

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

Log Message:
if dma property is set to false, fallback to pio mode


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/allwinner/awin_mmc.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_mmc.c
diff -u src/sys/arch/arm/allwinner/awin_mmc.c:1.8 src/sys/arch/arm/allwinner/awin_mmc.c:1.9
--- src/sys/arch/arm/allwinner/awin_mmc.c:1.8	Tue Sep  9 19:23:46 2014
+++ src/sys/arch/arm/allwinner/awin_mmc.c	Tue Sep  9 20:39:52 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_mmc.c,v 1.8 2014/09/09 19:23:46 jmcneill Exp $ */
+/* $NetBSD: awin_mmc.c,v 1.9 2014/09/09 20:39:52 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill jmcne...@invisible.ca
@@ -29,7 +29,7 @@
 #include locators.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: awin_mmc.c,v 1.8 2014/09/09 19:23:46 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: awin_mmc.c,v 1.9 2014/09/09 20:39:52 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -89,6 +89,8 @@ struct awin_mmc_softc {
 	bus_space_handle_t sc_bsh;
 	bus_dma_tag_t sc_dmat;
 
+	bool sc_use_dma;
+
 	void *sc_ih;
 	kmutex_t sc_intr_lock;
 	kcondvar_t sc_intr_cv;
@@ -236,8 +238,11 @@ awin_mmc_attach(device_t parent, device_
 	bus_space_subregion(sc-sc_bst, aio-aio_core_bsh,
 	loc-loc_offset, loc-loc_size, sc-sc_bsh);
 
+	sc-sc_use_dma = true;
+	prop_dictionary_get_bool(cfg, dma, sc-sc_use_dma);
+
 	aprint_naive(\n);
-	aprint_normal(: SD/MMC interface\n);
+	aprint_normal(: SD3.0 (%s)\n, sc-sc_use_dma ? DMA : PIO);
 
 	awin_mmc_probe_clocks(sc, aio);
 
@@ -266,9 +271,11 @@ awin_mmc_attach(device_t parent, device_
 		}
 	}
 
-	if (awin_mmc_idma_setup(sc) != 0) {
-		aprint_error_dev(self, failed to setup DMA\n);
-		return;
+	if (sc-sc_use_dma) {
+		if (awin_mmc_idma_setup(sc) != 0) {
+			aprint_error_dev(self, failed to setup DMA\n);
+			return;
+		}
 	}
 
 	sc-sc_ih = intr_establish(loc-loc_intr, IPL_BIO, IST_LEVEL,
@@ -296,16 +303,18 @@ awin_mmc_attach_i(device_t self)
 	saa.saa_busname = sdmmc;
 	saa.saa_sct = awin_mmc_chip_functions;
 	saa.saa_sch = sc;
-	saa.saa_dmat = sc-sc_dmat;
 	saa.saa_clkmin = 400;
 	saa.saa_clkmax = 5;
 	saa.saa_caps = SMC_CAPS_4BIT_MODE|
 		   SMC_CAPS_8BIT_MODE|
 		   SMC_CAPS_SD_HIGHSPEED|
 		   SMC_CAPS_MMC_HIGHSPEED|
-		   SMC_CAPS_AUTO_STOP|
-		   SMC_CAPS_DMA|
-		   SMC_CAPS_MULTI_SEG_DMA;
+		   SMC_CAPS_AUTO_STOP;
+	if (sc-sc_use_dma) {
+		saa.saa_dmat = sc-sc_dmat;
+		saa.saa_caps |= SMC_CAPS_DMA|
+SMC_CAPS_MULTI_SEG_DMA;
+	}
 	if (sc-sc_has_gpio_detect) {
 		saa.saa_caps |= SMC_CAPS_POLL_CARD_DET;
 	}
@@ -410,9 +419,7 @@ awin_mmc_host_ocr(sdmmc_chipset_handle_t
 static int
 awin_mmc_host_maxblklen(sdmmc_chipset_handle_t sch)
 {
-	struct awin_mmc_softc *sc = sch;
-
-	return sc-sc_idma_xferlen;
+	return 8192;
 }
 
 static int
@@ -553,6 +560,43 @@ awin_mmc_bus_rod(sdmmc_chipset_handle_t 
 	return -1;
 }
 
+
+static int
+awin_mmc_pio_wait(struct awin_mmc_softc *sc, struct sdmmc_command *cmd)
+{
+	int retry = 0xf;
+	uint32_t bit = (cmd-c_flags  SCF_CMD_READ) ?
+	AWIN_MMC_STATUS_FIFO_EMPTY : AWIN_MMC_STATUS_FIFO_FULL;
+
+	while (--retry  0) {
+		uint32_t status = MMC_READ(sc, AWIN_MMC_STATUS);
+		if (!(status  bit))
+			return 0;
+		delay(10);
+	}
+
+	return ETIMEDOUT;
+}
+
+static int
+awin_mmc_pio_transfer(struct awin_mmc_softc *sc, struct sdmmc_command *cmd)
+{
+	uint32_t *datap = (uint32_t *)cmd-c_data;
+	int i;
+
+	for (i = 0; i  (cmd-c_resid  2); i++) {
+		if (awin_mmc_pio_wait(sc, cmd))
+			return ETIMEDOUT;
+		if (cmd-c_flags  SCF_CMD_READ) {
+			datap[i] = MMC_READ(sc, AWIN_MMC_FIFO);
+		} else {
+			MMC_WRITE(sc, AWIN_MMC_FIFO, datap[i]);
+		}
+	}
+
+	return 0;
+}
+
 static int
 awin_mmc_dma_prepare(struct awin_mmc_softc *sc, struct sdmmc_command *cmd)
 {
@@ -693,18 +737,25 @@ awin_mmc_exec_command(sdmmc_chipset_hand
 		MMC_WRITE(sc, AWIN_MMC_CMD, cmdval | cmd-c_opcode);
 	} else {
 		cmd-c_resid = cmd-c_datalen;
-		cmd-c_error = awin_mmc_dma_prepare(sc, cmd);
 		awin_mmc_led(sc, 0);
-		MMC_WRITE(sc, AWIN_MMC_CMD, cmdval | cmd-c_opcode);
-		if (cmd-c_error == 0) {
-			cmd-c_error = cv_timedwait(sc-sc_idst_cv,
-			sc-sc_intr_lock, hz*10);
-		}
-		awin_mmc_dma_complete(sc);
-		if (sc-sc_idma_idst  AWIN_MMC_IDST_ERROR) {
-			cmd-c_error = EIO;
-		} else if (!(sc-sc_idma_idst  AWIN_MMC_IDST_COMPLETE)) {
-			cmd-c_error = ETIMEDOUT;
+		if (sc-sc_use_dma) {
+			cmd-c_error = awin_mmc_dma_prepare(sc, cmd);
+			MMC_WRITE(sc, AWIN_MMC_CMD, cmdval | cmd-c_opcode);
+			if (cmd-c_error == 0) {
+cmd-c_error = cv_timedwait(sc-sc_idst_cv,
+sc-sc_intr_lock, hz*10);
+			}
+			awin_mmc_dma_complete(sc);
+			if (sc-sc_idma_idst  AWIN_MMC_IDST_ERROR) {
+cmd-c_error = EIO;
+			} else if 

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

2014-09-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Sep  9 21:04:05 UTC 2014

Modified Files:
src/sys/arch/evbarm/awin: awin_machdep.c

Log Message:
disable dma on cubietruck for now


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/awin/awin_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/evbarm/awin/awin_machdep.c
diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.5 src/sys/arch/evbarm/awin/awin_machdep.c:1.6
--- src/sys/arch/evbarm/awin/awin_machdep.c:1.5	Tue Sep  9 02:43:19 2014
+++ src/sys/arch/evbarm/awin/awin_machdep.c	Tue Sep  9 21:04:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: awin_machdep.c,v 1.5 2014/09/09 02:43:19 jmcneill Exp $ */
+/*	$NetBSD: awin_machdep.c,v 1.6 2014/09/09 21:04:05 jmcneill Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: awin_machdep.c,v 1.5 2014/09/09 02:43:19 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: awin_machdep.c,v 1.6 2014/09/09 21:04:05 jmcneill Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -660,6 +660,8 @@ awin_device_register(device_t self, void
 			prop_dictionary_set_cstring(dict,
 			led-gpio, status-led2);
 		}
+		if (cubietruck_p)
+			prop_dictionary_set_bool(dict, dma, false);
 		return;
 	}
 



CVS commit: src/sys/arch

2014-09-09 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Sep  9 21:21:22 UTC 2014

Modified Files:
src/sys/arch/arm/samsung: exynos_gpio.c
src/sys/arch/evbarm/odroid: odroid_machdep.c

Log Message:
Xuhost bits for Exynos5 are located in the two top bits


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/samsung/exynos_gpio.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbarm/odroid/odroid_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/arm/samsung/exynos_gpio.c
diff -u src/sys/arch/arm/samsung/exynos_gpio.c:1.9 src/sys/arch/arm/samsung/exynos_gpio.c:1.10
--- src/sys/arch/arm/samsung/exynos_gpio.c:1.9	Fri Sep  5 08:01:05 2014
+++ src/sys/arch/arm/samsung/exynos_gpio.c	Tue Sep  9 21:21:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: exynos_gpio.c,v 1.9 2014/09/05 08:01:05 skrll Exp $	*/
+/*	$NetBSD: exynos_gpio.c,v 1.10 2014/09/09 21:21:22 reinoud Exp $	*/
 
 /*-
 * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #include gpio.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(1, $NetBSD: exynos_gpio.c,v 1.9 2014/09/05 08:01:05 skrll Exp $);
+__KERNEL_RCSID(1, $NetBSD: exynos_gpio.c,v 1.10 2014/09/09 21:21:22 reinoud Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -170,7 +170,7 @@ static struct exynos_gpio_pin_group exyn
 	GPIO_GRP(4, RIGHT, 0x01C0, GPY5, 8),
 	GPIO_GRP(4, RIGHT, 0x01E0, GPY6, 8),
 	GPIO_GRP(4, RIGHT, 0x0200, ETC0, 6),
-	GPIO_GRP(4, RIGHT, 0x0220, ETC6, 7),
+	GPIO_GRP(4, RIGHT, 0x0220, ETC6, 8),
 	GPIO_GRP(4, RIGHT, 0x0260, GPM0, 8),
 	GPIO_GRP(4, RIGHT, 0x0280, GPM1, 7),
 	GPIO_GRP(4, RIGHT, 0x02A0, GPM2, 5),

Index: src/sys/arch/evbarm/odroid/odroid_machdep.c
diff -u src/sys/arch/evbarm/odroid/odroid_machdep.c:1.32 src/sys/arch/evbarm/odroid/odroid_machdep.c:1.33
--- src/sys/arch/evbarm/odroid/odroid_machdep.c:1.32	Wed Sep  3 15:24:52 2014
+++ src/sys/arch/evbarm/odroid/odroid_machdep.c	Tue Sep  9 21:21:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: odroid_machdep.c,v 1.32 2014/09/03 15:24:52 reinoud Exp $ */
+/*	$NetBSD: odroid_machdep.c,v 1.33 2014/09/09 21:21:22 reinoud Exp $ */
 
 /*
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: odroid_machdep.c,v 1.32 2014/09/03 15:24:52 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: odroid_machdep.c,v 1.33 2014/09/09 21:21:22 reinoud Exp $);
 
 #include opt_evbarm_boardtype.h
 #include opt_exynos.h
@@ -450,7 +450,7 @@ consinit(void)
 	bus_space_handle_t bsh = EXYNOS_IOPHYSTOVIRT(iobase);
 	u_int i;
 	/*	
-	 * No need to guess at the UART frequency since we can caclulate it.
+	 * No need to guess at the UART frequency since we can calculate it.
 	 */
 	uint32_t freq = conspeed
 	   * (16 * (bus_space_read_4(bst, bsh, SSCOM_UBRDIV) + 1)
@@ -564,8 +564,8 @@ odroid_exynos4_gpio_ncs(device_t self, p
 	prop_dictionary_set_uint32(dict, nc-GPY5, 0xff - 0b);
 	prop_dictionary_set_uint32(dict, nc-GPY6, 0xff - 0b);
 	prop_dictionary_set_uint32(dict, nc-ETC0, 0x3f - 0b);
-	/* standard Xuhost bits at pin 5,6 */
-	prop_dictionary_set_uint32(dict, nc-ETC6, 0x7f - 0b0110);
+	/* standard Xuhost bits at pin 6,7 */
+	prop_dictionary_set_uint32(dict, nc-ETC6, 0xff - 0b1100);
 	prop_dictionary_set_uint32(dict, nc-GPM0, 0xff - 0b);
 	prop_dictionary_set_uint32(dict, nc-GPM1, 0x7f - 0b);
 	prop_dictionary_set_uint32(dict, nc-GPM2, 0x1f - 0b);



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

2014-09-09 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Sep  9 21:22:48 UTC 2014

Modified Files:
src/sys/arch/arm/samsung: exynos5_reg.h

Log Message:
Remove extra line


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/samsung/exynos5_reg.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/samsung/exynos5_reg.h
diff -u src/sys/arch/arm/samsung/exynos5_reg.h:1.14 src/sys/arch/arm/samsung/exynos5_reg.h:1.15
--- src/sys/arch/arm/samsung/exynos5_reg.h:1.14	Thu Sep  4 13:06:49 2014
+++ src/sys/arch/arm/samsung/exynos5_reg.h	Tue Sep  9 21:22:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: exynos5_reg.h,v 1.14 2014/09/04 13:06:49 reinoud Exp $	*/
+/*	$NetBSD: exynos5_reg.h,v 1.15 2014/09/09 21:22:48 reinoud Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -425,5 +425,4 @@
 #define   OTG_SYS_LINK_SWRST_UOTG	__BIT(13)
 #define   OTG_SYS_PHYLINK_SWRST		__BIT(14)
 
-
 #endif /* _ARM_SAMSUNG_EXYNOS5_REG_H_ */



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

2014-09-09 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Sep  9 21:24:10 UTC 2014

Modified Files:
src/sys/arch/arm/samsung: exynos_reg.h

Log Message:
Add usb20 phy host link enable
insert extra space


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/samsung/exynos_reg.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/samsung/exynos_reg.h
diff -u src/sys/arch/arm/samsung/exynos_reg.h:1.10 src/sys/arch/arm/samsung/exynos_reg.h:1.11
--- src/sys/arch/arm/samsung/exynos_reg.h:1.10	Fri Sep  5 08:01:05 2014
+++ src/sys/arch/arm/samsung/exynos_reg.h	Tue Sep  9 21:24:10 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: exynos_reg.h,v 1.10 2014/09/05 08:01:05 skrll Exp $	*/
+/*	$NetBSD: exynos_reg.h,v 1.11 2014/09/09 21:24:10 reinoud Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -179,12 +179,13 @@
 #define EXYNOS_PMU_USB_HSIC_1_PHY_CTRL	0x708
 #define EXYNOS_PMU_USB_HSIC_2_PHY_CTRL	0x70C
 
-#define PMU_PHY_ENABLE			(1 0)
+#define PMU_PHY_ENABLE			(1  0)
 #define PMU_PHY_DISABLE			(0)
 
 
 /* used SYSREG registers */
 #define EXYNOS5_SYSREG_USB20_PHY_TYPE	0x230
+#define   USB20_PHY_HOST_LINK_EN	(1  0)
 
 
 /* Generic USB registers/constants */



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

2014-09-09 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Sep  9 21:26:47 UTC 2014

Modified Files:
src/sys/arch/arm/samsung: exynos_usb.c

Log Message:
Implement the XuhostPWREN/XuhostOVERCUR register selection
Update the usb2 isolation. It ought to work for Exynos5 too.

Only issue now is ohci not working


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/samsung/exynos_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/samsung/exynos_usb.c
diff -u src/sys/arch/arm/samsung/exynos_usb.c:1.8 src/sys/arch/arm/samsung/exynos_usb.c:1.9
--- src/sys/arch/arm/samsung/exynos_usb.c:1.8	Thu Sep  4 13:18:28 2014
+++ src/sys/arch/arm/samsung/exynos_usb.c	Tue Sep  9 21:26:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: exynos_usb.c,v 1.8 2014/09/04 13:18:28 reinoud Exp $	*/
+/*	$NetBSD: exynos_usb.c,v 1.9 2014/09/09 21:26:47 reinoud Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: exynos_usb.c,v 1.8 2014/09/04 13:18:28 reinoud Exp $);
+__KERNEL_RCSID(1, $NetBSD: exynos_usb.c,v 1.9 2014/09/09 21:26:47 reinoud Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -78,6 +78,7 @@ struct exynos_usb_softc {
 	bus_space_handle_t sc_ohci_bsh;
 	bus_space_handle_t sc_usb2phy_bsh;
 
+	bus_space_handle_t sc_sysregs_bsh;
 	bus_space_handle_t sc_pmuregs_bsh;
 
 	device_t	 sc_ohci_dev;
@@ -92,11 +93,22 @@ struct exynos_usb_attach_args {
 };
 
 
-static struct exynos_gpio_pinset uhost_pwr_pinset = {
+#ifdef EXYNOS4
+static struct exynos_gpio_pinset e4_uhost_pwr_pinset = {
+	.pinset_group = ETC6,
+	.pinset_func  = 0,
+	.pinset_mask  = __BIT(6) | __BIT(7),
+};
+#endif
+
+
+#ifdef EXYNOS5
+static struct exynos_gpio_pinset e5_uhost_pwr_pinset = {
 	.pinset_group = ETC6,
 	.pinset_func  = 0,
 	.pinset_mask  = __BIT(5) | __BIT(6),
 };
+#endif
 
 
 static int exynos_usb_intr(void *arg);
@@ -129,7 +141,8 @@ exynos_usb_attach(device_t parent, devic
 	struct exyo_locators *loc = exyoaa-exyo_loc;
 	struct exynos_gpio_pindata XuhostOVERCUR;
 	struct exynos_gpio_pindata XuhostPWREN;
-	bus_size_t ehci_offset, ohci_offset, usb2phy_offset, pmu_offset;
+	bus_size_t ehci_offset, ohci_offset, usb2phy_offset;
+	bus_size_t pmu_offset, sysreg_offset;
 
 	/* no locators expected */
 	KASSERT(loc-loc_port == EXYOCF_PORT_DEFAULT);
@@ -149,6 +162,7 @@ exynos_usb_attach(device_t parent, devic
 		ehci_offset= EXYNOS4_USB2_HOST_EHCI_OFFSET;
 		ohci_offset= EXYNOS4_USB2_HOST_OHCI_OFFSET;
 		usb2phy_offset = EXYNOS4_USB2_HOST_PHYCTRL_OFFSET;
+		sysreg_offset  = EXYNOS4_SYSREG_OFFSET;
 		pmu_offset = EXYNOS4_PMU_OFFSET;
 	}
 #endif
@@ -157,6 +171,7 @@ exynos_usb_attach(device_t parent, devic
 		ehci_offset= EXYNOS5_USB2_HOST_EHCI_OFFSET;
 		ohci_offset= EXYNOS5_USB2_HOST_OHCI_OFFSET;
 		usb2phy_offset = EXYNOS5_USB2_HOST_PHYCTRL_OFFSET;
+		sysreg_offset  = EXYNOS5_SYSREG_OFFSET;
 		pmu_offset = EXYNOS5_PMU_OFFSET;
 	}
 #endif
@@ -173,22 +188,39 @@ exynos_usb_attach(device_t parent, devic
 		sc-sc_usb2phy_bsh);
 
 	bus_space_subregion(sc-sc_bst, exyoaa-exyo_core_bsh,
+		sysreg_offset, EXYNOS_BLOCK_SIZE,
+		sc-sc_sysregs_bsh);
+	bus_space_subregion(sc-sc_bst, exyoaa-exyo_core_bsh,
 		pmu_offset, EXYNOS_BLOCK_SIZE,
 		sc-sc_pmuregs_bsh);
 
 	aprint_naive(\n);
 	aprint_normal(\n);
 
-	/* power up USB subsystem XXX PWREN not working yet */
-	exynos_gpio_pinset_acquire(uhost_pwr_pinset);
-	exynos_gpio_pinset_to_pindata(uhost_pwr_pinset, 5, XuhostPWREN);
-	exynos_gpio_pinset_to_pindata(uhost_pwr_pinset, 6, XuhostOVERCUR);
+	/* power up USB subsystem */
+#ifdef EXYNOS4
+	if (IS_EXYNOS4_P()) {
+		exynos_gpio_pinset_acquire(e4_uhost_pwr_pinset);
+		exynos_gpio_pinset_to_pindata(e4_uhost_pwr_pinset, 6, XuhostPWREN);
+		exynos_gpio_pinset_to_pindata(e4_uhost_pwr_pinset, 7, XuhostOVERCUR);
+	}
+#endif
+#ifdef EXYNOS5
+	if (IS_EXYNOS5_P()) {
+		exynos_gpio_pinset_acquire(e5_uhost_pwr_pinset);
+		exynos_gpio_pinset_to_pindata(e5_uhost_pwr_pinset, 5, XuhostPWREN);
+		exynos_gpio_pinset_to_pindata(e5_uhost_pwr_pinset, 6, XuhostOVERCUR);
+	}
+#endif
 
 	/* enable power and set Xuhost OVERCUR to inactive by pulling it up */
 	exynos_gpio_pindata_ctl(XuhostPWREN, GPIO_PIN_PULLUP);
 	exynos_gpio_pindata_ctl(XuhostOVERCUR, GPIO_PIN_PULLUP);
 	DELAY(8);
 
+	/* init USB phys */
+	exynos_usb_phy_init(sc);
+
 	/*
 	 * Disable interrupts
 	 */
@@ -203,9 +235,6 @@ exynos_usb_attach(device_t parent, devic
 	caplength + EHCI_USBINTR, 0);
 #endif
 
-	/* init USB phys */
-	exynos_usb_phy_init(sc);
-
 	/* claim shared interrupt for OHCI/EHCI */
 	sc-sc_intrh = intr_establish(sc-sc_irq,
 		IPL_USB, IST_LEVEL, exynos_usb_intr, sc);
@@ -375,25 +404,37 @@ exynos_ehci_attach(device_t parent, devi
  * USB Phy init
  */
 
+/* XXX 5422 not handled since its unknown how it handles this XXX*/
 static void
 exynos_usb2_set_isolation(struct 

CVS commit: src/sys/dev/i2c

2014-09-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Sep  9 22:44:32 UTC 2014

Modified Files:
src/sys/dev/i2c: files.i2c gttwsireg.h

Log Message:
AllWinner implementation uses a different register layout, select it with 
options GTTWSI_ALLWINNER


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/gttwsireg.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/i2c/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.54 src/sys/dev/i2c/files.i2c:1.55
--- src/sys/dev/i2c/files.i2c:1.54	Sun May 18 11:46:23 2014
+++ src/sys/dev/i2c/files.i2c	Tue Sep  9 22:44:32 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.54 2014/05/18 11:46:23 kardel Exp $
+#	$NetBSD: files.i2c,v 1.55 2014/09/09 22:44:32 jmcneill Exp $
 
 obsolete defflag	opt_i2cbus.h		I2C_SCAN
 define	i2cbus { }
@@ -54,6 +54,7 @@ define	motoi2c
 file	dev/i2c/motoi2c.c			motoi2c
 define	mvi2c
 file	dev/i2c/gttwsi_core.c			mvi2c
+defflag opt_gttwsi.hGTTWSI_ALLWINNER
 
 #
 # I2C client devices

Index: src/sys/dev/i2c/gttwsireg.h
diff -u src/sys/dev/i2c/gttwsireg.h:1.1 src/sys/dev/i2c/gttwsireg.h:1.2
--- src/sys/dev/i2c/gttwsireg.h:1.1	Fri Sep  6 00:56:12 2013
+++ src/sys/dev/i2c/gttwsireg.h	Tue Sep  9 22:44:32 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: gttwsireg.h,v 1.1 2013/09/06 00:56:12 matt Exp $ */
+/* $NetBSD: gttwsireg.h,v 1.2 2014/09/09 22:44:32 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2008 Eiji Kawauchi.
@@ -27,8 +27,19 @@
 #ifndef _GTTWSIREG_H_
 #define _GTTWSIREG_H_
 
+#include opt_gttwsi.h
+
 #define GTTWSI_SIZE		0x100
 
+#if defined(GTTWSI_ALLWINNER)
+#define TWSI_SLAVEADDR		0x00
+#define TWSI_EXTEND_SLAVEADDR	0x04
+#define TWSI_DATA		0x08
+#define TWSI_CONTROL		0x0c
+#define TWSI_STATUS		0x10
+#define TWSI_BAUDRATE		0x14
+#define TWSI_SOFTRESET		0x1c
+#else
 #define	TWSI_SLAVEADDR		0x00
 #define	TWSI_EXTEND_SLAVEADDR	0x10
 #define	TWSI_DATA		0x04
@@ -36,6 +47,7 @@
 #define	TWSI_STATUS		0x0c	/* for read */
 #define	TWSI_BAUDRATE		0x0c	/* for write */
 #define	TWSI_SOFTRESET		0x1c
+#endif
 
 #define	SLAVEADDR_GCE_MASK	0x01
 #define	SLAVEADDR_SADDR_MASK	0xfe



CVS commit: src/sys/dev/i2c

2014-09-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Sep  9 22:47:33 UTC 2014

Modified Files:
src/sys/dev/i2c: files.i2c
Added Files:
src/sys/dev/i2c: axp20x.c

Log Message:
AXP20x Power Management Unit driver, pretty basic at the moment -- only acts as 
a temperature sensor


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/axp20x.c
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/i2c/files.i2c

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

Modified files:

Index: src/sys/dev/i2c/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.55 src/sys/dev/i2c/files.i2c:1.56
--- src/sys/dev/i2c/files.i2c:1.55	Tue Sep  9 22:44:32 2014
+++ src/sys/dev/i2c/files.i2c	Tue Sep  9 22:47:33 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.55 2014/09/09 22:44:32 jmcneill Exp $
+#	$NetBSD: files.i2c,v 1.56 2014/09/09 22:47:33 jmcneill Exp $
 
 obsolete defflag	opt_i2cbus.h		I2C_SCAN
 define	i2cbus { }
@@ -215,3 +215,7 @@ device  mpl115a: sysmon_envsys
 attach  mpl115a at iic
 filedev/i2c/mpl115a.c		mpl115a
 
+# AXP20x Power Management Unit
+device	axp20x: sysmon_envsys
+attach	axp20x at iic
+file	dev/i2c/axp20x.c			axp20x

Added files:

Index: src/sys/dev/i2c/axp20x.c
diff -u /dev/null src/sys/dev/i2c/axp20x.c:1.1
--- /dev/null	Tue Sep  9 22:47:34 2014
+++ src/sys/dev/i2c/axp20x.c	Tue Sep  9 22:47:33 2014
@@ -0,0 +1,123 @@
+/* $NetBSD: axp20x.c,v 1.1 2014/09/09 22:47:33 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2014 Jared D. McNeill jmcne...@invisible.ca
+ * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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 sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: axp20x.c,v 1.1 2014/09/09 22:47:33 jmcneill Exp $);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/device.h
+#include sys/conf.h
+#include sys/bus.h
+#include sys/kmem.h
+
+#include dev/i2c/i2cvar.h
+
+#include dev/sysmon/sysmonvar.h
+
+#define AXP_TEMP_MON_REG	0x5e	/* 2 bytes */
+
+struct axp20x_softc {
+	device_t	sc_dev;
+	i2c_tag_t	sc_i2c;
+	i2c_addr_t	sc_addr;
+
+	struct sysmon_envsys *sc_sme;
+	envsys_data_t	sc_sensor_temp;
+};
+
+static int	axp20x_match(device_t, cfdata_t, void *);
+static void	axp20x_attach(device_t, device_t, void *);
+
+static void	axp20x_sensors_refresh(struct sysmon_envsys *, envsys_data_t *);
+static int	axp20x_read(struct axp20x_softc *, uint8_t, uint8_t *, size_t);
+
+CFATTACH_DECL_NEW(axp20x, sizeof(struct axp20x_softc),
+axp20x_match, axp20x_attach, NULL, NULL);
+
+static int
+axp20x_match(device_t parent, cfdata_t match, void *aux)
+{
+	return 1;
+}
+
+static void
+axp20x_attach(device_t parent, device_t self, void *aux)
+{
+	struct axp20x_softc *sc = device_private(self);
+	struct i2c_attach_args *ia = aux;
+
+	sc-sc_dev = self;
+	sc-sc_i2c = ia-ia_tag;
+	sc-sc_addr = ia-ia_addr;
+
+	aprint_naive(\n);
+	aprint_normal(\n);
+
+	sc-sc_sme = sysmon_envsys_create();
+	sc-sc_sme-sme_name = device_xname(self);
+	sc-sc_sme-sme_cookie = sc;
+	sc-sc_sme-sme_refresh = axp20x_sensors_refresh;
+
+	sc-sc_sensor_temp.units = ENVSYS_STEMP;
+	sc-sc_sensor_temp.state = ENVSYS_SINVALID;
+	sc-sc_sensor_temp.flags = ENVSYS_FHAS_ENTROPY;
+	snprintf(sc-sc_sensor_temp.desc, sizeof(sc-sc_sensor_temp),
+	internal temperature);
+	sysmon_envsys_sensor_attach(sc-sc_sme, sc-sc_sensor_temp);
+
+	sysmon_envsys_register(sc-sc_sme);
+}
+
+static void
+axp20x_sensors_refresh(struct sysmon_envsys *sme, envsys_data_t *edata)
+{
+	struct axp20x_softc *sc = sme-sme_cookie;
+	uint8_t buf[2];
+	int error;
+
+	iic_acquire_bus(sc-sc_i2c, 0);
+	error = axp20x_read(sc, AXP_TEMP_MON_REG, buf, sizeof(buf));
+	iic_release_bus(sc-sc_i2c, 0);
+
+	if (error) {
+		edata-state = 

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

2014-09-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Sep  9 22:49:20 UTC 2014

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

Log Message:
add axp20x


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 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.24 src/sys/arch/evbarm/conf/CUBIEBOARD:1.25
--- src/sys/arch/evbarm/conf/CUBIEBOARD:1.24	Tue Sep  9 00:16:03 2014
+++ src/sys/arch/evbarm/conf/CUBIEBOARD	Tue Sep  9 22:49:20 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: CUBIEBOARD,v 1.24 2014/09/09 00:16:03 jmcneill Exp $
+#	$NetBSD: CUBIEBOARD,v 1.25 2014/09/09 22:49:20 jmcneill Exp $
 #
 #	CUBIEBOARD -- Allwinner A10/A20 Eval Board Kernel
 #
@@ -226,6 +226,7 @@ gpio*		at awingpio?
 awiniic0	at awinio? port 0
 #awiniic*	at awinio? port ?
 iic*		at awiniic?
+axp20x0 	at iic0 addr 0x34	# AXP209 Power Management Unit
 
 # On-board 16550 UARTs
 com0		at awinio? port 0			# UART0 (console)



CVS commit: src/sys/dev/i2c

2014-09-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Sep  9 23:39:16 UTC 2014

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

Log Message:
fix a sizeof typo


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/axp20x.c

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

Modified files:

Index: src/sys/dev/i2c/axp20x.c
diff -u src/sys/dev/i2c/axp20x.c:1.1 src/sys/dev/i2c/axp20x.c:1.2
--- src/sys/dev/i2c/axp20x.c:1.1	Tue Sep  9 22:47:33 2014
+++ src/sys/dev/i2c/axp20x.c	Tue Sep  9 23:39:16 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: axp20x.c,v 1.1 2014/09/09 22:47:33 jmcneill Exp $ */
+/* $NetBSD: axp20x.c,v 1.2 2014/09/09 23:39:16 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill jmcne...@invisible.ca
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: axp20x.c,v 1.1 2014/09/09 22:47:33 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: axp20x.c,v 1.2 2014/09/09 23:39:16 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -87,7 +87,7 @@ axp20x_attach(device_t parent, device_t 
 	sc-sc_sensor_temp.units = ENVSYS_STEMP;
 	sc-sc_sensor_temp.state = ENVSYS_SINVALID;
 	sc-sc_sensor_temp.flags = ENVSYS_FHAS_ENTROPY;
-	snprintf(sc-sc_sensor_temp.desc, sizeof(sc-sc_sensor_temp),
+	snprintf(sc-sc_sensor_temp.desc, sizeof(sc-sc_sensor_temp.desc),
 	internal temperature);
 	sysmon_envsys_sensor_attach(sc-sc_sme, sc-sc_sensor_temp);
 



CVS commit: src/etc/etc.evbarm

2014-09-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep 10 05:03:50 UTC 2014

Modified Files:
src/etc/etc.evbarm: Makefile.inc

Log Message:
Add CUBIETRUCK


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/etc/etc.evbarm/Makefile.inc

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

Modified files:

Index: src/etc/etc.evbarm/Makefile.inc
diff -u src/etc/etc.evbarm/Makefile.inc:1.64 src/etc/etc.evbarm/Makefile.inc:1.65
--- src/etc/etc.evbarm/Makefile.inc:1.64	Sun Sep  7 20:17:57 2014
+++ src/etc/etc.evbarm/Makefile.inc	Wed Sep 10 05:03:50 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.64 2014/09/07 20:17:57 skrll Exp $
+#	$NetBSD: Makefile.inc,v 1.65 2014/09/10 05:03:50 matt Exp $
 #
 #	etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets
 #
@@ -25,6 +25,8 @@ EVBARM_BOARDS.armv7+=		BPI
 EVBARM_BOARDS.armv7hf+=		BPI
 EVBARM_BOARDS.armv7+=		CUBIEBOARD
 EVBARM_BOARDS.armv7hf+=		CUBIEBOARD
+EVBARM_BOARDS.armv7+=		CUBIETRUCK
+EVBARM_BOARDS.armv7hf+=		CUBIETRUCK
 .else
 # little endian boards
 #EVBARM_BOARDS.armv4+=		ARMADILLO210
@@ -84,6 +86,8 @@ EVBARM_BOARDS.armv7+=		BPI
 EVBARM_BOARDS.armv7hf+= 	BPI
 EVBARM_BOARDS.armv7+=		CUBIEBOARD
 EVBARM_BOARDS.armv7hf+= 	CUBIEBOARD
+EVBARM_BOARDS.armv7+=		CUBIETRUCK
+EVBARM_BOARDS.armv7hf+= 	CUBIETRUCK
 #EVBARM_BOARDS.armv7+=		IGEPV2
 EVBARM_BOARDS.armv7+=		MIRABOX
 EVBARM_BOARDS.armv7hf+=		MIRABOX