CVS commit: [netbsd-7] src/doc

2015-04-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 19 06:46:42 UTC 2015

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

Log Message:
Fix whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.261 -r1.1.2.262 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.261 src/doc/CHANGES-7.0:1.1.2.262
--- src/doc/CHANGES-7.0:1.1.2.261	Sun Apr 19 06:45:52 2015
+++ src/doc/CHANGES-7.0	Sun Apr 19 06:46:42 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.261 2015/04/19 06:45:52 riz Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.262 2015/04/19 06:46:42 riz Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -19767,6 +19767,7 @@ lib/libc/arch/sh3/gen/swapcontext.S		1.1
 	Correctly preserve old sate in swapcontext(3).
 	Fixes PR port-sh3/49597 reported by Yasushi Oshima.
 	[uwe, ticket #709]
+
 sys/dev/pci/files.pci1.375 via patch
 sys/dev/pci/ixgbe/ixgbe.c			1.24-1.27 via patch
 sys/dev/pci/ixgbe/ixgbe.h			1.4-1.6 via patch



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

2015-04-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 19 06:50:22 UTC 2015

Modified Files:
src/sys/dev/pci [netbsd-7]: if_wm.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #698):
sys/dev/pci/if_wm.c: revision 1.316
  Fix a bug that newer revision of I218-{LM,V} use wrong PHY access functions.
The problem only occured on devices that the PCI device ID was 0x15a[0123].


To generate a diff of this commit:
cvs rdiff -u -r1.289.2.5 -r1.289.2.6 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.289.2.5 src/sys/dev/pci/if_wm.c:1.289.2.6
--- src/sys/dev/pci/if_wm.c:1.289.2.5	Thu Apr 16 06:10:43 2015
+++ src/sys/dev/pci/if_wm.c	Sun Apr 19 06:50:22 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.289.2.5 2015/04/16 06:10:43 snj Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.289.2.6 2015/04/19 06:50:22 riz Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -81,7 +81,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.289.2.5 2015/04/16 06:10:43 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.289.2.6 2015/04/19 06:50:22 riz Exp $");
 
 #include 
 #include 
@@ -6397,8 +6397,9 @@ wm_gmii_mediainit(struct wm_softc *sc, p
 	 *  For some devices, we can determine the PHY access method
 	 * from sc_type.
 	 *
-	 *  For ICH8 variants, it's difficult to determine the PHY access
-	 * method by sc_type, so use the PCI product ID for some devices.
+	 *  For ICH and PCH variants, it's difficult to determine the PHY
+	 * access  method by sc_type, so use the PCI product ID for some
+	 * devices.
 	 * For other ICH8 variants, try to use igp's method. If the PHY
 	 * can't detect, then use bm's method.
 	 */
@@ -6407,30 +6408,16 @@ wm_gmii_mediainit(struct wm_softc *sc, p
 	case PCI_PRODUCT_INTEL_PCH_M_LC:
 		/* 82577 */
 		sc->sc_phytype = WMPHY_82577;
-		mii->mii_readreg = wm_gmii_hv_readreg;
-		mii->mii_writereg = wm_gmii_hv_writereg;
 		break;
 	case PCI_PRODUCT_INTEL_PCH_D_DM:
 	case PCI_PRODUCT_INTEL_PCH_D_DC:
 		/* 82578 */
 		sc->sc_phytype = WMPHY_82578;
-		mii->mii_readreg = wm_gmii_hv_readreg;
-		mii->mii_writereg = wm_gmii_hv_writereg;
 		break;
 	case PCI_PRODUCT_INTEL_PCH2_LV_LM:
 	case PCI_PRODUCT_INTEL_PCH2_LV_V:
 		/* 82579 */
 		sc->sc_phytype = WMPHY_82579;
-		mii->mii_readreg = wm_gmii_hv_readreg;
-		mii->mii_writereg = wm_gmii_hv_writereg;
-		break;
-	case PCI_PRODUCT_INTEL_I217_LM:
-	case PCI_PRODUCT_INTEL_I217_V:
-	case PCI_PRODUCT_INTEL_I218_LM:
-	case PCI_PRODUCT_INTEL_I218_V:
-		/* I21[78] */
-		mii->mii_readreg = wm_gmii_hv_readreg;
-		mii->mii_writereg = wm_gmii_hv_writereg;
 		break;
 	case PCI_PRODUCT_INTEL_82801I_BM:
 	case PCI_PRODUCT_INTEL_82801J_R_BM_LM:
@@ -6467,6 +6454,11 @@ wm_gmii_mediainit(struct wm_softc *sc, p
 		}
 		break;
 	}
+	if ((sc->sc_type >= WM_T_PCH) && (sc->sc_type <= WM_T_PCH_LPT)) {
+		/* All PCH* use _hv_ */
+		mii->mii_readreg = wm_gmii_hv_readreg;
+		mii->mii_writereg = wm_gmii_hv_writereg;
+	}
 	mii->mii_statchg = wm_gmii_statchg;
 
 	wm_gmii_reset(sc);



CVS commit: [netbsd-7] src/doc

2015-04-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 19 06:45:52 UTC 2015

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

Log Message:
Ticket #697.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.260 -r1.1.2.261 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.260 src/doc/CHANGES-7.0:1.1.2.261
--- src/doc/CHANGES-7.0:1.1.2.260	Sun Apr 19 05:27:29 2015
+++ src/doc/CHANGES-7.0	Sun Apr 19 06:45:52 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.260 2015/04/19 05:27:29 msaitoh Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.261 2015/04/19 06:45:52 riz Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -19767,3 +19767,41 @@ lib/libc/arch/sh3/gen/swapcontext.S		1.1
 	Correctly preserve old sate in swapcontext(3).
 	Fixes PR port-sh3/49597 reported by Yasushi Oshima.
 	[uwe, ticket #709]
+sys/dev/pci/files.pci1.375 via patch
+sys/dev/pci/ixgbe/ixgbe.c			1.24-1.27 via patch
+sys/dev/pci/ixgbe/ixgbe.h			1.4-1.6 via patch
+sys/dev/pci/ixgbe/ixgbe_82598.c			1.2-1.3 via patch
+sys/dev/pci/ixgbe/ixgbe_82598.h			1.1-1.2 via patch
+sys/dev/pci/ixgbe/ixgbe_82599.c			1.6-1.8 via patch
+sys/dev/pci/ixgbe/ixgbe_82599.h			1.1 via patch
+sys/dev/pci/ixgbe/ixgbe_api.c			1.5-1.6 via patch
+sys/dev/pci/ixgbe/ixgbe_api.h			1.2-1.3 via patch
+sys/dev/pci/ixgbe/ixgbe_common.c		1.3-1.4 via patch
+sys/dev/pci/ixgbe/ixgbe_common.h		1.2-1.3 via patch
+sys/dev/pci/ixgbe/ixgbe_mbx.c			1.2-1.3 via patch
+sys/dev/pci/ixgbe/ixgbe_mbx.h			1.2-1.3 via patch
+sys/dev/pci/ixgbe/ixgbe_osdep.h			1.4-1.6 via patch
+sys/dev/pci/ixgbe/ixgbe_phy.c			1.3-1.4 via patch
+sys/dev/pci/ixgbe/ixgbe_phy.h			1.2-1.3 via patch
+sys/dev/pci/ixgbe/ixgbe_type.h			1.8-1.9 via patch
+sys/dev/pci/ixgbe/ixgbe_vf.c			1.2-1.3 via patch
+sys/dev/pci/ixgbe/ixgbe_vf.h			1.3-1.4 via patch
+sys/dev/pci/ixgbe/ixgbe_x540.c			1.1-1.2 via patch
+sys/dev/pci/ixgbe/ixgbe_x540.h			1.1 via patch
+sys/dev/pci/ixgbe/ixv.c1.5-1.7 via patch
+sys/dev/pci/ixgbe/ixv.h1.4-1.5 via patch
+
+	Synchronize our ixg(4) driver up to FreeBSD r243716:
+	 - Add X540 support.
+	 - Add TSO6 support.
+	 - Add 100BaseTX support.
+	 - The max size in dma tag is changed from 65535 to 262140 (IXGBE_TSO_SIZE).
+	   The value is the same as other *BSDs. The change might cause a address
+	   space shortage (ixgbe_dmamap_create() might fail) on some machines.
+	 - Show 1000Base-SX correctly.
+	 - Fix if_baudrate from 1G to 10G.
+	 - Fix a bug that ifconfig -z (SOICZIFDATA) doesn't work.
+	 - Fix a lot of bugs.
+	 - Improve performance.
+	[msaitoh, ticket #697]
+



CVS commit: [netbsd-7] src/doc

2015-04-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 19 06:51:43 UTC 2015

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

Log Message:
Ticket 698.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.262 -r1.1.2.263 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.262 src/doc/CHANGES-7.0:1.1.2.263
--- src/doc/CHANGES-7.0:1.1.2.262	Sun Apr 19 06:46:42 2015
+++ src/doc/CHANGES-7.0	Sun Apr 19 06:51:43 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.262 2015/04/19 06:46:42 riz Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.263 2015/04/19 06:51:43 riz Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -19806,3 +19806,8 @@ sys/dev/pci/ixgbe/ixv.h1.4-1.5 via p
 	 - Improve performance.
 	[msaitoh, ticket #697]
 
+sys/dev/pci/if_wm.c1.316
+
+	Fix PHY access functions for newer revisions of I218-{LM,V}.
+	[msaitoh, ticket #698]
+



CVS commit: [netbsd-5] xsrc

2015-04-19 Thread SAITOH Masanobu
Module Name:xsrc
Committed By:   msaitoh
Date:   Sun Apr 19 07:20:33 UTC 2015

Modified Files:
xsrc/external/mit/libX11/dist/include/X11 [netbsd-5]: Xlibint.h
xsrc/xfree/xc/lib/X11 [netbsd-5]: Xlibint.h

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1959):
xsrc/external/mit/libX11/dist/include/X11/Xlibint.h patch
xsrc/xfree/xc/lib/X11/Xlibint.h 1.2

Fix CVE-2013-7439: Buffer overflow in MakeBigReq macro in libX11.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2 \
xsrc/external/mit/libX11/dist/include/X11/Xlibint.h
cvs rdiff -u -r1.1.1.7 -r1.1.1.7.8.1 xsrc/xfree/xc/lib/X11/Xlibint.h

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

Modified files:

Index: xsrc/external/mit/libX11/dist/include/X11/Xlibint.h
diff -u xsrc/external/mit/libX11/dist/include/X11/Xlibint.h:1.1.1.1.2.1 xsrc/external/mit/libX11/dist/include/X11/Xlibint.h:1.1.1.1.2.2
--- xsrc/external/mit/libX11/dist/include/X11/Xlibint.h:1.1.1.1.2.1	Thu Sep 17 03:32:56 2009
+++ xsrc/external/mit/libX11/dist/include/X11/Xlibint.h	Sun Apr 19 07:20:33 2015
@@ -530,6 +530,14 @@ extern LockInfoPtr _Xglobal_lock;
 #endif
 
 #ifdef WORD64
+/*
+ * MakeBigReq sets the CARD16 "req->length" to 0 and inserts a new CARD32
+ * length, after req->length, before the data in the request.  The new length
+ * includes the "n" extra 32-bit words.
+ *
+ * Do not use MakeBigReq if there is no data already in the request.
+ * req->length must already be >= 2.
+ */
 #define MakeBigReq(req,n) \
 { \
 char _BRdat[4]; \
@@ -548,7 +556,7 @@ extern LockInfoPtr _Xglobal_lock;
 CARD32 _BRlen = req->length - 1; \
 req->length = 0; \
 _BRdat = ((CARD32 *)req)[_BRlen]; \
-memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
 ((CARD32 *)req)[1] = _BRlen + n + 2; \
 Data32(dpy, &_BRdat, 4); \
 }
@@ -559,13 +567,20 @@ extern LockInfoPtr _Xglobal_lock;
 CARD32 _BRlen = req->length - 1; \
 req->length = 0; \
 _BRdat = ((CARD32 *)req)[_BRlen]; \
-memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
 ((CARD32 *)req)[1] = _BRlen + n + 2; \
 Data32(dpy, &_BRdat, 4); \
 }
 #endif
 #endif
 
+/*
+ * SetReqLen increases the count of 32-bit words in the request by "n",
+ * or by "badlen" if "n" is too large.
+ *
+ * Do not use SetReqLen if "req" does not already have data after the
+ * xReq header.  req->length must already be >= 2.
+ */
 #define SetReqLen(req,n,badlen) \
 if ((req->length + n) > (unsigned)65535) { \
 	if (dpy->bigreq_size) { \

Index: xsrc/xfree/xc/lib/X11/Xlibint.h
diff -u xsrc/xfree/xc/lib/X11/Xlibint.h:1.1.1.7 xsrc/xfree/xc/lib/X11/Xlibint.h:1.1.1.7.8.1
--- xsrc/xfree/xc/lib/X11/Xlibint.h:1.1.1.7	Fri Mar 18 13:04:29 2005
+++ xsrc/xfree/xc/lib/X11/Xlibint.h	Sun Apr 19 07:20:33 2015
@@ -528,6 +528,14 @@ extern LockInfoPtr _Xglobal_lock;
 #endif
 
 #ifdef WORD64
+/*
+ * MakeBigReq sets the CARD16 "req->length" to 0 and inserts a new CARD32
+ * length, after req->length, before the data in the request.  The new length
+ * includes the "n" extra 32-bit words.
+ *
+ * Do not use MakeBigReq if there is no data already in the request.
+ * req->length must already be >= 2.
+ */
 #define MakeBigReq(req,n) \
 { \
 char _BRdat[4]; \
@@ -546,7 +554,7 @@ extern LockInfoPtr _Xglobal_lock;
 CARD32 _BRlen = req->length - 1; \
 req->length = 0; \
 _BRdat = ((CARD32 *)req)[_BRlen]; \
-memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
 ((CARD32 *)req)[1] = _BRlen + n + 2; \
 Data32(dpy, &_BRdat, 4); \
 }
@@ -557,13 +565,20 @@ extern LockInfoPtr _Xglobal_lock;
 CARD32 _BRlen = req->length - 1; \
 req->length = 0; \
 _BRdat = ((CARD32 *)req)[_BRlen]; \
-memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
 ((CARD32 *)req)[1] = _BRlen + n + 2; \
 Data32(dpy, &_BRdat, 4); \
 }
 #endif
 #endif
 
+/*
+ * SetReqLen increases the count of 32-bit words in the request by "n",
+ * or by "badlen" if "n" is too large.
+ *
+ * Do not use SetReqLen if "req" does not already have data after the
+ * xReq header.  req->length must already be >= 2.
+ */
 #define SetReqLen(req,n,badlen) \
 if ((req->length + n) > (unsigned)65535) { \
 	if (dpy->bigreq_size) { \



CVS commit: [netbsd-5-2] xsrc

2015-04-19 Thread SAITOH Masanobu
Module Name:xsrc
Committed By:   msaitoh
Date:   Sun Apr 19 07:25:32 UTC 2015

Modified Files:
xsrc/external/mit/libX11/dist/include/X11 [netbsd-5-2]: Xlibint.h
xsrc/xfree/xc/lib/X11 [netbsd-5-2]: Xlibint.h

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1959):
xsrc/external/mit/libX11/dist/include/X11/Xlibint.h patch
xsrc/xfree/xc/lib/X11/Xlibint.h 1.2

Fix CVE-2013-7439: Buffer overflow in MakeBigReq macro in libX11.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1.2.1 -r1.1.1.1.2.1.4.1 \
xsrc/external/mit/libX11/dist/include/X11/Xlibint.h
cvs rdiff -u -r1.1.1.7 -r1.1.1.7.18.1 xsrc/xfree/xc/lib/X11/Xlibint.h

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

Modified files:

Index: xsrc/external/mit/libX11/dist/include/X11/Xlibint.h
diff -u xsrc/external/mit/libX11/dist/include/X11/Xlibint.h:1.1.1.1.2.1 xsrc/external/mit/libX11/dist/include/X11/Xlibint.h:1.1.1.1.2.1.4.1
--- xsrc/external/mit/libX11/dist/include/X11/Xlibint.h:1.1.1.1.2.1	Thu Sep 17 03:32:56 2009
+++ xsrc/external/mit/libX11/dist/include/X11/Xlibint.h	Sun Apr 19 07:25:32 2015
@@ -530,6 +530,14 @@ extern LockInfoPtr _Xglobal_lock;
 #endif
 
 #ifdef WORD64
+/*
+ * MakeBigReq sets the CARD16 "req->length" to 0 and inserts a new CARD32
+ * length, after req->length, before the data in the request.  The new length
+ * includes the "n" extra 32-bit words.
+ *
+ * Do not use MakeBigReq if there is no data already in the request.
+ * req->length must already be >= 2.
+ */
 #define MakeBigReq(req,n) \
 { \
 char _BRdat[4]; \
@@ -548,7 +556,7 @@ extern LockInfoPtr _Xglobal_lock;
 CARD32 _BRlen = req->length - 1; \
 req->length = 0; \
 _BRdat = ((CARD32 *)req)[_BRlen]; \
-memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
 ((CARD32 *)req)[1] = _BRlen + n + 2; \
 Data32(dpy, &_BRdat, 4); \
 }
@@ -559,13 +567,20 @@ extern LockInfoPtr _Xglobal_lock;
 CARD32 _BRlen = req->length - 1; \
 req->length = 0; \
 _BRdat = ((CARD32 *)req)[_BRlen]; \
-memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
 ((CARD32 *)req)[1] = _BRlen + n + 2; \
 Data32(dpy, &_BRdat, 4); \
 }
 #endif
 #endif
 
+/*
+ * SetReqLen increases the count of 32-bit words in the request by "n",
+ * or by "badlen" if "n" is too large.
+ *
+ * Do not use SetReqLen if "req" does not already have data after the
+ * xReq header.  req->length must already be >= 2.
+ */
 #define SetReqLen(req,n,badlen) \
 if ((req->length + n) > (unsigned)65535) { \
 	if (dpy->bigreq_size) { \

Index: xsrc/xfree/xc/lib/X11/Xlibint.h
diff -u xsrc/xfree/xc/lib/X11/Xlibint.h:1.1.1.7 xsrc/xfree/xc/lib/X11/Xlibint.h:1.1.1.7.18.1
--- xsrc/xfree/xc/lib/X11/Xlibint.h:1.1.1.7	Fri Mar 18 13:04:29 2005
+++ xsrc/xfree/xc/lib/X11/Xlibint.h	Sun Apr 19 07:25:32 2015
@@ -528,6 +528,14 @@ extern LockInfoPtr _Xglobal_lock;
 #endif
 
 #ifdef WORD64
+/*
+ * MakeBigReq sets the CARD16 "req->length" to 0 and inserts a new CARD32
+ * length, after req->length, before the data in the request.  The new length
+ * includes the "n" extra 32-bit words.
+ *
+ * Do not use MakeBigReq if there is no data already in the request.
+ * req->length must already be >= 2.
+ */
 #define MakeBigReq(req,n) \
 { \
 char _BRdat[4]; \
@@ -546,7 +554,7 @@ extern LockInfoPtr _Xglobal_lock;
 CARD32 _BRlen = req->length - 1; \
 req->length = 0; \
 _BRdat = ((CARD32 *)req)[_BRlen]; \
-memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
 ((CARD32 *)req)[1] = _BRlen + n + 2; \
 Data32(dpy, &_BRdat, 4); \
 }
@@ -557,13 +565,20 @@ extern LockInfoPtr _Xglobal_lock;
 CARD32 _BRlen = req->length - 1; \
 req->length = 0; \
 _BRdat = ((CARD32 *)req)[_BRlen]; \
-memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
 ((CARD32 *)req)[1] = _BRlen + n + 2; \
 Data32(dpy, &_BRdat, 4); \
 }
 #endif
 #endif
 
+/*
+ * SetReqLen increases the count of 32-bit words in the request by "n",
+ * or by "badlen" if "n" is too large.
+ *
+ * Do not use SetReqLen if "req" does not already have data after the
+ * xReq header.  req->length must already be >= 2.
+ */
 #define SetReqLen(req,n,badlen) \
 if ((req->length + n) > (unsigned)65535) { \
 	if (dpy->bigreq_size) { \



CVS commit: [netbsd-5-1] xsrc

2015-04-19 Thread SAITOH Masanobu
Module Name:xsrc
Committed By:   msaitoh
Date:   Sun Apr 19 07:29:15 UTC 2015

Modified Files:
xsrc/external/mit/libX11/dist/include/X11 [netbsd-5-1]: Xlibint.h
xsrc/xfree/xc/lib/X11 [netbsd-5-1]: Xlibint.h

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1959):
xsrc/external/mit/libX11/dist/include/X11/Xlibint.h patch
xsrc/xfree/xc/lib/X11/Xlibint.h 1.2

Fix CVE-2013-7439: Buffer overflow in MakeBigReq macro in libX11.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1.2.1 -r1.1.1.1.2.1.2.1 \
xsrc/external/mit/libX11/dist/include/X11/Xlibint.h
cvs rdiff -u -r1.1.1.7 -r1.1.1.7.12.1 xsrc/xfree/xc/lib/X11/Xlibint.h

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

Modified files:

Index: xsrc/external/mit/libX11/dist/include/X11/Xlibint.h
diff -u xsrc/external/mit/libX11/dist/include/X11/Xlibint.h:1.1.1.1.2.1 xsrc/external/mit/libX11/dist/include/X11/Xlibint.h:1.1.1.1.2.1.2.1
--- xsrc/external/mit/libX11/dist/include/X11/Xlibint.h:1.1.1.1.2.1	Thu Sep 17 03:32:56 2009
+++ xsrc/external/mit/libX11/dist/include/X11/Xlibint.h	Sun Apr 19 07:29:15 2015
@@ -530,6 +530,14 @@ extern LockInfoPtr _Xglobal_lock;
 #endif
 
 #ifdef WORD64
+/*
+ * MakeBigReq sets the CARD16 "req->length" to 0 and inserts a new CARD32
+ * length, after req->length, before the data in the request.  The new length
+ * includes the "n" extra 32-bit words.
+ *
+ * Do not use MakeBigReq if there is no data already in the request.
+ * req->length must already be >= 2.
+ */
 #define MakeBigReq(req,n) \
 { \
 char _BRdat[4]; \
@@ -548,7 +556,7 @@ extern LockInfoPtr _Xglobal_lock;
 CARD32 _BRlen = req->length - 1; \
 req->length = 0; \
 _BRdat = ((CARD32 *)req)[_BRlen]; \
-memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
 ((CARD32 *)req)[1] = _BRlen + n + 2; \
 Data32(dpy, &_BRdat, 4); \
 }
@@ -559,13 +567,20 @@ extern LockInfoPtr _Xglobal_lock;
 CARD32 _BRlen = req->length - 1; \
 req->length = 0; \
 _BRdat = ((CARD32 *)req)[_BRlen]; \
-memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
 ((CARD32 *)req)[1] = _BRlen + n + 2; \
 Data32(dpy, &_BRdat, 4); \
 }
 #endif
 #endif
 
+/*
+ * SetReqLen increases the count of 32-bit words in the request by "n",
+ * or by "badlen" if "n" is too large.
+ *
+ * Do not use SetReqLen if "req" does not already have data after the
+ * xReq header.  req->length must already be >= 2.
+ */
 #define SetReqLen(req,n,badlen) \
 if ((req->length + n) > (unsigned)65535) { \
 	if (dpy->bigreq_size) { \

Index: xsrc/xfree/xc/lib/X11/Xlibint.h
diff -u xsrc/xfree/xc/lib/X11/Xlibint.h:1.1.1.7 xsrc/xfree/xc/lib/X11/Xlibint.h:1.1.1.7.12.1
--- xsrc/xfree/xc/lib/X11/Xlibint.h:1.1.1.7	Fri Mar 18 13:04:29 2005
+++ xsrc/xfree/xc/lib/X11/Xlibint.h	Sun Apr 19 07:29:15 2015
@@ -528,6 +528,14 @@ extern LockInfoPtr _Xglobal_lock;
 #endif
 
 #ifdef WORD64
+/*
+ * MakeBigReq sets the CARD16 "req->length" to 0 and inserts a new CARD32
+ * length, after req->length, before the data in the request.  The new length
+ * includes the "n" extra 32-bit words.
+ *
+ * Do not use MakeBigReq if there is no data already in the request.
+ * req->length must already be >= 2.
+ */
 #define MakeBigReq(req,n) \
 { \
 char _BRdat[4]; \
@@ -546,7 +554,7 @@ extern LockInfoPtr _Xglobal_lock;
 CARD32 _BRlen = req->length - 1; \
 req->length = 0; \
 _BRdat = ((CARD32 *)req)[_BRlen]; \
-memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
 ((CARD32 *)req)[1] = _BRlen + n + 2; \
 Data32(dpy, &_BRdat, 4); \
 }
@@ -557,13 +565,20 @@ extern LockInfoPtr _Xglobal_lock;
 CARD32 _BRlen = req->length - 1; \
 req->length = 0; \
 _BRdat = ((CARD32 *)req)[_BRlen]; \
-memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
 ((CARD32 *)req)[1] = _BRlen + n + 2; \
 Data32(dpy, &_BRdat, 4); \
 }
 #endif
 #endif
 
+/*
+ * SetReqLen increases the count of 32-bit words in the request by "n",
+ * or by "badlen" if "n" is too large.
+ *
+ * Do not use SetReqLen if "req" does not already have data after the
+ * xReq header.  req->length must already be >= 2.
+ */
 #define SetReqLen(req,n,badlen) \
 if ((req->length + n) > (unsigned)65535) { \
 	if (dpy->bigreq_size) { \



CVS commit: [netbsd-5] src/lib/libc/arch/sh3/gen

2015-04-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Apr 19 07:43:02 UTC 2015

Modified Files:
src/lib/libc/arch/sh3/gen [netbsd-5]: swapcontext.S

Log Message:
Pull up following revision(s) (requested by uwe in ticket #1960):

lib/libc/arch/sh3/gen/swapcontext.S 1.11-1.12 via patch

Correctly preserve old sate in swapcontext(3).
Fixes PR port-sh3/49597 reported by Yasushi Oshima.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.6.1 src/lib/libc/arch/sh3/gen/swapcontext.S

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

Modified files:

Index: src/lib/libc/arch/sh3/gen/swapcontext.S
diff -u src/lib/libc/arch/sh3/gen/swapcontext.S:1.9 src/lib/libc/arch/sh3/gen/swapcontext.S:1.9.6.1
--- src/lib/libc/arch/sh3/gen/swapcontext.S:1.9	Mon Apr 28 20:22:57 2008
+++ src/lib/libc/arch/sh3/gen/swapcontext.S	Sun Apr 19 07:43:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.9 2008/04/28 20:22:57 martin Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.9.6.1 2015/04/19 07:43:02 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: swapcontext.S,v 1.9 2008/04/28 20:22:57 martin Exp $")
+	RCSID("$NetBSD: swapcontext.S,v 1.9.6.1 2015/04/19 07:43:02 msaitoh Exp $")
 #endif /* SYSLIBC_SCCS and not lint */
 
 /*
@@ -40,33 +40,33 @@
  */
 ENTRY(swapcontext)
 	PIC_PROLOGUE(.L_got)
-	mov.l	r5, @-sp
 	sts.l	pr, @-sp
 
 	mov.l	.L__getcontext, r0
-1:	CALL	r0			/* _getcontext(oucp) */
+	mov.l	r5, @-sp
+1:	CALL	r0			! _getcontext(oucp)
 	 mov.l	r4, @-sp
-	mov.l	@sp+, r1
+	!! getcontext captures oucp resuming here with r12 (when PIC),
+	!! pr, r5 and r4 pushed onto the stack
+
 	tst	r0, r0
-	bf	3f			/* return error from getcontext */
+	bf.s	3f			! return error from getcontext
+	 mov.l	@sp, r1			! saved oucp
+
+	!! adjust oucp to resume after setcontext below
+	mova	3f, r0
+	mov.l	r0, @(36 + 1 * 4, r1)	! _UC_MACHINE_SET_PC(oucp, pr)
 
-	/* Note: getcontext does _UC_MACHINE_INTRV(oucp) = 0 for us */
-	mov.l	@sp, r0
-	mov.l	r0, @(36 + 1 * 4, r1)	/* _UC_MACHINE_SET_PC(oucp, pr) */
 	mov.l	.L_setcontext, r2
-2:	CALL	r2			/* setcontext(ucp) */
-	 mov.l	@(4, sp), r4
-	/* if we get here, return error from setcontext */
-3:
+2:	CALL	r2			! setcontext(ucp)
+	 mov.l	@(4, sp), r4		! saved ucp
+
+	.align	2
+3:	!! we get here on errors and when resuming oucp
+	add	#8, sp			! skip r4 and r5
 	lds.l	@sp+, pr
-#ifdef PIC
-	add	#4, sp
-	rts
-	 PIC_EPILOGUE
-#else
 	rts
-	 add	#4, sp
-#endif
+	 PIC_EPILOGUE_SLOT
 
 	.align	2
 .L_got:			PIC_GOT_DATUM



CVS commit: [netbsd-5] src/doc

2015-04-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Apr 19 07:45:47 UTC 2015

Modified Files:
src/doc [netbsd-5]: CHANGES-5.3

Log Message:
Ticket 1959 and 1960.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.110 -r1.1.2.111 src/doc/CHANGES-5.3

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-5.3
diff -u src/doc/CHANGES-5.3:1.1.2.110 src/doc/CHANGES-5.3:1.1.2.111
--- src/doc/CHANGES-5.3:1.1.2.110	Sun Apr 19 06:12:56 2015
+++ src/doc/CHANGES-5.3	Sun Apr 19 07:45:47 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.3,v 1.1.2.110 2015/04/19 06:12:56 msaitoh Exp $
+# $NetBSD: CHANGES-5.3,v 1.1.2.111 2015/04/19 07:45:47 msaitoh Exp $
 
 A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.3
 release:
@@ -3820,3 +3820,15 @@ sys/arch/sparc/stand/ofwboot/openfirm.h	
 	Fix kernel loading failures from partitions started from over first
 	4GB of disks on sparc64.
 	[nakayama, ticket #1958]
+
+xsrc/external/mit/libX11/dist/include/X11/Xlibint.h	patch
+xsrc/xfree/xc/lib/X11/Xlibint.h1.2
+
+	Fix CVE-2013-7439: Buffer overflow in MakeBigReq macro in libX11.
+	[mrg, ticket #1959]
+
+lib/libc/arch/sh3/gen/swapcontext.S		1.11-1.12 via patch
+
+	Correctly preserve old sate in swapcontext(3).
+	Fixes PR port-sh3/49597 reported by Yasushi Oshima.
+	[uwe, ticket #1960]



CVS commit: [netbsd-5-2] src/doc

2015-04-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Apr 19 07:46:18 UTC 2015

Modified Files:
src/doc [netbsd-5-2]: CHANGES-5.2.4

Log Message:
Ticket 1959.


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

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-5.2.4
diff -u src/doc/CHANGES-5.2.4:1.1.2.24 src/doc/CHANGES-5.2.4:1.1.2.25
--- src/doc/CHANGES-5.2.4:1.1.2.24	Fri Apr 17 10:52:21 2015
+++ src/doc/CHANGES-5.2.4	Sun Apr 19 07:46:18 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2.4,v 1.1.2.24 2015/04/17 10:52:21 msaitoh Exp $
+# $NetBSD: CHANGES-5.2.4,v 1.1.2.25 2015/04/19 07:46:18 msaitoh Exp $
 
 A complete list of changes from the NetBSD 5.2.3 release to the NetBSD 5.2.4
 release:
@@ -2589,3 +2589,9 @@ sys/arch/sparc/stand/ofwboot/Locore.c		1
 	Fix kernel loading failures from partitions started from over first
 	4GB of disks on sparc64.
 	[nakayama, ticket #1958]
+
+xsrc/external/mit/libX11/dist/include/X11/Xlibint.h	patch
+xsrc/xfree/xc/lib/X11/Xlibint.h1.2
+
+	Fix CVE-2013-7439: Buffer overflow in MakeBigReq macro in libX11.
+	[mrg, ticket #1959]



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

2015-04-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Apr 19 07:46:49 UTC 2015

Modified Files:
src/doc [netbsd-5-1]: CHANGES-5.1.6

Log Message:
Ticket 1959.


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

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

Modified files:

Index: src/doc/CHANGES-5.1.6
diff -u src/doc/CHANGES-5.1.6:1.1.2.23 src/doc/CHANGES-5.1.6:1.1.2.24
--- src/doc/CHANGES-5.1.6:1.1.2.23	Fri Apr 17 10:52:38 2015
+++ src/doc/CHANGES-5.1.6	Sun Apr 19 07:46:48 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1.6,v 1.1.2.23 2015/04/17 10:52:38 msaitoh Exp $
+# $NetBSD: CHANGES-5.1.6,v 1.1.2.24 2015/04/19 07:46:48 msaitoh Exp $
 
 A complete list of changes from the NetBSD 5.1.5 release to the NetBSD 5.1.6
 release:
@@ -2589,3 +2589,9 @@ sys/arch/sparc/stand/ofwboot/Locore.c		1
 	Fix kernel loading failures from partitions started from over first
 	4GB of disks on sparc64.
 	[nakayama, ticket #1958]
+
+xsrc/external/mit/libX11/dist/include/X11/Xlibint.h	patch
+xsrc/xfree/xc/lib/X11/Xlibint.h1.2
+
+	Fix CVE-2013-7439: Buffer overflow in MakeBigReq macro in libX11.
+	[mrg, ticket #1959]



CVS commit: src/sys/conf

2015-04-19 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Apr 19 09:20:54 UTC 2015

Modified Files:
src/sys/conf: majors.std

Log Message:
Note that sysmon device is also required for sysmon_power.

XXX This will be changing again soon (once I get the various portions of
XXX sysmon modularized).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/conf/majors.std

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

Modified files:

Index: src/sys/conf/majors.std
diff -u src/sys/conf/majors.std:1.1 src/sys/conf/majors.std:1.2
--- src/sys/conf/majors.std:1.1	Fri Sep 19 17:32:34 2014
+++ src/sys/conf/majors.std	Sun Apr 19 09:20:54 2015
@@ -1,4 +1,4 @@
-# $NetBSD: majors.std,v 1.1 2014/09/19 17:32:34 matt Exp $
+# $NetBSD: majors.std,v 1.2 2015/04/19 09:20:54 pgoyette Exp $
 #
 # MI major assignments for standard devices
 #
@@ -12,5 +12,5 @@ device-major	log		char 246
 device-major	filedesc	char 247
 device-major	rnd		char 248		rnd
 device-major	clockctl	char 249		clockctl
-device-major	sysmon		char 250		sysmon_envsys | sysmon_wdog
+device-major	sysmon		char 250		sysmon_envsys | sysmon_wdog | sysmon_power
 device-major	ksyms		char 251		ksyms



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

2015-04-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 19 14:42:15 UTC 2015

Added Files:
src/sys/dev/pci/ixgbe [netbsd-7]: ixgbe_82598.h ixgbe_82599.h
ixgbe_x540.c ixgbe_x540.h

Log Message:
Apply patch (requested by msaitoh in ticket #697):
sys/dev/pci/files.pci   1.375 via patch
sys/dev/pci/ixgbe/ixgbe.c   1.24-1.27 via patch
sys/dev/pci/ixgbe/ixgbe.h   1.4-1.6 via patch
sys/dev/pci/ixgbe/ixgbe_82598.c 1.2-1.3 via patch
sys/dev/pci/ixgbe/ixgbe_82598.h 1.1-1.2 via patch
sys/dev/pci/ixgbe/ixgbe_82599.c 1.6-1.8 via patch
sys/dev/pci/ixgbe/ixgbe_82599.h 1.1 via patch
sys/dev/pci/ixgbe/ixgbe_api.c   1.5-1.6 via patch
sys/dev/pci/ixgbe/ixgbe_api.h   1.2-1.3 via patch
sys/dev/pci/ixgbe/ixgbe_common.c1.3-1.4 via patch
sys/dev/pci/ixgbe/ixgbe_common.h1.2-1.3 via patch
sys/dev/pci/ixgbe/ixgbe_mbx.c   1.2-1.3 via patch
sys/dev/pci/ixgbe/ixgbe_mbx.h   1.2-1.3 via patch
sys/dev/pci/ixgbe/ixgbe_osdep.h 1.4-1.6 via patch
sys/dev/pci/ixgbe/ixgbe_phy.c   1.3-1.4 via patch
sys/dev/pci/ixgbe/ixgbe_phy.h   1.2-1.3 via patch
sys/dev/pci/ixgbe/ixgbe_type.h  1.8-1.9 via patch
sys/dev/pci/ixgbe/ixgbe_vf.c1.2-1.3 via patch
sys/dev/pci/ixgbe/ixgbe_vf.h1.3-1.4 via patch
sys/dev/pci/ixgbe/ixgbe_x540.c  1.1-1.2 via patch
sys/dev/pci/ixgbe/ixgbe_x540.h  1.1 via patch
sys/dev/pci/ixgbe/ixv.c 1.5-1.7 via patch
sys/dev/pci/ixgbe/ixv.h 1.4-1.5 via patch

Synchronize our ixg(4) driver up to FreeBSD r243716:
 - Add X540 support.
 - Add TSO6 support.
 - Add 100BaseTX support.
 - The max size in dma tag is changed from 65535 to 262140 
(IXGBE_TSO_SIZE).
   The value is the same as other *BSDs. The change might cause a 
address
   space shortage (ixgbe_dmamap_create() might fail) on some machines.
 - Show 1000Base-SX correctly.
 - Fix if_baudrate from 1G to 10G.
 - Fix a bug that ifconfig -z (SOICZIFDATA) doesn't work.
 - Fix a lot of bugs.
 - Improve performance.
[msaitoh, ticket #697]


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.2.4.2 src/sys/dev/pci/ixgbe/ixgbe_82598.h \
src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r0 -r1.1.4.2 src/sys/dev/pci/ixgbe/ixgbe_82599.h \
src/sys/dev/pci/ixgbe/ixgbe_x540.h

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

Added files:

Index: src/sys/dev/pci/ixgbe/ixgbe_82598.h
diff -u /dev/null src/sys/dev/pci/ixgbe/ixgbe_82598.h:1.2.4.2
--- /dev/null	Sun Apr 19 14:42:15 2015
+++ src/sys/dev/pci/ixgbe/ixgbe_82598.h	Sun Apr 19 14:42:14 2015
@@ -0,0 +1,52 @@
+/**
+
+  Copyright (c) 2001-2012, Intel Corporation 
+  All rights reserved.
+  
+  Redistribution and use in source and binary forms, with or without 
+  modification, are permitted provided that the following conditions are met:
+  
+   1. Redistributions of source code must retain the above copyright notice, 
+  this list of conditions and the following disclaimer.
+  
+   2. Redistributions in binary form must reproduce the above copyright 
+  notice, this list of conditions and the following disclaimer in the 
+  documentation and/or other materials provided with the distribution.
+  
+   3. Neither the name of the Intel Corporation nor the names of its 
+  contributors may be used to endorse or promote products derived from 
+  this software without specific prior written permission.
+  
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.
+
+**/
+/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82598.h 238149 2012-07-05 20:51:44Z jfv $*/
+
+#ifndef _IXGBE_82598_H_
+#define _IXGBE_82598_H_
+
+u32 ixgbe_get_pcie_msix_count_82598(struct ixgbe_hw *hw);

CVS commit: src/usr.sbin/sysinst

2015-04-19 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Apr 19 16:14:04 UTC 2015

Modified Files:
src/usr.sbin/sysinst: msg.mbr.fr msg.mi.fr

Log Message:
Several fixes for the French translation. Looks like the '{\n' break the
interface: the "No" buttons sometimes disappear.

Actually I can't test this change right now; will see tomorrow.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/msg.mbr.fr
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/msg.mi.fr

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

Modified files:

Index: src/usr.sbin/sysinst/msg.mbr.fr
diff -u src/usr.sbin/sysinst/msg.mbr.fr:1.2 src/usr.sbin/sysinst/msg.mbr.fr:1.3
--- src/usr.sbin/sysinst/msg.mbr.fr:1.2	Sun Aug  3 16:09:38 2014
+++ src/usr.sbin/sysinst/msg.mbr.fr	Sun Apr 19 16:14:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mbr.fr,v 1.2 2014/08/03 16:09:38 martin Exp $	*/
+/*	$NetBSD: msg.mbr.fr,v 1.3 2015/04/19 16:14:03 maxv Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -41,7 +41,7 @@ sur une partie de celui-ci.
 Une installation sur une partie du disque crée une partition, ou `slice', pour
 NetBSD dans le secteur de démarrage (Master Boot Record, alias MBR) de votre
 disque. Une installation sur la totalité du disque est `dangereusement
-dédiée' : elle réinitialise complétement le MBR, ce qui efface tout système
+dédiée' : elle réinitialise complètement le MBR, ce qui efface tout système
 d'exploitation ou données existants sur le disque. Cela rend également
 impossible l'installation ultérieure d'un deuxième système d'exploitation,
 sauf si vous réinstallez complètement NetBSD en utilisant uniquement une

Index: src/usr.sbin/sysinst/msg.mi.fr
diff -u src/usr.sbin/sysinst/msg.mi.fr:1.5 src/usr.sbin/sysinst/msg.mi.fr:1.6
--- src/usr.sbin/sysinst/msg.mi.fr:1.5	Mon Sep 22 19:01:02 2014
+++ src/usr.sbin/sysinst/msg.mi.fr	Sun Apr 19 16:14:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.fr,v 1.5 2014/09/22 19:01:02 roy Exp $	*/
+/*	$NetBSD: msg.mi.fr,v 1.6 2015/04/19 16:14:03 maxv Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -95,7 +95,8 @@ procédure va effectuer les actions suiva
 
 (Une fois le partitionnement configuré, le système d'installation vous
 demandera de confirmer avant d'appliquer toute modification sur votre
-disque dur.
+disque dur.)
+
 Souhaitez-vous continuer ?
 }
 
@@ -107,24 +108,22 @@ Vous devriez faire une sauvegarde complè
 continuer la procédure de mise à jour.
 Voulez-vous vraiment mettre à jour NetBSD ?
 (Ceci est le dernier avertissement avant que cette
-procédure ne modifie votre disque).
+procédure ne modifie votre disque.)
 }
 
 message reinstallusure
 {Décompressons maintenant les composants de NetBSD sur un disque dur
-démarrable.
-Cette procédure va rapatrier et décompresser les composants
-sur un disque démarrable déjà partitionnné.
-Elle n'inscrit pas de "label" sur le disque,
-n'installe pas de nouveaux secteurs d'amorçage et ne modifie
-pas les fichiers de configuration existants
-(Quittez et choisissez `installer' ou `mettre à jour').
-Vous devriez déjà avoir fait une installation
-ou une mise à jour avant de démarrer cette procédure !
+démarrable. Cette procédure va rapatrier et décompresser les composants
+sur un disque démarrable déjà partitionnné. Elle n'inscrit pas de "label" sur
+le disque, n'installe pas de nouveaux secteurs d'amorçage et ne modifie
+pas les fichiers de configuration existants. (Quittez et choisissez `installer'
+ou `mettre à jour' si vous désirez ces options.)
+Vous devriez déjà avoir fait une installation ou une mise à jour avant de
+démarrer cette procédure !
 
 Voulez-vous réellement réinstaller les composants NetBSD ?
 (Ceci est le dernier avertissement avant que cette procédure ne commence à
-modifier vos disques).
+modifier vos disques.)
 }
 
 message mount_failed
@@ -188,7 +187,7 @@ choix possible, arrondi au cylindre-près
 Si vous choisissez "Secteurs", vous pourrez choisir précisément
 les tailles.
 Sur les disques modernes, la taille réelle des cylindres est variable
-et il y a peu d'intéret à aligner les partitions sur les cylindres.
+et il y a peu d'intérêt à aligner les partitions sur les cylindres.
 Pour les disques plus anciens, il est recommandé de choisir des tailles
 de partitions arrondies au cylindre-près, pour plus de performance.
 
@@ -233,7 +232,7 @@ message add_another_ptn
 {Ajouter manuellement une nouvelle partition}
 
 message fssizesok
-{Taille de la partition acceptée. Libre : espace %d %s, %d partition}
+{Taille de la partition acceptée. Libre : %d %s et %d partitions}
 
 message fssizesbad
 {Réduire la taille de la partition de %d %s (%u secteurs).}
@@ -299,7 +298,7 @@ message end_fmt
 {fin : %9u %8u%c %9u}
 
 message bsize_fmt
-{taille de bloc : %9d bytes}
+{ taille de bloc : %9d bytes}
 
 message fsize_fmt
 { taille de fragment : %9d bytes}

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

2015-04-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 19 16:26:23 UTC 2015

Modified Files:
src/sys/dev/pci [netbsd-7]: pcidevs

Log Message:
Apply patch (requested by msaitoh in ticket #699):
sys/dev/pci/pcidevs 1.1200, 1.1203, 1.1208-1.1212, 
1.1214-1.1220 via patch

Sync pcidevs with rev. 1.1220:
- Add Samsung Electronics XP941 M.2 SSD
- Add Intel Atom Z36xx and Z37xx devices from the datasheet.
- Add Intel QuickAssist Virtual Function Device IDs
- Add some Intel 10/40G devices.
- Add Some Intel E7520 devices
- Add Some Intel IOP332 devices
- Add Xeon E5 v3 and C61x devices.
- Add Mobile 5th Generation Intel Core devices.
- Add Intel 63xxESB AC'97 Audio Controller
- Fix product ID of INTEL 5000_PCIE_4.
- Add some Intel 9 Series devices
- Add some Intel devices.
- Sort VIATECH's entries in the device ID's order.
- Add some VIATECH devices.
- Add COMPAQ iLOs.
- Add HP IPMI device.
- Add another HP vendor ID (was 3PAR)
- Add two PLX PCI Bridges.
- Add Radeon HD 54xx Audio
- Add Dell DARC 4 devices
- Add nForce Host Bridges.
- Add MegaRAID SAS3108
[msaitoh, ticket #699]


To generate a diff of this commit:
cvs rdiff -u -r1.1199.2.5 -r1.1199.2.6 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1199.2.5 src/sys/dev/pci/pcidevs:1.1199.2.6
--- src/sys/dev/pci/pcidevs:1.1199.2.5	Tue Feb 17 15:04:47 2015
+++ src/sys/dev/pci/pcidevs	Sun Apr 19 16:26:23 2015
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1199.2.5 2015/02/17 15:04:47 martin Exp $
+$NetBSD: pcidevs,v 1.1199.2.6 2015/04/19 16:26:23 riz Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -588,6 +588,7 @@ vendor ENE		0x1524	ENE Technology
 vendor TERRATEC		0x153b	TerraTec Electronic
 vendor PERLE		0x155f	Perle Systems
 vendor SOLIDUM		0x1588	Solidum Systems
+vendor HP2		0x1590	Hewlett-Packard
 vendor SYBA		0x1592	Syba
 vendor FARADAY		0x159b	Faraday Technology
 vendor GEOCAST		0x15a1	Geocast Network Systems
@@ -1522,6 +1523,7 @@ product ATI RADEON_HD7340	0x9808	Radeon 
 product ATI RADEON_HD2600_HD	0xaa08	Radeon HD2600 HD Audio Controller
 product ATI RADEON_HD4350_HD	0xaa38	Radeon HD4350 HD Audio Controller
 product ATI RADEON_HD5600_HDMI	0xaa60	Redwood HDMI Audio
+product ATI RADEON_HD54XX_HDA	0xaa68	Radeon HD 54xx Audio
 
 /* Auravision products */
 product AURAVISION VXP524	0x01f7	VxP524 PCI Video Processor
@@ -1912,6 +1914,8 @@ product COMPAQ CSA5300_2	0xb060	Smart Ar
 product COMPAQ PRESARIO56XX	0xb0b8	Presario 56xx
 product COMPAQ M700		0xb112	Armada M700
 product COMPAQ CSA5i_2		0xb178	Smart Array 5i/532 rev. 2
+product COMPAQ ILO_1		0xb203	iLO
+product COMPAQ ILO_2		0xb204	iLO
 product COMPAQ NF3P_BNC		0xf150	NetFlex 3/P w/ BNC
 product COMPAQ NF3P		0xf130	NetFlex 3/P
 
@@ -2047,7 +2051,10 @@ product DELL PERC_3DI_2		0x0008	PERC 3/D
 product DELL PERC_3DI_3		0x000a	PERC 3/Di
 product DELL PERC_4DI		0x000e	PERC 4/Di
 product DELL PERC_4DI_2		0x000f	PERC 4/Di
+product DELL DRAC_4		0x0011	DRAC 4
+product DELL DRAC_4_VUART	0x0012	DRAC 4 Virtual UART
 product DELL PERC_4ESI		0x0013	PERC 4e/Si
+product DELL DRAC_4_SMIC	0x0014	DRAC 4 SMIC
 product DELL PERC_5		0x0015	PERC 5
 product DELL PERC_6 		0x0060	PERC 6
 product DELL PERC_3DI_2_SUB	0x00cf	PERC 3/Di
@@ -2417,6 +2424,7 @@ product HP HPSA_11		0x323a	Smart Array
 product HP HPSA_12		0x323b	Smart Array
 product HP HPSA_13		0x323c	Smart Array
 product HP USB			0x3300	iLO3 Virtual USB
+product HP IPMI			0x3302	IPMI
 product HP ILO3_SLAVE		0x3306	iLO3 Slave
 product HP ILO3_MGMT		0x3307	iLO3 Management
 product HP RS780_PPB_GFX	0x9602  (AMD) RS780 PCI-PCI Bridge (int gfx)
@@ -2575,6 +2583,8 @@ product INTEL 6700PXH_IOXAPIC	0x0326	670
 product INTEL 6700PXH_PCIE0	0x0329	6700PXH PCI Express-to-PCI Bridge #0
 product INTEL 6700PXH_PCIE1	0x032a	6700PXH PCI Express-to-PCI Bridge #1
 product INTEL 6702PXH_PCIX	0x032c	6702PXH PCI Express-to-PCIX
+product INTEL IOP332_A		0x0330	IOP332 PCI Express-to-PCI Bridge #0
+product INTEL IOP332_B		0x0332	IOP332 PCI Express-to-PCI Bridge #1
 product INTEL 80331		0x0335	Lindsay I/O Processor PCI-X Bridge
 product INTEL 41210A		0x0340	Serial to Parallel PCI Bridge A
 product INTEL 41210B		0x0341	Serial to Parallel PCI Bridge B
@@ -2591,6 +2601,8 @@ product INTEL DH89XXCC_SGMII	0x0438	DH89
 product INTEL DH89XXCC_SERDES	0x043a	DH89XXCC SerDes
 product INTEL DH89XXCC_BPLANE	0x043c	DH89XXCC backplane
 product INTEL DH89XXCC_SFP	0x0440	DH89XXCC SFP
+product INTEL DH89XXCC_IQIA_VF	0x0442	DH89XXCC QuickAssist Virtual Function
+product INTEL DH89XXCL_IQIA_VF	0x0443	DH89XXCL QuickAssist Virtual Function
 product INTEL PCEB		0x0482	82375EB/SB PCI-EISA Bridge
 product INTEL 

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

2015-04-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 19 16:47:39 UTC 2015

Modified Files:
src/sys/arch/x86/x86 [netbsd-7]: intel_busclock.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #702):
sys/arch/x86/x86/intel_busclock.c: revision 1.21
Update from Intel SDM:
- Add busclock values for Airmont.


To generate a diff of this commit:
cvs rdiff -u -r1.19.2.1 -r1.19.2.2 src/sys/arch/x86/x86/intel_busclock.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/x86/x86/intel_busclock.c
diff -u src/sys/arch/x86/x86/intel_busclock.c:1.19.2.1 src/sys/arch/x86/x86/intel_busclock.c:1.19.2.2
--- src/sys/arch/x86/x86/intel_busclock.c:1.19.2.1	Thu Jan  8 11:15:45 2015
+++ src/sys/arch/x86/x86/intel_busclock.c	Sun Apr 19 16:47:39 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_busclock.c,v 1.19.2.1 2015/01/08 11:15:45 martin Exp $	*/
+/*	$NetBSD: intel_busclock.c,v 1.19.2.2 2015/04/19 16:47:39 riz Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.19.2.1 2015/01/08 11:15:45 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.19.2.2 2015/04/19 16:47:39 riz Exp $");
 
 #include 
 #include 
@@ -272,6 +272,56 @@ p3_get_bus_clock(struct cpu_info *ci)
 			goto print_msr;
 		}
 		break;
+	case 0x4c: /* Airmont */
+		if (rdmsr_safe(MSR_FSB_FREQ, &msr) == EFAULT) {
+			aprint_debug_dev(ci->ci_dev,
+			"unable to determine bus speed");
+			goto print_msr;
+		}
+		bus = (msr >> 0) & 0xf;
+		switch (bus) {
+		case 0:
+			bus_clock =  8333;
+			break;
+		case 1:
+			bus_clock = 1;
+			break;
+		case 2:
+			bus_clock = 1;
+			break;
+		case 3:
+			bus_clock = 11650;
+			break;
+		case 4:
+			bus_clock =  8333;
+			break;
+		case 5:
+			bus_clock = 1;
+			break;
+		case 6:
+			bus_clock = 1;
+			break;
+		case 7:
+			bus_clock = 11666;
+			break;
+		case 12:
+			bus_clock =  8000;
+			break;
+		case 13:
+			bus_clock =  9333;
+			break;
+		case 14:
+			bus_clock =  9000;
+			break;
+		case 15:
+			bus_clock =  ;
+			break;
+		default:
+			aprint_debug("%s: unknown Airmont FSB_FREQ value %d",
+			device_xname(ci->ci_dev), bus);
+			goto print_msr;
+		}
+		break;
 	default:
 		aprint_debug("%s: unknown i686 model %02x, can't get bus clock",
 		device_xname(ci->ci_dev),



CVS commit: [netbsd-7] src/usr.sbin/cpuctl/arch

2015-04-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 19 16:42:19 UTC 2015

Modified Files:
src/usr.sbin/cpuctl/arch [netbsd-7]: i386.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #701):
usr.sbin/cpuctl/arch/i386.c: revision 1.65
Update from Intel SDM:
- Add Atom Z8000, Future gen Xeon (Broadwell), Next gen Xeon Phi and so on.
- Add comments.


To generate a diff of this commit:
cvs rdiff -u -r1.58.2.2 -r1.58.2.3 src/usr.sbin/cpuctl/arch/i386.c

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.58.2.2 src/usr.sbin/cpuctl/arch/i386.c:1.58.2.3
--- src/usr.sbin/cpuctl/arch/i386.c:1.58.2.2	Sun Dec 14 17:02:38 2014
+++ src/usr.sbin/cpuctl/arch/i386.c	Sun Apr 19 16:42:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.58.2.2 2014/12/14 17:02:38 martin Exp $	*/
+/*	$NetBSD: i386.c,v 1.58.2.3 2015/04/19 16:42:19 riz Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.58.2.2 2014/12/14 17:02:38 martin Exp $");
+__RCSID("$NetBSD: i386.c,v 1.58.2.3 2015/04/19 16:42:19 riz Exp $");
 #endif /* not lint */
 
 #include 
@@ -349,12 +349,12 @@ const struct cpu_cpuid_nameclass i386_cp
 [0x2f] = "Xeon E7 family",
 [0x35] = "Atom Family",
 [0x36] = "Atom S1000",
-[0x37] = "Atom E3000, Z3000",
+[0x37] = "Atom E3000, Z3[67]00",
 [0x3a] = "Xeon E3-1200v2 and 3rd gen core, "
 	 "Ivy Bridge",
 [0x3c] = "4th gen Core, Xeon E3-12xx v3 "
 	 "(Haswell)",
-[0x3d] = "Core M-5xxx (Broadwell)",
+[0x3d] = "Core M-5xxx, Future 5th gen Core (Broadwell)",
 [0x3e] = "Xeon E5/E7 v2 (Ivy Bridge-E), "
 	 "Core i7-49xx Extreme",
 [0x3f] = "Xeon E5-2600/1600 v3 (Haswell-E), "
@@ -363,12 +363,15 @@ const struct cpu_cpuid_nameclass i386_cp
 	 "(Haswell)",
 [0x46] = "4th gen Core, Xeon E3-12xx v3 "
 	 "(Haswell)",
-[0x4a] = "Future Atom E3000, Z3000",
+[0x4a] = "Atom Z3400",
+[0x4c] = "Atom Z8000",
 [0x4d] = "Atom C2000",
-[0x4e] = "Future Core",
-[0x56] = "Future Xeon",
-[0x5a] = "Future Atom E3000, Z3000",
-[0x5d] = "Future Atom E3000, Z3000",
+[0x4e] = "Future gen Core",
+[0x4f] = "Future gen Xeon (Broadwell)",
+[0x56] = "Next gen Xeon D (Broadwell)",
+[0x57] = "Next gen Xeon Phi",
+[0x5a] = "Atom E3500",
+[0x5d] = "Future Atom (Silvermont)",
 			},
 			"Pentium Pro, II or III",	/* Default */
 			NULL,
@@ -996,6 +999,11 @@ intel_cpu_cacheinfo(struct cpu_info *ci)
 			if (descs[i] & 0x8000)
 continue;
 			for (j = 0; j < 4; j++) {
+/*
+ * The least significant byte in EAX
+ * ((desc[0] >> 0) & 0xff) is always 0x01 and
+ * it should be ignored.
+ */
 if (i == 0 && j == 0)
 	continue;
 desc = (descs[i] >> (j * 8)) & 0xff;



CVS commit: [netbsd-7] src/doc

2015-04-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 19 16:49:08 UTC 2015

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

Log Message:
Tickets 699, 701, 702.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.263 -r1.1.2.264 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.263 src/doc/CHANGES-7.0:1.1.2.264
--- src/doc/CHANGES-7.0:1.1.2.263	Sun Apr 19 06:51:43 2015
+++ src/doc/CHANGES-7.0	Sun Apr 19 16:49:08 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.263 2015/04/19 06:51:43 riz Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.264 2015/04/19 16:49:08 riz Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -19811,3 +19811,45 @@ sys/dev/pci/if_wm.c1.316
 	Fix PHY access functions for newer revisions of I218-{LM,V}.
 	[msaitoh, ticket #698]
 
+sys/dev/pci/pcidevs1.1200, 1.1203, 1.1208-1.1212, 1.1214-1.1220 via patch
+sys/dev/pci/pcidevs.hregen
+sys/dev/pci/pcidevs_data.h			regen
+
+	Sync pcidevs with rev. 1.1220:
+	- Add Samsung Electronics XP941 M.2 SSD
+	- Add Intel Atom Z36xx and Z37xx devices from the datasheet.
+	- Add Intel QuickAssist Virtual Function Device IDs
+	- Add some Intel 10/40G devices.
+	- Add Some Intel E7520 devices
+	- Add Some Intel IOP332 devices
+	- Add Xeon E5 v3 and C61x devices.
+	- Add Mobile 5th Generation Intel Core devices.
+	- Add Intel 63xxESB AC'97 Audio Controller
+	- Fix product ID of INTEL 5000_PCIE_4.
+	- Add some Intel 9 Series devices
+	- Add some Intel devices.
+	- Sort VIATECH's entries in the device ID's order.
+	- Add some VIATECH devices.
+	- Add COMPAQ iLOs.
+	- Add HP IPMI device.
+	- Add another HP vendor ID (was 3PAR)
+	- Add two PLX PCI Bridges.
+	- Add Radeon HD 54xx Audio
+	- Add Dell DARC 4 devices
+	- Add nForce Host Bridges.
+	- Add MegaRAID SAS3108
+	[msaitoh, ticket #699]
+
+usr.sbin/cpuctl/arch/i386.c			1.65
+
+	Update from Intel SDM:
+	- Add Atom Z8000, Future gen Xeon (Broadwell), Next gen Xeon Phi and so on.
+	- Add comments.
+	[msaitoh, ticket #701]
+
+sys/arch/x86/x86/intel_busclock.c		1.21
+
+	Update from Intel SDM:
+	- Add busclock values for Airmont.
+	[msaitoh, ticket #702]
+



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

2015-04-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 19 17:01:50 UTC 2015

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

Log Message:
Apply patch (requested by msaitoh in ticket #1292):
sys/dev/pci/if_wm.c 1.313-1.314 and 1.316 via patch

Fix a bug that the first access to NVM is failed on 8254[17] which use
SPI EEPROM. Observed on Dell PowerEdge [12]850.
Thanks Tom Ivar Helbekkmo for debugging.

Fix a bug that wm_sgmii_writereg() function doesn't pass the "val"
argument to the I2CCMD register. Reported by Bernard Merindol
in PR#49789.

Fix a bug that newer revision of I218-{LM,V} use wrong PHY access
functions. The problem only occured on devices that the PCI device ID
was 0x15a[0123].
[msaitoh, ticket #1292]


To generate a diff of this commit:
cvs rdiff -u -r1.227.2.16 -r1.227.2.17 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.227.2.16 src/sys/dev/pci/if_wm.c:1.227.2.17
--- src/sys/dev/pci/if_wm.c:1.227.2.16	Thu Apr 16 06:20:08 2015
+++ src/sys/dev/pci/if_wm.c	Sun Apr 19 17:01:50 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.227.2.16 2015/04/16 06:20:08 snj Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.227.2.17 2015/04/19 17:01:50 riz Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.227.2.16 2015/04/16 06:20:08 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.227.2.17 2015/04/19 17:01:50 riz Exp $");
 
 #include 
 #include 
@@ -1713,6 +1713,7 @@ wm_attach(device_t parent, device_t self
 	case WM_T_82541_2:
 	case WM_T_82547:
 	case WM_T_82547_2:
+		sc->sc_flags |= WM_F_EEPROM_HANDSHAKE;
 		reg = CSR_READ(sc, WMREG_EECD);
 		if (reg & EECD_EE_TYPE) {
 			/* SPI */
@@ -1728,7 +1729,6 @@ wm_attach(device_t parent, device_t self
 sc->sc_nvm_addrbits = 6;
 			}
 		}
-		sc->sc_flags |= WM_F_EEPROM_HANDSHAKE;
 		break;
 	case WM_T_82571:
 	case WM_T_82572:
@@ -6842,8 +6842,9 @@ wm_gmii_mediainit(struct wm_softc *sc, p
 	 *  For some devices, we can determine the PHY access method
 	 * from sc_type.
 	 *
-	 *  For ICH8 variants, it's difficult to determine the PHY access
-	 * method by sc_type, so use the PCI product ID for some devices.
+	 *  For ICH and PCH variants, it's difficult to determine the PHY
+	 * access  method by sc_type, so use the PCI product ID for some
+	 * devices.
 	 * For other ICH8 variants, try to use igp's method. If the PHY
 	 * can't detect, then use bm's method.
 	 */
@@ -6852,30 +6853,16 @@ wm_gmii_mediainit(struct wm_softc *sc, p
 	case PCI_PRODUCT_INTEL_PCH_M_LC:
 		/* 82577 */
 		sc->sc_phytype = WMPHY_82577;
-		mii->mii_readreg = wm_gmii_hv_readreg;
-		mii->mii_writereg = wm_gmii_hv_writereg;
 		break;
 	case PCI_PRODUCT_INTEL_PCH_D_DM:
 	case PCI_PRODUCT_INTEL_PCH_D_DC:
 		/* 82578 */
 		sc->sc_phytype = WMPHY_82578;
-		mii->mii_readreg = wm_gmii_hv_readreg;
-		mii->mii_writereg = wm_gmii_hv_writereg;
 		break;
 	case PCI_PRODUCT_INTEL_PCH2_LV_LM:
 	case PCI_PRODUCT_INTEL_PCH2_LV_V:
 		/* 82579 */
 		sc->sc_phytype = WMPHY_82579;
-		mii->mii_readreg = wm_gmii_hv_readreg;
-		mii->mii_writereg = wm_gmii_hv_writereg;
-		break;
-	case PCI_PRODUCT_INTEL_I217_LM:
-	case PCI_PRODUCT_INTEL_I217_V:
-	case PCI_PRODUCT_INTEL_I218_LM:
-	case PCI_PRODUCT_INTEL_I218_V:
-		/* I21[78] */
-		mii->mii_readreg = wm_gmii_hv_readreg;
-		mii->mii_writereg = wm_gmii_hv_writereg;
 		break;
 	case PCI_PRODUCT_INTEL_82801I_BM:
 	case PCI_PRODUCT_INTEL_82801J_R_BM_LM:
@@ -6912,6 +6899,11 @@ wm_gmii_mediainit(struct wm_softc *sc, p
 		}
 		break;
 	}
+	if ((sc->sc_type >= WM_T_PCH) && (sc->sc_type <= WM_T_PCH_LPT)) {
+		/* All PCH* use _hv_ */
+		mii->mii_readreg = wm_gmii_hv_readreg;
+		mii->mii_writereg = wm_gmii_hv_writereg;
+	}
 	mii->mii_statchg = wm_gmii_statchg;
 
 	wm_gmii_reset(sc);
@@ -7644,16 +7636,18 @@ wm_sgmii_writereg(device_t self, int phy
 	struct wm_softc *sc = device_private(self);
 	uint32_t i2ccmd;
 	int i;
+	int val_swapped;
 
 	if (wm_get_swfw_semaphore(sc, swfwphysem[sc->sc_funcid])) {
 		aprint_error_dev(sc->sc_dev, "%s: failed to get semaphore\n",
 		__func__);
 		return;
 	}
-
+	/* Swap the data bytes for the I2C interface */
+	val_swapped = ((val >> 8) & 0x00FF) | ((val << 8) & 0xFF00);
 	i2ccmd = (reg << I2CCMD_REG_ADDR_SHIFT)
 	| (phy << I2CCMD_PHY_ADDR_SHIFT)
-	| I2CCMD_OPCODE_WRITE;
+	| I2CCMD_OPCODE_WRITE | val_swapped;
 	CSR_WRITE(sc, WMREG_I2CCMD, i2ccmd);
 
 	/* Poll the ready bit */



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

2015-04-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 19 17:06:27 UTC 2015

Modified Files:
src/sys/dev/pci [netbsd-6]: pcidevs

Log Message:
sys/dev/pci/pcidevs 1.1208-1.1220 via patch
sys/dev/pci/pcidevs.h   regen
sys/dev/pci/pcidevs_data.h  regen

- Add Intel QuickAssist Virtual Function Device IDs
- Add some Intel 10/40G devices.
- Add Some Intel E7520 devices
- Add Some Intel IOP332 devices
- Add Xeon E5 v3 and C61x devices.
- Add Mobile 5th Generation Intel Core devices.
- Add Intel 63xxESB AC'97 Audio Controller
- Fix product ID of INTEL 5000_PCIE_4.
- Add some Intel devices.
- Sort VIATECH's entries in the device ID's order.
- Add some VIATECH devices.
- Add COMPAQ iLOs.
- Add HP IPMI device.
- Add another HP vendor ID (was 3PAR)
- Add AR816x/AR817x chips (part of PR/49584)
- Add two PLX PCI Bridges.
- Add Radeon HD 54xx Audio
- Add Dell DARC 4 devices
- Add nForce Host Bridges.
- Add MegaRAID SAS3108
[msaitoh, ticket #1293]


To generate a diff of this commit:
cvs rdiff -u -r1.1102.2.16 -r1.1102.2.17 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1102.2.16 src/sys/dev/pci/pcidevs:1.1102.2.17
--- src/sys/dev/pci/pcidevs:1.1102.2.16	Sun Dec  7 16:36:46 2014
+++ src/sys/dev/pci/pcidevs	Sun Apr 19 17:06:27 2015
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1102.2.16 2014/12/07 16:36:46 martin Exp $
+$NetBSD: pcidevs,v 1.1102.2.17 2015/04/19 17:06:27 riz Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -585,6 +585,7 @@ vendor ENE		0x1524	ENE Technology
 vendor TERRATEC		0x153b	TerraTec Electronic
 vendor PERLE		0x155f	Perle Systems
 vendor SOLIDUM		0x1588	Solidum Systems
+vendor HP2		0x1590	Hewlett-Packard
 vendor SYBA		0x1592	Syba
 vendor FARADAY		0x159b	Faraday Technology
 vendor GEOCAST		0x15a1	Geocast Network Systems
@@ -1164,6 +1165,7 @@ product ATTANSIC AR8171		0x10a1	AR8171
 product ATTANSIC ETHERNET_100	0x2048	L2 100 Mbit Ethernet Adapter
 product ATTANSIC AR8152_B	0x2060	AR8152 v1.1 Fast Ethernet Adapter
 product ATTANSIC AR8152_B2	0x2062	AR8152 v2.0 Fast Ethernet Adapter
+product ATTANSIC E2200		0xe091	E2200
 
 /* ATI products */
 /* See http://www.x.org/wiki/Radeon%20ASICs */
@@ -1477,6 +1479,7 @@ product ATI RADEON_HD6320	0x9806	Radeon 
 product ATI RADEON_HD7340	0x9808	Radeon HD7340 Graphics
 product ATI RADEON_HD2600_HD	0xaa08	Radeon HD2600 HD Audio Controller
 product ATI RADEON_HD5600_HDMI	0xaa60	Redwood HDMI Audio
+product ATI RADEON_HD54XX_HDA	0xaa68	Radeon HD 54xx Audio
 
 /* Auravision products */
 product AURAVISION VXP524	0x01f7	VxP524 PCI Video Processor
@@ -1844,6 +1847,8 @@ product COMPAQ CSA5300_2	0xb060	Smart Ar
 product COMPAQ PRESARIO56XX	0xb0b8	Presario 56xx
 product COMPAQ M700		0xb112	Armada M700
 product COMPAQ CSA5i_2		0xb178	Smart Array 5i/532 rev. 2
+product COMPAQ ILO_1		0xb203	iLO
+product COMPAQ ILO_2		0xb204	iLO
 product COMPAQ NF3P_BNC		0xf150	NetFlex 3/P w/ BNC
 product COMPAQ NF3P		0xf130	NetFlex 3/P
 
@@ -1974,7 +1979,10 @@ product DELL PERC_3DI_2		0x0008	PERC 3/D
 product DELL PERC_3DI_3		0x000a	PERC 3/Di
 product DELL PERC_4DI		0x000e	PERC 4/Di
 product DELL PERC_4DI_2		0x000f	PERC 4/Di
+product DELL DRAC_4		0x0011	DRAC 4
+product DELL DRAC_4_VUART	0x0012	DRAC 4 Virtual UART
 product DELL PERC_4ESI		0x0013	PERC 4e/Si
+product DELL DRAC_4_SMIC	0x0014	DRAC 4 SMIC
 product DELL PERC_5		0x0015	PERC 5
 product DELL PERC_6 		0x0060	PERC 6
 product DELL PERC_3DI_2_SUB	0x00cf	PERC 3/Di
@@ -2339,6 +2347,7 @@ product HP HPSA_11		0x323a	Smart Array
 product HP HPSA_12		0x323b	Smart Array
 product HP HPSA_13		0x323c	Smart Array
 product HP USB			0x3300	iLO3 Virtual USB
+product HP IPMI			0x3302	IPMI
 product HP ILO3_SLAVE		0x3306	iLO3 Slave
 product HP ILO3_MGMT		0x3307	iLO3 Management
 
@@ -2498,11 +2507,15 @@ product INTEL IOP333_A		0x0370	IOP333 PC
 product INTEL IOP333_B		0x0372	IOP333 PCI Express-to-PCI Bridge #1
 product INTEL 6700PXH_PCIE0	0x0329	6700PXH PCI Express-to-PCI Bridge #0
 product INTEL 6700PXH_PCIE1	0x032a	6700PXH PCI Express-to-PCI Bridge #1
+product INTEL IOP332_A		0x0330	IOP332 PCI Express-to-PCI Bridge #0
+product INTEL IOP332_B		0x0332	IOP332 PCI Express-to-PCI Bridge #1
 product INTEL SRCZCRX		0x0407	RAID Controller
 product INTEL SRCU42E		0x0408	SCSI RAID Controller
 product INTEL SRCS28X		0x0409	SATA RAID Controller
 product INTEL HASWELL_IGD	0x0402	Haswell Integrated Graphics Device
 product INTEL HASWELL_IGD_1	0x0412	Haswell Integrated Graphics Device
+product INTEL DH89XXCC_IQIA_VF	0x0442	DH89XXCC QuickAssist Virtual Function
+product INTEL DH89XXCL_IQIA_VF	0x0443	DH89XXCL QuickAssist Virtual Function
 pro

CVS commit: [netbsd-6] src/doc

2015-04-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 19 17:08:12 UTC 2015

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

Log Message:
Tickets 1292, 1293


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

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

Modified files:

Index: src/doc/CHANGES-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.213 src/doc/CHANGES-6.2:1.1.2.214
--- src/doc/CHANGES-6.2:1.1.2.213	Sun Apr 19 05:58:46 2015
+++ src/doc/CHANGES-6.2	Sun Apr 19 17:08:12 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.213 2015/04/19 05:58:46 msaitoh Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.214 2015/04/19 17:08:12 riz Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -11430,3 +11430,45 @@ lib/libc/arch/sh3/gen/swapcontext.S		1.1
 	Correctly preserve old sate in swapcontext(3).
 	Fixes PR port-sh3/49597 reported by Yasushi Oshima.
 	[uwe, ticket #1294]
+
+sys/dev/pci/if_wm.c1.313-1.314 and 1.316 via patch
+
+	Fix a bug that the first access to NVM is failed on 8254[17] which use
+	SPI EEPROM. Observed on Dell PowerEdge [12]850.
+	Thanks Tom Ivar Helbekkmo for debugging.
+
+	Fix a bug that wm_sgmii_writereg() function doesn't pass the "val"
+	argument to the I2CCMD register. Reported by Bernard Merindol
+	in PR#49789.
+
+	Fix a bug that newer revision of I218-{LM,V} use wrong PHY access
+	functions. The problem only occured on devices that the PCI device ID
+	was 0x15a[0123].
+	[msaitoh, ticket #1292]
+
+sys/dev/pci/pcidevs1.1208-1.1220 via patch
+sys/dev/pci/pcidevs.hregen
+sys/dev/pci/pcidevs_data.h			regen
+
+	- Add Intel QuickAssist Virtual Function Device IDs
+	- Add some Intel 10/40G devices.
+	- Add Some Intel E7520 devices
+	- Add Some Intel IOP332 devices
+	- Add Xeon E5 v3 and C61x devices.
+	- Add Mobile 5th Generation Intel Core devices.
+	- Add Intel 63xxESB AC'97 Audio Controller
+	- Fix product ID of INTEL 5000_PCIE_4.
+	- Add some Intel devices.
+	- Sort VIATECH's entries in the device ID's order.
+	- Add some VIATECH devices.
+	- Add COMPAQ iLOs.
+	- Add HP IPMI device.
+	- Add another HP vendor ID (was 3PAR)
+	- Add AR816x/AR817x chips (part of PR/49584)
+	- Add two PLX PCI Bridges.
+	- Add Radeon HD 54xx Audio
+	- Add Dell DARC 4 devices
+	- Add nForce Host Bridges.
+	- Add MegaRAID SAS3108
+	[msaitoh, ticket #1293]
+



CVS commit: src/distrib/utils/embedded

2015-04-19 Thread Hubert Feyrer
Module Name:src
Committed By:   hubertf
Date:   Sun Apr 19 17:56:57 UTC 2015

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
Add some documentation:
Tell what this does, and what it expects from conf files


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.57 src/distrib/utils/embedded/mkimage:1.58
--- src/distrib/utils/embedded/mkimage:1.57	Sat Apr 18 22:06:48 2015
+++ src/distrib/utils/embedded/mkimage	Sun Apr 19 17:56:57 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.57 2015/04/18 22:06:48 hubertf Exp $
+# $NetBSD: mkimage,v 1.58 2015/04/19 17:56:57 hubertf Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -32,6 +32,20 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
+#
+# Makes a bootable image for the host architecture given.
+# The host specific functions are pulled in from a /bin/sh script in the
+# "conf" directory, and is expected to provide the following shell
+# functions, which are called in the following order:
+#
+#  - make_fstab: Creates the host's /etc/fstab with / on ${rootdev}.
+#If -m is given, a number of directories are put on a tmpfs RAM disk
+#  - customize: After unpacking the sets, this gets the system to
+#a working state, e. g. by setting up /etc/rc.conf and /dev
+#  - populate: Add common goods like kernel and bootloader
+#  - make_label: Prints disklabel to stdout
+#
+
 set -e
 
 DIR="$(cd "$(dirname "$0")" && pwd)"



CVS commit: src

2015-04-19 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Apr 19 18:15:26 UTC 2015

Modified Files:
src/external/gpl3/gcc/dist/libstdc++-v3/libsupc++: atexit_arm.cc
src/lib/libc/stdlib: atexit.c

Log Message:
Redo __aeabi_atexit by shuffling the arguments and dropping the code in
libstdc++.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/gpl3/gcc/dist/libstdc++-v3/libsupc++/atexit_arm.cc
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/stdlib/atexit.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/gpl3/gcc/dist/libstdc++-v3/libsupc++/atexit_arm.cc
diff -u src/external/gpl3/gcc/dist/libstdc++-v3/libsupc++/atexit_arm.cc:1.1.1.2 src/external/gpl3/gcc/dist/libstdc++-v3/libsupc++/atexit_arm.cc:1.2
--- src/external/gpl3/gcc/dist/libstdc++-v3/libsupc++/atexit_arm.cc:1.1.1.2	Sat Mar  1 08:41:35 2014
+++ src/external/gpl3/gcc/dist/libstdc++-v3/libsupc++/atexit_arm.cc	Sun Apr 19 18:15:26 2015
@@ -23,7 +23,7 @@
 
 #include 
 
-#if defined(__arm__) && defined(__ARM_EABI__)
+#if defined(__arm__) && defined(__ARM_EABI__) && !defined(__NetBSD__)
 
 namespace __aeabiv1
 {

Index: src/lib/libc/stdlib/atexit.c
diff -u src/lib/libc/stdlib/atexit.c:1.28 src/lib/libc/stdlib/atexit.c:1.29
--- src/lib/libc/stdlib/atexit.c:1.28	Sat Apr 18 21:44:31 2015
+++ src/lib/libc/stdlib/atexit.c	Sun Apr 19 18:15:26 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: atexit.c,v 1.28 2015/04/18 21:44:31 joerg Exp $	*/
+/*	$NetBSD: atexit.c,v 1.29 2015/04/19 18:15:26 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: atexit.c,v 1.28 2015/04/18 21:44:31 joerg Exp $");
+__RCSID("$NetBSD: atexit.c,v 1.29 2015/04/19 18:15:26 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "reentrant.h"
@@ -136,7 +136,14 @@ __libc_atexit_init(void)
  *	http://www.codesourcery.com/cxx-abi/abi.html#dso-dtor
  */
 #if defined(__ARM_EABI__) && !defined(lint)
-__strong_alias(__aeabi_atexit,__cxa_atexit);
+int
+__aeabi_atexit(void *arg, void (*func)(void *), void *dso);
+
+int
+__aeabi_atexit(void *arg, void (*func)(void *), void *dso)
+{
+	return __cxa_atexit(func, arg, dso);
+}
 #endif
 
 int



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

2015-04-19 Thread Hubert Feyrer
Module Name:src
Committed By:   hubertf
Date:   Sun Apr 19 18:28:31 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf rpi.conf rpi_inst.conf
usermode.conf

Log Message:
Cleanup: make_filesystems is not used any longer, purge remains


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/conf/armv7.conf
cvs rdiff -u -r1.28 -r1.29 src/distrib/utils/embedded/conf/rpi.conf
cvs rdiff -u -r1.6 -r1.7 src/distrib/utils/embedded/conf/rpi_inst.conf
cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/embedded/conf/usermode.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.1 src/distrib/utils/embedded/conf/armv7.conf:1.2
--- src/distrib/utils/embedded/conf/armv7.conf:1.1	Thu Apr  9 10:55:23 2015
+++ src/distrib/utils/embedded/conf/armv7.conf	Sun Apr 19 18:28:31 2015
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.1 2015/04/09 10:55:23 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.2 2015/04/19 18:28:31 hubertf Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -11,10 +11,6 @@ kernels_awin="BPI CUBIEBOARD CUBIETRUCK 
 kernels_rpi="RPI2"
 kernels_amlogic="ODROID-C1"
 
-make_filesystems() {
-	make_filesystems_evbarm
-}
-
 make_label() {
 	make_label_evbarm
 }

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.28 src/distrib/utils/embedded/conf/rpi.conf:1.29
--- src/distrib/utils/embedded/conf/rpi.conf:1.28	Mon Apr  6 20:19:28 2015
+++ src/distrib/utils/embedded/conf/rpi.conf	Sun Apr 19 18:28:31 2015
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.28 2015/04/06 20:19:28 jmcneill Exp $
+# $NetBSD: rpi.conf,v 1.29 2015/04/19 18:28:31 hubertf Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -11,10 +11,6 @@ resize=true
 firmwaredir=$src/external/broadcom/rpi-firmware/dist
 firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
 
-make_filesystems() {
-	make_filesystems_evbarm
-}
-
 make_fstab() {
 	make_fstab_evbarm
 }

Index: src/distrib/utils/embedded/conf/rpi_inst.conf
diff -u src/distrib/utils/embedded/conf/rpi_inst.conf:1.6 src/distrib/utils/embedded/conf/rpi_inst.conf:1.7
--- src/distrib/utils/embedded/conf/rpi_inst.conf:1.6	Fri Jan 23 15:17:58 2015
+++ src/distrib/utils/embedded/conf/rpi_inst.conf	Sun Apr 19 18:28:31 2015
@@ -1,4 +1,4 @@
-# $NetBSD: rpi_inst.conf,v 1.6 2015/01/23 15:17:58 skrll Exp $
+# $NetBSD: rpi_inst.conf,v 1.7 2015/04/19 18:28:31 hubertf Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -75,10 +75,6 @@ customize_evbarm() {
 firmwaredir=$src/external/broadcom/rpi-firmware/dist
 firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
 
-make_filesystems() {
-	make_filesystems_evbarm
-}
-
 make_fstab() {
 	make_fstab_evbarm
 }

Index: src/distrib/utils/embedded/conf/usermode.conf
diff -u src/distrib/utils/embedded/conf/usermode.conf:1.4 src/distrib/utils/embedded/conf/usermode.conf:1.5
--- src/distrib/utils/embedded/conf/usermode.conf:1.4	Fri Jan 23 15:17:58 2015
+++ src/distrib/utils/embedded/conf/usermode.conf	Sun Apr 19 18:28:31 2015
@@ -1,4 +1,4 @@
-# $NetBSD: usermode.conf,v 1.4 2015/01/23 15:17:58 skrll Exp $
+# $NetBSD: usermode.conf,v 1.5 2015/04/19 18:28:31 hubertf Exp $
 # NetBSD/usermode customization script used by mkimage
 
 # XXX: BROKEN, needs to be converted to makefs
@@ -10,11 +10,6 @@ setsdir=/usr/build/release/$(uname -m)/b
 size=0	# in MB
 usermodedirs="/var.cow /etc.cow /root.cow /pkgs"
 
-make_filesystems() {
-	newfs /dev/r${vnddev}a
-	mount /dev/${vnddev}a ${mnt}
-}
-
 make_fstab() {
 cat > ${mnt}/etc/fstab << EOF
 # NetBSD/usermode /etc/fstab



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

2015-04-19 Thread Hubert Feyrer
Module Name:src
Committed By:   hubertf
Date:   Sun Apr 19 18:53:33 UTC 2015

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

Log Message:
More cleanup:
Instead of first overwriting the *_evbarm functions with own code,
and then calling them from the regular functions, directly put the
code into the regular functions.

No more functions from evbarm.conf are used now.
Some variables are still used!


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/distrib/utils/embedded/conf/rpi_inst.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/rpi_inst.conf
diff -u src/distrib/utils/embedded/conf/rpi_inst.conf:1.7 src/distrib/utils/embedded/conf/rpi_inst.conf:1.8
--- src/distrib/utils/embedded/conf/rpi_inst.conf:1.7	Sun Apr 19 18:28:31 2015
+++ src/distrib/utils/embedded/conf/rpi_inst.conf	Sun Apr 19 18:53:33 2015
@@ -1,4 +1,4 @@
-# $NetBSD: rpi_inst.conf,v 1.7 2015/04/19 18:28:31 hubertf Exp $
+# $NetBSD: rpi_inst.conf,v 1.8 2015/04/19 18:53:33 hubertf Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -17,7 +17,7 @@ init=8
 size=$(( 10485760 + ${swap} * 1024 * 512 + ${boot} * 1024 * 512 + ${init} * 1024 * 512 ))
 msdosid=12
 
-make_label_evbarm() {
+make_label() {
 	# compute all sizes in terms of sectors
 	local totalsize=$(( ${newsize} * 1024 * 2 / 512 ))
 
@@ -64,28 +64,17 @@ drivedata: 0 
 EOF
 }
 
-make_fstab_evbarm() {
-:
-}
-
-customize_evbarm() {
+customize() {
 	echo "${bar} creating directories ${bar}"
 	mkdir ${mnt}/proc ${mnt}/kern
 }
-firmwaredir=$src/external/broadcom/rpi-firmware/dist
-firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
 
 make_fstab() {
-	make_fstab_evbarm
+	:
 }
 
-make_label() {
-	make_label_evbarm
-}
-
-customize() {
-	customize_evbarm
-}
+firmwaredir=$src/external/broadcom/rpi-firmware/dist
+firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
 
 populate() {
 	cat > ${mnt}/boot/cmdline.txt << EOF



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

2015-04-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 19 18:54:52 UTC 2015

Modified Files:
src/sys/arch/arm/amlogic: amlogic_board.c amlogic_crureg.h amlogic_io.c
amlogic_var.h files.amlogic
Added Files:
src/sys/arch/arm/amlogic: amlogic_sdio.c amlogic_sdioreg.h

Log Message:
Add a driver for Amlogic "SDIO" MMC controller.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/amlogic/amlogic_board.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/amlogic/amlogic_crureg.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/amlogic/amlogic_io.c \
src/sys/arch/arm/amlogic/amlogic_var.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/amlogic/amlogic_sdio.c \
src/sys/arch/arm/amlogic/amlogic_sdioreg.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/amlogic/files.amlogic

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/amlogic/amlogic_board.c
diff -u src/sys/arch/arm/amlogic/amlogic_board.c:1.11 src/sys/arch/arm/amlogic/amlogic_board.c:1.12
--- src/sys/arch/arm/amlogic/amlogic_board.c:1.11	Fri Apr  3 14:02:06 2015
+++ src/sys/arch/arm/amlogic/amlogic_board.c	Sun Apr 19 18:54:52 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: amlogic_board.c,v 1.11 2015/04/03 14:02:06 jmcneill Exp $ */
+/* $NetBSD: amlogic_board.c,v 1.12 2015/04/19 18:54:52 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_amlogic.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amlogic_board.c,v 1.11 2015/04/03 14:02:06 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amlogic_board.c,v 1.12 2015/04/19 18:54:52 jmcneill Exp $");
 
 #define	_ARM32_BUS_DMA_PRIVATE
 #include 
@@ -109,6 +109,31 @@ amlogic_get_rate_sys(void)
 }
 
 uint32_t
+amlogic_get_rate_clk81(void)
+{
+	uint32_t cc, rate;
+
+	rate = amlogic_get_rate_fixed();
+	cc = CBUS_READ(HHI_MPEG_CLK_CNTL_REG);
+	
+	switch (__SHIFTOUT(cc, HHI_MPEG_CLK_CNTL_DIV_SRC)) {
+	case 7:
+		rate /= 5;
+		break;
+	case 6:
+		rate /= 3;
+		break;
+	case 5:
+		rate /= 4;
+		break;
+	default:
+		panic("CLK81: unknown rate, HHI_MPEG_CLK_CNTL_REG = %#x", cc);
+	}
+
+	return rate / (__SHIFTOUT(cc, HHI_MPEG_CLK_CNTL_DIV_N) + 1);
+}
+
+uint32_t
 amlogic_get_rate_fixed(void)
 {
 	uint32_t cntl;
@@ -216,6 +241,11 @@ amlogic_sdhc_select_port(int port)
 		CBUS_SET_CLEAR(PERIPHS_PIN_MUX_2_REG, 0, 0xfc00);
 		CBUS_SET_CLEAR(PERIPHS_PIN_MUX_8_REG, 0, 0x0600);
 		CBUS_SET_CLEAR(PERIPHS_PIN_MUX_2_REG, 0x00f0, 0);
+
+		/* XXX ODROID-C1 */
+		CBUS_SET_CLEAR(PREG_PAD_GPIO5_EN_N_REG, 0x2000, 0);
+		CBUS_SET_CLEAR(PREG_PAD_GPIO5_OUT_REG, 0, 0x8000);
+		CBUS_SET_CLEAR(PREG_PAD_GPIO5_EN_N_REG, 0, 0x8000);
 		break;
 	case AMLOGIC_SDHC_PORT_C:
 		/* BOOT -> SDHC pin mux settings */
@@ -224,6 +254,93 @@ amlogic_sdhc_select_port(int port)
 		CBUS_SET_CLEAR(PERIPHS_PIN_MUX_6_REG, 0, 0xff00);
 		CBUS_SET_CLEAR(PERIPHS_PIN_MUX_4_REG, 0x7000, 0);
 		CBUS_SET_CLEAR(PERIPHS_PIN_MUX_7_REG, 0x000c, 0);
+
+		/* XXX ODROID-C1 */
+		CBUS_SET_CLEAR(PAD_PULL_UP_3_REG, 0, 0x00ff);
+		break;
+	default:
+		return EINVAL;
+	}
+
+	return 0;
+}
+
+void
+amlogic_sdhc_reset_port(int port)
+{
+	switch (port) {
+	case AMLOGIC_SDHC_PORT_C:
+		CBUS_SET_CLEAR(PERIPHS_PIN_MUX_2_REG, 0, 0x0100);
+		CBUS_SET_CLEAR(PREG_PAD_GPIO3_EN_N_REG, 0, 0x0200);
+		CBUS_SET_CLEAR(PREG_PAD_GPIO3_OUT_REG, 0x0200, 0);
+		delay(1000);
+		CBUS_SET_CLEAR(PREG_PAD_GPIO3_OUT_REG, 0, 0x0200);
+		delay(2000);
+		CBUS_SET_CLEAR(PREG_PAD_GPIO3_OUT_REG, 0x0200, 0);
+		delay(1000);
+		break;
+	}
+}
+
+bool
+amlogic_sdhc_is_removable(int port)
+{
+	switch (port) {
+	case AMLOGIC_SDHC_PORT_B:
+		return true;
+	default:
+		return false;
+	}
+}
+
+bool
+amlogic_sdhc_is_card_present(int port)
+{
+	switch (port) {
+	case AMLOGIC_SDHC_PORT_B:
+		/* GPIO CARD_6 */
+		return !(CBUS_READ(PREG_PAD_GPIO0_IN_REG) & __BIT(28));
+	default:
+		return true;
+	}
+}
+
+void
+amlogic_sdio_init(void)
+{
+	/* enable SDIO clk */
+	CBUS_WRITE(EE_CLK_GATING0_REG,
+	CBUS_READ(EE_CLK_GATING0_REG) | EE_CLK_GATING0_SDIO);
+
+	/* reset */
+	CBUS_SET_CLEAR(RESET6_REG, RESET6_SDIO, 0);
+}
+
+int
+amlogic_sdio_select_port(int port)
+{
+	switch (port) {
+	case AMLOGIC_SDIO_PORT_B:
+		/* CARD -> SDIO pin mux settings */
+		CBUS_SET_CLEAR(PERIPHS_PIN_MUX_6_REG, 0, 0x3f00);
+		CBUS_SET_CLEAR(PERIPHS_PIN_MUX_8_REG, 0, 0x063f);
+		CBUS_SET_CLEAR(PERIPHS_PIN_MUX_2_REG, 0, 0x00f0);
+		CBUS_SET_CLEAR(PERIPHS_PIN_MUX_2_REG, 0xfc00, 0);
+
+		/* XXX ODROID-C1 */
+		CBUS_SET_CLEAR(PREG_PAD_GPIO5_EN_N_REG, 0x2000, 0);
+		CBUS_SET_CLEAR(PREG_PAD_GPIO5_OUT_REG, 0, 0x8000);
+		CBUS_SET_CLEAR(PREG_PAD_GPIO5_EN_N_REG, 0, 0x8000);
+		break;
+	case AMLOGIC_SDIO_PORT_C:
+		/* BOOT -> SDIO pin mux settings */
+		CBUS_SET_CLEAR(PERIPHS_PIN_MUX_2_REG, 0, 0x06c2fc00);
+		CBUS_SET_CLEAR(PERIPHS_PIN_MUX_8_REG, 0, 0x003f);
+		CBUS_SET_CLEAR(PERIPHS_PIN_MUX_4_REG, 0, 0x

CVS commit: src/libexec/httpd

2015-04-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 19 19:05:19 UTC 2015

Modified Files:
src/libexec/httpd: cgi-bozo.c

Log Message:
Fix deref "command" after "free(file)", from KIYOHARA Takashi


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/libexec/httpd/cgi-bozo.c

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

Modified files:

Index: src/libexec/httpd/cgi-bozo.c
diff -u src/libexec/httpd/cgi-bozo.c:1.25 src/libexec/httpd/cgi-bozo.c:1.26
--- src/libexec/httpd/cgi-bozo.c:1.25	Tue Jun 24 03:23:59 2014
+++ src/libexec/httpd/cgi-bozo.c	Sun Apr 19 15:05:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgi-bozo.c,v 1.25 2014/06/24 07:23:59 shm Exp $	*/
+/*	$NetBSD: cgi-bozo.c,v 1.26 2015/04/19 19:05:19 christos Exp $	*/
 
 /*	$eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -247,7 +247,8 @@ bozo_process_cgi(bozo_httpreq_t *request
 	char	date[40];
 	bozoheaders_t *headp;
 	const char *type, *clen, *info, *cgihandler;
-	char	*query, *s, *t, *path, *env, *command, *file, *url;
+	char	*query, *s, *t, *path, *env, *file, *url;
+	char	command[MAXPATHLEN];
 	char	**envp, **curenvp, *argv[4];
 	char	*uri;
 	size_t	len;
@@ -284,7 +285,6 @@ bozo_process_cgi(bozo_httpreq_t *request
 	path = NULL;
 	envp = NULL;
 	cgihandler = NULL;
-	command = NULL;
 	info = NULL;
 
 	len = strlen(url);
@@ -309,12 +309,13 @@ bozo_process_cgi(bozo_httpreq_t *request
 
 	ix = 0;
 	if (cgihandler) {
-		command = file + 1;
+		snprintf(command, sizeof(command), "%s", file + 1);
 		path = bozostrdup(httpd, cgihandler);
 		argv[ix++] = path;
 			/* argv[] = [ path, command, query, NULL ] */
 	} else {
-		command = file + CGIBIN_PREFIX_LEN + 1;
+		snprintf(command, sizeof(command), "%s",
+		file + CGIBIN_PREFIX_LEN + 1);
 		if ((s = strchr(command, '/')) != NULL) {
 			info = bozostrdup(httpd, s);
 			*s = '\0';



CVS commit: src/sys/compat/svr4

2015-04-19 Thread Tyler R. Retzlaff
Module Name:src
Committed By:   rtr
Date:   Sun Apr 19 19:17:37 UTC 2015

Modified Files:
src/sys/compat/svr4: svr4_stream.c

Log Message:
clean up the way ti_bind() was converted to use sockaddr_big.

instead of using the original sockaddr_{in,un} structures for storage
use the single sockaddr_big structure instead.

while here ditch superfluous assignment of sockaddr sb_len since the
assignment is already performed in netaddr_to_sockaddr_{in,un}


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/compat/svr4/svr4_stream.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/compat/svr4/svr4_stream.c
diff -u src/sys/compat/svr4/svr4_stream.c:1.82 src/sys/compat/svr4/svr4_stream.c:1.83
--- src/sys/compat/svr4/svr4_stream.c:1.82	Fri Apr  3 20:01:07 2015
+++ src/sys/compat/svr4/svr4_stream.c	Sun Apr 19 19:17:37 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_stream.c,v 1.82 2015/04/03 20:01:07 rtr Exp $	 */
+/*	$NetBSD: svr4_stream.c,v 1.83 2015/04/19 19:17:37 rtr Exp $	 */
 
 /*-
  * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_stream.c,v 1.82 2015/04/03 20:01:07 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_stream.c,v 1.83 2015/04/19 19:17:37 rtr Exp $");
 
 #include 
 #include 
@@ -750,9 +750,9 @@ ti_bind(file_t *fp, int fd, struct svr4_
 {
 	int error;
 	struct svr4_strm *st = svr4_stream_get(fp);
-	struct sockaddr_in sain;
-	struct sockaddr_un saun;
-	struct sockaddr_big *sbig;
+	struct sockaddr_in *sain;
+	struct sockaddr_un *saun;
+	struct sockaddr_big sbig;
 	void *sup = NULL;
 	int sasize;
 	struct svr4_strmcmd bnd;
@@ -775,34 +775,34 @@ ti_bind(file_t *fp, int fd, struct svr4_
 
 	switch (st->s_family) {
 	case AF_INET:
-		sbig = (struct sockaddr_big *)&sain;
-		sbig->sb_len = sasize = sizeof(sain);
+		sain = (struct sockaddr_in *)&sbig;
+		sasize = sizeof(*sain);
 
 		if (bnd.offs == 0)
 			goto reply;
 
-		netaddr_to_sockaddr_in(&sain, &bnd);
+		netaddr_to_sockaddr_in(sain, &bnd);
 
 		DPRINTF(("TI_BIND: fam %d, port %d, addr %x\n",
-			 sain.sin_family, sain.sin_port,
-			 sain.sin_addr.s_addr));
+			 sain->sin_family, sain->sin_port,
+			 sain->sin_addr.s_addr));
 		break;
 
 	case AF_LOCAL:
-		sbig = (struct sockaddr_big *)&saun;
-		sbig->sb_len = sasize = sizeof(saun);
+		saun = (struct sockaddr_un *)&sbig;
+		sasize = sizeof(*saun);
 		if (bnd.offs == 0)
 			goto reply;
 
-		netaddr_to_sockaddr_un(&saun, &bnd);
+		netaddr_to_sockaddr_un(saun, &bnd);
 
-		if (saun.sun_path[0] == '\0')
+		if (saun->sun_path[0] == '\0')
 			goto reply;
 
 		DPRINTF(("TI_BIND: fam %d, path %s\n",
-			 saun.sun_family, saun.sun_path));
+			 saun->sun_family, saun->sun_path));
 
-		if ((error = clean_pipe(l, saun.sun_path)) != 0)
+		if ((error = clean_pipe(l, saun->sun_path)) != 0)
 			return error;
 
 		bnd.pad[28] = 0x1000;	/* magic again */
@@ -816,7 +816,7 @@ ti_bind(file_t *fp, int fd, struct svr4_
 
 	DPRINTF(("TI_BIND: fileno %d\n", fd));
 
-	error = do_sys_bind(l, fd, (struct sockaddr *)sbig);
+	error = do_sys_bind(l, fd, (struct sockaddr *)&sbig);
 	if (error != 0) {
 		DPRINTF(("TI_BIND: bind failed %d\n", error));
 		return error;



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

2015-04-19 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Apr 19 21:09:03 UTC 2015

Modified Files:
src/sys/arch/evbarm/conf: GENERIC.common

Log Message:
Add JIT options and DKWEDGE_{AUTODISCOVER,GPT}


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/GENERIC.common

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/GENERIC.common
diff -u src/sys/arch/evbarm/conf/GENERIC.common:1.5 src/sys/arch/evbarm/conf/GENERIC.common:1.6
--- src/sys/arch/evbarm/conf/GENERIC.common:1.5	Sat Apr 18 11:32:37 2015
+++ src/sys/arch/evbarm/conf/GENERIC.common	Sun Apr 19 21:09:02 2015
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC.common,v 1.5 2015/04/18 11:32:37 skrll Exp $
+#	$NetBSD: GENERIC.common,v 1.6 2015/04/19 21:09:02 matt Exp $
 #
 #	GENERIC evbarm kernel config (template)
 #
@@ -47,6 +47,10 @@ options 	INET6		# IPV6
 #options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
 #options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG
 
+# JIT compiler for bpfilter
+#options 	SLJIT
+options 	BPFJIT
+
 #options 	NFS_BOOT_BOOTP
 options 	NFS_BOOT_DHCP
 #options 	NFS_BOOT_BOOTSTATIC
@@ -106,6 +110,10 @@ options 	KTRACE		# system call tracing, 
 #options 	USERCONF	# userconf(4) support
 #options 	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
 
+# Wedge support   
+options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
+options 	DKWEDGE_METHOD_GPT	# Supports GPT partitions as wedges
+
 # Alternate buffer queue strategies for better responsiveness under high
 # disk I/O load.
 #options 	BUFQ_READPRIO



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

2015-04-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 19 21:23:01 UTC 2015

Modified Files:
src/sys/arch/arm/amlogic: amlogic_sdhc.c

Log Message:
The Amlogic SDHC controller doesn't support SG DMA. When we advertise
DMA but not SG DMA support, the sdmmc layer breaks up transfers into
multiple PAGE_SIZE (8KB here) transfers.

Remove the DMA capability flag and do transfers through a MAXPHYS-sized
buffer instead. This lets us do larger transfers and even with the memcpy,
still a significant win for performance.

Before: 134217728 bytes transferred in 15.301 secs (8771827 bytes/sec)
After:  134217728 bytes transferred in 8.834 secs (15193313 bytes/sec)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/amlogic/amlogic_sdhc.c

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

Modified files:

Index: src/sys/arch/arm/amlogic/amlogic_sdhc.c
diff -u src/sys/arch/arm/amlogic/amlogic_sdhc.c:1.4 src/sys/arch/arm/amlogic/amlogic_sdhc.c:1.5
--- src/sys/arch/arm/amlogic/amlogic_sdhc.c:1.4	Fri Apr 17 18:36:15 2015
+++ src/sys/arch/arm/amlogic/amlogic_sdhc.c	Sun Apr 19 21:23:01 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: amlogic_sdhc.c,v 1.4 2015/04/17 18:36:15 jmcneill Exp $ */
+/* $NetBSD: amlogic_sdhc.c,v 1.5 2015/04/19 21:23:01 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amlogic_sdhc.c,v 1.4 2015/04/17 18:36:15 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amlogic_sdhc.c,v 1.5 2015/04/19 21:23:01 jmcneill Exp $");
 
 #include 
 #include 
@@ -64,6 +64,10 @@ struct amlogic_sdhc_softc {
 	kcondvar_t		sc_intr_cv;
 
 	uint32_t		sc_intr_ista;
+
+	bus_dmamap_t		sc_dmamap;
+	bus_dma_segment_t	sc_segs[1];
+	void			*sc_bbuf;
 };
 
 CFATTACH_DECL_NEW(amlogic_sdhc, sizeof(struct amlogic_sdhc_softc),
@@ -87,6 +91,8 @@ static int	amlogic_sdhc_set_clock(struct
 static int	amlogic_sdhc_wait_idle(struct amlogic_sdhc_softc *);
 static int	amlogic_sdhc_wait_ista(struct amlogic_sdhc_softc *, uint32_t, int);
 
+static void	amlogic_sdhc_dmainit(struct amlogic_sdhc_softc *);
+
 static struct sdmmc_chip_functions amlogic_sdhc_chip_functions = {
 	.host_reset = amlogic_sdhc_host_reset,
 	.host_ocr = amlogic_sdhc_host_ocr,
@@ -152,6 +158,8 @@ amlogic_sdhc_attach(device_t parent, dev
 	}
 	aprint_normal_dev(self, "interrupting on irq %d\n", loc->loc_intr);
 
+	amlogic_sdhc_dmainit(sc);
+
 	config_interrupts(self, amlogic_sdhc_attach_i);
 }
 
@@ -171,12 +179,12 @@ amlogic_sdhc_attach_i(device_t self)
 	saa.saa_sch = sc;
 	saa.saa_clkmin = 400;
 	saa.saa_clkmax = 5;
+	/* Do not advertise DMA capabilities, we handle DMA ourselves */
 	saa.saa_caps = SMC_CAPS_4BIT_MODE|
 		   SMC_CAPS_8BIT_MODE|
 		   SMC_CAPS_SD_HIGHSPEED|
 		   SMC_CAPS_MMC_HIGHSPEED|
-		   SMC_CAPS_AUTO_STOP|
-		   SMC_CAPS_DMA;
+		   SMC_CAPS_AUTO_STOP;
 
 	sc->sc_sdmmc_dev = config_found(self, &saa, NULL);
 }
@@ -205,6 +213,35 @@ amlogic_sdhc_intr(void *priv)
 	return 1;
 }
 
+static void
+amlogic_sdhc_dmainit(struct amlogic_sdhc_softc *sc)
+{
+	int error, rseg;
+
+	error = bus_dmamem_alloc(sc->sc_dmat, MAXPHYS, PAGE_SIZE, MAXPHYS,
+	sc->sc_segs, 1, &rseg, BUS_DMA_WAITOK);
+	if (error) {
+		device_printf(sc->sc_dev, "bus_dmamem_alloc failed: %d\n", error);
+		return;
+	}
+	KASSERT(rseg == 1);
+
+	error = bus_dmamem_map(sc->sc_dmat, sc->sc_segs, rseg, PAGE_SIZE,
+	&sc->sc_bbuf, BUS_DMA_WAITOK);
+	if (error) {
+		device_printf(sc->sc_dev, "bus_dmamem_map failed\n");
+		return;
+	}
+
+	error = bus_dmamap_create(sc->sc_dmat, MAXPHYS, 1, MAXPHYS, 0,
+	BUS_DMA_WAITOK, &sc->sc_dmamap);
+	if (error) {
+		device_printf(sc->sc_dev, "bus_dmamap_create failed\n");
+		return;
+	}
+
+}
+
 static int
 amlogic_sdhc_set_clock(struct amlogic_sdhc_softc *sc, u_int freq)
 {
@@ -437,6 +474,7 @@ amlogic_sdhc_exec_command(sdmmc_chipset_
 {
 	struct amlogic_sdhc_softc *sc = sch;
 	uint32_t cmdval = 0, cntl, srst, pdma, ictl;
+	bool use_bbuf = false;
 	int i;
 
 	KASSERT(cmd->c_blklen <= 512);
@@ -516,9 +554,22 @@ amlogic_sdhc_exec_command(sdmmc_chipset_
 	}
 
 	if (cmd->c_datalen > 0) {
-		KASSERT(cmd->c_dmamap->dm_nsegs == 1);
-		KASSERT(cmd->c_dmamap->dm_segs[0].ds_len >= cmd->c_datalen);
-		SDHC_WRITE(sc, SD_ADDR_REG, cmd->c_dmamap->dm_segs[0].ds_addr);
+		cmd->c_error = bus_dmamap_load(sc->sc_dmat, sc->sc_dmamap,
+		sc->sc_bbuf, MAXPHYS, NULL, BUS_DMA_WAITOK);
+		if (cmd->c_error) {
+			device_printf(sc->sc_dev, "bus_dmamap_load failed\n");
+			goto done;
+		}
+		if (ISSET(cmd->c_flags, SCF_CMD_READ)) {
+			bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap, 0,
+			MAXPHYS, BUS_DMASYNC_PREREAD);
+		} else {
+			memcpy(sc->sc_bbuf, cmd->c_data, cmd->c_datalen);
+			bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap, 0,
+			MAXPHYS, BUS_DMASYNC_PREWRITE);
+		}
+		SDHC_WRITE(sc, SD_ADDR_REG, sc->sc_dmamap->dm_segs[0].ds_addr);
+		use_bbuf = true;
 	}
 
 	cm

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

2015-04-19 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Apr 19 21:25:19 UTC 2015

Modified Files:
src/sys/arch/arm/allwinner: files.awin

Log Message:
Let the ALLWINNER_Axx define the CPU they use


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/allwinner/files.awin

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

Modified files:

Index: src/sys/arch/arm/allwinner/files.awin
diff -u src/sys/arch/arm/allwinner/files.awin:1.29 src/sys/arch/arm/allwinner/files.awin:1.30
--- src/sys/arch/arm/allwinner/files.awin:1.29	Sun Dec 21 17:40:59 2014
+++ src/sys/arch/arm/allwinner/files.awin	Sun Apr 19 21:25:19 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.awin,v 1.29 2014/12/21 17:40:59 jmcneill Exp $
+#	$NetBSD: files.awin,v 1.30 2015/04/19 21:25:19 matt Exp $
 #
 # Configuration info for Allwinner ARM Peripherals
 #
@@ -23,10 +23,10 @@ defparam opt_allwinner.h			MEMSIZE
 defparam opt_allwinner.h			AWIN_WDT_DEFAULT_PERIOD
 defflag opt_allwinner.hAWIN_CONSOLE_EARLY
 defflag opt_allwinner.hAWINETH_COUNTERS
-defflag opt_allwinner.hALLWINNER_A10
-defflag opt_allwinner.hALLWINNER_A20
-defflag opt_allwinner.hALLWINNER_A31
-defflag opt_allwinner.hALLWINNER_A80
+defflag opt_allwinner.hALLWINNER_A10: CPU_CORTEXA8
+defflag opt_allwinner.hALLWINNER_A20: CPU_CORTEXA7
+defflag opt_allwinner.hALLWINNER_A31: CPU_CORTEXA7
+defflag opt_allwinner.hALLWINNER_A80: CPU_CORTEXA7
 defflag opt_allwinner.hAWIN_GPIO_IGNORE_FW
 defflag opt_allwinner.hAWIN_HDMI_DEBUG
 defflag opt_allwinner.hAWIN_TCON_DEBUG



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

2015-04-19 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Apr 19 21:28:38 UTC 2015

Modified Files:
src/sys/arch/evbarm/conf: ALLWINNER_A80 CUBIEBOARD CUBIEBOARD_INSTALL
CUBIETRUCK

Log Message:
Remove options CPU_CORTEX* since options ALLWINNER_* will now define them.
Use GENERIC.common for CUBIEBOARD (and BPI and CUBIETRUCK)


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/conf/ALLWINNER_A80
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/evbarm/conf/CUBIEBOARD
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/CUBIEBOARD_INSTALL
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/CUBIETRUCK

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/ALLWINNER_A80
diff -u src/sys/arch/evbarm/conf/ALLWINNER_A80:1.15 src/sys/arch/evbarm/conf/ALLWINNER_A80:1.16
--- src/sys/arch/evbarm/conf/ALLWINNER_A80:1.15	Fri Apr  3 23:25:07 2015
+++ src/sys/arch/evbarm/conf/ALLWINNER_A80	Sun Apr 19 21:28:37 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: ALLWINNER_A80,v 1.15 2015/04/03 23:25:07 jmcneill Exp $
+#	$NetBSD: ALLWINNER_A80,v 1.16 2015/04/19 21:28:37 matt Exp $
 #
 #	ALLWINNER_A80 - Allwinner A80 boards (Cubieboard4, OptimusBoard, etc)
 #
@@ -16,7 +16,6 @@ makeoptions 	KERNEL_BASE_PHYS="0x800
 makeoptions 	KERNEL_BASE_VIRT="0x8000"
 options 	PMAP_NEED_ALLOC_POOLPAGE
 
-options 	CPU_CORTEXA7
 options 	ALLWINNER_A80
 options 	MULTIPROCESSOR
 options 	MEMSIZE=2048

Index: src/sys/arch/evbarm/conf/CUBIEBOARD
diff -u src/sys/arch/evbarm/conf/CUBIEBOARD:1.38 src/sys/arch/evbarm/conf/CUBIEBOARD:1.39
--- src/sys/arch/evbarm/conf/CUBIEBOARD:1.38	Fri Feb 13 13:48:17 2015
+++ src/sys/arch/evbarm/conf/CUBIEBOARD	Sun Apr 19 21:28:37 2015
@@ -1,162 +1,27 @@
 #
-#	$NetBSD: CUBIEBOARD,v 1.38 2015/02/13 13:48:17 joerg Exp $
+#	$NetBSD: CUBIEBOARD,v 1.39 2015/04/19 21:28:37 matt Exp $
 #
 #	CUBIEBOARD -- Allwinner A10/A20 Eval Board Kernel
 #
 
 include	"arch/evbarm/conf/std.awin"
 
-# estimated number of users
-
-maxusers	32
-
-# Standard system options
-
-options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
-#options 	NTP		# NTP phase/frequency locked loop
-
 # CPU options
 
 no makeoptions	BOARDTYPE
 makeoptions	BOARDTYPE="cubieboard"
 #options 	UVMHIST,UVMHIST_PRINT
-options 	CPU_CORTEXA8
-options 	CPU_CORTEXA7
 options 	ALLWINNER_A10
 options 	ALLWINNER_A20
-options 	PMAPCOUNTERS
 options 	AWIN_CONSOLE_EARLY
 
-# Architecture options
-
-# File systems
-
-file-system	FFS		# UFS
-#file-system	LFS		# log-structured file system
-file-system	MFS		# memory file system
-file-system	NFS		# Network file system
-#file-system 	ADOSFS		# AmigaDOS-compatible file system
-file-system 	EXT2FS		# second extended file system (linux)
-file-system	CD9660		# ISO 9660 + Rock Ridge file system
-file-system	MSDOSFS		# MS-DOS file system
-#file-system	FDESC		# /dev/fd
-file-system	KERNFS		# /kern
-#file-system	NULLFS		# loopback file system
-file-system	PROCFS		# /proc
-file-system	PUFFS		# Userspace file systems (e.g. ntfs-3g & sshfs)
-#file-system	UMAPFS		# NULLFS + uid and gid remapping
-#file-system	UNION		# union file system
-file-system	TMPFS		# memory file system
-file-system	PTYFS		# /dev/pts/N support
-
-# File system options
-#options 	QUOTA		# legacy UFS quotas
-#options 	QUOTA2		# new, in-filesystem UFS quotas
-#options 	FFS_EI		# FFS Endian Independent support
-#options 	NFSSERVER
-options 	WAPBL		# File system journaling support
-#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
-
-# Networking options
-
-#options 	GATEWAY		# packet forwarding
-options 	INET		# IP + ICMP + TCP + UDP
-options 	INET6		# IPV6
-#options 	IPSEC		# IP security
-#options 	IPSEC_DEBUG	# debug for IP security
-#options 	MROUTING	# IP multicast routing
-#options 	PIM		# Protocol Independent Multicast
-#options 	NETATALK	# AppleTalk networking
-#options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
-#options 	PPP_DEFLATE	# Deflate compression support for PPP
-#options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
-#options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG
-
-options 	NFS_BOOT_BOOTP
-options 	NFS_BOOT_DHCP
-#options		NFS_BOOT_BOOTSTATIC
-#options		NFS_BOOTSTATIC_MYIP="\"192.168.1.4\""
-#options		NFS_BOOTSTATIC_GWIP="\"192.168.1.1\""
-#options		NFS_BOOTSTATIC_MASK="\"255.255.255.0\""
-#options		NFS_BOOTSTATIC_SERVADDR="\"192.168.1.1\""
-#options		NFS_BOOTSTATIC_SERVER="\"192.168.1.1:/nfs/sdp2430\""
-
-options		NFS_BOOT_RWSIZE=1024
-
-# Compatibility options
-
-options		COMPAT_NETBSD32	# allow running arm (e.g. non-earm) binaries
-#options 	COMPAT_43	# 4.3BSD compatibility.
-#options 	COMPAT_09	# NetBSD 0.9,
-#options 	COMPAT_10	# NetBSD 1.0,
-#options 	COMPAT_11	# NetBSD 1.1,
-#options 	COMPAT_12	# NetBSD 1.2,
-#options 	COMPAT_13	# NetBSD 1.3,
-#options 	COMPAT_14	# NetBSD 1.4,
-#options 	COMPAT_15	# NetBSD 1.5,
-#options 	COMPAT_16	# NetBSD 1.6,
-#option

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

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

Modified Files:
src/sys/arch/arm/amlogic: amlogic_sdhc.c

Log Message:
fix size of dmamem map


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/amlogic/amlogic_sdhc.c

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

Modified files:

Index: src/sys/arch/arm/amlogic/amlogic_sdhc.c
diff -u src/sys/arch/arm/amlogic/amlogic_sdhc.c:1.5 src/sys/arch/arm/amlogic/amlogic_sdhc.c:1.6
--- src/sys/arch/arm/amlogic/amlogic_sdhc.c:1.5	Sun Apr 19 21:23:01 2015
+++ src/sys/arch/arm/amlogic/amlogic_sdhc.c	Sun Apr 19 22:51:04 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: amlogic_sdhc.c,v 1.5 2015/04/19 21:23:01 jmcneill Exp $ */
+/* $NetBSD: amlogic_sdhc.c,v 1.6 2015/04/19 22:51:04 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amlogic_sdhc.c,v 1.5 2015/04/19 21:23:01 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amlogic_sdhc.c,v 1.6 2015/04/19 22:51:04 jmcneill Exp $");
 
 #include 
 #include 
@@ -226,7 +226,7 @@ amlogic_sdhc_dmainit(struct amlogic_sdhc
 	}
 	KASSERT(rseg == 1);
 
-	error = bus_dmamem_map(sc->sc_dmat, sc->sc_segs, rseg, PAGE_SIZE,
+	error = bus_dmamem_map(sc->sc_dmat, sc->sc_segs, rseg, MAXPHYS,
 	&sc->sc_bbuf, BUS_DMA_WAITOK);
 	if (error) {
 		device_printf(sc->sc_dev, "bus_dmamem_map failed\n");



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

2015-04-19 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Apr 19 23:03:47 UTC 2015

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

Log Message:
Remove CPU_CORTEXA7 since ALLWINNER_A31 implies it


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/evbarm/conf/HUMMINGBIRD_A31

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/HUMMINGBIRD_A31
diff -u src/sys/arch/evbarm/conf/HUMMINGBIRD_A31:1.23 src/sys/arch/evbarm/conf/HUMMINGBIRD_A31:1.24
--- src/sys/arch/evbarm/conf/HUMMINGBIRD_A31:1.23	Fri Apr  3 23:25:07 2015
+++ src/sys/arch/evbarm/conf/HUMMINGBIRD_A31	Sun Apr 19 23:03:47 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: HUMMINGBIRD_A31,v 1.23 2015/04/03 23:25:07 jmcneill Exp $
+#	$NetBSD: HUMMINGBIRD_A31,v 1.24 2015/04/19 23:03:47 matt Exp $
 #
 #	HUMMINGBIRD_A31 - Merrii Hummingbird A31
 #
@@ -12,7 +12,6 @@ no makeoptions	BOARDTYPE
 makeoptions	BOARDTYPE="hummingbird_a31"
 
 # CPU options
-options 	CPU_CORTEXA7
 options 	MULTIPROCESSOR
 options 	MEMSIZE=1024
 options 	ALLWINNER_A31



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

2015-04-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 19 23:12:21 UTC 2015

Modified Files:
src/sys/arch/arm/amlogic: amlogic_sdio.c

Log Message:
Like SDHC, SDIO also doesn't support SG DMA.

Remove the DMA capability flag and do transfers through a MAXPHYS-sized
buffer instead. This lets us do larger transfers and even with the memcpy,
still a significant win for performance.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/amlogic/amlogic_sdio.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/amlogic/amlogic_sdio.c
diff -u src/sys/arch/arm/amlogic/amlogic_sdio.c:1.1 src/sys/arch/arm/amlogic/amlogic_sdio.c:1.2
--- src/sys/arch/arm/amlogic/amlogic_sdio.c:1.1	Sun Apr 19 18:54:52 2015
+++ src/sys/arch/arm/amlogic/amlogic_sdio.c	Sun Apr 19 23:12:21 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: amlogic_sdio.c,v 1.1 2015/04/19 18:54:52 jmcneill Exp $ */
+/* $NetBSD: amlogic_sdio.c,v 1.2 2015/04/19 23:12:21 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amlogic_sdio.c,v 1.1 2015/04/19 18:54:52 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amlogic_sdio.c,v 1.2 2015/04/19 23:12:21 jmcneill Exp $");
 
 #include 
 #include 
@@ -68,6 +68,10 @@ struct amlogic_sdio_softc {
 	kcondvar_t		sc_intr_cv;
 
 	uint32_t		sc_intr_irqs;
+
+	bus_dmamap_t		sc_dmamap;
+	bus_dma_segment_t	sc_segs[1];
+	void			*sc_bbuf;
 };
 
 CFATTACH_DECL_NEW(amlogic_sdio, sizeof(struct amlogic_sdio_softc),
@@ -90,6 +94,8 @@ static void	amlogic_sdio_card_intr_ack(s
 static int	amlogic_sdio_set_clock(struct amlogic_sdio_softc *, u_int);
 static int	amlogic_sdio_wait_irqs(struct amlogic_sdio_softc *, uint32_t, int);
 
+static void	amlogic_sdio_dmainit(struct amlogic_sdio_softc *);
+
 static struct sdmmc_chip_functions amlogic_sdio_chip_functions = {
 	.host_reset = amlogic_sdio_host_reset,
 	.host_ocr = amlogic_sdio_host_ocr,
@@ -159,6 +165,8 @@ amlogic_sdio_attach(device_t parent, dev
 	sc->sc_bus_freq = amlogic_get_rate_clk81();
 	aprint_debug_dev(self, "CLK81 rate: %u Hz\n", sc->sc_bus_freq);
 
+	amlogic_sdio_dmainit(sc);
+
 	config_interrupts(self, amlogic_sdio_attach_i);
 }
 
@@ -179,10 +187,10 @@ amlogic_sdio_attach_i(device_t self)
 	saa.saa_sch = sc;
 	saa.saa_clkmin = 400;
 	saa.saa_clkmax = 5;
+	/* Do not advertise DMA capabilities, we handle DMA ourselves */
 	saa.saa_caps = SMC_CAPS_4BIT_MODE|
 		   SMC_CAPS_SD_HIGHSPEED|
-		   SMC_CAPS_MMC_HIGHSPEED|
-		   SMC_CAPS_DMA;
+		   SMC_CAPS_MMC_HIGHSPEED;
 
 	sc->sc_sdmmc_dev = config_found(self, &saa, NULL);
 }
@@ -193,13 +201,45 @@ amlogic_sdio_intr(void *priv)
 	struct amlogic_sdio_softc *sc = priv;
 
 	mutex_enter(&sc->sc_intr_lock);
-	sc->sc_intr_irqs |= SDIO_READ(sc, SDIO_IRQS_REG);
-	cv_broadcast(&sc->sc_intr_cv);
+	const u_int irqs = SDIO_READ(sc, SDIO_IRQS_REG);
+	if (irqs & SDIO_IRQS_CLEAR) {
+		SDIO_WRITE(sc, SDIO_IRQS_REG, irqs);
+		sc->sc_intr_irqs |= irqs;
+		cv_broadcast(&sc->sc_intr_cv);
+	}
 	mutex_exit(&sc->sc_intr_lock);
 
 	return 1;
 }
 
+static void
+amlogic_sdio_dmainit(struct amlogic_sdio_softc *sc)
+{
+	int error, rseg;
+
+	error = bus_dmamem_alloc(sc->sc_dmat, MAXPHYS, PAGE_SIZE, MAXPHYS,
+	sc->sc_segs, 1, &rseg, BUS_DMA_WAITOK);
+	if (error) {
+		device_printf(sc->sc_dev, "bus_dmamem_alloc failed\n");
+		return;
+	}
+	KASSERT(rseg == 1);
+
+	error = bus_dmamem_map(sc->sc_dmat, sc->sc_segs, rseg, MAXPHYS,
+	&sc->sc_bbuf, BUS_DMA_WAITOK);
+	if (error) {
+		device_printf(sc->sc_dev, "bus_dmamem_map failed\n");
+		return;
+	}
+
+	error = bus_dmamap_create(sc->sc_dmat, MAXPHYS, 1, MAXPHYS, 0,
+	BUS_DMA_WAITOK, &sc->sc_dmamap);
+	if (error) {
+		device_printf(sc->sc_dev, "bus_dmamap_create failed\n");
+		return;
+	}
+}
+
 static int
 amlogic_sdio_set_clock(struct amlogic_sdio_softc *sc, u_int freq)
 {
@@ -337,6 +377,7 @@ amlogic_sdio_exec_command(sdmmc_chipset_
 {
 	struct amlogic_sdio_softc *sc = sch;
 	uint32_t send, ext, mult, addr;
+	bool use_bbuf = false;
 	int i;
 
 	KASSERT(cmd->c_blklen <= 512);
@@ -386,10 +427,22 @@ amlogic_sdio_exec_command(sdmmc_chipset_
 			send |= SDIO_SEND_COMMAND_HAS_DATA;
 		}
 
-		KASSERT(cmd->c_dmamap->dm_nsegs == 1);
-		KASSERT(cmd->c_dmamap->dm_segs[0].ds_len >= cmd->c_datalen);
-
-		addr = cmd->c_dmamap->dm_segs[0].ds_addr;
+		cmd->c_error = bus_dmamap_load(sc->sc_dmat, sc->sc_dmamap,
+		sc->sc_bbuf, MAXPHYS, NULL, BUS_DMA_WAITOK);
+		if (cmd->c_error) {
+			device_printf(sc->sc_dev, "bus_dmamap_load failed\n");
+			goto done;
+		}
+		if (ISSET(cmd->c_flags, SCF_CMD_READ)) {
+			bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap, 0,
+			MAXPHYS, BUS_DMASYNC_PREREAD);
+		} else {
+			memcpy(sc->sc_bbuf, cmd->c_data, cmd->c_datalen);
+			bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap, 0,
+			MAXPHYS, BUS_DMASYNC_PREWRITE);
+		}
+		addr = sc->sc_dmamap->dm_segs[

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

2015-04-19 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Apr 20 00:09:48 UTC 2015

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

Log Message:
Comment out __HAVE_PREEMPTION


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

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

Modified files:

Index: src/sys/arch/evbarm/conf/CUBIEBOARD
diff -u src/sys/arch/evbarm/conf/CUBIEBOARD:1.39 src/sys/arch/evbarm/conf/CUBIEBOARD:1.40
--- src/sys/arch/evbarm/conf/CUBIEBOARD:1.39	Sun Apr 19 21:28:37 2015
+++ src/sys/arch/evbarm/conf/CUBIEBOARD	Mon Apr 20 00:09:48 2015
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: CUBIEBOARD,v 1.39 2015/04/19 21:28:37 matt Exp $
+#	$NetBSD: CUBIEBOARD,v 1.40 2015/04/20 00:09:48 matt Exp $
 #
 #	CUBIEBOARD -- Allwinner A10/A20 Eval Board Kernel
 #
@@ -39,7 +39,7 @@ mainbus0	at root
 
 # CPU(s)
 options 	MULTIPROCESSOR
-options 	__HAVE_PREEMPTION
+#options 	__HAVE_PREEMPTION
 cpu*		at mainbus?
 
 # Specify the memory size in megabytes (optional).



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

2015-04-19 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Apr 20 00:11:27 UTC 2015

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

Log Message:
Use TPIDRPRW_IS_CURLWP


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

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

Modified files:

Index: src/sys/arch/evbarm/conf/std.awin
diff -u src/sys/arch/evbarm/conf/std.awin:1.5 src/sys/arch/evbarm/conf/std.awin:1.6
--- src/sys/arch/evbarm/conf/std.awin:1.5	Wed Oct 22 00:24:52 2014
+++ src/sys/arch/evbarm/conf/std.awin	Mon Apr 20 00:11:27 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: std.awin,v 1.5 2014/10/22 00:24:52 jmcneill Exp $
+#	$NetBSD: std.awin,v 1.6 2015/04/20 00:11:27 matt Exp $
 #
 # standard NetBSD/evbarm for Allwinner based options
 
@@ -16,7 +16,7 @@ options 	CORTEX_PMC
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
 options 	ARM_HAS_VBAR
 options 	__HAVE_MM_MD_DIRECT_MAPPED_PHYS
-options 	TPIDRPRW_IS_CURCPU
+options 	TPIDRPRW_IS_CURLWP
 options 	KERNEL_BASE_EXT=0x8000
 options 	FPU_VFP
 options 	GTTWSI_ALLWINNER



CVS commit: src/sys/arch

2015-04-19 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Apr 20 01:33:22 UTC 2015

Modified Files:
src/sys/arch/arm/allwinner: awin_board.c awin_gpio.c awin_io.c
awin_var.h awin_wdt.c files.awin
src/sys/arch/evbarm/awin: awin_machdep.c
Removed Files:
src/sys/arch/arm/allwinner: awin_space.c

Log Message:
Switch to armv7_generic bus_space.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/arm/allwinner/awin_board.c \
src/sys/arch/arm/allwinner/awin_var.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/allwinner/awin_gpio.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/arm/allwinner/awin_io.c
cvs rdiff -u -r1.4 -r0 src/sys/arch/arm/allwinner/awin_space.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/allwinner/awin_wdt.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arm/allwinner/files.awin
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/evbarm/awin/awin_machdep.c

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

Modified files:

Index: src/sys/arch/arm/allwinner/awin_board.c
diff -u src/sys/arch/arm/allwinner/awin_board.c:1.34 src/sys/arch/arm/allwinner/awin_board.c:1.35
--- src/sys/arch/arm/allwinner/awin_board.c:1.34	Mon Dec 22 00:07:24 2014
+++ src/sys/arch/arm/allwinner/awin_board.c	Mon Apr 20 01:33:22 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: awin_board.c,v 1.34 2014/12/22 00:07:24 jmcneill Exp $	*/
+/*	$NetBSD: awin_board.c,v 1.35 2015/04/20 01:33:22 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,7 +36,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.34 2014/12/22 00:07:24 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.35 2015/04/20 01:33:22 matt Exp $");
 
 #include 
 #include 
@@ -128,9 +128,10 @@ static void
 awin_cpu_clk(void)
 {
 	struct cpu_info * const ci = curcpu();
+	bus_space_tag_t bst = &armv7_generic_bs_tag;
 
 #if defined(ALLWINNER_A80)
-	const uint32_t c0cpux = bus_space_read_4(&awin_bs_tag, awin_core_bsh,
+	const uint32_t c0cpux = bus_space_read_4(bst, awin_core_bsh,
 	AWIN_A80_CCU_OFFSET + AWIN_A80_CCU_PLL_C0CPUX_CTRL_REG);
 	const u_int p = (c0cpux & AWIN_A80_CCU_PLL_CxCPUX_OUT_EXT_DIVP) ? 4 : 1;
 	const u_int n = __SHIFTOUT(c0cpux, AWIN_A80_CCU_PLL_CxCPUX_FACTOR_N);
@@ -140,7 +141,7 @@ awin_cpu_clk(void)
 	u_int reg = awin_chip_id() == AWIN_CHIP_ID_A31 ?
   AWIN_A31_CPU_AXI_CFG_REG :
   AWIN_CPU_AHB_APB0_CFG_REG;
-	const uint32_t cpu0_cfg = bus_space_read_4(&awin_bs_tag, awin_core_bsh,
+	const uint32_t cpu0_cfg = bus_space_read_4(bst, awin_core_bsh,
 	AWIN_CCM_OFFSET + reg);
 	const u_int cpu_clk_sel = __SHIFTIN(cpu0_cfg, AWIN_CPU_CLK_SRC_SEL);
 	switch (__SHIFTOUT(cpu_clk_sel, AWIN_CPU_CLK_SRC_SEL)) {
@@ -151,7 +152,7 @@ awin_cpu_clk(void)
 		ci->ci_data.cpu_cc_freq = AWIN_REF_FREQ;
 		break;
 	case AWIN_CPU_CLK_SRC_SEL_PLL1: {
-		const uint32_t pll1_cfg = bus_space_read_4(&awin_bs_tag,
+		const uint32_t pll1_cfg = bus_space_read_4(bst,
 		awin_core_bsh, AWIN_CCM_OFFSET + AWIN_PLL1_CFG_REG);
 		u_int p, n, k, m;
 		if (awin_chip_id() == AWIN_CHIP_ID_A31) {
@@ -180,6 +181,7 @@ void
 awin_bootstrap(vaddr_t iobase, vaddr_t uartbase)
 {
 	int error;
+	bus_space_tag_t bst = &armv7_generic_bs_tag;
 
 #ifdef AWIN_CONSOLE_EARLY
 	uart_base = (volatile uint32_t *)uartbase;
@@ -187,21 +189,21 @@ awin_bootstrap(vaddr_t iobase, vaddr_t u
 	printf("Early console started\n");
 #endif
 
-	error = bus_space_map(&awin_bs_tag, AWIN_CORE_PBASE,
-	AWIN_CORE_SIZE, 0, &awin_core_bsh);
+	error = bus_space_map(bst, AWIN_CORE_PBASE, AWIN_CORE_SIZE,
+	0, &awin_core_bsh);
 	if (error)
 		panic("%s: failed to map awin %s registers: %d",
 		__func__, "io", error);
 	KASSERT(awin_core_bsh == iobase);
 
 #ifdef ALLWINNER_A80
-	error = bus_space_map(&awin_bs_tag, AWIN_A80_CORE2_PBASE,
-	AWIN_A80_CORE2_SIZE, 0, &awin_core2_bsh);
+	error = bus_space_map(bst, AWIN_A80_CORE2_PBASE, AWIN_A80_CORE2_SIZE,
+	0, &awin_core2_bsh);
 	if (error)
 		panic("%s: failed to map awin %s registers: %d",
 		__func__, "core2", error);
-	error = bus_space_map(&awin_bs_tag, AWIN_A80_RCPUS_PBASE,
-	AWIN_A80_RCPUS_SIZE, 0, &awin_rcpus_bsh);
+	error = bus_space_map(bst, AWIN_A80_RCPUS_PBASE, AWIN_A80_RCPUS_SIZE,
+	0, &awin_rcpus_bsh);
 	if (error)
 		panic("%s: failed to map awin %s registers: %d",
 		__func__, "rcpus", error);
@@ -228,16 +230,16 @@ awin_bootstrap(vaddr_t iobase, vaddr_t u
 		uint32_t s[4];
 		unsigned int cpuno;
 		for (cpuno = 0; cpuno < 4; cpuno++) {
-			s[cpuno] = bus_space_read_4(&awin_bs_tag, awin_core_bsh,
+			s[cpuno] = bus_space_read_4(bst, awin_core_bsh,
 			AWIN_A31_CPUCFG_OFFSET +
 			AWIN_A31_CPUCFG_STATUS_REG(cpuno));
 		}
 		printf("%s: cpu status: 0=%#x 1=%#x 2=%#x 3=%#x\n", __func__,
 		s[0], s[1], s[2], s[3]);
 	} else if (awin_chip_id() == AWIN_CHIP_ID_A20) {
-		uint32_t s0 = bus_space_read_4(&awin_bs_tag, awin_core_bsh,
+		uint32_t s0 = bus_space

CVS commit: src/sys/dev/ic

2015-04-19 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Apr 20 02:55:14 UTC 2015

Modified Files:
src/sys/dev/ic: spdmem.c spdmemreg.h spdmemvar.h

Log Message:
Initial pass at supporting decode for DDR4.

XXX I fully expect that reporting of PC4-x values is incorrect.
XXX Please report this, or any other errors that you may see.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/ic/spdmem.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/spdmemreg.h
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ic/spdmemvar.h

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

Modified files:

Index: src/sys/dev/ic/spdmem.c
diff -u src/sys/dev/ic/spdmem.c:1.12 src/sys/dev/ic/spdmem.c:1.13
--- src/sys/dev/ic/spdmem.c:1.12	Wed Apr  1 06:08:39 2015
+++ src/sys/dev/ic/spdmem.c	Mon Apr 20 02:55:14 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: spdmem.c,v 1.12 2015/04/01 06:08:39 matt Exp $ */
+/* $NetBSD: spdmem.c,v 1.13 2015/04/20 02:55:14 pgoyette Exp $ */
 
 /*
  * Copyright (c) 2007 Nicolas Joly
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.12 2015/04/01 06:08:39 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.13 2015/04/20 02:55:14 pgoyette Exp $");
 
 #include 
 #include 
@@ -55,6 +55,7 @@ static void decode_sdram(const struct sy
 static void decode_ddr(const struct sysctlnode *, device_t, struct spdmem *);
 static void decode_ddr2(const struct sysctlnode *, device_t, struct spdmem *);
 static void decode_ddr3(const struct sysctlnode *, device_t, struct spdmem *);
+static void decode_ddr4(const struct sysctlnode *, device_t, struct spdmem *);
 static void decode_fbdimm(const struct sysctlnode *, device_t, struct spdmem *);
 
 static void decode_size_speed(device_t, const struct sysctlnode *,
@@ -79,6 +80,25 @@ static const char* const spdmem_basic_ty
 	"DDR4 SDRAM"
 };
 
+static const char* const spdmem_ddr4_module_types[] = {
+	"DDR4 Extended",
+	"DDR4 RDIMM",
+	"DDR4 UDIMM",
+	"DDR4 SO-DIMM",
+	"DDR4 Load-Reduced DIMM",
+	"DDR4 Mini-RDIMM",
+	"DDR4 Mini-UDIMM",
+	"DDR4 Reserved",
+	"DDR4 72Bit SO-RDIMM",
+	"DDR4 72Bit SO-UDIMM",
+	"DDR4 Undefined",
+	"DDR4 Reserved",
+	"DDR4 16Bit SO-DIMM",
+	"DDR4 32Bit SO-DIMM",
+	"DDR4 Reserved",
+	"DDR4 Undefined"
+};
+
 static const char* const spdmem_superset_types[] = {
 	"unknown",
 	"ESDRAM",
@@ -116,6 +136,9 @@ static const char* const spdmem_parity_t
 	"cmd/addr/data parity, data ECC"
 };
 
+int spd_rom_sizes[] = { 0, 128, 256, 384, 512 };
+
+
 /* Cycle time fractional values (units of .001 ns) for DDR2 SDRAM */
 static const uint16_t spdmem_cycle_frac[] = {
 	0, 100, 200, 300, 400, 500, 600, 700, 800, 900,
@@ -202,7 +225,31 @@ spdmem_common_probe(struct spdmem_softc 
 			return 0;
 		}
 		return 1;
-	}
+	} else if (spd_type == SPDMEM_MEMTYPE_DDR4SDRAM) {
+		spd_len = (sc->sc_read)(sc, 0) & 0x0f;
+		if ((unsigned int)spd_len > __arraycount(spd_rom_sizes))
+			return 0;
+		spd_len = spd_rom_sizes[spd_len];
+		spd_crc_cover=128;
+		if (spd_crc_cover > spd_len)
+			return 0;
+		crc_calc = spdcrc16(sc, spd_crc_cover);
+		crc_spd = (sc->sc_read)(sc, 127) << 8;
+		crc_spd |= (sc->sc_read)(sc, 126);
+		if (crc_calc != crc_spd) {
+			aprint_debug("crc16 failed, covers %d bytes, "
+ "calc = 0x%04x, spd = 0x%04x\n",
+ spd_crc_cover, crc_calc, crc_spd);
+			return 0;
+		}
+		/*
+		 * We probably could also verify the CRC for the other
+		 * "pages" of SPD data in blocks 1 and 2, but we'll do
+		 * it some other time.
+		 */
+		return 1;
+	} else
+		return 0;
 
 	/* For unrecognized memory types, don't match at all */
 	return 0;
@@ -218,15 +265,26 @@ spdmem_common_attach(struct spdmem_softc
 	unsigned int i, spd_len, spd_size;
 	const struct sysctlnode *node = NULL;
 
-	/*
-	 * FBDIMM and DDR3 (and probably all newer) have a different
-	 * encoding of the SPD EEPROM used/total sizes
-	 */
 	s->sm_len = (sc->sc_read)(sc, 0);
 	s->sm_size = (sc->sc_read)(sc, 1);
 	s->sm_type = (sc->sc_read)(sc, 2);
 
-	if (s->sm_type >= SPDMEM_MEMTYPE_FBDIMM) {
+	if (s->sm_type == SPDMEM_MEMTYPE_DDR4SDRAM) {
+		/*
+		 * An even newer encoding with one byte holding both
+		 * the used-size and capacity values
+		 */
+		spd_len = s->sm_len & 0x0f;
+		spd_size = (s->sm_len >> 4) & 0x07;
+
+		spd_len = spd_rom_sizes[spd_len];
+		spd_size *= 512;
+
+	} else if (s->sm_type >= SPDMEM_MEMTYPE_FBDIMM) {
+		/*
+		 * FBDIMM and DDR3 (and probably all newer) have a different
+		 * encoding of the SPD EEPROM used/total sizes
+		 */
 		spd_size = 64 << (s->sm_len & SPDMEM_SPDSIZE_MASK);
 		switch (s->sm_len & SPDMEM_SPDLEN_MASK) {
 		case SPDMEM_SPDLEN_128:
@@ -316,6 +374,11 @@ spdmem_common_attach(struct spdmem_softc
 		s->sm_sdr.sdr_superset == SPDMEM_SUPERSET_ESDRAM) {
 			type = spdmem_superset_types[SPDMEM_SUPERSET_ESDRAM];
 		}
+		if (s->sm_type == SPDMEM_MEMTYPE_DDR4SDRAM &&
+		s->sm_ddr4.ddr4_mod_type <
+__arraycount(spdmem_ddr4_module_types)) {
+			type = spdmem_ddr4

CVS commit: src/share/man

2015-04-19 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr 20 06:50:13 UTC 2015

Modified Files:
src/share/man/man5: modules.conf.5
src/share/man/man9: buffercache.9

Log Message:
Add missing .El. From Henning Petersen in PR 49845.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man5/modules.conf.5
cvs rdiff -u -r1.29 -r1.30 src/share/man/man9/buffercache.9

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

Modified files:

Index: src/share/man/man5/modules.conf.5
diff -u src/share/man/man5/modules.conf.5:1.1 src/share/man/man5/modules.conf.5:1.2
--- src/share/man/man5/modules.conf.5:1.1	Sat Mar 21 19:10:43 2015
+++ src/share/man/man5/modules.conf.5	Mon Apr 20 06:50:13 2015
@@ -1,4 +1,4 @@
-.\"$NetBSD: modules.conf.5,v 1.1 2015/03/21 19:10:43 jmcneill Exp $
+.\"$NetBSD: modules.conf.5,v 1.2 2015/04/20 06:50:13 wiz Exp $
 .\"
 .\" Copyright (c) 2015 Jared McNeill 
 .\" All rights reserved.
@@ -53,6 +53,7 @@ configuration file resides in
 .Xr rc.d 8
 script that parses
 .Nm .
+.El
 .Sh SEE ALSO
 .Xr modload 8 ,
 .Xr rc 8

Index: src/share/man/man9/buffercache.9
diff -u src/share/man/man9/buffercache.9:1.29 src/share/man/man9/buffercache.9:1.30
--- src/share/man/man9/buffercache.9:1.29	Sun Mar 29 21:02:06 2015
+++ src/share/man/man9/buffercache.9	Mon Apr 20 06:50:13 2015
@@ -1,4 +1,4 @@
-.\" $NetBSD: buffercache.9,v 1.29 2015/03/29 21:02:06 riastradh Exp $
+.\" $NetBSD: buffercache.9,v 1.30 2015/04/20 06:50:13 wiz Exp $
 .\"
 .\" Copyright (c)2003 YAMAMOTO Takashi,
 .\" All rights reserved.
@@ -306,6 +306,7 @@ the buffer's additional contents.
 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 .It Fn brelse "bp" "set"
 Unbusy a buffer and release it to the free lists.
+.El
 .\" 
 .Sh CODE REFERENCES
 The buffer cache subsystem is implemented within the file