CVS commit: [netbsd-7] src/doc

2015-06-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jun  3 06:53:37 UTC 2015

Modified Files:
src/doc [netbsd-7]: CHANGES-7.0

Log Message:
ticket 752


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.317 -r1.1.2.318 src/doc/CHANGES-7.0

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-7.0
diff -u src/doc/CHANGES-7.0:1.1.2.317 src/doc/CHANGES-7.0:1.1.2.318
--- src/doc/CHANGES-7.0:1.1.2.317	Tue Jun  2 20:43:40 2015
+++ src/doc/CHANGES-7.0	Wed Jun  3 06:53:37 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.317 2015/06/02 20:43:40 snj Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.318 2015/06/03 06:53:37 snj Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -23681,3 +23681,23 @@ external/bsd/blacklist/test/srvtest.c		1
 	  return NULL.
 	[christos, ticket #815]
 
+sys/modules/example/Makefile			delete
+sys/modules/example/example.c			delete
+sys/modules/examples/Makefile			1.1
+sys/modules/examples/Makefile.inc		1.1
+sys/modules/examples/README			1.1-1.3
+sys/modules/examples/hello/Makefile		1.1
+sys/modules/examples/hello/hello.c		1.1
+sys/modules/examples/luahello/luahello.lua	1.1, 1.2
+sys/modules/examples/ping/Makefile		1.1
+sys/modules/examples/ping/cmd_ping.c		1.1, 1.2
+sys/modules/examples/ping/ping.c		1.1
+sys/modules/examples/ping/ping.h		1.1
+sys/modules/examples/properties/Makefile	1.1
+sys/modules/examples/properties/properties.c	1.1
+sys/modules/examples/readhappy/Makefile		1.1
+sys/modules/examples/readhappy/readhappy.c	1.1
+
+	Provide a more comprehensive set of example kernel modules.
+	[pgoyette, ticket #752]
+



CVS commit: [netbsd-7] src/sys/modules

2015-06-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jun  3 06:51:40 UTC 2015

Added Files:
src/sys/modules/examples [netbsd-7]: Makefile Makefile.inc README
src/sys/modules/examples/hello [netbsd-7]: Makefile hello.c
src/sys/modules/examples/luahello [netbsd-7]: luahello.lua
src/sys/modules/examples/ping [netbsd-7]: Makefile cmd_ping.c ping.c
ping.h
src/sys/modules/examples/properties [netbsd-7]: Makefile properties.c
src/sys/modules/examples/readhappy [netbsd-7]: Makefile readhappy.c
Removed Files:
src/sys/modules/example [netbsd-7]: Makefile example.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #752):
sys/modules/example/Makefile: file removal
sys/modules/example/example.c: file removal
sys/modules/examples/Makefile: revision 1.1
sys/modules/examples/Makefile.inc: revision 1.1
sys/modules/examples/README: revisions 1.1-1.3
sys/modules/examples/hello/Makefile: revision 1.1
sys/modules/examples/hello/hello.c: revision 1.1
sys/modules/examples/luahello/luahello.lua: revisions 1.1, 1.2
sys/modules/examples/ping/Makefile: revision 1.1
sys/modules/examples/ping/cmd_ping.c: revisions 1.1, 1.2
sys/modules/examples/ping/ping.c: revision 1.1
sys/modules/examples/ping/ping.h: revision 1.1
sys/modules/examples/properties/Makefile: revision 1.1
sys/modules/examples/properties/properties.c: revision 1.1
sys/modules/examples/readhappy/Makefile: revision 1.1
sys/modules/examples/readhappy/readhappy.c: revision 1.1
Soon to be replaced with a more comprehensive set of examples.
--
A set of more comprehensive example kernel modules to replace our
previous single example.
These examples were provided by Kamil Rytarowski.
XXX These modules are built as part of a system build, but they
XXX are NOT installed in $DESTDIR.
--
Fix instructions to match reality.  (I renamed the example from the
original submitter, but didn't catch all internal references.)
--
Fix up another internal reference to renamed module, and adjust some
English grammar.
--
Even though this isn't a man page, it looks like one.  So sort the
SEE ALSO section accordingly.
--
Fix RCS ID.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/sys/modules/example/Makefile
cvs rdiff -u -r1.7 -r0 src/sys/modules/example/example.c
cvs rdiff -u -r0 -r1.1.2.2 src/sys/modules/examples/Makefile \
src/sys/modules/examples/Makefile.inc
cvs rdiff -u -r0 -r1.3.2.2 src/sys/modules/examples/README
cvs rdiff -u -r0 -r1.1.2.2 src/sys/modules/examples/hello/Makefile \
src/sys/modules/examples/hello/hello.c
cvs rdiff -u -r0 -r1.2.2.2 src/sys/modules/examples/luahello/luahello.lua
cvs rdiff -u -r0 -r1.1.2.2 src/sys/modules/examples/ping/Makefile \
src/sys/modules/examples/ping/ping.c src/sys/modules/examples/ping/ping.h
cvs rdiff -u -r0 -r1.2.2.2 src/sys/modules/examples/ping/cmd_ping.c
cvs rdiff -u -r0 -r1.1.2.2 src/sys/modules/examples/properties/Makefile \
src/sys/modules/examples/properties/properties.c
cvs rdiff -u -r0 -r1.1.2.2 src/sys/modules/examples/readhappy/Makefile \
src/sys/modules/examples/readhappy/readhappy.c

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

Added files:

Index: src/sys/modules/examples/Makefile
diff -u /dev/null src/sys/modules/examples/Makefile:1.1.2.2
--- /dev/null	Wed Jun  3 06:51:40 2015
+++ src/sys/modules/examples/Makefile	Wed Jun  3 06:51:40 2015
@@ -0,0 +1,11 @@
+#	$NetBSD: Makefile,v 1.1.2.2 2015/06/03 06:51:40 snj Exp $
+
+.include 
+
+SUBDIR+=	hello
+#SUBDIR+=	luahello	# Nothing to build here, only text files
+SUBDIR+=	ping		# Needs an additional helper program
+SUBDIR+=	properties
+SUBDIR+=	readhappy
+
+.include 
Index: src/sys/modules/examples/Makefile.inc
diff -u /dev/null src/sys/modules/examples/Makefile.inc:1.1.2.2
--- /dev/null	Wed Jun  3 06:51:40 2015
+++ src/sys/modules/examples/Makefile.inc	Wed Jun  3 06:51:40 2015
@@ -0,0 +1,9 @@
+#	$NetBSD: Makefile.inc,v 1.1.2.2 2015/06/03 06:51:40 snj Exp $
+
+# We only build the example modules; we don't want to install them anywhere
+
+kmodinstall:
+
+# Include parent's Makefile.inc
+
+.include "../Makefile.inc"

Index: src/sys/modules/examples/README
diff -u /dev/null src/sys/modules/examples/README:1.3.2.2
--- /dev/null	Wed Jun  3 06:51:40 2015
+++ src/sys/modules/examples/README	Wed Jun  3 06:51:40 2015
@@ -0,0 +1,59 @@
+	$NetBSD: README,v 1.3.2.2 2015/06/03 06:51:40 snj Exp $
+
+   Kernel Developer's Manual
+
+DESCRIPTION
+ The kernel example dynamic modules.
+
+ This directory contains the following example modules:
+ * hello   - the simplest `hello world' module
+ * properties  - handle incoming properties during the module load
+ * readhappy   - basic implementation of read(9) with happy numbers
+   

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

2015-06-02 Thread SUENAGA Hiroki
Module Name:src
Committed By:   hsuenaga
Date:   Wed Jun  3 04:31:46 UTC 2015

Modified Files:
src/sys/arch/evbarm/conf: ARMADAXP OPENBLOCKS_AX3

Log Message:
add kernel config of if_mvxpe(new ethernet) and mvxpsec(new cryptographic).
still disabled by default. I need to do more test...


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

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/ARMADAXP
diff -u src/sys/arch/evbarm/conf/ARMADAXP:1.15 src/sys/arch/evbarm/conf/ARMADAXP:1.16
--- src/sys/arch/evbarm/conf/ARMADAXP:1.15	Sat Aug 30 13:45:56 2014
+++ src/sys/arch/evbarm/conf/ARMADAXP	Wed Jun  3 04:31:46 2015
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: ARMADAXP,v 1.15 2014/08/30 13:45:56 kiyohara Exp $
+#	$NetBSD: ARMADAXP,v 1.16 2015/06/03 04:31:46 hsuenaga Exp $
 #
 #	ARMADA XP DEV BOARD
 #
@@ -201,9 +201,13 @@ m25p0		at spi? slave 0
 # TWSI SDRAM Serial Presence Detect
 spdmem0		at iic? addr 0x56
 
-# On-chip Cryptographic Engines and Security Accelerator
+# On-chip Cryptographic Engines and Security Accelerator (S/W chaining)
 mvcesa* 	at mvsoc? offset ? irq ?
 
+# On-chip Cryptographic Engines and Security Accelerator (H/W chaining)
+#mvxpsec*	at mvsoc? offset ? irq ?
+#options 	MVXPSEC_DEBUG=MVXPSEC_DEBUG_ALL
+
 # On-chip USB 2.0 Interface
 ehci*		at mvsoc? offset ? irq ?
 
@@ -250,10 +254,16 @@ wd*		at atabus? drive ? flags 0x
 sd*		at atapibus? drive ? flags 0x   # ATAPI disk drives
 uk*		at atapibus? drive ? flags 0x   # ATAPI unknown
 
-# On-chip Gigabit Ethernet Controller Interface
+# On-chip Gigabit Ethernet Controller Interface (backward compatible mode)
 mvgbec* 	at mvsoc? offset ?
 mvgbe*		at mvgbec? port ? irq ?
 
+# On-chip Gigabit Ethernet Controller Interface (counter mode)
+#mvxpbm* 	at mvsoc? offset ?
+#mvxpe* 	at mvsoc? irq ?
+#options 	MVXPE_EVENT_COUNTERS
+#options 	MVXPE_DEBUG=0
+
 # On-chip RTC
 mvsocrtc*	at mvsoc? offset ? irq ?
 

Index: src/sys/arch/evbarm/conf/OPENBLOCKS_AX3
diff -u src/sys/arch/evbarm/conf/OPENBLOCKS_AX3:1.13 src/sys/arch/evbarm/conf/OPENBLOCKS_AX3:1.14
--- src/sys/arch/evbarm/conf/OPENBLOCKS_AX3:1.13	Sat Aug 30 13:40:18 2014
+++ src/sys/arch/evbarm/conf/OPENBLOCKS_AX3	Wed Jun  3 04:31:46 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: OPENBLOCKS_AX3,v 1.13 2014/08/30 13:40:18 kiyohara Exp $
+#	$NetBSD: OPENBLOCKS_AX3,v 1.14 2015/06/03 04:31:46 hsuenaga Exp $
 #
 #	OPENBLOCKS_AX3 -- Plat'Home. OpenBlockS AX3 kernel
 #
@@ -182,11 +182,17 @@ options 	MVSOC_FIXUP_DEVID=0x7826
 # On-chip Serial-ATA II Host Controller (SATAHC)
 mvsata* at mvsoc? offset ? irq ?
 
-# On-chip Gigabit Ethernet Controller Interface
+# On-chip Gigabit Ethernet Controller Interface (backward compatible mode)
 mvgbec* at mvsoc? offset ?
 mvgbe*	at mvgbec? port ? irq ?
 makphy* at mii? phy ?
 
+# On-chip Gigabit Ethernet Controller Interface (counter mode)
+#mvxpbm* 	at mvsoc? offset ?
+#mvxpe* 	at mvsoc? irq ?
+#options 	MVXPE_EVENT_COUNTERS
+#options 	MVXPE_DEBUG=0
+
 # On-chip USB 2.0 Interface
 ehci*	at mvsoc? offset ? irq ?
 
@@ -199,6 +205,10 @@ gttwsi* at mvsoc? offset ? irq ?
 iic*	at gttwsi?
 s390rtc* at iic1 addr 0x30
 
+# On-chip Cryptographic Engines and Security Accelerator (DMA)
+#mvxpsec*	at mvsoc? offset ? irq ?
+#options 	MVXPSEC_DEBUG=MVXPSEC_DEBUG_ALL
+
 # On-chip UART Interface
 com*	at mvsoc? offset ? irq ?
 options 	COM_16750		# : required



CVS commit: src/sys

2015-06-02 Thread SUENAGA Hiroki
Module Name:src
Committed By:   hsuenaga
Date:   Wed Jun  3 04:20:02 UTC 2015

Modified Files:
src/sys/arch/arm/marvell: files.marvell mvsoc.c mvsocvar.h
src/sys/dev/marvell: files.armada
Added Files:
src/sys/dev/marvell: mvxpsec.c mvxpsecreg.h mvxpsecvar.h

Log Message:
add new cryptographic accelerator driver 'mvxpsec.'

this driver controls CESA unit as same as mvcesa, but uses DMA engines and
does CBC operations, HMAC operations by hardware. about 2 kbytes of data
are processed at one. supported algorithms are:

 - DES-CBC, 3DES-CBC, AES-CBC
 - HMAC-SHA1, HMAC-MD5

non-CBC algorithm such as AES-GCM is not supported by CESA's acceleration
engine. mvcesa is still useful to implement such algorithms as combination of
accelerated block cipher and software chaining.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/marvell/files.marvell
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/marvell/mvsoc.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/marvell/mvsocvar.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/marvell/files.armada
cvs rdiff -u -r0 -r1.1 src/sys/dev/marvell/mvxpsec.c \
src/sys/dev/marvell/mvxpsecreg.h src/sys/dev/marvell/mvxpsecvar.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/marvell/files.marvell
diff -u src/sys/arch/arm/marvell/files.marvell:1.16 src/sys/arch/arm/marvell/files.marvell:1.17
--- src/sys/arch/arm/marvell/files.marvell:1.16	Wed Jun  3 03:55:47 2015
+++ src/sys/arch/arm/marvell/files.marvell	Wed Jun  3 04:20:02 2015
@@ -1,4 +1,4 @@
-#   $NetBSD: files.marvell,v 1.16 2015/06/03 03:55:47 hsuenaga Exp $
+#   $NetBSD: files.marvell,v 1.17 2015/06/03 04:20:02 hsuenaga Exp $
 #
 # Configuration info for Marvell System on Chip support
 #
@@ -70,6 +70,9 @@ attach	ehci at mvsoc with mvusb_mbus
 # Cryptographic Engines and Security Accelerator
 attach	mvcesa at mvsoc with mvcesa_mbus
 
+# ARMADA XP Cryptographic Engines and Security Accelerator
+attach	mvxpsec at mvsoc with mvxpsec_mbus
+
 # TWSI Two-Wire Serial Interface
 attach	gttwsi at mvsoc with gttwsi_mbus
 

Index: src/sys/arch/arm/marvell/mvsoc.c
diff -u src/sys/arch/arm/marvell/mvsoc.c:1.22 src/sys/arch/arm/marvell/mvsoc.c:1.23
--- src/sys/arch/arm/marvell/mvsoc.c:1.22	Wed Jun  3 03:55:47 2015
+++ src/sys/arch/arm/marvell/mvsoc.c	Wed Jun  3 04:20:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsoc.c,v 1.22 2015/06/03 03:55:47 hsuenaga Exp $	*/
+/*	$NetBSD: mvsoc.c,v 1.23 2015/06/03 04:20:02 hsuenaga Exp $	*/
 /*
  * Copyright (c) 2007, 2008, 2013, 2014 KIYOHARA Takashi
  * All rights reserved.
@@ -26,12 +26,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.22 2015/06/03 03:55:47 hsuenaga Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.23 2015/06/03 04:20:02 hsuenaga Exp $");
 
 #include "opt_cputypes.h"
 #include "opt_mvsoc.h"
 #ifdef ARMADAXP
 #include "mvxpe.h"
+#include "mvxpsec.h"
 #endif
 
 #include 
@@ -274,6 +275,10 @@ static struct {
 	  ARMADAXP_ATTR_PEX3_MEM,	ARMADAXP_UNITID_PEX3 },
 	{ ARMADAXP_TAG_PEX3_IO,
 	  ARMADAXP_ATTR_PEX3_IO,	ARMADAXP_UNITID_PEX3 },
+	{ ARMADAXP_TAG_CRYPT0,
+	  ARMADAXP_ATTR_CRYPT0_NOSWAP,	ARMADAXP_UNITID_CRYPT },
+	{ ARMADAXP_TAG_CRYPT1,
+	  ARMADAXP_ATTR_CRYPT1_NOSWAP,	ARMADAXP_UNITID_CRYPT },
 #endif
 };
 
@@ -692,8 +697,13 @@ static const struct mvsoc_periph {
 { ARMADAXP(MV78130), "mvgbec", 1, ARMADAXP_GBE1_BASE,IRQ_DEFAULT },
 { ARMADAXP(MV78130), "mvgbec", 2, ARMADAXP_GBE2_BASE,IRQ_DEFAULT },
 #endif
+#if NMVXPSEC > 0
+{ ARMADAXP(MV78130), "mvxpsec", 0, ARMADAXP_XPSEC0_BASE,ARMADAXP_IRQ_CESA0 },
+{ ARMADAXP(MV78130), "mvxpsec", 1, ARMADAXP_XPSEC1_BASE,ARMADAXP_IRQ_CESA1 },
+#else
 { ARMADAXP(MV78130), "mvcesa", 0, ARMADAXP_CESA0_BASE,ARMADAXP_IRQ_CESA0 },
 { ARMADAXP(MV78130), "mvcesa", 1, ARMADAXP_CESA1_BASE,ARMADAXP_IRQ_CESA1 },
+#endif
 
 { ARMADAXP(MV78160), "mvsoctmr",0,MVSOC_TMR_BASE,	ARMADAXP_IRQ_TIMER0 },
 { ARMADAXP(MV78160), "com",0, MVSOC_COM0_BASE,	ARMADAXP_IRQ_UART0 },
@@ -728,8 +738,13 @@ static const struct mvsoc_periph {
 { ARMADAXP(MV78160), "mvgbec", 2, ARMADAXP_GBE2_BASE,IRQ_DEFAULT },
 { ARMADAXP(MV78160), "mvgbec", 3, ARMADAXP_GBE3_BASE,IRQ_DEFAULT },
 #endif
+#if NMVXPSEC > 0
+{ ARMADAXP(MV78160), "mvxpsec", 0, ARMADAXP_XPSEC0_BASE,ARMADAXP_IRQ_CESA0 },
+{ ARMADAXP(MV78160), "mvxpsec", 1, ARMADAXP_XPSEC1_BASE,ARMADAXP_IRQ_CESA1 },
+#else
 { ARMADAXP(MV78160), "mvcesa", 0, ARMADAXP_CESA0_BASE,ARMADAXP_IRQ_CESA0 },
 { ARMADAXP(MV78160), "mvcesa", 1, ARMADAXP_CESA1_BASE,ARMADAXP_IRQ_CESA1 },
+#endif
 
 { ARMADAXP(MV78230), "mvsoctmr",0,MVSOC_TMR_BASE,	ARMADAXP_IRQ_TIMER0 },
 { ARMADAXP(MV78230), "com",0, MVSOC_COM0_BASE,	ARMADAXP_IRQ_UART0 },
@@ -762,8 +777,13 @@ static const struct mvsoc_periph {
 { ARMADAXP(MV78230), "mvgbec", 1, ARMADAXP_GBE1_BASE,IRQ_DEFAULT },
 { ARMADAXP(MV78230), "mvgbec", 2, ARMADAXP_GBE2

CVS commit: src/sys/dev/marvell

2015-06-02 Thread SUENAGA Hiroki
Module Name:src
Committed By:   hsuenaga
Date:   Wed Jun  3 04:00:06 UTC 2015

Modified Files:
src/sys/dev/marvell: marvellreg.h

Log Message:
reduce magic numbers. SDRAM address space attribute register has cache coherency
control bits. this bit is important for AURORA_IO_CACHE_COHERENCY.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/marvell/marvellreg.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/marvell/marvellreg.h
diff -u src/sys/dev/marvell/marvellreg.h:1.8 src/sys/dev/marvell/marvellreg.h:1.9
--- src/sys/dev/marvell/marvellreg.h:1.8	Sat Mar 15 10:40:39 2014
+++ src/sys/dev/marvell/marvellreg.h	Wed Jun  3 04:00:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: marvellreg.h,v 1.8 2014/03/15 10:40:39 kiyohara Exp $	*/
+/*	$NetBSD: marvellreg.h,v 1.9 2015/06/03 04:00:06 hsuenaga Exp $	*/
 /*
  * Copyright (c) 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -73,11 +73,13 @@
 #define MARVELL_DISCOVERY_REVB	0x20
 
 #define MARVELL_ATTR_MASK		0xff
+#define MARVELL_ATTR_SDRAM_CFU_SHARE	0x10 /* shared and snoop enabled.*/
+#define MARVELL_ATTR_SDRAM_CFU_L2_DEP	0x20 /* enable L2 deposit */
 #ifdef AURORA_IO_CACHE_COHERENCY
-#define MARVELL_ATTR_SDRAM_CS0		0x1e
-#define MARVELL_ATTR_SDRAM_CS1		0x1d
-#define MARVELL_ATTR_SDRAM_CS2		0x1b
-#define MARVELL_ATTR_SDRAM_CS3		0x17
+#define MARVELL_ATTR_SDRAM_CS0		(0x0e | MARVELL_ATTR_SDRAM_CFU_SHARE)
+#define MARVELL_ATTR_SDRAM_CS1		(0x0d | MARVELL_ATTR_SDRAM_CFU_SHARE)
+#define MARVELL_ATTR_SDRAM_CS2		(0x0b | MARVELL_ATTR_SDRAM_CFU_SHARE)
+#define MARVELL_ATTR_SDRAM_CS3		(0x07 | MARVELL_ATTR_SDRAM_CFU_SHARE)
 #else
 #define MARVELL_ATTR_SDRAM_CS0		0x0e
 #define MARVELL_ATTR_SDRAM_CS1		0x0d



CVS commit: src/sys

2015-06-02 Thread SUENAGA Hiroki
Module Name:src
Committed By:   hsuenaga
Date:   Wed Jun  3 03:55:47 UTC 2015

Modified Files:
src/sys/arch/arm/marvell: files.marvell mvsoc.c
src/sys/dev/marvell: files.armada if_mvxpe.c if_mvxpereg.h
if_mvxpevar.h
Added Files:
src/sys/dev/marvell: mvxpbm.c mvxpbmvar.h

Log Message:
separate buffer management codes 'mvxpbm.c' from if_mvxpe.c.

the buffer management(ex. fill the rx descriptors/buffers) is done by H/W in
ARMADA XP/380, and is done by S/W in ARMADA 370. the H/W BM support is not yet
implemented, so all devices use the S/W management mode at this time.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/marvell/files.marvell
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/marvell/mvsoc.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/marvell/files.armada \
src/sys/dev/marvell/if_mvxpe.c src/sys/dev/marvell/if_mvxpereg.h \
src/sys/dev/marvell/if_mvxpevar.h
cvs rdiff -u -r0 -r1.1 src/sys/dev/marvell/mvxpbm.c \
src/sys/dev/marvell/mvxpbmvar.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/marvell/files.marvell
diff -u src/sys/arch/arm/marvell/files.marvell:1.15 src/sys/arch/arm/marvell/files.marvell:1.16
--- src/sys/arch/arm/marvell/files.marvell:1.15	Wed Jun  3 03:34:38 2015
+++ src/sys/arch/arm/marvell/files.marvell	Wed Jun  3 03:55:47 2015
@@ -1,4 +1,4 @@
-#   $NetBSD: files.marvell,v 1.15 2015/06/03 03:34:38 hsuenaga Exp $
+#   $NetBSD: files.marvell,v 1.16 2015/06/03 03:55:47 hsuenaga Exp $
 #
 # Configuration info for Marvell System on Chip support
 #
@@ -58,6 +58,9 @@ attach	mvsata at mvsoc with mvsata_mbus
 # Gigabit Ethernet Controller Interface
 attach	mvgbec at mvsoc with mvgbec_mbus
 
+# ARMADA XP Buffer Manager
+attach	mvxpbm at mvsoc with mvxpbm_mbus
+
 # ARMADA XP Gigabit Ethernet Controller Interface
 attach	mvxpe at mvsoc with mvxpe_mbus
 

Index: src/sys/arch/arm/marvell/mvsoc.c
diff -u src/sys/arch/arm/marvell/mvsoc.c:1.21 src/sys/arch/arm/marvell/mvsoc.c:1.22
--- src/sys/arch/arm/marvell/mvsoc.c:1.21	Wed Jun  3 03:04:21 2015
+++ src/sys/arch/arm/marvell/mvsoc.c	Wed Jun  3 03:55:47 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsoc.c,v 1.21 2015/06/03 03:04:21 hsuenaga Exp $	*/
+/*	$NetBSD: mvsoc.c,v 1.22 2015/06/03 03:55:47 hsuenaga Exp $	*/
 /*
  * Copyright (c) 2007, 2008, 2013, 2014 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.21 2015/06/03 03:04:21 hsuenaga Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.22 2015/06/03 03:55:47 hsuenaga Exp $");
 
 #include "opt_cputypes.h"
 #include "opt_mvsoc.h"
@@ -685,6 +685,7 @@ static const struct mvsoc_periph {
 { ARMADAXP(MV78130), "mvsdio", 0, ARMADAXP_SDIO_BASE,ARMADAXP_IRQ_SDIO },
 { ARMADAXP(MV78130), "mvxpe", 0, ARMADAXP_GBE0_BASE,ARMADAXP_IRQ_GBE0_TH_RXTX },
 #if NMVXPE > 0
+{ ARMADAXP(MV78130), "mvxpbm", 0, MVA_OFFSET_DEFAULT,IRQ_DEFAULT },
 { ARMADAXP(MV78130), "mvxpe", 1, ARMADAXP_GBE1_BASE,ARMADAXP_IRQ_GBE1_TH_RXTX },
 { ARMADAXP(MV78130), "mvxpe", 2, ARMADAXP_GBE2_BASE,ARMADAXP_IRQ_GBE2_TH_RXTX },
 #else
@@ -716,6 +717,7 @@ static const struct mvsoc_periph {
 { ARMADAXP(MV78160), "mvspi",  0, ARMADAXP_SPI_BASE,ARMADAXP_IRQ_SPI },
 { ARMADAXP(MV78160), "mvsdio", 0, ARMADAXP_SDIO_BASE,ARMADAXP_IRQ_SDIO },
 #if NMVXPE > 0
+{ ARMADAXP(MV78160), "mvxpbm", 0, MVA_OFFSET_DEFAULT,IRQ_DEFAULT },
 { ARMADAXP(MV78160), "mvxpe", 0, ARMADAXP_GBE0_BASE,ARMADAXP_IRQ_GBE0_TH_RXTX },
 { ARMADAXP(MV78160), "mvxpe", 1, ARMADAXP_GBE1_BASE,ARMADAXP_IRQ_GBE1_TH_RXTX },
 { ARMADAXP(MV78160), "mvxpe", 2, ARMADAXP_GBE2_BASE,ARMADAXP_IRQ_GBE2_TH_RXTX },
@@ -751,6 +753,7 @@ static const struct mvsoc_periph {
 { ARMADAXP(MV78230), "mvspi",  0, ARMADAXP_SPI_BASE,ARMADAXP_IRQ_SPI },
 { ARMADAXP(MV78230), "mvsdio", 0, ARMADAXP_SDIO_BASE,ARMADAXP_IRQ_SDIO },
 #if NMVXPE > 0
+{ ARMADAXP(MV78230), "mvxpbm", 0, MVA_OFFSET_DEFAULT,IRQ_DEFAULT },
 { ARMADAXP(MV78230), "mvxpe", 0, ARMADAXP_GBE0_BASE,ARMADAXP_IRQ_GBE0_TH_RXTX },
 { ARMADAXP(MV78230), "mvxpe", 1, ARMADAXP_GBE1_BASE,ARMADAXP_IRQ_GBE1_TH_RXTX },
 { ARMADAXP(MV78230), "mvxpe", 2, ARMADAXP_GBE2_BASE,ARMADAXP_IRQ_GBE2_TH_RXTX },
@@ -784,6 +787,7 @@ static const struct mvsoc_periph {
 { ARMADAXP(MV78260), "mvspi",  0, ARMADAXP_SPI_BASE,ARMADAXP_IRQ_SPI },
 { ARMADAXP(MV78260), "mvsdio", 0, ARMADAXP_SDIO_BASE,ARMADAXP_IRQ_SDIO },
 #if NMVXPE > 0
+{ ARMADAXP(MV78260), "mvxpbm", 0, MVA_OFFSET_DEFAULT,IRQ_DEFAULT },
 { ARMADAXP(MV78260), "mvxpe", 0, ARMADAXP_GBE0_BASE,ARMADAXP_IRQ_GBE0_TH_RXTX },
 { ARMADAXP(MV78260), "mvxpe", 1, ARMADAXP_GBE1_BASE,ARMADAXP_IRQ_GBE1_TH_RXTX },
 { ARMADAXP(MV78260), "mvxpe", 2, ARMADAXP_GBE2_BASE,ARMADAXP_IRQ_GBE2_TH_RXTX },
@@ -820,6 +824,7 @@ static const struct mvsoc_periph {
 { ARMADAXP(MV78460), "mvspi",  0, ARMADAXP_SPI_

CVS commit: src/sys

2015-06-02 Thread SUENAGA Hiroki
Module Name:src
Committed By:   hsuenaga
Date:   Wed Jun  3 03:34:38 UTC 2015

Modified Files:
src/sys/arch/arm/marvell: files.marvell
Added Files:
src/sys/dev/marvell: files.armada

Log Message:
move Marvell ARMADA SoC's device driver definitions from arm/marvell
to dev/marvell.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/marvell/files.marvell
cvs rdiff -u -r0 -r1.1 src/sys/dev/marvell/files.armada

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/marvell/files.marvell
diff -u src/sys/arch/arm/marvell/files.marvell:1.14 src/sys/arch/arm/marvell/files.marvell:1.15
--- src/sys/arch/arm/marvell/files.marvell:1.14	Sun May  3 14:38:09 2015
+++ src/sys/arch/arm/marvell/files.marvell	Wed Jun  3 03:34:38 2015
@@ -1,4 +1,4 @@
-#   $NetBSD: files.marvell,v 1.14 2015/05/03 14:38:09 hsuenaga Exp $
+#   $NetBSD: files.marvell,v 1.15 2015/06/03 03:34:38 hsuenaga Exp $
 #
 # Configuration info for Marvell System on Chip support
 #
@@ -27,6 +27,7 @@ file	arch/arm/marvell/armadaxp.c		armada
 
 # Integrated peripherals
 include "dev/marvell/files.discovery"
+include "dev/marvell/files.armada"
 
 # Timers
 device	mvsoctmr: sysmon_wdog
@@ -58,10 +59,7 @@ attach	mvsata at mvsoc with mvsata_mbus
 attach	mvgbec at mvsoc with mvgbec_mbus
 
 # ARMADA XP Gigabit Ethernet Controller Interface
-define	mvxpe { [port = -1 ], [irq = -1] }
-device	mvxpe: ether, ifnet, arp, mii
 attach	mvxpe at mvsoc with mvxpe_mbus
-file	dev/marvell/if_mvxpe.c			mvxpe		needs-flag
 
 # USB 2.0 Interface
 attach	ehci at mvsoc with mvusb_mbus

Added files:

Index: src/sys/dev/marvell/files.armada
diff -u /dev/null src/sys/dev/marvell/files.armada:1.1
--- /dev/null	Wed Jun  3 03:34:38 2015
+++ src/sys/dev/marvell/files.armada	Wed Jun  3 03:34:38 2015
@@ -0,0 +1,7 @@
+#	$NetBSD: files.armada,v 1.1 2015/06/03 03:34:38 hsuenaga Exp $
+# Configuration info for Marvell ARMADA integrated peripherals
+
+# ARMADA XP Gigabit Ethernet Controller Interface
+define	mvxpe { [port = -1 ], [irq = -1] }
+device	mvxpe: ether, ifnet, arp, mii
+file	dev/marvell/if_mvxpe.c			mvxpe		needs-flag



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

2015-06-02 Thread SUENAGA Hiroki
Module Name:src
Committed By:   hsuenaga
Date:   Wed Jun  3 03:25:51 UTC 2015

Modified Files:
src/sys/arch/evbarm/marvell: marvell_machdep.c

Log Message:
initialize ARMADA XP's Mbus address decoder and code clean up
probably we need more sophisticated Mbus driver or KPI...


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/evbarm/marvell/marvell_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/marvell/marvell_machdep.c
diff -u src/sys/arch/evbarm/marvell/marvell_machdep.c:1.31 src/sys/arch/evbarm/marvell/marvell_machdep.c:1.32
--- src/sys/arch/evbarm/marvell/marvell_machdep.c:1.31	Thu May 14 05:39:32 2015
+++ src/sys/arch/evbarm/marvell/marvell_machdep.c	Wed Jun  3 03:25:51 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: marvell_machdep.c,v 1.31 2015/05/14 05:39:32 hsuenaga Exp $ */
+/*	$NetBSD: marvell_machdep.c,v 1.32 2015/06/03 03:25:51 hsuenaga Exp $ */
 /*
  * Copyright (c) 2007, 2008, 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: marvell_machdep.c,v 1.31 2015/05/14 05:39:32 hsuenaga Exp $");
+__KERNEL_RCSID(0, "$NetBSD: marvell_machdep.c,v 1.32 2015/06/03 03:25:51 hsuenaga Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_ddb.h"
@@ -130,6 +130,45 @@ static void marvell_device_register(devi
 static void marvell_startend_by_tag(int, uint64_t *, uint64_t *);
 #endif
 
+static void
+marvell_fixup_mbus_pex(int memtag, int iotag)
+{
+	uint32_t target, attr;
+	int window;
+
+	/* Reset PCI-Express space to window register. */
+	window = mvsoc_target(memtag, &target, &attr, NULL, NULL);
+	write_mlmbreg(MVSOC_MLMB_WCR(window),
+	MVSOC_MLMB_WCR_WINEN |
+	MVSOC_MLMB_WCR_TARGET(target) |
+	MVSOC_MLMB_WCR_ATTR(attr) |
+	MVSOC_MLMB_WCR_SIZE(MARVELL_PEXMEM_SIZE));
+	write_mlmbreg(MVSOC_MLMB_WBR(window),
+	MARVELL_PEXMEM_PBASE & MVSOC_MLMB_WBR_BASE_MASK);
+#ifdef PCI_NETBSD_CONFIGURE
+	if (window < nremap) {
+		write_mlmbreg(MVSOC_MLMB_WRLR(window),
+		MARVELL_PEXMEM_PBASE & MVSOC_MLMB_WRLR_REMAP_MASK);
+		write_mlmbreg(MVSOC_MLMB_WRHR(window), 0);
+	}
+#endif
+	window = mvsoc_target(iotag, &target, &attr, NULL, NULL);
+	write_mlmbreg(MVSOC_MLMB_WCR(window),
+	MVSOC_MLMB_WCR_WINEN |
+	MVSOC_MLMB_WCR_TARGET(target) |
+	MVSOC_MLMB_WCR_ATTR(attr) |
+	MVSOC_MLMB_WCR_SIZE(MARVELL_PEXIO_SIZE));
+	write_mlmbreg(MVSOC_MLMB_WBR(window),
+	MARVELL_PEXIO_PBASE & MVSOC_MLMB_WBR_BASE_MASK);
+#ifdef PCI_NETBSD_CONFIGURE
+	if (window < nremap) {
+		write_mlmbreg(MVSOC_MLMB_WRLR(window),
+		MARVELL_PEXIO_PBASE & MVSOC_MLMB_WRLR_REMAP_MASK);
+		write_mlmbreg(MVSOC_MLMB_WRHR(window), 0);
+	}
+#endif
+}
+
 #if defined(ORION) || defined(KIRKWOOD) || defined(MV78XX0)
 static void
 marvell_system_reset(void)
@@ -146,8 +185,20 @@ marvell_system_reset(void)
 	cpu_reset();
 	/*NOTREACHED*/
 }
+
+static void
+marvell_fixup_mbus(int memtag, int iotag)
+{
+	/* assume u-boot initializes mbus registers correctly */
+
+	/* set marvell common PEX params */
+	marvell_fixup_mbus_pex(memtag, iotag);
+
+	/* other configurations? */
+}
 #endif
 
+
 #if defined(ARMADAXP)
 static void
 armadaxp_system_reset(void)
@@ -166,6 +217,18 @@ armadaxp_system_reset(void)
 
 	/*NOTREACHED*/
 }
+
+static void
+armadaxp_fixup_mbus(int memtag, int iotag)
+{
+	/* force set SoC default parameters */
+	armadaxp_init_mbus();
+
+	/* set marvell common PEX params */
+	marvell_fixup_mbus_pex(memtag, iotag);
+
+	/* other configurations? */
+}
 #endif
 
 
@@ -223,8 +286,7 @@ extern uint32_t *u_boot_args[];
 u_int
 initarm(void *arg)
 {
-	uint32_t target, attr, base, size;
-	int cs, cs_end, memtag = 0, iotag = 0, window;
+	int cs, cs_end, memtag = 0, iotag = 0;
 
 	mvsoc_bootstrap(MARVELL_INTERREGS_VBASE);
 
@@ -277,6 +339,7 @@ initarm(void *arg)
 		cs_end = MARVELL_TAG_SDRAM_CS3;
 
 		orion_getclks(MARVELL_INTERREGS_VBASE);
+		marvell_fixup_mbus(memtag, iotag);
 		break;
 #endif	/* ORION */
 
@@ -299,6 +362,7 @@ initarm(void *arg)
 
 		kirkwood_getclks(MARVELL_INTERREGS_VBASE);
 		mvsoc_clkgating = kirkwood_clkgating;
+		marvell_fixup_mbus(memtag, iotag);
 		break;
 #endif	/* KIRKWOOD */
 
@@ -318,6 +382,7 @@ initarm(void *arg)
 		cs_end = MARVELL_TAG_SDRAM_CS3;
 
 		mv78xx0_getclks(MARVELL_INTERREGS_VBASE);
+		marvell_fixup_mbus(memtag, iotag);
 		break;
 #endif	/* MV78XX0 */
 
@@ -343,6 +408,7 @@ initarm(void *arg)
 	misc_base = MARVELL_INTERREGS_VBASE + ARMADAXP_MISC_BASE;
 		armadaxp_getclks();
 		mvsoc_clkgating = armadaxp_clkgating;
+		armadaxp_fixup_mbus(memtag, iotag);
 
 #ifdef L2CACHE_ENABLE
 		/* Initialize L2 Cache */
@@ -374,14 +440,11 @@ initarm(void *arg)
 	misc_base = MARVELL_INTERREGS_VBASE + ARMADAXP_MISC_BASE;
 		armada370_getclks();
 		mvsoc_clkgating = armadaxp_clkgating;
+		armadaxp_fixup_mbus(memtag, iotag);
 
 #ifdef L2CACHE_ENABLE
 		/*

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

2015-06-02 Thread SUENAGA Hiroki
Module Name:src
Committed By:   hsuenaga
Date:   Wed Jun  3 03:04:21 UTC 2015

Modified Files:
src/sys/arch/arm/marvell: mvsoc.c mvsoc_intr.h mvsocreg.h mvsocvar.h

Log Message:
dump Mbus settins on boot if AV_VERBOSE or AV_DEBUG is enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/marvell/mvsoc.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/marvell/mvsoc_intr.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/marvell/mvsocreg.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/marvell/mvsocvar.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/marvell/mvsoc.c
diff -u src/sys/arch/arm/marvell/mvsoc.c:1.20 src/sys/arch/arm/marvell/mvsoc.c:1.21
--- src/sys/arch/arm/marvell/mvsoc.c:1.20	Mon May 11 05:49:48 2015
+++ src/sys/arch/arm/marvell/mvsoc.c	Wed Jun  3 03:04:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsoc.c,v 1.20 2015/05/11 05:49:48 hsuenaga Exp $	*/
+/*	$NetBSD: mvsoc.c,v 1.21 2015/06/03 03:04:21 hsuenaga Exp $	*/
 /*
  * Copyright (c) 2007, 2008, 2013, 2014 KIYOHARA Takashi
  * All rights reserved.
@@ -26,13 +26,17 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.20 2015/05/11 05:49:48 hsuenaga Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.21 2015/06/03 03:04:21 hsuenaga Exp $");
 
 #include "opt_cputypes.h"
 #include "opt_mvsoc.h"
+#ifdef ARMADAXP
 #include "mvxpe.h"
+#endif
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -47,6 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -917,6 +922,9 @@ mvsoc_attach(device_t parent, device_t s
 		panic("unknown SoC: model 0x%04x, rev 0x%02x", model, rev);
 	tags = tagstbl[i].tags;
 
+	if (boothowto & (AB_VERBOSE | AB_DEBUG))
+		mvsoc_target_dump(sc);
+
 	for (i = 0; i < __arraycount(mvsoc_periphs); i++) {
 		if (mvsoc_periphs[i].model != model)
 			continue;
@@ -1247,3 +1255,43 @@ mvsoc_target_peripheral(uint32_t target,
 	}
 	return i;
 }
+
+int
+mvsoc_target_dump(struct mvsoc_softc *sc)
+{
+	uint32_t reg, base, size, target, attr, enable;
+	int i, n;
+
+	for (i = 0, n = 0; i < nwindow; i++) {
+		reg = read_mlmbreg(MVSOC_MLMB_WCR(i));
+		enable = reg & MVSOC_MLMB_WCR_WINEN;
+		target = MVSOC_MLMB_WCR_GET_TARGET(reg);
+		attr = MVSOC_MLMB_WCR_GET_ATTR(reg);
+		size = MVSOC_MLMB_WCR_GET_SIZE(reg);
+
+		reg = read_mlmbreg(MVSOC_MLMB_WBR(i));
+		base = MVSOC_MLMB_WBR_GET_BASE(reg);
+
+		if (!enable)
+			continue;
+
+		aprint_verbose_dev(sc->sc_dev,
+		"Mbus window %2d: Base 0x%08x Size 0x%08x ", i, base, size);
+#ifdef ARMADAXP
+		armadaxp_attr_dump(sc, target, attr);
+#else
+		mvsoc_attr_dump(sc, target, attr);
+#endif
+		printf("\n");
+		n++;
+	}
+
+	return n;
+}
+
+int
+mvsoc_attr_dump(struct mvsoc_softc *sc, uint32_t target, uint32_t attr)
+{
+	aprint_verbose_dev(sc->sc_dev, "target 0x%x(attr 0x%x)", target, attr);
+	return 0;
+}

Index: src/sys/arch/arm/marvell/mvsoc_intr.h
diff -u src/sys/arch/arm/marvell/mvsoc_intr.h:1.5 src/sys/arch/arm/marvell/mvsoc_intr.h:1.6
--- src/sys/arch/arm/marvell/mvsoc_intr.h:1.5	Wed Apr  8 21:43:30 2015
+++ src/sys/arch/arm/marvell/mvsoc_intr.h	Wed Jun  3 03:04:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsoc_intr.h,v 1.5 2015/04/08 21:43:30 matt Exp $	*/
+/*	$NetBSD: mvsoc_intr.h,v 1.6 2015/06/03 03:04:21 hsuenaga Exp $	*/
 /*
  * Copyright (c) 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -34,6 +34,7 @@
 #if defined(ARMADAXP)
 #define __HAVE_PIC_SET_PRIORITY
 #define __HAVE_PIC_PENDING_INTRS
+#define PIC_MAXMAXSOURCES 256
 #endif
 #endif
 

Index: src/sys/arch/arm/marvell/mvsocreg.h
diff -u src/sys/arch/arm/marvell/mvsocreg.h:1.11 src/sys/arch/arm/marvell/mvsocreg.h:1.12
--- src/sys/arch/arm/marvell/mvsocreg.h:1.11	Tue May 19 09:20:19 2015
+++ src/sys/arch/arm/marvell/mvsocreg.h	Wed Jun  3 03:04:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsocreg.h,v 1.11 2015/05/19 09:20:19 hsuenaga Exp $	*/
+/*	$NetBSD: mvsocreg.h,v 1.12 2015/06/03 03:04:21 hsuenaga Exp $	*/
 /*
  * Copyright (c) 2007, 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -86,15 +86,23 @@
 #define MVSOC_MLMB_WCR(w)		  ((w) < 8 ? ((w) << 4) + 0x0 :\
 		 (((w) - 8) << 3) + 0x90)
 #define MVSOC_MLMB_WCR_WINEN			(1 << 0)
+#define MVSOC_MLMB_WCR_SYNC			(1 << 1) /* sync barrier */
 #define MVSOC_MLMB_WCR_TARGET(t)		(((t) & 0xf) << 4)
+#define MVSOC_MLMB_WCR_GET_TARGET(reg)		(((reg) >> 4) & 0xf)
 #define MVSOC_MLMB_WCR_ATTR(a)			(((a) & 0xff) << 8)
+#define MVSOC_MLMB_WCR_GET_ATTR(reg)		(((reg) >> 8) & 0xff)
 #define MVSOC_MLMB_WCR_SIZE_MASK		0x
 #define MVSOC_MLMB_WCR_SIZE(s)		  (((s) - 1) & MVSOC_MLMB_WCR_SIZE_MASK)
+#define MVSOC_MLMB_WCR_GET_SIZE(reg) \
+(((reg) & MVSOC_MLMB_WCR_SIZE_MASK) + (1 << 16))
 #define MVSOC_MLMB_WBR(w)		  ((w) < 8 ? ((w) << 4) + 0x4 :\
 		 (((w) - 8) << 3) + 0x94)
 #define MVSOC_MLMB_WBR_BASE_MASK		0x
+#define MVSOC_MLMB_WBR_GET_BASE(reg)		(reg & MVSOC_ML

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

2015-06-02 Thread SUENAGA Hiroki
Module Name:src
Committed By:   hsuenaga
Date:   Wed Jun  3 02:53:19 UTC 2015

Modified Files:
src/sys/arch/arm/marvell: armadaxp.c armadaxpreg.h armadaxpvar.h

Log Message:
add ARMADA XP's Soc internal bus(Mbus) address decoder initialization function.
some versions of u-boot initializes the address decoder incorrectly(probably
these values are come from Kirkwood SoC or older.) the codes generates
SoC's default address spaces and some modifications for NetBSD's assumption.

add error interrupt definitions, interrupt name strings for 'vmstat -e',
verbose output of Mbus settings for such low-level debugging of SoC.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/marvell/armadaxp.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/marvell/armadaxpreg.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/marvell/armadaxpvar.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/marvell/armadaxp.c
diff -u src/sys/arch/arm/marvell/armadaxp.c:1.14 src/sys/arch/arm/marvell/armadaxp.c:1.15
--- src/sys/arch/arm/marvell/armadaxp.c:1.14	Tue May 19 09:20:19 2015
+++ src/sys/arch/arm/marvell/armadaxp.c	Wed Jun  3 02:53:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: armadaxp.c,v 1.14 2015/05/19 09:20:19 hsuenaga Exp $	*/
+/*	$NetBSD: armadaxp.c,v 1.15 2015/06/03 02:53:19 hsuenaga Exp $	*/
 /***
 Copyright (C) Marvell International Ltd. and its affiliates
 
@@ -37,7 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
 ***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: armadaxp.c,v 1.14 2015/05/19 09:20:19 hsuenaga Exp $");
+__KERNEL_RCSID(0, "$NetBSD: armadaxp.c,v 1.15 2015/06/03 02:53:19 hsuenaga Exp $");
 
 #define _INTR_PRIVATE
 
@@ -97,10 +97,20 @@ static void armadaxp_pic_unblock_irqs(st
 static void armadaxp_pic_block_irqs(struct pic_softc *, size_t, uint32_t);
 static void armadaxp_pic_establish_irq(struct pic_softc *, struct intrsource *);
 static void armadaxp_pic_set_priority(struct pic_softc *, int);
+static void armadaxp_pic_source_name(struct pic_softc *, int, char*, size_t);
 
 static int armadaxp_find_pending_irqs(void);
 static void armadaxp_pic_block_irq(struct pic_softc *, size_t);
 
+/* handle error cause */
+static void armadaxp_err_pic_unblock_irqs(struct pic_softc *, size_t, uint32_t);
+static void armadaxp_err_pic_block_irqs(struct pic_softc *, size_t, uint32_t);
+static void armadaxp_err_pic_establish_irq(struct pic_softc *,
+struct intrsource *);
+static void armadaxp_err_pic_source_name(struct pic_softc *,
+int, char*, size_t);
+static int armadaxp_err_pic_pending_irqs(struct pic_softc *);
+
 struct vco_freq_ratio {
 	uint8_t	vco_cpu;	/* VCO to CLK0(CPU) clock ratio */
 	uint8_t	vco_l2c;	/* VCO to NB(L2 cache) clock ratio */
@@ -108,6 +118,303 @@ struct vco_freq_ratio {
 	uint8_t	vco_ddr;	/* VCO to DR(DDR memory) clock ratio */
 };
 
+/*
+ * Interrupt names for ARMADA XP
+ */
+static const char * const armadaxp_pic_source_names[] = {
+	/* Main Interrupt Cause Per-CPU (IRQ 0-29) */
+	"InDBLowSum", "InDBHighSum", "OutDBSum", "CFU_LocalSum",
+	"SoC_ErrorSum", "LTimer0", "LTimer1", "LWDT", "GbE0_TH_RxTx",
+	"GbE0_RxTx", "GbE1_RxTxTh", "GbE1_RxTx", "GbE2_RxTxTh", "GbE2_RxTx",
+	"GbE3_RxTxTh", "GbE3_RxTx", "GPIO0_7", "GPIO8_15", "GPIO16_23",
+	"GPIO24_31", "GPIO32_39", "GPIO40_47", "GPIO48_55", "GPIO56_63",
+	"GPIO64_66", "SCNT", "PCNT", "Reserved27", "VCNT", "Reserved29",
+	/* Main Interrupt Cause Global-Shared (IRQ 30-115) */
+	"SPI0", "I2C0", "I2C1", "IDMA0", "IDMA1", "IDMA2", "IDMA3", "GTimer0",
+	"GTimer1", "GTimer2", "GTimer3", "UART0", "UART1", "UART2", "UART3",
+	"USB0", "USB1", "USB2", "CESA0", "CESA1", "RTC", "XOR0_Ch0",
+	"XOR0_Ch1", "BM", "SDIO", "SATA0", "TDM", "SATA1", "PEX0_0", "PEX0_1",
+	"PEX0_2", "PEX0_3", "PEX1_0", "PEX1_1", "PEX1_2", "PEX1_3",
+	"GbE0_Sum", "GbE0_Rx", "GbE0_Tx", "GbE0_Misc", "GbE1_Sum", "GbE1_Rx",
+	"GbE1_Tx", "GbE1_Misc", "GbE2_Sum", "GbE2_Rx", "GbE2_Tx", "GbE2_Misc",
+	"GbE3_Sum", "GbE3_Rx", "GbE3_Tx", "GbE3_Misc", "GPIO0_7", "GPIO8_15",
+	"GPIO16_23", "GPIO24_31", "Reserved86", "GPIO32_39", "GPIO40_47",
+	"GPIO48_55", "GPIO56_63", "GPIO64_66", "SPI1", "WDT", "XOR1_Ch2",
+	"XOR1_Ch3", "SharedDB1Sum", "SharedDB2Sum", "SharedDB3Sum", "PEX2_0",
+	"Reserved100", "Reserved101", "Reserved102", "PEX3_0", "Reserved104",
+	"Reserved105", "Reserved106", "PMU", "DRAM", "GbE0_Wakeup",
+	"GbE1_Wakeup", "GbE2_Wakeup", "GbE3_Wakeup", "NAND", "Reserved114",
+	"Reserved115"
+};
+static const char * const armadaxp_err_pic_source_names[] = {
+	/*
+	 * IRQ 120-151 (bit 0-31 in SoC Error Interrupt Cause register)
+	 * connected to SoC_ErrorSum in Main Interrupt Cause
+	 */
+	"ERR_CESA0", "ERR_DevBus", "ERR_IDMA", "ERR_XOR1",
+	"ERR_PEX0", "ERR_PEX1", "ERR_GbE", "ERR_CESA1",
+	"ERR_USB", "ERR_DRAM", "ERR_XOR0"

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

2015-06-02 Thread SUENAGA Hiroki
Module Name:src
Committed By:   hsuenaga
Date:   Wed Jun  3 02:30:11 UTC 2015

Modified Files:
src/sys/arch/arm/arm: cpufunc.c

Log Message:
initialize sdcache operations for PJ4B.
otherwise the kernel crashes without 'options L2CACHE_ENABLE.'


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/arch/arm/arm/cpufunc.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/arm/cpufunc.c
diff -u src/sys/arch/arm/arm/cpufunc.c:1.154 src/sys/arch/arm/arm/cpufunc.c:1.155
--- src/sys/arch/arm/arm/cpufunc.c:1.154	Thu May 14 05:39:32 2015
+++ src/sys/arch/arm/arm/cpufunc.c	Wed Jun  3 02:30:11 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.154 2015/05/14 05:39:32 hsuenaga Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.155 2015/06/03 02:30:11 hsuenaga Exp $	*/
 
 /*
  * arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.154 2015/05/14 05:39:32 hsuenaga Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.155 2015/06/03 02:30:11 hsuenaga Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_cpuoptions.h"
@@ -1380,6 +1380,10 @@ struct cpu_functions pj4bv7_cpufuncs = {
 	.cf_dcache_inv_range	= armv7_dcache_inv_range,
 	.cf_dcache_wb_range	= armv7_dcache_wb_range,
 
+	.cf_sdcache_wbinv_range	= (void *)cpufunc_nullop,
+	.cf_sdcache_inv_range	= (void *)cpufunc_nullop,
+	.cf_sdcache_wb_range	= (void *)cpufunc_nullop,
+
 	.cf_idcache_wbinv_all	= armv7_idcache_wbinv_all,
 	.cf_idcache_wbinv_range	= armv7_idcache_wbinv_range,
 



CVS commit: src/sys/net

2015-06-02 Thread SUENAGA Hiroki
Module Name:src
Committed By:   hsuenaga
Date:   Wed Jun  3 02:17:51 UTC 2015

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

Log Message:
Obtain softnet_lock before entering IP networking stack from gif software
interrupt.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/net/if_gif.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_gif.c
diff -u src/sys/net/if_gif.c:1.84 src/sys/net/if_gif.c:1.85
--- src/sys/net/if_gif.c:1.84	Mon Apr 20 10:19:54 2015
+++ src/sys/net/if_gif.c	Wed Jun  3 02:17:51 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gif.c,v 1.84 2015/04/20 10:19:54 roy Exp $	*/
+/*	$NetBSD: if_gif.c,v 1.85 2015/06/03 02:17:51 hsuenaga Exp $	*/
 /*	$KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.84 2015/04/20 10:19:54 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.85 2015/06/03 02:17:51 hsuenaga Exp $");
 
 #include "opt_inet.h"
 
@@ -344,12 +344,16 @@ gifintr(void *arg)
 		switch (sc->gif_psrc->sa_family) {
 #ifdef INET
 		case AF_INET:
+			mutex_enter(softnet_lock);
 			error = in_gif_output(ifp, family, m);
+			mutex_exit(softnet_lock);
 			break;
 #endif
 #ifdef INET6
 		case AF_INET6:
+			mutex_enter(softnet_lock);
 			error = in6_gif_output(ifp, family, m);
+			mutex_exit(softnet_lock);
 			break;
 #endif
 		default:



CVS commit: src/share/mk

2015-06-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun  2 23:00:25 UTC 2015

Modified Files:
src/share/mk: bsd.lib.mk

Log Message:
Strip the debug symbols via a temporary file, atomically replacing the full
random access archive to avoid races.


To generate a diff of this commit:
cvs rdiff -u -r1.356 -r1.357 src/share/mk/bsd.lib.mk

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

Modified files:

Index: src/share/mk/bsd.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.356 src/share/mk/bsd.lib.mk:1.357
--- src/share/mk/bsd.lib.mk:1.356	Sun Nov 30 20:34:30 2014
+++ src/share/mk/bsd.lib.mk	Tue Jun  2 19:00:25 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.lib.mk,v 1.356 2014/12/01 01:34:30 erh Exp $
+#	$NetBSD: bsd.lib.mk,v 1.357 2015/06/02 23:00:25 christos Exp $
 #	@(#)bsd.lib.mk	8.3 (Berkeley) 4/22/94
 
 .include 
@@ -641,7 +641,8 @@ ${_LIB.so.debug}: ${_LIB.so.full}
 	${_MKTARGET_CREATE}
 	(  ${OBJCOPY} --only-keep-debug ${_LIB.so.full} ${_LIB.so.debug} \
 	&& ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
-		--add-gnu-debuglink=${_LIB.so.debug} ${_LIB.so.full} \
+	--add-gnu-debuglink=${_LIB.so.debug} ${_LIB.so.full} \
+	${_LIB.so.full}.tmp && mv -f ${_LIB.so.full}.tmp ${_LIB.so.full} \
 	) || (rm -f ${.TARGET}; false)
 .endif
 



CVS commit: src/external/bsd/blacklist/bin

2015-06-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jun  2 21:03:46 UTC 2015

Modified Files:
src/external/bsd/blacklist/bin: blacklistd.8

Log Message:
prune bogus comma from Nm args


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/blacklist/bin/blacklistd.8

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

Modified files:

Index: src/external/bsd/blacklist/bin/blacklistd.8
diff -u src/external/bsd/blacklist/bin/blacklistd.8:1.11 src/external/bsd/blacklist/bin/blacklistd.8:1.12
--- src/external/bsd/blacklist/bin/blacklistd.8:1.11	Thu Apr 30 06:20:43 2015
+++ src/external/bsd/blacklist/bin/blacklistd.8	Tue Jun  2 21:03:46 2015
@@ -1,4 +1,4 @@
-.\" $NetBSD: blacklistd.8,v 1.11 2015/04/30 06:20:43 riz Exp $
+.\" $NetBSD: blacklistd.8,v 1.12 2015/06/02 21:03:46 snj Exp $
 .\"
 .\" Copyright (c) 2015 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -31,7 +31,7 @@
 .Dt BLACKLISTD 8
 .Os
 .Sh NAME
-.Nm blacklistd ,
+.Nm blacklistd
 .Nd block and release ports on demand to avoid DoS abuse
 .Sh SYNOPSIS
 .Nm



CVS commit: src/external/bsd/blacklist/bin

2015-06-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun  2 20:52:00 UTC 2015

Modified Files:
src/external/bsd/blacklist/bin: conf.c

Log Message:
restore address length before printing.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/blacklist/bin/conf.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/bsd/blacklist/bin/conf.c
diff -u src/external/bsd/blacklist/bin/conf.c:1.21 src/external/bsd/blacklist/bin/conf.c:1.22
--- src/external/bsd/blacklist/bin/conf.c:1.21	Tue Jun  2 10:02:10 2015
+++ src/external/bsd/blacklist/bin/conf.c	Tue Jun  2 16:52:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: conf.c,v 1.21 2015/06/02 14:02:10 christos Exp $	*/
+/*	$NetBSD: conf.c,v 1.22 2015/06/02 20:52:00 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: conf.c,v 1.21 2015/06/02 14:02:10 christos Exp $");
+__RCSID("$NetBSD: conf.c,v 1.22 2015/06/02 20:52:00 christos Exp $");
 
 #include 
 #include 
@@ -488,6 +488,7 @@ conf_amask_eq(const void *v1, const void
 out:
 	if (debug > 1) {
 		char b1[256], b2[256];
+		len <<= 2;
 		hexdump(b1, sizeof(b1), "a1", v1, len);
 		hexdump(b2, sizeof(b2), "a1", v2, len);
 		(*lfun)(LOG_DEBUG, "%s: %s != %s [0x%x]", __func__,



CVS commit: [netbsd-7] src/doc

2015-06-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jun  2 20:43:40 UTC 2015

Modified Files:
src/doc [netbsd-7]: CHANGES-7.0

Log Message:
774, 813, 815


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.316 -r1.1.2.317 src/doc/CHANGES-7.0

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-7.0
diff -u src/doc/CHANGES-7.0:1.1.2.316 src/doc/CHANGES-7.0:1.1.2.317
--- src/doc/CHANGES-7.0:1.1.2.316	Tue Jun  2 14:51:11 2015
+++ src/doc/CHANGES-7.0	Tue Jun  2 20:43:40 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.316 2015/06/02 14:51:11 sborrill Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.317 2015/06/02 20:43:40 snj Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -23626,3 +23626,58 @@ sys/external/bsd/drm2/radeon/radeon_pci.
 	PR#49744.
 	[mrg, ticket #818]
 
+sbin/gpt/Makefile1.9-1.13
+sbin/gpt/add.c	1.25-1.27
+sbin/gpt/backup.c1.2-1.8
+sbin/gpt/biosboot.c1.8-1.14
+sbin/gpt/create.c1.8-1.12
+sbin/gpt/destroy.c1.5, 1.6
+sbin/gpt/drvctl.c1.1
+sbin/gpt/gpt.8	1.29-1.36
+sbin/gpt/gpt.c	1.29-1.40
+sbin/gpt/gpt.h	1.12-1.18
+sbin/gpt/gpt_uuid.c1.1-1.10
+sbin/gpt/gpt_uuid.h1.1-1.3
+sbin/gpt/label.c1.15-1.18
+sbin/gpt/map.c	1.7
+sbin/gpt/migrate.c1.15-1.21
+sbin/gpt/recover.c1.5
+sbin/gpt/remove.c1.13-1.16
+sbin/gpt/resize.c1.9-1.11
+sbin/gpt/resizedisk.c1.1-1.6
+sbin/gpt/restore.c1.2-1.7
+sbin/gpt/set.c	1.3-1.5
+sbin/gpt/show.c	1.16-1.21
+sbin/gpt/type.c	1.1-1.6
+sbin/gpt/unset.c1.3-1.5
+
+	gpt(8): Complete overhaul, including adding follwing subcommands:
+resize, set, unset, backup, restore, and resizedisk.
+gpt(8): added type subcommand to modify partition type.
+	[jnemeth, ticket #774]
+
+sys/arch/arm/include/profile.h			1.17 via patch
+
+	ARM has deprecated using both PC and LR in the register list of
+	pop with ARMv6T2, so split the instructions up.
+	[joerg, ticket #813]
+
+external/bsd/blacklist/bin/conf.c		1.19, 1.20
+external/bsd/blacklist/etc/blacklistd.conf	1.4
+external/bsd/blacklist/lib/bl.c			1.25, 1.26
+external/bsd/blacklist/test/Makefile		1.3
+external/bsd/blacklist/test/srvtest.c		1.10
+
+	blacklistd(8):
+	- Centralize and fix =/* parsing, now =/24 works again.
+	- Fix example in blacklistd.conf
+	- srvtest: add ability to test using a local socket.
+	- Put back setting uid and gid to -1 if they are not available.
+	- Merge the uid data too, so that we don't end up with multiple
+	  entries when we don't care about the uid in the config file. In
+	  this case sshd returns either uid=root|sshd depending on how we
+	  failed, so we used to get two entries.
+	- Make sure that we get the socket messages we expect, otherwise
+	  return NULL.
+	[christos, ticket #815]
+



CVS commit: [netbsd-7] src/external/bsd/blacklist

2015-06-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jun  2 20:32:44 UTC 2015

Modified Files:
src/external/bsd/blacklist/bin [netbsd-7]: conf.c
src/external/bsd/blacklist/etc [netbsd-7]: blacklistd.conf
src/external/bsd/blacklist/lib [netbsd-7]: bl.c
src/external/bsd/blacklist/test [netbsd-7]: Makefile srvtest.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #815):
external/bsd/blacklist/bin/conf.c: revision 1.19, 1.20
external/bsd/blacklist/etc/blacklistd.conf: revision 1.4
external/bsd/blacklist/lib/bl.c: revisions 1.25, 1.26
external/bsd/blacklist/test/Makefile: revision 1.3
external/bsd/blacklist/test/srvtest.c: revision 1.10
Centralize and fix =/* parsing, now =/24 works again.
XXX: pullup-7
--
fix example.
--
Add ability to test using a local socket.
--
put back setting uid and gid to -1 if they are not available.
--
Merge the uid data too, so that we don't end up with multiple entries
when we don't care about the uid in the config file. In this case sshd
returns either uid=root|sshd depending on how we failed, so we used to
get two entries.
--
Make sure that we get the socket messages we expect, otherwise return NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.18.2.2 -r1.18.2.3 src/external/bsd/blacklist/bin/conf.c
cvs rdiff -u -r1.3.2.2 -r1.3.2.3 \
src/external/bsd/blacklist/etc/blacklistd.conf
cvs rdiff -u -r1.24.2.2 -r1.24.2.3 src/external/bsd/blacklist/lib/bl.c
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 src/external/bsd/blacklist/test/Makefile
cvs rdiff -u -r1.9.2.2 -r1.9.2.3 src/external/bsd/blacklist/test/srvtest.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/bsd/blacklist/bin/conf.c
diff -u src/external/bsd/blacklist/bin/conf.c:1.18.2.2 src/external/bsd/blacklist/bin/conf.c:1.18.2.3
--- src/external/bsd/blacklist/bin/conf.c:1.18.2.2	Thu Apr 30 06:07:33 2015
+++ src/external/bsd/blacklist/bin/conf.c	Tue Jun  2 20:32:44 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: conf.c,v 1.18.2.2 2015/04/30 06:07:33 riz Exp $	*/
+/*	$NetBSD: conf.c,v 1.18.2.3 2015/06/02 20:32:44 snj Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: conf.c,v 1.18.2.2 2015/04/30 06:07:33 riz Exp $");
+__RCSID("$NetBSD: conf.c,v 1.18.2.3 2015/06/02 20:32:44 snj Exp $");
 
 #include 
 #include 
@@ -83,20 +83,38 @@ advance(char **p)
 }
 
 static int
-getnum(const char *f, size_t l, void *r, const char *p)
+getnum(const char *f, size_t l, bool local, void *rp, const char *name,
+const char *p)
 {
 	int e;
 	intmax_t im;
+	int *r = rp;
+
+	if (strcmp(p, "*") == 0) {
+		*r = -1;
+		return 0;
+	}
+	if (strcmp(p, "=") == 0) {
+		if (local)
+			goto out;
+		*r = -2;
+		return 0;
+	}
 
 	im = strtoi(p, NULL, 0, 0, INT_MAX, &e);
 	if (e == 0) {
-		*(int *)r = (int)im;
+		*r = (int)im;
 		return 0;
 	}
 
 	if (f == NULL)
 		return -1;
-	(*lfun)(LOG_ERR, "%s: %s, %zu: Bad number [%s]", __func__, f, l, p);
+	(*lfun)(LOG_ERR, "%s: %s, %zu: Bad number for %s [%s]", __func__, f, l,
+	   name,  p);
+	return -1;
+out:
+	(*lfun)(LOG_ERR, "%s: %s, %zu: `=' for %s not allowed in local config",
+	__func__, f, l, name);
 	return -1;
 
 }
@@ -104,25 +122,7 @@ getnum(const char *f, size_t l, void *r,
 static int
 getnfail(const char *f, size_t l, bool local, struct conf *c, const char *p)
 {
-	if (strcmp(p, "*") == 0) {
-		c->c_nfail = -1;
-		return 0;
-	}
-	if (strcmp(p, "=") == 0) {
-		if (local)
-			goto out;
-		c->c_nfail = -2;
-		return 0;
-	}
-	if (getnum(NULL, 0, &c->c_nfail, p) == 0)
-		return 0;
-
-	(*lfun)(LOG_ERR, "%s: %s, %zu: Bad nfail [%s]", __func__, f, l, p);
-	return -1;
-out:
-	(*lfun)(LOG_ERR, "%s: %s, %zu: `=' nfail not allowed in local config",
-	__func__, f, l);
-	return -1;
+	return getnum(f, l, local, &c->c_nfail, "nfail", p);
 }
 
 static int
@@ -186,7 +186,7 @@ out:
 }
 
 static int
-getport(const char *f, size_t l, void *r, const char *p)
+getport(const char *f, size_t l, bool local, void *r, const char *p)
 {
 	struct servent *sv;
 
@@ -200,11 +200,7 @@ getport(const char *f, size_t l, void *r
 		return 0;
 	}
 
-	if (getnum(NULL, 0, r, p) == 0)
-		return 0;
-
-	(*lfun)(LOG_ERR, "%s: %s, %zu: Bad service [%s]", __func__, f, l, p);
-	return -1;
+	return getnum(f, l, local, r, "service", p);
 }
 
 static int
@@ -317,7 +313,7 @@ gethostport(const char *f, size_t l, boo
 
 	if (strcmp(pstr, "*") == 0)
 		c->c_port = -1;
-	else if (getport(f, l, &c->c_port, pstr) == -1)
+	else if (getport(f, l, local, &c->c_port, pstr) == -1)
 		return -1;
 
 	if (port && c->c_port != -1)
@@ -336,10 +332,6 @@ static int
 getproto(const char *f, size_t l, bool local __unused, struct conf *c,
 const char *p)
 {
-	if (strcmp(p, "*") == 0) {
-		c->c_proto = -1;
-		return 0;
-	}
 	if (strcmp(p, "stream") == 0) {
 		c->c_proto = IPPROTO_TCP;
 		return 0;
@@ -

CVS commit: [netbsd-7] src/sys/arch/arm/include

2015-06-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jun  2 20:03:37 UTC 2015

Modified Files:
src/sys/arch/arm/include [netbsd-7]: profile.h

Log Message:
Pull up following revision(s) (requested by joerg in ticket #813):
sys/arch/arm/include/profile.h: revision 1.17 via patch
ARM has deprecated using both PC and LR in the register list of pop with
ARMv6T2, so split the instructions up.


To generate a diff of this commit:
cvs rdiff -u -r1.14.2.1 -r1.14.2.2 src/sys/arch/arm/include/profile.h

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

Modified files:

Index: src/sys/arch/arm/include/profile.h
diff -u src/sys/arch/arm/include/profile.h:1.14.2.1 src/sys/arch/arm/include/profile.h:1.14.2.2
--- src/sys/arch/arm/include/profile.h:1.14.2.1	Mon Dec  1 08:59:04 2014
+++ src/sys/arch/arm/include/profile.h	Tue Jun  2 20:03:37 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: profile.h,v 1.14.2.1 2014/12/01 08:59:04 martin Exp $	*/
+/*	$NetBSD: profile.h,v 1.14.2.2 2015/06/02 20:03:37 snj Exp $	*/
 
 /*
  * Copyright (c) 2001 Ben Harris
@@ -76,7 +76,8 @@
 	/*\
 	 * Restore registers that were trashed during mcount		\
 	 */\
-	__asm("pop	{r0-r3, lr, pc}");\
+	__asm("pop	{r0-r3, lr}");	\
+	__asm("pop	{pc}");		\
 	__asm(".size	" MCOUNT_ASM_NAME ", .-" MCOUNT_ASM_NAME);
 #elif defined(__ARM_DWARF_EH__)
 #define	MCOUNT\
@@ -116,7 +117,8 @@
 	/*\
 	 * Restore registers that were trashed during mcount		\
 	 */\
-	__asm("pop	{r0-r4, lr, pc}");\
+	__asm("pop	{r0-r4, lr}");	\
+	__asm("pop	{pc}");		\
 	__asm(".cfi_endproc");		\
 	__asm(".size	" MCOUNT_ASM_NAME ", .-" MCOUNT_ASM_NAME);
 #else
@@ -159,7 +161,8 @@
 	/*\
 	 * Restore registers that were trashed during mcount		\
 	 */\
-	__asm("pop	{r0-r4, lr, pc}");\
+	__asm("pop	{r0-r4, lr}");	\
+	__asm("pop	{pc}");		\
 	__asm(".cfi_endproc");		\
 	__asm(".fnend");		\
 	__asm(".size	" MCOUNT_ASM_NAME ", .-" MCOUNT_ASM_NAME);



CVS commit: [netbsd-7] src/sbin/gpt

2015-06-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jun  2 19:49:38 UTC 2015

Modified Files:
src/sbin/gpt [netbsd-7]: Makefile add.c backup.c biosboot.c create.c
destroy.c gpt.8 gpt.c gpt.h label.c map.c migrate.c recover.c
remove.c resize.c restore.c set.c show.c unset.c
Added Files:
src/sbin/gpt [netbsd-7]: drvctl.c gpt_uuid.c gpt_uuid.h resizedisk.c
type.c

Log Message:
Pull up following revision(s) (requested by jnemeth in ticket #774):
sbin/gpt/Makefile: revisions 1.9-1.13
sbin/gpt/add.c: revisions 1.25-1.27
sbin/gpt/backup.c: revisions 1.2-1.8
sbin/gpt/biosboot.c: revisions 1.8-1.14
sbin/gpt/create.c: revisions 1.8-1.12
sbin/gpt/destroy.c: revisions 1.5-1.6
sbin/gpt/drvctl.c: revision 1.1
sbin/gpt/gpt.8: revisions 1.29-1.36
sbin/gpt/gpt.c: revisions 1.29-1.40
sbin/gpt/gpt.h: revisions 1.12-1.18
sbin/gpt/gpt_uuid.c: revisions 1.1-1.10
sbin/gpt/gpt_uuid.h: revisions 1.1-1.3
sbin/gpt/label.c: revisions 1.15-1.18
sbin/gpt/map.c: revision 1.7
sbin/gpt/migrate.c: revisions 1.15-1.21
sbin/gpt/recover.c: revision 1.5
sbin/gpt/remove.c: revisions 1.13-1.16
sbin/gpt/resize.c: revisions 1.9-1.11
sbin/gpt/resizedisk.c: revisions 1.1-1.6
sbin/gpt/restore.c: revisions 1.2-1.7
sbin/gpt/set.c: revisions 1.3-1.5
sbin/gpt/show.c: revision 1.16-1.21
sbin/gpt/type.c: revisions 1.1-1.6
sbin/gpt/unset.c: revisions 1.3-1.5
- record the sector size of the disk
- correct confusion with end_cylinder and end_sector in MBRs
--
- dump all partitions, not just ones that are in use
- while here, squash a memory leak
 It shouldn't be necessary to backup unused partitions, however
the partition GUID is created at the time the GPT is created and
is never changed.  It shouldn't matter if the GUID of an unused
partition changes, but there may be some special case where it
does.  Since it isn't a big deal to record the unused partitions,
might as well do it.
--
Initial cut of gpt restore.  This functions correctly in testing,
but isn't all that pretty.  It has minimal error testing and may
leak memory.  It also only works with empty disks.  If passed "-F"
flag, it will blank the disk for you.
--
document the new restore subcommand
--
- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT
--
Fix compile error observed on i386. Use PRIu64.
--
no C99isms in tool code
--
- handle a GPT that isn't an exact multiple of a sector
- adjust PMBR size, in case new disk is a different size
- don't leak as much memory
- clean up error handling somewhat
--
PR/44218 - David Young -- add "type" subcommand to change a partition type
--
PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L " as selector option
--
minor toolification: need libprop...
--
more toolification
--
more toolification changes
--
remove compat defines.
--
Add internal uuid support, since the linux+macos versions of the library
are different than than *bsd ones, and others might not have it at all.
--
Check size of correct buffer.  Note, just being pedantic as the buffer
being checked is the same size as the one that should have been checked.
--
correctly show partition type in the new world order
--
actually return the uuid when parsing one that is in numeric format
--
using random values for hdr->hdr_guid does not work very well
--
oops, forgot to update end of data area
--
It's HAVE_NBTOOL_CONFIG_H, not HAVE_NBTOOLS_CONFIG_H
--
Fix tools build on !NetBSD.
--
include  for both the non-tools build,
and the tools build on a host where the file exists.
Fixes a build problem on FreeBSD, reported by Herbert J. Skuhra, where
tools/compat's configure detected that be32dec() and friends were
available in the host's , so tools/compat did not provide
its own versions.
--
"0" is not guaranteed to be unique
--
provide a copy of the kernel uuid generator (with portable API calls) for
tools.
--
Allow specifying sector and media size on the command line.
--
Remove trailing whitespace.
--
Make gpt(8) generate v4 (random) uuids.
Don't needlessly leak your date/time and MAC address when you edit
the disk.
Read from /dev/urandom rather than calling arc4random or anything,
since this is a tool.  (Cygwin seems to have /dev/urandom, but yell
if this breaks the build on your exotic platform because it lacks
/dev/urandom.)
ok apb
--
Paranoia: choke noisily on EOF from /dev/urandom.
--
Report the argument instead of (null) when opendisk fails.
--
handle constness
--
handle constness better
--
Add some more common partition types.
--
Bump date for previous.
--
Fix handling of -t option for the type command.
Match any type, when no option is given, just like for the label command.
--
Factor out the getdisksize() drvctl method, and provide an alternative that
directly uses the disk ioctl's ins

CVS commit: src/lib/libedit/readline

2015-06-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun  2 15:36:45 UTC 2015

Modified Files:
src/lib/libedit/readline: readline.h

Log Message:
remove duplicate declaration


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libedit/readline/readline.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/libedit/readline/readline.h
diff -u src/lib/libedit/readline/readline.h:1.36 src/lib/libedit/readline/readline.h:1.37
--- src/lib/libedit/readline/readline.h:1.36	Tue Jun  2 11:35:31 2015
+++ src/lib/libedit/readline/readline.h	Tue Jun  2 11:36:45 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.h,v 1.36 2015/06/02 15:35:31 christos Exp $	*/
+/*	$NetBSD: readline.h,v 1.37 2015/06/02 15:36:45 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -40,7 +40,6 @@
 typedef int	  Function(const char *, int);
 typedef void	  VFunction(void);
 typedef void	  rl_vcpfunc_t(char *);
-typedef char	 *rl_compentry_func_t(const char *, int);
 typedef char	**rl_completion_func_t(const char *, int, int);
 typedef char *rl_compentry_func_t(const char *, int);
 typedef int	  rl_command_func_t(int, int);



CVS commit: src/lib/libedit

2015-06-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun  2 15:35:31 UTC 2015

Modified Files:
src/lib/libedit: readline.c
src/lib/libedit/readline: readline.h

Log Message:
Adjust API to a more modern readline (Ryo Onodera)


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/lib/libedit/readline.c
cvs rdiff -u -r1.35 -r1.36 src/lib/libedit/readline/readline.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/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.116 src/lib/libedit/readline.c:1.117
--- src/lib/libedit/readline.c:1.116	Tue May 26 15:59:21 2015
+++ src/lib/libedit/readline.c	Tue Jun  2 11:35:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.116 2015/05/26 19:59:21 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.117 2015/06/02 15:35:31 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.116 2015/05/26 19:59:21 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.117 2015/06/02 15:35:31 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -78,7 +78,7 @@ FILE *rl_outstream = NULL;
 int rl_point = 0;
 int rl_end = 0;
 char *rl_line_buffer = NULL;
-VCPFunction *rl_linefunc = NULL;
+rl_vcpfunc_t *rl_linefunc = NULL;
 int rl_done = 0;
 VFunction *rl_event_hook = NULL;
 KEYMAP_ENTRY_ARRAY emacs_standard_keymap,
@@ -107,9 +107,9 @@ int rl_attempted_completion_over = 0;
 char *rl_basic_word_break_characters = break_chars;
 char *rl_completer_word_break_characters = NULL;
 char *rl_completer_quote_characters = NULL;
-CPFunction *rl_completion_entry_function = NULL;
+rl_compentry_func_t *rl_completion_entry_function = NULL;
 char *(*rl_completion_word_break_hook)(void) = NULL;
-CPPFunction *rl_attempted_completion_function = NULL;
+rl_completion_func_t *rl_attempted_completion_function = NULL;
 Function *rl_pre_input_hook = NULL;
 Function *rl_startup1_hook = NULL;
 int (*rl_getc_function)(FILE *) = NULL;
@@ -1831,7 +1831,7 @@ rl_complete(int ignore __attribute__((__
 
 	/* Just look at how many global variables modify this operation! */
 	return fn_complete(e,
-	(CPFunction *)rl_completion_entry_function,
+	(rl_compentry_func_t *)rl_completion_entry_function,
 	rl_attempted_completion_function,
 	ct_decode_string(rl_basic_word_break_characters, &wbreak_conv),
 	ct_decode_string(breakchars, &sprefix_conv),
@@ -2009,7 +2009,7 @@ rl_callback_read_char(void)
 }
 
 void 
-rl_callback_handler_install(const char *prompt, VCPFunction *linefunc)
+rl_callback_handler_install(const char *prompt, rl_vcpfunc_t *linefunc)
 {
 	if (e == NULL) {
 		rl_initialize();

Index: src/lib/libedit/readline/readline.h
diff -u src/lib/libedit/readline/readline.h:1.35 src/lib/libedit/readline/readline.h:1.36
--- src/lib/libedit/readline/readline.h:1.35	Tue May 26 15:59:21 2015
+++ src/lib/libedit/readline/readline.h	Tue Jun  2 11:35:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.h,v 1.35 2015/05/26 19:59:21 christos Exp $	*/
+/*	$NetBSD: readline.h,v 1.36 2015/06/02 15:35:31 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -39,9 +39,9 @@
 /* typedefs */
 typedef int	  Function(const char *, int);
 typedef void	  VFunction(void);
-typedef void	  VCPFunction(char *);
-typedef char	 *CPFunction(const char *, int);
-typedef char	**CPPFunction(const char *, int, int);
+typedef void	  rl_vcpfunc_t(char *);
+typedef char	 *rl_compentry_func_t(const char *, int);
+typedef char	**rl_completion_func_t(const char *, int, int);
 typedef char *rl_compentry_func_t(const char *, int);
 typedef int	  rl_command_func_t(int, int);
 
@@ -108,9 +108,9 @@ extern int		 max_input_history;
 extern char		*rl_basic_word_break_characters;
 extern char		*rl_completer_word_break_characters;
 extern char		*rl_completer_quote_characters;
-extern CPFunction	*rl_completion_entry_function;
+extern rl_compentry_func_t *rl_completion_entry_function;
 extern char		*(*rl_completion_word_break_hook)(void);
-extern CPPFunction	*rl_attempted_completion_function;
+extern rl_completion_func_t *rl_attempted_completion_function;
 extern int		 rl_attempted_completion_over;
 extern int		rl_completion_type;
 extern int		rl_completion_query_items;
@@ -175,7 +175,7 @@ char		*filename_completion_function(cons
 char		*username_completion_function(const char *, int);
 int		 rl_complete(int, int);
 int		 rl_read_key(void);
-char	   **completion_matches(const char *, CPFunction *);
+char	   **completion_matches(const char *, rl_compentry_func_t *);
 void		 rl_display_match_list(char **, int, int);
 
 int		 rl_insert(int, int);
@@ -184,7 +184,7 @@ void		 rl_reset_terminal(const char *);
 int		 rl_bind_key(int, rl_command_func_t *);
 int		 rl_newline(int, int);
 void		 rl_callback_read_char(void);
-void		 rl_callback_handler_install

CVS commit: [netbsd-7] src/doc

2015-06-02 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Tue Jun  2 14:51:11 UTC 2015

Modified Files:
src/doc [netbsd-7]: CHANGES-7.0

Log Message:
Ticket #818


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.315 -r1.1.2.316 src/doc/CHANGES-7.0

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-7.0
diff -u src/doc/CHANGES-7.0:1.1.2.315 src/doc/CHANGES-7.0:1.1.2.316
--- src/doc/CHANGES-7.0:1.1.2.315	Tue Jun  2 10:14:45 2015
+++ src/doc/CHANGES-7.0	Tue Jun  2 14:51:11 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.315 2015/06/02 10:14:45 sborrill Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.316 2015/06/02 14:51:11 sborrill Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -23620,3 +23620,9 @@ sys/arch/vax/vsa/vsbus.c			1.61
 	port-vax/49935.
 	[abs, ticket #817]
 
+sys/external/bsd/drm2/radeon/radeon_pci.c	1.10
+
+	Disable drmkms on R100 and most R200 cards. Works around
+	PR#49744.
+	[mrg, ticket #818]
+



CVS commit: [netbsd-7] src/sys/external/bsd/drm2/radeon

2015-06-02 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Tue Jun  2 14:50:50 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/radeon [netbsd-7]: radeon_pci.c

Log Message:
Pull up the following revisions(s) (requested by mrg in ticket #818):
sys/external/bsd/drm2/radeon/radeon_pci.c:  revision 1.10

Disable drmkms on R100 and most R200 cards. Works around PR#49744.


To generate a diff of this commit:
cvs rdiff -u -r1.4.4.2 -r1.4.4.3 \
src/sys/external/bsd/drm2/radeon/radeon_pci.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/external/bsd/drm2/radeon/radeon_pci.c
diff -u src/sys/external/bsd/drm2/radeon/radeon_pci.c:1.4.4.2 src/sys/external/bsd/drm2/radeon/radeon_pci.c:1.4.4.3
--- src/sys/external/bsd/drm2/radeon/radeon_pci.c:1.4.4.2	Thu Apr 23 07:31:17 2015
+++ src/sys/external/bsd/drm2/radeon/radeon_pci.c	Tue Jun  2 14:50:50 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_pci.c,v 1.4.4.2 2015/04/23 07:31:17 snj Exp $	*/
+/*	$NetBSD: radeon_pci.c,v 1.4.4.3 2015/06/02 14:50:50 sborrill Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_pci.c,v 1.4.4.2 2015/04/23 07:31:17 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_pci.c,v 1.4.4.3 2015/06/02 14:50:50 sborrill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "vga.h"
@@ -118,10 +118,14 @@ extern struct drm_driver *const radeon_d
 extern const struct pci_device_id *const radeon_device_ids;
 extern const size_t radeon_n_device_ids;
 
+/* Set this to false if you want to match R100/R200 */
+bool radeon_pci_ignore_r100_r200 = true;
+
 static bool
 radeon_pci_lookup(const struct pci_attach_args *pa, unsigned long *flags)
 {
 	size_t i;
+	enum radeon_family fam;
 
 	for (i = 0; i < radeon_n_device_ids; i++) {
 		if ((PCI_VENDOR(pa->pa_id) == radeon_device_ids[i].vendor) &&
@@ -133,6 +137,11 @@ radeon_pci_lookup(const struct pci_attac
 	if (i == radeon_n_device_ids)
 		return false;
 
+	/* NetBSD drm2 fails on R100 and many R200 chipsets, disable for now  */
+	fam = radeon_device_ids[i].driver_data & RADEON_FAMILY_MASK;
+	if (radeon_pci_ignore_r100_r200 && fam < CHIP_RV280)
+		return false;
+
 	if (flags)
 		*flags = radeon_device_ids[i].driver_data;
 	return true;



CVS commit: src/sys/dev/pci

2015-06-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jun  2 14:19:26 UTC 2015

Modified Files:
src/sys/dev/pci: if_wm.c if_wmreg.h if_wmvar.h

Log Message:
Fix a lot of bugs to 82575 and newer's SERDES based systems work.
 - Add SERDES specific functions.
 - Fix IO pin configuration.
 - Reset autonego timer when link becomes up.

TODO:
 - Fix a bug that SFP ROM can't read.
 - Perhaps some work is required for 8257[12] serdes systems.
 - Remove duplicated code in TBI's link related functions.


To generate a diff of this commit:
cvs rdiff -u -r1.324 -r1.325 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/if_wmvar.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/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.324 src/sys/dev/pci/if_wm.c:1.325
--- src/sys/dev/pci/if_wm.c:1.324	Tue Jun  2 13:26:36 2015
+++ src/sys/dev/pci/if_wm.c	Tue Jun  2 14:19:26 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.324 2015/06/02 13:26:36 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.325 2015/06/02 14:19:26 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -81,7 +81,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.324 2015/06/02 13:26:36 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.325 2015/06/02 14:19:26 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -392,8 +392,8 @@ struct wm_softc {
 	uint32_t sc_pba;		/* prototype PBA register */
 
 	int sc_tbi_linkup;		/* TBI link status */
-	int sc_tbi_anegticks;		/* autonegotiation ticks */
-	int sc_tbi_ticks;		/* tbi ticks */
+	int sc_tbi_serdes_anegticks;	/* autonegotiation ticks */
+	int sc_tbi_serdes_ticks;	/* tbi ticks */
 
 	int sc_mchash_type;		/* multicast filter offset */
 
@@ -595,6 +595,7 @@ static void	wm_txintr(struct wm_softc *)
 static void	wm_rxintr(struct wm_softc *);
 static void	wm_linkintr_gmii(struct wm_softc *, uint32_t);
 static void	wm_linkintr_tbi(struct wm_softc *, uint32_t);
+static void	wm_linkintr_serdes(struct wm_softc *, uint32_t);
 static void	wm_linkintr(struct wm_softc *, uint32_t);
 static int	wm_intr(void *);
 
@@ -602,6 +603,8 @@ static int	wm_intr(void *);
  * Media related.
  * GMII, SGMII, TBI, SERDES and SFP.
  */
+/* Common */
+static void	wm_tbi_serdes_set_linkled(struct wm_softc *);
 /* GMII related */
 static void	wm_gmii_reset(struct wm_softc *);
 static int	wm_get_phy_id_82575(struct wm_softc *);
@@ -631,12 +634,16 @@ static bool	wm_sgmii_uses_mdio(struct wm
 static int	wm_sgmii_readreg(device_t, int, int);
 static void	wm_sgmii_writereg(device_t, int, int, int);
 /* TBI related */
-static int	wm_check_for_link(struct wm_softc *);
 static void	wm_tbi_mediainit(struct wm_softc *);
 static int	wm_tbi_mediachange(struct ifnet *);
 static void	wm_tbi_mediastatus(struct ifnet *, struct ifmediareq *);
-static void	wm_tbi_set_linkled(struct wm_softc *);
-static void	wm_tbi_check_link(struct wm_softc *);
+static int	wm_check_for_link(struct wm_softc *);
+static void	wm_tbi_tick(struct wm_softc *);
+/* SERDES related */
+static void	wm_serdes_power_up_link_82575(struct wm_softc *);
+static int	wm_serdes_mediachange(struct ifnet *);
+static void	wm_serdes_mediastatus(struct ifnet *, struct ifmediareq *);
+static void	wm_serdes_tick(struct wm_softc *);
 /* SFP related */
 static int	wm_sfp_read_data_byte(struct wm_softc *, uint16_t, uint8_t *);
 static uint32_t	wm_sfp_get_media_type(struct wm_softc *);
@@ -728,6 +735,7 @@ static void	wm_k1_gig_workaround_hv(stru
 static void	wm_set_mdio_slow_mode_hv(struct wm_softc *);
 static void	wm_configure_k1_ich8lan(struct wm_softc *, int);
 static void	wm_reset_init_script_82575(struct wm_softc *);
+static void	wm_reset_mdicnfg_82580(struct wm_softc *);
 
 CFATTACH_DECL3_NEW(wm, sizeof(struct wm_softc),
 wm_match, wm_attach, wm_detach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN);
@@ -1366,7 +1374,7 @@ wm_attach(device_t parent, device_t self
 	prop_data_t ea;
 	prop_number_t pn;
 	uint8_t enaddr[ETHER_ADDR_LEN];
-	uint16_t cfg1, cfg2, swdpin, io3;
+	uint16_t cfg1, cfg2, swdpin, nvmword;
 	pcireg_t preg, memtype;
 	uint16_t eeprom_data, apme_mask;
 	bool force_clear_smbi;
@@ -2046,6 +2054,14 @@ wm_attach(device_t parent, device_t self
 		printf("WOL\n");
 #endif
 
+	if ((sc->sc_type == WM_T_82575) || (sc->sc_type == WM_T_82576)) {
+		/* Check NVM for autonegotiation */
+		if (wm_nvm_read(sc, NVM_OFF_COMPAT, 1, &nvmword) == 0) {
+			if ((nvmword & NVM_COMPAT_SERDES_FORCE_MODE) != 0)
+sc->sc_flags |= WM_F_PCS_DIS_AUTONEGO;
+		}
+	}
+
 	/*
 	 * XXX need special handling for some multiple port cards
 	 * to disable a paticular port.
@@ -2067,17 +2083,37 @@ wm_attach(device_t parent, device_t self
 
 	if (cfg1 & NVM_CFG1_ILOS)
 		sc->sc_ctrl |= CTRL_ILOS;
-	if (sc->sc_type >= WM_T_82544) {
-		sc->sc_ctrl |=
-		((swdpin >> NVM_SWDPIN_SWDPIO_S

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

2015-06-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jun  2 14:06:16 UTC 2015

Modified Files:
src/sys/arch/arm/arm32: irq_dispatch.S

Log Message:
Add a clrex/dmb to irq path as recommended by ARM.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/arm32/irq_dispatch.S

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/arm32/irq_dispatch.S
diff -u src/sys/arch/arm/arm32/irq_dispatch.S:1.15 src/sys/arch/arm/arm32/irq_dispatch.S:1.16
--- src/sys/arch/arm/arm32/irq_dispatch.S:1.15	Sun Aug 18 06:28:18 2013
+++ src/sys/arch/arm/arm32/irq_dispatch.S	Tue Jun  2 14:06:16 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: irq_dispatch.S,v 1.15 2013/08/18 06:28:18 matt Exp $	*/
+/*	$NetBSD: irq_dispatch.S,v 1.16 2015/06/02 14:06:16 matt Exp $	*/
 
 /*
  * Copyright (c) 2002 Fujitsu Component Limited
@@ -97,6 +97,11 @@ ARM_ASENTRY_NP(irq_entry)
 	PUSHFRAMEINSVC			/* Push an interrupt frame */
 	ENABLE_ALIGNMENT_FAULTS		/* finishes with curcpu() in r4 */
 
+#ifdef _ARM_ARCH_7
+	clrex/* force all strex to fail */
+	dmb/* synchronize memory writes */
+#endif
+
 	/*
 	 * Increment the interrupt nesting depth and call the interrupt
 	 * dispatch routine.  We've pushed a frame, so we can safely use
@@ -153,6 +158,11 @@ ARM_ASENTRY_NP(irq_idle_entry)
 	add	r1, r6, #1
 	str	r1, [r4, #CI_INTR_DEPTH]
 
+#ifdef _ARM_ARCH_7
+	clrex/* force all strex to fail */
+	dmb/* synchronize memory writes */
+#endif
+
 	mov	r0, sp			/* arg for dispatcher */
 	bl	ARM_IRQ_HANDLER
 



CVS commit: src/sys/rump/librump/rumpkern

2015-06-02 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Jun  2 14:07:48 UTC 2015

Modified Files:
src/sys/rump/librump/rumpkern: vm.c

Log Message:
In case pagedaemon can't release any more memory, use kpause() instead
of cv_timedwait() on the pagedaemon condvar -- it's no use constantly
waking the pagedaemon up for new memory allocation attempts, as will
happen e.g. if new network connections are constantly pouring in.


To generate a diff of this commit:
cvs rdiff -u -r1.166 -r1.167 src/sys/rump/librump/rumpkern/vm.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/rump/librump/rumpkern/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.166 src/sys/rump/librump/rumpkern/vm.c:1.167
--- src/sys/rump/librump/rumpkern/vm.c:1.166	Sat Apr 18 15:49:18 2015
+++ src/sys/rump/librump/rumpkern/vm.c	Tue Jun  2 14:07:48 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm.c,v 1.166 2015/04/18 15:49:18 pooka Exp $	*/
+/*	$NetBSD: vm.c,v 1.167 2015/06/02 14:07:48 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.166 2015/04/18 15:49:18 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.167 2015/06/02 14:07:48 pooka Exp $");
 
 #include 
 #include 
@@ -1176,7 +1176,7 @@ uvm_pageout(void *arg)
 		uvmexp.paging == 0) {
 			rumpuser_dprintf("pagedaemoness: failed to reclaim "
 			"memory ... sleeping (deadlock?)\n");
-			cv_timedwait(&pdaemoncv, &pdaemonmtx, hz);
+			kpause("pddlk", false, hz, &pdaemonmtx);
 		}
 	}
 



CVS commit: src/external/bsd/blacklist/bin

2015-06-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun  2 14:02:10 UTC 2015

Modified Files:
src/external/bsd/blacklist/bin: blacklistctl.c conf.c run.c state.c
support.c support.h

Log Message:
Add more debugging, simplify.
Use symbolic constants: -2=FEQUALS, -1=FSTAR


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/blacklist/bin/blacklistctl.c
cvs rdiff -u -r1.20 -r1.21 src/external/bsd/blacklist/bin/conf.c
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/blacklist/bin/run.c
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/blacklist/bin/state.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/blacklist/bin/support.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/blacklist/bin/support.h

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

Modified files:

Index: src/external/bsd/blacklist/bin/blacklistctl.c
diff -u src/external/bsd/blacklist/bin/blacklistctl.c:1.17 src/external/bsd/blacklist/bin/blacklistctl.c:1.18
--- src/external/bsd/blacklist/bin/blacklistctl.c:1.17	Mon Feb  2 17:01:55 2015
+++ src/external/bsd/blacklist/bin/blacklistctl.c	Tue Jun  2 10:02:10 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: blacklistctl.c,v 1.17 2015/02/02 22:01:55 christos Exp $	*/
+/*	$NetBSD: blacklistctl.c,v 1.18 2015/06/02 14:02:10 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: blacklistctl.c,v 1.17 2015/02/02 22:01:55 christos Exp $");
+__RCSID("$NetBSD: blacklistctl.c,v 1.18 2015/06/02 14:02:10 christos Exp $");
 
 #include 
 #include 
@@ -85,7 +85,7 @@ main(int argc, char *argv[])
 	argc--;
 	argv++;
 
-	while ((o = getopt(argc, argv, "abdrw")) != -1)
+	while ((o = getopt(argc, argv, "abD:drw")) != -1)
 		switch (o) {
 		case 'a':
 			all = 1;
@@ -93,6 +93,9 @@ main(int argc, char *argv[])
 			break;
 		case 'b':
 			blocked = 1;
+		case 'D':
+			dbname = optarg;
+			break;
 			break;
 		case 'd':
 			debug++;

Index: src/external/bsd/blacklist/bin/conf.c
diff -u src/external/bsd/blacklist/bin/conf.c:1.20 src/external/bsd/blacklist/bin/conf.c:1.21
--- src/external/bsd/blacklist/bin/conf.c:1.20	Sat May 30 18:39:14 2015
+++ src/external/bsd/blacklist/bin/conf.c	Tue Jun  2 10:02:10 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: conf.c,v 1.20 2015/05/30 22:39:14 christos Exp $	*/
+/*	$NetBSD: conf.c,v 1.21 2015/06/02 14:02:10 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: conf.c,v 1.20 2015/05/30 22:39:14 christos Exp $");
+__RCSID("$NetBSD: conf.c,v 1.21 2015/06/02 14:02:10 christos Exp $");
 
 #include 
 #include 
@@ -56,6 +56,7 @@ __RCSID("$NetBSD: conf.c,v 1.20 2015/05/
 
 #include "bl.h"
 #include "internal.h"
+#include "support.h"
 #include "conf.h"
 
 
@@ -71,6 +72,9 @@ struct sockaddr_if {
 
 static int conf_is_interface(const char *);
 
+#define FSTAR	-1
+#define FEQUAL	-2
+
 static void
 advance(char **p)
 {
@@ -91,13 +95,13 @@ getnum(const char *f, size_t l, bool loc
 	int *r = rp;
 
 	if (strcmp(p, "*") == 0) {
-		*r = -1;
+		*r = FSTAR;
 		return 0;
 	}
 	if (strcmp(p, "=") == 0) {
 		if (local)
 			goto out;
-		*r = -2;
+		*r = FEQUAL;
 		return 0;
 	}
 
@@ -134,13 +138,13 @@ getsecs(const char *f, size_t l, bool lo
 
 	tot = 0;
 	if (strcmp(p, "*") == 0) {
-		c->c_duration = -1;
+		c->c_duration = FSTAR;
 		return 0;
 	}
 	if (strcmp(p, "=") == 0) {
 		if (local)
 			goto out;
-		c->c_duration = -2;
+		c->c_duration = FEQUAL;
 		return 0;
 	}
 again:
@@ -204,39 +208,22 @@ getport(const char *f, size_t l, bool lo
 }
 
 static int
-getmask(const char *f, size_t l, bool local __unused, const char **p, int def)
+getmask(const char *f, size_t l, bool local, const char **p, int *mask)
 {
 	char *d;
-	int e;
-	intmax_t im;
 	const char *s = *p; 
 
 	if ((d = strchr(s, ':')) != NULL) {
 		*d++ = '\0';
 		*p = d;
 	}
-	if ((d = strchr(s, '/')) == NULL)
-		return def;
-
-	*d++ = '\0';
-	if (strcmp(d, "=") == 0) {
-		if (local)
-			goto out;
-		return -2;
+	if ((d = strchr(s, '/')) == NULL) {
+		*mask = FSTAR;
+		return 0;
 	}
-	if (strcmp(d, "*") == 0)
-		return def;
-
-	im = strtoi(d, NULL, 0, 0, def, &e);
-	if (e == 0)
-		return (int)im;
 
-	(*lfun)(LOG_ERR, "%s: %s, %zu: Bad mask [%s]", __func__, f, l, d);
-	return -1;
-out:
-	(*lfun)(LOG_ERR, "%s: %s, %zu: `=' name not allowed in local"
-	" config", __func__, f, l);
-	return -1;
+	*d++ = '\0';
+	return getnum(f, l, local, mask, "mask", d);
 }
 
 static int
@@ -247,8 +234,8 @@ gethostport(const char *f, size_t l, boo
 	const char *pstr;
 
 	if (strcmp(p, "*") == 0) {
-		c->c_port = -1;
-		c->c_lmask = -1;
+		c->c_port = FSTAR;
+		c->c_lmask = FSTAR;
 		return 0;
 	}
 
@@ -259,12 +246,9 @@ gethostport(const char *f, size_t l, boo
 	} else
 		pstr = p;
 
-	if ((c->c_lmask = getmask(f, l, local, &pstr, 256)) == -1)
+	if (getmask(f, l, local, &pstr, &c->c_lmask) == -1)
 		goto out;
 
-	if (c->c_lmask == 256)
-		

CVS commit: src/external/bsd/blacklist/libexec

2015-06-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun  2 14:02:39 UTC 2015

Modified Files:
src/external/bsd/blacklist/libexec: blacklistd-helper

Log Message:
make proto and port optional


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/blacklist/libexec/blacklistd-helper

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

Modified files:

Index: src/external/bsd/blacklist/libexec/blacklistd-helper
diff -u src/external/bsd/blacklist/libexec/blacklistd-helper:1.4 src/external/bsd/blacklist/libexec/blacklistd-helper:1.5
--- src/external/bsd/blacklist/libexec/blacklistd-helper:1.4	Wed Jan 28 20:05:25 2015
+++ src/external/bsd/blacklist/libexec/blacklistd-helper	Tue Jun  2 10:02:39 2015
@@ -11,7 +11,13 @@
 
 case "$1" in
 add)
-	exec /sbin/npfctl rule $2 add block in final proto $3 from $4/$5 to any port $6
+	if [ -n "$3" ]; then
+		proto="proto $3"
+	fi
+	if [ -n "$6" ]; then
+		port="port $6"
+	fi
+	exec /sbin/npfctl rule $2 add block in final $proto from $4/$5 to any $port
 	;;
 rem)
 	exec /sbin/npfctl rule $2 rem-id $7



CVS commit: src/sys/dev/pci

2015-06-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jun  2 13:26:36 UTC 2015

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
No functional change:
 - Reorder functions.
 - Renale wm_tbi_check_link() to wm_tbi_tick() because this function acts as
   mii_tick().


To generate a diff of this commit:
cvs rdiff -u -r1.323 -r1.324 src/sys/dev/pci/if_wm.c

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.323 src/sys/dev/pci/if_wm.c:1.324
--- src/sys/dev/pci/if_wm.c:1.323	Tue Jun  2 03:49:10 2015
+++ src/sys/dev/pci/if_wm.c	Tue Jun  2 13:26:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.323 2015/06/02 03:49:10 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.324 2015/06/02 13:26:36 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -81,7 +81,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.323 2015/06/02 03:49:10 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.324 2015/06/02 13:26:36 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -606,8 +606,8 @@ static int	wm_intr(void *);
 static void	wm_gmii_reset(struct wm_softc *);
 static int	wm_get_phy_id_82575(struct wm_softc *);
 static void	wm_gmii_mediainit(struct wm_softc *, pci_product_id_t);
-static void	wm_gmii_mediastatus(struct ifnet *, struct ifmediareq *);
 static int	wm_gmii_mediachange(struct ifnet *);
+static void	wm_gmii_mediastatus(struct ifnet *, struct ifmediareq *);
 static void	wm_i82543_mii_sendbits(struct wm_softc *, uint32_t, int);
 static uint32_t	wm_i82543_mii_recvbits(struct wm_softc *);
 static int	wm_gmii_i82543_readreg(device_t, int, int);
@@ -633,8 +633,8 @@ static void	wm_sgmii_writereg(device_t, 
 /* TBI related */
 static int	wm_check_for_link(struct wm_softc *);
 static void	wm_tbi_mediainit(struct wm_softc *);
-static void	wm_tbi_mediastatus(struct ifnet *, struct ifmediareq *);
 static int	wm_tbi_mediachange(struct ifnet *);
+static void	wm_tbi_mediastatus(struct ifnet *, struct ifmediareq *);
 static void	wm_tbi_set_linkled(struct wm_softc *);
 static void	wm_tbi_check_link(struct wm_softc *);
 /* SFP related */
@@ -6628,21 +6628,6 @@ wm_gmii_mediainit(struct wm_softc *sc, p
 }
 
 /*
- * wm_gmii_mediastatus:	[ifmedia interface function]
- *
- *	Get the current interface media status on a 1000BASE-T device.
- */
-static void
-wm_gmii_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
-{
-	struct wm_softc *sc = ifp->if_softc;
-
-	ether_mediastatus(ifp, ifmr);
-	ifmr->ifm_active = (ifmr->ifm_active & ~IFM_ETH_FMASK)
-	| sc->sc_flowflags;
-}
-
-/*
  * wm_gmii_mediachange:	[ifmedia interface function]
  *
  *	Set hardware to newly-selected media on a 1000BASE-T device.
@@ -6691,6 +6676,21 @@ wm_gmii_mediachange(struct ifnet *ifp)
 	return rc;
 }
 
+/*
+ * wm_gmii_mediastatus:	[ifmedia interface function]
+ *
+ *	Get the current interface media status on a 1000BASE-T device.
+ */
+static void
+wm_gmii_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
+{
+	struct wm_softc *sc = ifp->if_softc;
+
+	ether_mediastatus(ifp, ifmr);
+	ifmr->ifm_active = (ifmr->ifm_active & ~IFM_ETH_FMASK)
+	| sc->sc_flowflags;
+}
+
 #define	MDI_IO		CTRL_SWDPIN(2)
 #define	MDI_DIR		CTRL_SWDPIO(2)	/* host -> PHY */
 #define	MDI_CLK		CTRL_SWDPIN(3)
@@ -7482,82 +7482,6 @@ wm_sgmii_writereg(device_t self, int phy
 
 /* TBI related */
 
-/* XXX Currently TBI only */
-static int
-wm_check_for_link(struct wm_softc *sc)
-{
-	struct ifmedia_entry *ife = sc->sc_mii.mii_media.ifm_cur;
-	uint32_t rxcw;
-	uint32_t ctrl;
-	uint32_t status;
-	uint32_t sig;
-
-	if (sc->sc_mediatype == WM_MEDIATYPE_SERDES) {
-		sc->sc_tbi_linkup = 1;
-		return 0;
-	}
-
-	rxcw = CSR_READ(sc, WMREG_RXCW);
-	ctrl = CSR_READ(sc, WMREG_CTRL);
-	status = CSR_READ(sc, WMREG_STATUS);
-
-	sig = (sc->sc_type > WM_T_82544) ? CTRL_SWDPIN(1) : 0;
-
-	DPRINTF(WM_DEBUG_LINK, ("%s: %s: sig = %d, status_lu = %d, rxcw_c = %d\n",
-		device_xname(sc->sc_dev), __func__,
-		((ctrl & CTRL_SWDPIN(1)) == sig),
-		((status & STATUS_LU) != 0),
-		((rxcw & RXCW_C) != 0)
-		));
-
-	/*
-	 * SWDPIN   LU RXCW
-	 *  000
-	 *  001	(should not happen)
-	 *  010	(should not happen)
-	 *  011	(should not happen)
-	 *  100	Disable autonego and force linkup
-	 *  101	got /C/ but not linkup yet
-	 *  110	(linkup)
-	 *  111	If IFM_AUTO, back to autonego
-	 *
-	 */
-	if (((ctrl & CTRL_SWDPIN(1)) == sig)
-	&& ((status & STATUS_LU) == 0)
-	&& ((rxcw & RXCW_C) == 0)) {
-		DPRINTF(WM_DEBUG_LINK, ("%s: force linkup and fullduplex\n",
-			__func__));
-		sc->sc_tbi_linkup = 0;
-		/* Disable auto-negotiation in the TXCW register */
-		CSR_WRITE(sc, WMREG_TXCW, (sc->sc_txcw & ~TXCW_ANE));
-
-		/*
-		 * Force link-up and also force full-duplex.
-		 *
-		 * NOTE: CTRL was updated

CVS commit: [netbsd-7] src/sys/arch/vax/vsa

2015-06-02 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Tue Jun  2 10:14:22 UTC 2015

Modified Files:
src/sys/arch/vax/vsa [netbsd-7]: vsbus.c

Log Message:
Pull up the following revisions(s) (requested by abs in ticket #817):
sys/arch/vax/vsa/vsbus.c:   revision 1.61

Fix VAX46 and VAX48 vsbus attach config. Addresses PR port-vax/49935.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.60.14.1 src/sys/arch/vax/vsa/vsbus.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/vax/vsa/vsbus.c
diff -u src/sys/arch/vax/vsa/vsbus.c:1.60 src/sys/arch/vax/vsa/vsbus.c:1.60.14.1
--- src/sys/arch/vax/vsa/vsbus.c:1.60	Thu Jun 28 13:58:21 2012
+++ src/sys/arch/vax/vsa/vsbus.c	Tue Jun  2 10:14:22 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vsbus.c,v 1.60 2012/06/28 13:58:21 abs Exp $ */
+/*	$NetBSD: vsbus.c,v 1.60.14.1 2015/06/02 10:14:22 sborrill Exp $ */
 /*
  * Copyright (c) 1996, 1999 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vsbus.c,v 1.60 2012/06/28 13:58:21 abs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vsbus.c,v 1.60.14.1 2015/06/02 10:14:22 sborrill Exp $");
 
 #include "opt_cputype.h"
 
@@ -138,6 +138,7 @@ vsbus_attach(device_t parent, device_t s
 		sc->sc_intclr = (char *)sc->sc_vsregs + 15;
 		sc->sc_intmsk = (char *)sc->sc_vsregs + 12;
 		vsbus_dma_init(sc, 32768);
+		break;
 #endif
 
 	default:



CVS commit: [netbsd-7] src/doc

2015-06-02 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Tue Jun  2 10:14:45 UTC 2015

Modified Files:
src/doc [netbsd-7]: CHANGES-7.0

Log Message:
Ticket #817


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.314 -r1.1.2.315 src/doc/CHANGES-7.0

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-7.0
diff -u src/doc/CHANGES-7.0:1.1.2.314 src/doc/CHANGES-7.0:1.1.2.315
--- src/doc/CHANGES-7.0:1.1.2.314	Mon Jun  1 19:40:04 2015
+++ src/doc/CHANGES-7.0	Tue Jun  2 10:14:45 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.314 2015/06/01 19:40:04 snj Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.315 2015/06/02 10:14:45 sborrill Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -23614,3 +23614,9 @@ external/gpl3/gcc/dist/gcc/config/arm/t-
 	libraries on earm* machines.
 	[martin, ticket #816]
 
+sys/arch/vax/vsa/vsbus.c			1.61
+
+	Fix VAX46 and VAX48 vsbus attach config. Addresses PR
+	port-vax/49935.
+	[abs, ticket #817]
+



CVS commit: src/tests/net/net

2015-06-02 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Jun  2 07:32:50 UTC 2015

Modified Files:
src/tests/net/net: t_forwarding.sh

Log Message:
Check if tests surely failed with TTL exceeded


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/net/net/t_forwarding.sh

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

Modified files:

Index: src/tests/net/net/t_forwarding.sh
diff -u src/tests/net/net/t_forwarding.sh:1.4 src/tests/net/net/t_forwarding.sh:1.5
--- src/tests/net/net/t_forwarding.sh:1.4	Fri May 29 02:06:46 2015
+++ src/tests/net/net/t_forwarding.sh	Tue Jun  2 07:32:50 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: t_forwarding.sh,v 1.4 2015/05/29 02:06:46 ozaki-r Exp $
+#	$NetBSD: t_forwarding.sh,v 1.5 2015/06/02 07:32:50 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -279,7 +279,8 @@ test_ttl()
 	export RUMP_SERVER=$SOCKSRC
 	$DEBUG && rump.ifconfig -v shmif0
 	atf_check -s exit:0 -o ignore rump.ping -q -n -w $TIMEOUT -c 1 -T 1 $IP4SRCGW
-	atf_check -s not-exit:0 -o ignore rump.ping -q -n -w $TIMEOUT -c 1 -T 1 $IP4DST
+	atf_check -s not-exit:0 -o match:'Time To Live exceeded' \
+	rump.ping -v -n -w $TIMEOUT -c 1 -T 1 $IP4DST
 	atf_check -s exit:0 -o ignore rump.ping -q -n -w $TIMEOUT -c 1 -T 2 $IP4DST
 	$DEBUG && rump.ifconfig -v shmif0
 }
@@ -319,7 +320,8 @@ test_hoplimit()
 	$DEBUG && rump.ifconfig -v shmif0
 	export LD_PRELOAD=/usr/lib/librumphijack.so
 	atf_check -s exit:0 -o ignore ping6 -q -n -c 1 -h 1 -X $TIMEOUT $IP6SRCGW
-	atf_check -s not-exit:0 -o ignore ping6 -q -n -c 1 -h 1 -X $TIMEOUT $IP6DST
+	atf_check -s not-exit:0 -o match:'Time to live exceeded' \
+	ping6 -v -n -c 1 -h 1 -X $TIMEOUT $IP6DST
 	atf_check -s exit:0 -o ignore ping6 -q -n -c 1 -h 2 -X $TIMEOUT $IP6DST
 	unset LD_PRELOAD
 	$DEBUG && rump.ifconfig -v shmif0