CVS commit: src/common/lib/libc/arch

2015-10-17 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sun Oct 18 02:28:07 UTC 2015

Modified Files:
src/common/lib/libc/arch/sparc/atomic: Makefile.inc
src/common/lib/libc/arch/sparc64/atomic: atomic_add.S atomic_and.S
atomic_cas.S atomic_dec.S atomic_inc.S atomic_op_asm.h atomic_or.S
atomic_swap.S

Log Message:
Fix 64-bit atomic operations on 32-bit kernel and userland, and add
support for missing __sync_*_8 builtins.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/common/lib/libc/arch/sparc/atomic/Makefile.inc
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/arch/sparc64/atomic/atomic_add.S \
src/common/lib/libc/arch/sparc64/atomic/atomic_and.S \
src/common/lib/libc/arch/sparc64/atomic/atomic_cas.S \
src/common/lib/libc/arch/sparc64/atomic/atomic_inc.S \
src/common/lib/libc/arch/sparc64/atomic/atomic_op_asm.h \
src/common/lib/libc/arch/sparc64/atomic/atomic_swap.S
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/sparc64/atomic/atomic_dec.S \
src/common/lib/libc/arch/sparc64/atomic/atomic_or.S

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

Modified files:

Index: src/common/lib/libc/arch/sparc/atomic/Makefile.inc
diff -u src/common/lib/libc/arch/sparc/atomic/Makefile.inc:1.18 src/common/lib/libc/arch/sparc/atomic/Makefile.inc:1.19
--- src/common/lib/libc/arch/sparc/atomic/Makefile.inc:1.18	Mon Oct 13 08:59:41 2014
+++ src/common/lib/libc/arch/sparc/atomic/Makefile.inc	Sun Oct 18 02:28:07 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.18 2014/10/13 08:59:41 martin Exp $
+#	$NetBSD: Makefile.inc,v 1.19 2015/10/18 02:28:07 nakayama Exp $
 
 .include 
 
@@ -12,6 +12,12 @@ SPARC64DIR=	${.PARSEDIR}/../../sparc64/a
 
 .include "${SPARC64DIR}/Makefile.inc"
 
+.if defined(LIB) && (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \
+	|| ${LIB} == "rump")
+SRCS+=	atomic_nand_64_cas.c atomic_xor_64_cas.c atomic_sub_64_cas.c \
+	atomic_cas_64_cas.c
+.endif
+
 .else
 
 . if defined(LIB)

Index: src/common/lib/libc/arch/sparc64/atomic/atomic_add.S
diff -u src/common/lib/libc/arch/sparc64/atomic/atomic_add.S:1.6 src/common/lib/libc/arch/sparc64/atomic/atomic_add.S:1.7
--- src/common/lib/libc/arch/sparc64/atomic/atomic_add.S:1.6	Sun May 25 15:56:12 2008
+++ src/common/lib/libc/arch/sparc64/atomic/atomic_add.S	Sun Oct 18 02:28:07 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_add.S,v 1.6 2008/05/25 15:56:12 chs Exp $	*/
+/*	$NetBSD: atomic_add.S,v 1.7 2015/10/18 02:28:07 nakayama Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -52,14 +52,22 @@ ATOMIC_OP_ALIAS(atomic_add_int_nv,_atomi
 STRONG_ALIAS(_atomic_add_int_nv,_atomic_add_32)
 
 ENTRY(_atomic_add_64)
+#ifndef __arch64__
+	COMBINE(%o1, %o2, %o1)
+#endif
 	ldx	[%o0], %o2
 1:	add	%o1, %o2, %o3
 	casx	[%o0], %o2, %o3
 	cmp	%o2, %o3
 	bne,a,pn %xcc, 1b
 	 mov	%o3, %o2
+#ifdef __arch64__
 	retl
 	 add	%o1, %o2, %o0
+#else
+	add	%o1, %o2, %o0
+	SPLIT_RETL(%o0, %o0, %o1)
+#endif
 ATOMIC_OP_ALIAS(atomic_add_64,_atomic_add_64)
 
 ATOMIC_OP_ALIAS(atomic_add_64_nv,_atomic_add_64)
@@ -74,3 +82,19 @@ ATOMIC_OP_ALIAS_SIZE(atomic_add_long_nv,
 STRONG_ALIAS_SIZE(_atomic_add_long_nv,_atomic_add)
 ATOMIC_OP_ALIAS_SIZE(atomic_add_ptr_nv,_atomic_add)
 STRONG_ALIAS_SIZE(_atomic_add_ptr_nv,_atomic_add)
+
+#if !defined(__arch64__) && defined(CRT_ALIAS)
+ENTRY(__sync_fetch_and_add_8)
+	COMBINE(%o1, %o2, %o1)
+	ldx	[%o0], %o2
+1:	add	%o1, %o2, %o3
+	casx	[%o0], %o2, %o3
+	cmp	%o2, %o3
+	bne,a,pn %xcc, 1b
+	 mov	%o3, %o2
+	SPLIT_RETL(%o2, %o0, %o1)
+CRT_ALIAS(__sync_add_and_fetch_8,_atomic_add_64_nv)
+
+CRT_ALIAS(__atomic_fetch_add_8,__sync_fetch_and_add_8)
+CRT_ALIAS(__atomic_add_fetch_8,__sync_add_and_fetch_8)
+#endif
Index: src/common/lib/libc/arch/sparc64/atomic/atomic_and.S
diff -u src/common/lib/libc/arch/sparc64/atomic/atomic_and.S:1.6 src/common/lib/libc/arch/sparc64/atomic/atomic_and.S:1.7
--- src/common/lib/libc/arch/sparc64/atomic/atomic_and.S:1.6	Sun May 25 15:56:12 2008
+++ src/common/lib/libc/arch/sparc64/atomic/atomic_and.S	Sun Oct 18 02:28:07 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_and.S,v 1.6 2008/05/25 15:56:12 chs Exp $	*/
+/*	$NetBSD: atomic_and.S,v 1.7 2015/10/18 02:28:07 nakayama Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -52,14 +52,22 @@ ATOMIC_OP_ALIAS(atomic_and_uint_nv,_atom
 STRONG_ALIAS(_atomic_and_uint_nv,_atomic_and_32)
 
 ENTRY(_atomic_and_64)
+#ifndef __arch64__
+	COMBINE(%o1, %o2, %o1)
+#endif
 	ldx	[%o0], %o2
 1:	and	%o1, %o2, %o3
 	casx	[%o0], %o2, %o3
 	cmp	%o2, %o3
 	bne,a,pn %xcc, 1b
 	 mov	%o3, %o2
+#ifdef __arch64__
 	retl
 	 and	%o1, %o2, %o0
+#else
+	and	%o1, %o2, %o0
+	SPLIT_RETL(%o0, %o0, %o1)
+#endif
 ATOMIC_OP_ALIAS(atomic_and_64,_atomic_and_64)
 
 ATOMIC_OP_ALIAS(atomic_and_64_nv,_atomic_and_64)
@@ -70,3 +78,19 @@ STRONG_ALIAS_SIZE(_atomic_and_ulong,_ato
 
 ATOMIC_OP_ALIAS_SIZE(atomic_and_ulong_nv,_atomic_and)
 STRONG_ALIAS_SIZE(_atomic_and_u

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

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Oct 18 00:39:14 UTC 2015

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

Log Message:
dont drop to Debugger on error


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

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_nouveau.c
diff -u src/sys/arch/arm/nvidia/tegra_nouveau.c:1.1 src/sys/arch/arm/nvidia/tegra_nouveau.c:1.2
--- src/sys/arch/arm/nvidia/tegra_nouveau.c:1.1	Sat Oct 17 21:18:16 2015
+++ src/sys/arch/arm/nvidia/tegra_nouveau.c	Sun Oct 18 00:39:14 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_nouveau.c,v 1.1 2015/10/17 21:18:16 jmcneill Exp $ */
+/* $NetBSD: tegra_nouveau.c,v 1.2 2015/10/18 00:39:14 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_nouveau.c,v 1.1 2015/10/17 21:18:16 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_nouveau.c,v 1.2 2015/10/18 00:39:14 jmcneill Exp $");
 
 #include 
 #include 
@@ -157,7 +157,6 @@ tegra_nouveau_init(struct tegra_nouveau_
 	error = -drm_dev_register(dev, 0);
 	if (error) {
 		drm_dev_unref(dev);
-		Debugger();
 		return error;
 	}
 



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

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Oct 18 00:38:37 UTC 2015

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

Log Message:
add __BUS_SPACE_HAS_STREAM_METHODS, used by nouveau


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/std.tegra

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

Modified files:

Index: src/sys/arch/evbarm/conf/std.tegra
diff -u src/sys/arch/evbarm/conf/std.tegra:1.8 src/sys/arch/evbarm/conf/std.tegra:1.9
--- src/sys/arch/evbarm/conf/std.tegra:1.8	Thu Oct 15 07:13:50 2015
+++ src/sys/arch/evbarm/conf/std.tegra	Sun Oct 18 00:38:37 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: std.tegra,v 1.8 2015/10/15 07:13:50 skrll Exp $
+#	$NetBSD: std.tegra,v 1.9 2015/10/18 00:38:37 jmcneill Exp $
 #
 
 machine	evbarm arm
@@ -19,6 +19,7 @@ options 	KERNEL_BASE_EXT=0x8000
 options 	FPU_VFP
 options 	PCI_NETBSD_CONFIGURE
 options 	__HAVE_PCI_CONF_HOOK
+options 	__BUS_SPACE_HAS_STREAM_METHODS
 options 	TEGRAK1_PMAP_WORKAROUND
 
 makeoptions	KERNEL_BASE_PHYS="0x8100"



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

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Oct 18 00:37:56 UTC 2015

Modified Files:
src/sys/arch/arm/arm32: armv7_generic_space.c

Log Message:
mark a4x read region / write region as not implemented


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/arm32/armv7_generic_space.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/arm32/armv7_generic_space.c
diff -u src/sys/arch/arm/arm32/armv7_generic_space.c:1.1 src/sys/arch/arm/arm32/armv7_generic_space.c:1.2
--- src/sys/arch/arm/arm32/armv7_generic_space.c:1.1	Sun Mar 29 22:26:18 2015
+++ src/sys/arch/arm/arm32/armv7_generic_space.c	Sun Oct 18 00:37:56 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: armv7_generic_space.c,v 1.1 2015/03/29 22:26:18 jmcneill Exp $	*/
+/*	$NetBSD: armv7_generic_space.c,v 1.2 2015/10/18 00:37:56 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: armv7_generic_space.c,v 1.1 2015/03/29 22:26:18 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: armv7_generic_space.c,v 1.2 2015/10/18 00:37:56 jmcneill Exp $");
 
 #include 
 #include 
@@ -259,9 +259,9 @@ struct bus_space armv7_generic_a4x_bs_ta
 	bs_notimpl_bs_rm_8,
 
 	/* read region */
-	a4x_bs_rr_1,
-	NSWAP(a4x_bs_rr_2),
-	NSWAP(a4x_bs_rr_4),
+	bs_notimpl_bs_rr_1,
+	bs_notimpl_bs_rr_2,
+	bs_notimpl_bs_rr_4,
 	bs_notimpl_bs_rr_8,
 
 	/* write (single) */
@@ -277,9 +277,9 @@ struct bus_space armv7_generic_a4x_bs_ta
 	bs_notimpl_bs_wm_8,
 
 	/* write region */
-	a4x_bs_wr_1,
-	NSWAP(a4x_bs_wr_2),
-	NSWAP(a4x_bs_wr_4),
+	bs_notimpl_bs_wr_1,
+	bs_notimpl_bs_wr_2,
+	bs_notimpl_bs_wr_4,
 	bs_notimpl_bs_wr_8,
 #endif
 };



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

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Oct 18 00:28:32 UTC 2015

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
pull in arm/arm32/param.h


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/arm/include/arm32/vmparam.h

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

Modified files:

Index: src/sys/arch/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.39 src/sys/arch/arm/include/arm32/vmparam.h:1.40
--- src/sys/arch/arm/include/arm32/vmparam.h:1.39	Sat Jun 20 07:13:25 2015
+++ src/sys/arch/arm/include/arm32/vmparam.h	Sun Oct 18 00:28:32 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.39 2015/06/20 07:13:25 skrll Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.40 2015/10/18 00:28:32 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -45,6 +45,7 @@
  */
 
 #include 
+#include 
 #include 	/* pt_entry_t */
 
 #define	__USE_TOPDOWN_VM 



CVS commit: src/sys/sys

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Oct 18 00:28:15 UTC 2015

Modified Files:
src/sys/sys: resourcevar.h

Log Message:
pull in resource.h


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/sys/resourcevar.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/sys/resourcevar.h
diff -u src/sys/sys/resourcevar.h:1.55 src/sys/sys/resourcevar.h:1.56
--- src/sys/sys/resourcevar.h:1.55	Fri Sep  5 05:47:40 2014
+++ src/sys/sys/resourcevar.h	Sun Oct 18 00:28:15 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: resourcevar.h,v 1.55 2014/09/05 05:47:40 matt Exp $	*/
+/*	$NetBSD: resourcevar.h,v 1.56 2015/10/18 00:28:15 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -39,6 +39,7 @@
 #endif
 
 #include 
+#include 
 
 /*
  * Kernel per-process accounting / statistics



CVS commit: src/sys/external/bsd/drm2/include/drm

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 21:27:02 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/include/drm: drm_agp_netbsd.h

Log Message:
dont pull in agp.h when building as a module


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/include/drm/drm_agp_netbsd.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/external/bsd/drm2/include/drm/drm_agp_netbsd.h
diff -u src/sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h:1.5 src/sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h:1.6
--- src/sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h:1.5	Sat Oct 17 21:09:49 2015
+++ src/sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h	Sat Oct 17 21:27:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_agp_netbsd.h,v 1.5 2015/10/17 21:09:49 jmcneill Exp $	*/
+/*	$NetBSD: drm_agp_netbsd.h,v 1.6 2015/10/17 21:27:02 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -50,7 +50,11 @@
 #define	PCI_AGP_COMMAND_FW	AGPCMD_FWEN
 
 #if defined(__i386__) || defined(__x86_64__)
+#if defined(_KERNEL_OPT)
 #include "agp.h"
+#else
+#define NAGP 1
+#endif
 #if NAGP > 0
 #define	__OS_HAS_AGP	1
 #endif



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

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 21:18:47 UTC 2015

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

Log Message:
add nouveau, commented out for now


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/evbarm/conf/JETSONTK1

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/JETSONTK1
diff -u src/sys/arch/evbarm/conf/JETSONTK1:1.31 src/sys/arch/evbarm/conf/JETSONTK1:1.32
--- src/sys/arch/evbarm/conf/JETSONTK1:1.31	Sun Aug  2 00:24:45 2015
+++ src/sys/arch/evbarm/conf/JETSONTK1	Sat Oct 17 21:18:47 2015
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: JETSONTK1,v 1.31 2015/08/02 00:24:45 jmcneill Exp $
+#	$NetBSD: JETSONTK1,v 1.32 2015/10/17 21:18:47 jmcneill Exp $
 #
 #	NVIDIA Jetson TK1 - Tegra K1 development kit
 #	https://developer.nvidia.com/jetson-tk1
@@ -149,6 +149,9 @@ tegrahdmi0	at tegraio?		# HDMI
 tegracec0	at tegraio?		# HDMI CEC
 hdmicec*	at hdmicecbus?
 
+# GPU
+#nouveau0	at tegraio?		# GPU
+
 # USB 2.0
 ehci0		at tegraio? port 0	# USB1
 ehci1		at tegraio? port 1	# USB2



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

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 21:18:16 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: files.tegra tegra_io.c
Added Files:
src/sys/arch/arm/nvidia: tegra_nouveau.c

Log Message:
Add bus glue for attaching nouveau DRM


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/nvidia/files.tegra
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/nvidia/tegra_io.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/nvidia/tegra_nouveau.c

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

Modified files:

Index: src/sys/arch/arm/nvidia/files.tegra
diff -u src/sys/arch/arm/nvidia/files.tegra:1.16 src/sys/arch/arm/nvidia/files.tegra:1.17
--- src/sys/arch/arm/nvidia/files.tegra:1.16	Sat Aug 22 15:10:04 2015
+++ src/sys/arch/arm/nvidia/files.tegra	Sat Oct 17 21:18:16 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.tegra,v 1.16 2015/08/22 15:10:04 jmcneill Exp $
+#	$NetBSD: files.tegra,v 1.17 2015/10/17 21:18:16 jmcneill Exp $
 #
 # Configuration info for NVIDIA Tegra ARM Peripherals
 #
@@ -116,6 +116,10 @@ device	tegracec: hdmicecbus
 attach	tegracec at tegraio with tegra_cec
 file	arch/arm/nvidia/tegra_cec.c		tegra_cec
 
+# GPU
+attach	nouveau at tegraio with tegra_nouveau
+file	arch/arm/nvidia/tegra_nouveau.c		tegra_nouveau
+
 # Console parameters
 defparam opt_tegra.h			CONADDR
 defparam opt_tegra.h			CONSPEED

Index: src/sys/arch/arm/nvidia/tegra_io.c
diff -u src/sys/arch/arm/nvidia/tegra_io.c:1.13 src/sys/arch/arm/nvidia/tegra_io.c:1.14
--- src/sys/arch/arm/nvidia/tegra_io.c:1.13	Sat Aug  1 21:20:11 2015
+++ src/sys/arch/arm/nvidia/tegra_io.c	Sat Oct 17 21:18:16 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_io.c,v 1.13 2015/08/01 21:20:11 jmcneill Exp $ */
+/* $NetBSD: tegra_io.c,v 1.14 2015/10/17 21:18:16 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_tegra.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_io.c,v 1.13 2015/08/01 21:20:11 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_io.c,v 1.14 2015/10/17 21:18:16 jmcneill Exp $");
 
 #include 
 #include 
@@ -144,6 +144,10 @@ static const struct tegra_locators tegra
 TEGRA_HDMI_OFFSET, TEGRA_HDMI_SIZE, NOPORT, TEGRA_INTR_HDMI },
 };
 
+static const struct tegra_locators tegra_gpu_locators[] = {
+  { "nouveau", 0, TEGRA_GPU_SIZE, NOPORT, NOINTR }
+};
+
 int
 tegraio_match(device_t parent, cfdata_t cf, void *aux)
 {
@@ -171,6 +175,8 @@ tegraio_attach(device_t parent, device_t
 	tegraio_scan(self, (bus_space_handle_t)NULL,
 	tegra_ghost_locators, __arraycount(tegra_ghost_locators));
 	tegraio_scan(self, (bus_space_handle_t)NULL,
+	tegra_gpu_locators, __arraycount(tegra_gpu_locators));
+	tegraio_scan(self, (bus_space_handle_t)NULL,
 	tegra_pcie_locators, __arraycount(tegra_pcie_locators));
 }
 

Added files:

Index: src/sys/arch/arm/nvidia/tegra_nouveau.c
diff -u /dev/null src/sys/arch/arm/nvidia/tegra_nouveau.c:1.1
--- /dev/null	Sat Oct 17 21:18:16 2015
+++ src/sys/arch/arm/nvidia/tegra_nouveau.c	Sat Oct 17 21:18:16 2015
@@ -0,0 +1,225 @@
+/* $NetBSD: tegra_nouveau.c,v 1.1 2015/10/17 21:18:16 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2015 Jared D. McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "locators.h"
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: tegra_nouveau.c,v 1.1 2015/10/17 21:18:16 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+extern char *nouveau_config;
+extern char *nouveau_debug;
+extern struct drm_driver *const nouveau_drm_driver;
+
+static int	tegra_nouveau_match(device_t, cfdata_t, void *);
+static void	tegra_

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

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 21:17:15 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: tegra_reg.h

Log Message:
add GPU, SOR, and DPAUX offsets


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/nvidia/tegra_reg.h

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_reg.h
diff -u src/sys/arch/arm/nvidia/tegra_reg.h:1.13 src/sys/arch/arm/nvidia/tegra_reg.h:1.14
--- src/sys/arch/arm/nvidia/tegra_reg.h:1.13	Sat Aug  1 21:20:11 2015
+++ src/sys/arch/arm/nvidia/tegra_reg.h	Sat Oct 17 21:17:15 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_reg.h,v 1.13 2015/08/01 21:20:11 jmcneill Exp $ */
+/* $NetBSD: tegra_reg.h,v 1.14 2015/10/17 21:17:15 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -55,6 +55,8 @@
 #define TEGRA_HOST1X_SIZE	0x00034000
 #define TEGRA_GHOST_BASE	0x5400
 #define TEGRA_GHOST_SIZE	0x0100
+#define TEGRA_GPU_BASE		0x5700
+#define TEGRA_GPU_SIZE		0x0200
 #define TEGRA_PPSB_BASE		0x6000
 #define TEGRA_PPSB_SIZE		0x0100
 #define TEGRA_APB_BASE		0x7000
@@ -146,5 +148,9 @@
 #define TEGRA_DISPLAYB_SIZE	0x0004
 #define TEGRA_HDMI_OFFSET	0x0028
 #define TEGRA_HDMI_SIZE		0x0004
+#define TEGRA_SOR_OFFSET	0x0054
+#define TEGRA_SOR_SIZE		0x0004
+#define TEGRA_DPAUX_OFFSET	0x005c
+#define TEGRA_DPAUX_SIZE	0x0004
 
 #endif /* _ARM_TEGRA_REG_H */



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

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 21:16:27 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: tegra_intr.h

Log Message:
add SOR and GPU interrupt numbers


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/nvidia/tegra_intr.h

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_intr.h
diff -u src/sys/arch/arm/nvidia/tegra_intr.h:1.7 src/sys/arch/arm/nvidia/tegra_intr.h:1.8
--- src/sys/arch/arm/nvidia/tegra_intr.h:1.7	Sat Aug  1 21:20:11 2015
+++ src/sys/arch/arm/nvidia/tegra_intr.h	Sat Oct 17 21:16:27 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_intr.h,v 1.7 2015/08/01 21:20:11 jmcneill Exp $ */
+/* $NetBSD: tegra_intr.h,v 1.8 2015/10/17 21:16:27 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -58,6 +58,7 @@
 #define TEGRA_INTR_DISPLAYA	TEGRA_INTR(73)
 #define TEGRA_INTR_DISPLAYB	TEGRA_INTR(74)
 #define TEGRA_INTR_HDMI		TEGRA_INTR(75)
+#define TEGRA_INTR_SOR		TEGRA_INTR(76)
 #define TEGRA_INTR_HDA		TEGRA_INTR(81)
 #define TEGRA_INTR_I2C2		TEGRA_INTR(84)
 #define TEGRA_INTR_UARTD	TEGRA_INTR(90)
@@ -75,4 +76,6 @@
 #define TEGRA_INTR_TMR8		TEGRA_INTR(154)
 #define TEGRA_INTR_TMR9		TEGRA_INTR(155)
 #define TEGRA_INTR_TMR0		TEGRA_INTR(156)
+#define TEGRA_INTR_GPU		TEGRA_INTR(157)
+#define TEGRA_INTR_GPU_NONSTALL	TEGRA_INTR(158)
 #endif /* _ARM_TEGRA_INTR_H */



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

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 21:16:10 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: tegra_car.c tegra_carreg.h tegra_var.h

Log Message:
add support for enabling the GPU


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/nvidia/tegra_car.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/nvidia/tegra_carreg.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/nvidia/tegra_var.h

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_car.c
diff -u src/sys/arch/arm/nvidia/tegra_car.c:1.26 src/sys/arch/arm/nvidia/tegra_car.c:1.27
--- src/sys/arch/arm/nvidia/tegra_car.c:1.26	Sat Aug  1 21:20:11 2015
+++ src/sys/arch/arm/nvidia/tegra_car.c	Sat Oct 17 21:16:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_car.c,v 1.26 2015/08/01 21:20:11 jmcneill Exp $ */
+/* $NetBSD: tegra_car.c,v 1.27 2015/10/17 21:16:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_car.c,v 1.26 2015/08/01 21:20:11 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_car.c,v 1.27 2015/10/17 21:16:09 jmcneill Exp $");
 
 #include 
 #include 
@@ -831,3 +831,32 @@ tegra_car_wdt_enable(u_int timer, bool e
 	CAR_RST_SOURCE_WDT_SEL |
 	CAR_RST_SOURCE_WDT_EN);
 }
+
+void
+tegra_car_gpu_enable(void)
+{
+	bus_space_tag_t bst;
+	bus_space_handle_t bsh;
+
+	tegra_car_get_bs(&bst, &bsh);
+
+	/* Enter reset, enable clock */
+	bus_space_write_4(bst, bsh, CAR_RST_DEV_X_SET_REG, CAR_DEV_X_GPU);
+	bus_space_write_4(bst, bsh, CAR_CLK_ENB_X_SET_REG, CAR_DEV_X_GPU);
+
+	/* Set PLLP_OUT5 to 204MHz */
+	const u_int rate = 20400;
+	const u_int div = howmany(tegra_car_pllp0_rate() * 2, rate) - 2;
+	tegra_reg_set_clear(bst, bsh, CAR_PLLP_OUTC_REG,
+	__SHIFTIN(div, CAR_PLLP_OUTC_OUT5_RATIO) |
+	CAR_PLLP_OUTC_OUT5_CLKEN,
+	CAR_PLLP_OUTC_OUT5_RATIO);
+	delay(20);
+
+	/* Remove clamping from 3D partition in the PMC */
+	tegra_pmc_remove_clamping(PMC_PARTID_TD);
+	delay(20);
+
+	/* Leave reset */
+	bus_space_write_4(bst, bsh, CAR_RST_DEV_X_CLR_REG, CAR_DEV_X_GPU);
+}

Index: src/sys/arch/arm/nvidia/tegra_carreg.h
diff -u src/sys/arch/arm/nvidia/tegra_carreg.h:1.20 src/sys/arch/arm/nvidia/tegra_carreg.h:1.21
--- src/sys/arch/arm/nvidia/tegra_carreg.h:1.20	Sat Jul 25 15:50:42 2015
+++ src/sys/arch/arm/nvidia/tegra_carreg.h	Sat Oct 17 21:16:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_carreg.h,v 1.20 2015/07/25 15:50:42 jmcneill Exp $ */
+/* $NetBSD: tegra_carreg.h,v 1.21 2015/10/17 21:16:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -63,6 +63,11 @@
 #define CAR_PLLP_OUTB_OUT3_OVRRIDE	__BIT(2)
 #define CAR_PLLP_OUTB_OUT3_CLKEN	__BIT(1)
 #define CAR_PLLP_OUTB_OUT3_RSTN		__BIT(0)
+#define CAR_PLLP_OUTC_REG	0x67c
+#define CAR_PLLP_OUTC_OUT5_RATIO	__BITS(31,24)
+#define CAR_PLLP_OUTC_OUT5_OVERRIDE	__BIT(18)
+#define CAR_PLLP_OUTC_OUT5_CLKEN	__BIT(17)
+#define CAR_PLLP_OUTC_OUT5_RSTN		__BIT(16)
 #define CAR_PLLP_MISC_REG	0xac
 
 #define CAR_PLLC_BASE_REG	0x80

Index: src/sys/arch/arm/nvidia/tegra_var.h
diff -u src/sys/arch/arm/nvidia/tegra_var.h:1.24 src/sys/arch/arm/nvidia/tegra_var.h:1.25
--- src/sys/arch/arm/nvidia/tegra_var.h:1.24	Sat Aug  1 21:20:11 2015
+++ src/sys/arch/arm/nvidia/tegra_var.h	Sat Oct 17 21:16:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_var.h,v 1.24 2015/08/01 21:20:11 jmcneill Exp $ */
+/* $NetBSD: tegra_var.h,v 1.25 2015/10/17 21:16:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -108,6 +108,7 @@ void	tegra_car_hdmi_enable(u_int);
 int	tegra_car_dc_enable(u_int);
 void	tegra_car_host1x_enable(void);
 void	tegra_car_wdt_enable(u_int, bool);
+void	tegra_car_gpu_enable(void);
 
 struct tegra_gpio_pin;
 struct tegra_gpio_pin *tegra_gpio_acquire(const char *, u_int);



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

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 21:14:49 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: tegra_pmc.c tegra_pmcreg.h

Log Message:
GPU power is controlled by a different register on Tegra124, handle this in 
tegra_pmc_remove_clamping


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/nvidia/tegra_pmc.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/nvidia/tegra_pmcreg.h

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_pmc.c
diff -u src/sys/arch/arm/nvidia/tegra_pmc.c:1.6 src/sys/arch/arm/nvidia/tegra_pmc.c:1.7
--- src/sys/arch/arm/nvidia/tegra_pmc.c:1.6	Mon May 25 10:40:23 2015
+++ src/sys/arch/arm/nvidia/tegra_pmc.c	Sat Oct 17 21:14:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_pmc.c,v 1.6 2015/05/25 10:40:23 jmcneill Exp $ */
+/* $NetBSD: tegra_pmc.c,v 1.7 2015/10/17 21:14:49 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_pmc.c,v 1.6 2015/05/25 10:40:23 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_pmc.c,v 1.7 2015/10/17 21:14:49 jmcneill Exp $");
 
 #include 
 #include 
@@ -152,6 +152,15 @@ tegra_pmc_remove_clamping(u_int partid)
 
 	tegra_pmc_get_bs(&bst, &bsh);
 
+	if (tegra_chip_id() == CHIP_ID_TEGRA124) {
+		/*
+		 * On Tegra124 the GPU power clamping is controlled by a
+		 * separate register
+		 */
+		bus_space_write_4(bst, bsh, PMC_GPU_RG_CNTRL_REG, 0);
+		return;
+	}
+
 	bus_space_write_4(bst, bsh, PMC_REMOVE_CLAMPING_CMD_0_REG,
 	__BIT(partid));
 }

Index: src/sys/arch/arm/nvidia/tegra_pmcreg.h
diff -u src/sys/arch/arm/nvidia/tegra_pmcreg.h:1.4 src/sys/arch/arm/nvidia/tegra_pmcreg.h:1.5
--- src/sys/arch/arm/nvidia/tegra_pmcreg.h:1.4	Mon May 18 21:03:36 2015
+++ src/sys/arch/arm/nvidia/tegra_pmcreg.h	Sat Oct 17 21:14:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_pmcreg.h,v 1.4 2015/05/18 21:03:36 jmcneill Exp $ */
+/* $NetBSD: tegra_pmcreg.h,v 1.5 2015/10/17 21:14:49 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -93,4 +93,7 @@
 #define PMC_IO_DPD2_STATUS_REG		0x1c4
 #define PMC_IO_DPD2_STATUS_HV		__BIT(6)
 
+#define PMC_GPU_RG_CNTRL_REG		0x2d4
+#define PMC_GPU_RG_CNTRL_RAIL_CLAMP	__BIT(0)
+
 #endif /* _ARM_TEGRA_PMCREG_H */



CVS commit: src/sys/external/bsd/drm2

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 21:13:38 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device:
nouveau_engine_device_base.c
src/sys/external/bsd/drm2/include/linux: platform_device.h

Log Message:
support for non-PCI devices


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \

src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/include/linux/platform_device.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/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c:1.4 src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c:1.5
--- src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c:1.4	Fri Mar  6 13:44:18 2015
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c	Sat Oct 17 21:13:38 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_engine_device_base.c,v 1.4 2015/03/06 13:44:18 riastradh Exp $	*/
+/*	$NetBSD: nouveau_engine_device_base.c,v 1.5 2015/10/17 21:13:38 jmcneill Exp $	*/
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_device_base.c,v 1.4 2015/03/06 13:44:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_device_base.c,v 1.5 2015/10/17 21:13:38 jmcneill Exp $");
 
 #include 
 #include 
@@ -528,8 +528,8 @@ nv_device_resource_tag(struct nouveau_de
 		else
 			return pa->pa_iot;
 	} else {
-		/* XXX nouveau platform device */
-		panic("can't handle non-PCI nouveau devices");
+		KASSERT(bar < device->platformdev->nresource);
+		return device->platformdev->resource[bar].tag;
 	}
 }
 #endif
@@ -541,8 +541,9 @@ nv_device_resource_start(struct nouveau_
 		return pci_resource_start(device->pdev, bar);
 	} else {
 #ifdef __NetBSD__
-		/* XXX nouveau platform device */
-		panic("can't handle non-PCI nouveau devices");
+		if (bar >= device->platformdev->nresource)
+			return 0;
+		return device->platformdev->resource[bar].start;
 #else
 		struct resource *res;
 		res = platform_get_resource(device->platformdev,
@@ -561,8 +562,9 @@ nv_device_resource_len(struct nouveau_de
 		return pci_resource_len(device->pdev, bar);
 	} else {
 #ifdef __NetBSD__
-		/* XXX nouveau platform device */
-		panic("can't handle non-PCI nouveau devices");
+		if (bar >= device->platformdev->nresource)
+			return 0;
+		return device->platformdev->resource[bar].len;
 #else
 		struct resource *res;
 		res = platform_get_resource(device->platformdev,

Index: src/sys/external/bsd/drm2/include/linux/platform_device.h
diff -u src/sys/external/bsd/drm2/include/linux/platform_device.h:1.4 src/sys/external/bsd/drm2/include/linux/platform_device.h:1.5
--- src/sys/external/bsd/drm2/include/linux/platform_device.h:1.4	Wed Aug  6 15:01:33 2014
+++ src/sys/external/bsd/drm2/include/linux/platform_device.h	Sat Oct 17 21:13:38 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: platform_device.h,v 1.4 2014/08/06 15:01:33 riastradh Exp $	*/
+/*	$NetBSD: platform_device.h,v 1.5 2015/10/17 21:13:38 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -33,10 +33,20 @@
 #define _LINUX_PLATFORM_DEVICE_H_
 
 #include 
+#include 
+
+#define NUM_PLATFORM_RESOURCE	2
 
 struct platform_device {
 	struct device	dev;	/* XXX DON'T BELIEVE ME */
 	uint64_t	id;
+
+	unsigned int	nresource;
+	struct {
+		bus_space_tag_t	tag;
+		bus_addr_t	start;
+		bus_size_t	len;
+	}		resource[NUM_PLATFORM_RESOURCE];
 };
 
 #endif  /* _LINUX_PLATFORM_DEVICE_H_ */



CVS commit: src/sys/external/bsd/drm2/dist/drm/ttm

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 21:12:37 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/dist/drm/ttm: ttm_bo_util.c

Log Message:
vunmap takes 2 parameters on netbsd


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c
diff -u src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c:1.5 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c:1.6
--- src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c:1.5	Mon Apr 20 19:17:04 2015
+++ src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c	Sat Oct 17 21:12:37 2015
@@ -371,7 +371,11 @@ static int ttm_copy_ttm_io_page(struct t
 	kunmap_atomic(src);
 #else
 	if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL))
+#ifdef __NetBSD__
+		vunmap(src, 1);
+#else
 		vunmap(src);
+#endif
 	else
 		kunmap(s);
 #endif



CVS commit: src/sys/external/bsd/drm2/drm

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 21:11:56 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/drm: drm_cache.c

Log Message:
skip clflush on arm


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/drm/drm_cache.c

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

Modified files:

Index: src/sys/external/bsd/drm2/drm/drm_cache.c
diff -u src/sys/external/bsd/drm2/drm/drm_cache.c:1.7 src/sys/external/bsd/drm2/drm/drm_cache.c:1.8
--- src/sys/external/bsd/drm2/drm/drm_cache.c:1.7	Sat Oct 17 15:13:19 2015
+++ src/sys/external/bsd/drm2/drm/drm_cache.c	Sat Oct 17 21:11:56 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_cache.c,v 1.7 2015/10/17 15:13:19 jmcneill Exp $	*/
+/*	$NetBSD: drm_cache.c,v 1.8 2015/10/17 21:11:56 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,8 +30,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_cache.c,v 1.7 2015/10/17 15:13:19 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_cache.c,v 1.8 2015/10/17 21:11:56 jmcneill Exp $");
 
+#include 
 #include 
 #include 
 
@@ -41,27 +42,34 @@ __KERNEL_RCSID(0, "$NetBSD: drm_cache.c,
 
 #include 
 
+#if !defined(__arm__)
+#define DRM_CLFLUSH	1
+#endif
+
+#if defined(DRM_CLFLUSH)
 static bool		drm_md_clflush_finegrained_p(void);
 static void		drm_md_clflush_all(void);
 static void		drm_md_clflush_page(struct page *);
 static void		drm_md_clflush_virt_range(const void *, size_t);
+#endif
 
 void
 drm_clflush_pages(struct page **pages, unsigned long npages)
 {
-
+#if defined(DRM_CLFLUSH)
 	if (drm_md_clflush_finegrained_p()) {
 		while (npages--)
 			drm_md_clflush_page(pages[npages]);
 	} else {
 		drm_md_clflush_all();
 	}
+#endif
 }
 
 void
 drm_clflush_pglist(struct pglist *list)
 {
-
+#if defined(DRM_CLFLUSH)
 	if (drm_md_clflush_finegrained_p()) {
 		struct vm_page *page;
 
@@ -71,26 +79,29 @@ drm_clflush_pglist(struct pglist *list)
 	} else {
 		drm_md_clflush_all();
 	}
+#endif
 }
 
 void
 drm_clflush_page(struct page *page)
 {
-
+#if defined(DRM_CLFLUSH)
 	if (drm_md_clflush_finegrained_p())
 		drm_md_clflush_page(page);
 	else
 		drm_md_clflush_all();
+#endif
 }
 
 void
 drm_clflush_virt_range(const void *vaddr, size_t nbytes)
 {
-
+#if defined(DRM_CLFLUSH)
 	if (drm_md_clflush_finegrained_p())
 		drm_md_clflush_virt_range(vaddr, nbytes);
 	else
 		drm_md_clflush_all();
+#endif
 }
 
 #if defined(__i386__) || defined(__x86_64__)



CVS commit: src/sys/external/bsd/drm2/include/drm

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 21:11:06 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/include/drm: bus_dma_hacks.h

Log Message:
use VM_FREELIST_DEFAULT on arm


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.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/external/bsd/drm2/include/drm/bus_dma_hacks.h
diff -u src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h:1.7 src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h:1.8
--- src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h:1.7	Sat Jul 26 14:27:40 2014
+++ src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h	Sat Oct 17 21:11:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma_hacks.h,v 1.7 2014/07/26 14:27:40 riastradh Exp $	*/
+/*	$NetBSD: bus_dma_hacks.h,v 1.8 2015/10/17 21:11:06 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -40,13 +40,13 @@
 #include 
 #include 
 
-/* XXX This is x86-specific bollocks.  */
-#if !defined(__i386__) && !defined(__x86_64__)
-#error DRM GEM/TTM need new MI bus_dma APIs!  Halp!
-#endif
-
+#if defined(__i386__) || defined(__x86_64__)
 #include 
 #include 
+#elif defined(__arm__)
+#else
+#error DRM GEM/TTM need new MI bus_dma APIs!  Halp!
+#endif
 
 static inline int
 bus_dmamem_wire_uvm_object(bus_dma_tag_t tag, struct uvm_object *uobj,
@@ -116,7 +116,11 @@ bus_dmamem_unwire_uvm_object(bus_dma_tag
 static inline int
 bus_dmamem_pgfl(bus_dma_tag_t tag)
 {
+#if defined(__i386__) || defined(__x86_64__)
 	return x86_select_freelist(tag->_bounce_alloc_hi - 1);
+#else
+	return VM_FREELIST_DEFAULT;
+#endif
 }
 
 static inline int



CVS commit: src/sys/external/bsd/drm2/include/drm

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 21:09:49 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/include/drm: drm_agp_netbsd.h

Log Message:
only define __OS_HAS_AGP if x86 and NAGP > 0


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/include/drm/drm_agp_netbsd.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/external/bsd/drm2/include/drm/drm_agp_netbsd.h
diff -u src/sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h:1.4 src/sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h:1.5
--- src/sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h:1.4	Sat Aug 23 08:03:33 2014
+++ src/sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h	Sat Oct 17 21:09:49 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_agp_netbsd.h,v 1.4 2014/08/23 08:03:33 riastradh Exp $	*/
+/*	$NetBSD: drm_agp_netbsd.h,v 1.5 2015/10/17 21:09:49 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -47,12 +47,16 @@
 #include 
 #include 
 
-#define	__OS_HAS_AGP	1
-
 #define	PCI_AGP_COMMAND_FW	AGPCMD_FWEN
 
+#if defined(__i386__) || defined(__x86_64__)
+#include "agp.h"
+#if NAGP > 0
+#define	__OS_HAS_AGP	1
+#endif
 __CTASSERT(PAGE_SIZE == AGP_PAGE_SIZE);
 __CTASSERT(PAGE_SHIFT == AGP_PAGE_SHIFT);
+#endif
 
 struct agp_kern_info {
 	struct agp_info aki_info;



CVS commit: src/sys/external/bsd/drm2/include/linux

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 21:07:23 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/include/linux: acpi.h

Log Message:
only include acpivar.h when NACPICA > 0


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/include/linux/acpi.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/external/bsd/drm2/include/linux/acpi.h
diff -u src/sys/external/bsd/drm2/include/linux/acpi.h:1.3 src/sys/external/bsd/drm2/include/linux/acpi.h:1.4
--- src/sys/external/bsd/drm2/include/linux/acpi.h:1.3	Wed Nov  5 23:46:09 2014
+++ src/sys/external/bsd/drm2/include/linux/acpi.h	Sat Oct 17 21:07:23 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.h,v 1.3 2014/11/05 23:46:09 nonaka Exp $	*/
+/*	$NetBSD: acpi.h,v 1.4 2015/10/17 21:07:23 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -32,6 +32,16 @@
 #ifndef _LINUX_ACPI_H_
 #define _LINUX_ACPI_H_
 
+#ifdef _KERNEL_OPT
+#if defined(__i386__) || defined(__x86_64__)
+#include "acpica.h"
+#else
+#define NACPICA 0
+#endif
+#endif
+
+#if NACPICA > 0
 #include 
+#endif
 
 #endif  /* _LINUX_ACPI_H_ */



CVS commit: src/sys/external/bsd/drm2/linux

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 21:06:42 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/linux: linux_writecomb.c

Log Message:
only use mtrr api if options MTRR is present and we are on x86


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/linux/linux_writecomb.c

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

Modified files:

Index: src/sys/external/bsd/drm2/linux/linux_writecomb.c
diff -u src/sys/external/bsd/drm2/linux/linux_writecomb.c:1.3 src/sys/external/bsd/drm2/linux/linux_writecomb.c:1.4
--- src/sys/external/bsd/drm2/linux/linux_writecomb.c:1.3	Thu Jan  1 01:15:43 2015
+++ src/sys/external/bsd/drm2/linux/linux_writecomb.c	Sat Oct 17 21:06:42 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_writecomb.c,v 1.3 2015/01/01 01:15:43 mrg Exp $	*/
+/*	$NetBSD: linux_writecomb.c,v 1.4 2015/10/17 21:06:42 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,16 +30,22 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_writecomb.c,v 1.3 2015/01/01 01:15:43 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_writecomb.c,v 1.4 2015/10/17 21:06:42 jmcneill Exp $");
 
-#ifdef _KERNEL_OPT
+#if defined(__i386__) || defined(__x86_64__)
+#define HAS_MTRR 1
+#endif
+
+#if defined(_KERNEL_OPT) && defined(HAS_MTRR)
 #include "opt_mtrr.h"
 #endif
 
 #include 
 #include 
 
+#if defined(MTRR)
 #include 
+#endif
 
 #include 
 #include 
@@ -71,6 +77,7 @@ linux_writecomb_fini(void)
 int
 arch_phys_wc_add(unsigned long base, unsigned long size)
 {
+#if defined(MTRR)
 	struct mtrr *mtrr;
 	int n = 1;
 	int id;
@@ -111,11 +118,15 @@ fail1:	KASSERT(id < 0);
 fail0:	KASSERT(ret < 0);
 	kmem_free(mtrr, sizeof(*mtrr));
 	return ret;
+#else
+	return -1;
+#endif
 }
 
 void
 arch_phys_wc_del(int id)
 {
+#if defined(MTRR)
 	struct mtrr *mtrr;
 	int n;
 	int ret __diagused;
@@ -136,6 +147,7 @@ arch_phys_wc_del(int id)
 		KASSERT(n == 1);
 		kmem_free(mtrr, sizeof(*mtrr));
 	}
+#endif
 }
 
 int



CVS commit: src/sys/external/bsd/drm2/ttm

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 21:05:57 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/ttm: ttm_agp_backend.c

Log Message:
only build ttm_agp code if __OS_HAS_AGP is defined


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/ttm/ttm_agp_backend.c

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

Modified files:

Index: src/sys/external/bsd/drm2/ttm/ttm_agp_backend.c
diff -u src/sys/external/bsd/drm2/ttm/ttm_agp_backend.c:1.4 src/sys/external/bsd/drm2/ttm/ttm_agp_backend.c:1.5
--- src/sys/external/bsd/drm2/ttm/ttm_agp_backend.c:1.4	Sat Apr 25 21:00:29 2015
+++ src/sys/external/bsd/drm2/ttm/ttm_agp_backend.c	Sat Oct 17 21:05:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttm_agp_backend.c,v 1.4 2015/04/25 21:00:29 riastradh Exp $	*/
+/*	$NetBSD: ttm_agp_backend.c,v 1.5 2015/10/17 21:05:57 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ttm_agp_backend.c,v 1.4 2015/04/25 21:00:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_agp_backend.c,v 1.5 2015/10/17 21:05:57 jmcneill Exp $");
 
 #include 
 #include 
@@ -42,6 +42,8 @@ __KERNEL_RCSID(0, "$NetBSD: ttm_agp_back
 #include 
 #include 
 
+#if __OS_HAS_AGP
+
 struct ttm_agp {
 	struct ttm_dma_tt ttm_dma;
 	struct agp_softc *agp;
@@ -164,3 +166,5 @@ static const struct ttm_backend_func ttm
 	.unbind = &ttm_agp_unbind,
 	.destroy = &ttm_agp_destroy,
 };
+
+#endif



CVS commit: src/sys/arch/sparc64

2015-10-17 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sat Oct 17 19:29:48 UTC 2015

Modified Files:
src/sys/arch/sparc64/include: asm.h locore.h
src/sys/arch/sparc64/sparc64: copy.S

Log Message:
Move LP64 and ILP32 conversion macros COMBINE, SPLIT from locore.h
to asm.h, and provide SPLIT_RETL for the case SPLIT and then retl
immediately.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sparc64/include/asm.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc64/include/locore.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sparc64/sparc64/copy.S

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

Modified files:

Index: src/sys/arch/sparc64/include/asm.h
diff -u src/sys/arch/sparc64/include/asm.h:1.21 src/sys/arch/sparc64/include/asm.h:1.22
--- src/sys/arch/sparc64/include/asm.h:1.21	Sun Apr 28 23:42:23 2013
+++ src/sys/arch/sparc64/include/asm.h	Sat Oct 17 19:29:48 2015
@@ -1,4 +1,4 @@
-/*   $NetBSD: asm.h,v 1.21 2013/04/28 23:42:23 nakayama Exp $*/
+/*   $NetBSD: asm.h,v 1.22 2015/10/17 19:29:48 nakayama Exp $*/
 
 #include 
 
@@ -66,3 +66,25 @@
 /* use as needed to align things on longword boundaries */
 #define	_ALIGN	.align 8
 #define ICACHE_ALIGN	.align	32
+
+/*
+ * Combine 2 regs -- used to convert 64-bit ILP32
+ * values to LP64.
+ */
+#define	COMBINE(r1, r2, d)	\
+	clruw	r2;		\
+	sllx	r1, 32, d;	\
+	or	d, r2, d
+
+/*
+ * Split 64-bit value in 1 reg into high and low halves.
+ * Used for ILP32 return values.
+ */
+#define	SPLIT(s, r0, r1)	\
+	srl	s, 0, r1;	\
+	srlx	s, 32, r0
+
+#define	SPLIT_RETL(s, r0, r1)	\
+	srl	s, 0, r1;	\
+	retl;			\
+	 srlx	s, 32, r0

Index: src/sys/arch/sparc64/include/locore.h
diff -u src/sys/arch/sparc64/include/locore.h:1.8 src/sys/arch/sparc64/include/locore.h:1.9
--- src/sys/arch/sparc64/include/locore.h:1.8	Sun Aug 23 10:59:15 2015
+++ src/sys/arch/sparc64/include/locore.h	Sat Oct 17 19:29:48 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.h,v 1.8 2015/08/23 10:59:15 joerg Exp $	*/
+/*	$NetBSD: locore.h,v 1.9 2015/10/17 19:29:48 nakayama Exp $	*/
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -66,24 +66,6 @@
 
 
 /*
- * Combine 2 regs -- used to convert 64-bit ILP32
- * values to LP64.
- */
-#define	COMBINE(r1, r2, d)	\
-	clruw	r2;		\
-	sllx	r1, 32, d;	\
-	or	d, r2, d
-
-/*
- * Split 64-bit value in 1 reg into high and low halves.
- * Used for ILP32 return values.
- */
-#define	SPLIT(r0, r1)		\
-	srl	r0, 0, r1;	\
-	srlx	r0, 32, r0
-
-
-/*
  * A handy macro for maintaining instrumentation counters.
  * Note that this clobbers %o0, %o1 and %o2.  Normal usage is
  * something like:

Index: src/sys/arch/sparc64/sparc64/copy.S
diff -u src/sys/arch/sparc64/sparc64/copy.S:1.4 src/sys/arch/sparc64/sparc64/copy.S:1.5
--- src/sys/arch/sparc64/sparc64/copy.S:1.4	Sat Jul 10 10:12:07 2010
+++ src/sys/arch/sparc64/sparc64/copy.S	Sat Oct 17 19:29:48 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: copy.S,v 1.4 2010/07/10 10:12:07 nakayama Exp $	*/
+/*	$NetBSD: copy.S,v 1.5 2015/10/17 19:29:48 nakayama Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -883,7 +883,7 @@ ENTRY(probeget)
 	ldxa	[%o0] %asi, %o0		!	value = *(long *)addr;
 1:	
 #ifndef _LP64
-	SPLIT(%o0, %o1)
+	SPLIT(%o0, %o0, %o1)
 #endif
 	membar	#Sync
 #ifndef _LP64



CVS commit: src/distrib/sets/lists/xcomp

2015-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 17 19:20:51 UTC 2015

Modified Files:
src/distrib/sets/lists/xcomp: md.amd64 md.evbarm md.i386

Log Message:
remove extra lint libraries now that those libraries are private.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/distrib/sets/lists/xcomp/md.amd64
cvs rdiff -u -r1.2 -r1.3 src/distrib/sets/lists/xcomp/md.evbarm
cvs rdiff -u -r1.48 -r1.49 src/distrib/sets/lists/xcomp/md.i386

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

Modified files:

Index: src/distrib/sets/lists/xcomp/md.amd64
diff -u src/distrib/sets/lists/xcomp/md.amd64:1.43 src/distrib/sets/lists/xcomp/md.amd64:1.44
--- src/distrib/sets/lists/xcomp/md.amd64:1.43	Tue Oct 13 00:33:22 2015
+++ src/distrib/sets/lists/xcomp/md.amd64	Sat Oct 17 15:20:51 2015
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.43 2015/10/13 04:33:22 mrg Exp $
+# $NetBSD: md.amd64,v 1.44 2015/10/17 19:20:51 christos Exp $
 ./usr/X11R6/include/xf86Optrec.h			-unknown-	x11
 ./usr/X11R6/include/xf86Parser.h			-unknown-	x11
 ./usr/X11R6/man/cat3/XF86VidMode.0			-unknown-	.cat,x11
@@ -94,19 +94,5 @@
 ./usr/libdata/lint/llib-lI810XvMC.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lchromeXvMC.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lchromeXvMCPro.ln		-unknown-	lint,xorg
-./usr/libdata/lint/llib-ldbe.ln-unknown-	lint,xorg
-./usr/libdata/lint/llib-ldri.ln-unknown-	lint,xorg
-./usr/libdata/lint/llib-ldri2.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-ldrm_intel.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-ldrm_nouveau.ln			-unknown-	lint,xorg
-./usr/libdata/lint/llib-lexa.ln-unknown-	lint,xorg
-./usr/libdata/lint/llib-lextmod.ln			-unknown-	lint,xorg
-./usr/libdata/lint/llib-lfb.ln-unknown-	lint,xorg
-./usr/libdata/lint/llib-lglx.ln-unknown-	lint,xorg
-./usr/libdata/lint/llib-lint10.ln			-unknown-	lint,xorg
-./usr/libdata/lint/llib-lrecord.ln			-unknown-	lint,xorg
-./usr/libdata/lint/llib-lshadow.ln			-unknown-	lint,xorg
-./usr/libdata/lint/llib-lshadowfb.ln			-unknown-	lint,xorg
-./usr/libdata/lint/llib-lvbe.ln-unknown-	lint,xorg
-./usr/libdata/lint/llib-lvgahw.ln			-unknown-	lint,xorg
-./usr/libdata/lint/llib-lxaa.ln-unknown-	lint,xorg

Index: src/distrib/sets/lists/xcomp/md.evbarm
diff -u src/distrib/sets/lists/xcomp/md.evbarm:1.2 src/distrib/sets/lists/xcomp/md.evbarm:1.3
--- src/distrib/sets/lists/xcomp/md.evbarm:1.2	Mon Aug 17 12:05:25 2015
+++ src/distrib/sets/lists/xcomp/md.evbarm	Sat Oct 17 15:20:51 2015
@@ -1,14 +1 @@
-# $NetBSD: md.evbarm,v 1.2 2015/08/17 16:05:25 christos Exp $
-./usr/libdata/lint/llib-ldbe.ln		-unknown-	lint,xorg
-./usr/libdata/lint/llib-ldri.ln		-unknown-	lint,xorg
-./usr/libdata/lint/llib-ldri2.ln	-unknown-	lint,xorg
-./usr/libdata/lint/llib-lexa.ln		-unknown-	lint,xorg
-./usr/libdata/lint/llib-lextmod.ln	-unknown-	lint,xorg
-./usr/libdata/lint/llib-lfb.ln		-unknown-	lint,xorg
-./usr/libdata/lint/llib-lglx.ln		-unknown-	lint,xorg
-./usr/libdata/lint/llib-lrecord.ln	-unknown-	lint,xorg
-./usr/libdata/lint/llib-lshadow.ln	-unknown-	lint,xorg
-./usr/libdata/lint/llib-lshadowfb.ln	-unknown-	lint,xorg
-./usr/libdata/lint/llib-lvbe.ln		-unknown-	lint,xorg
-./usr/libdata/lint/llib-lvgahw.ln	-unknown-	lint,xorg
-./usr/libdata/lint/llib-lxaa.ln		-unknown-	lint,xorg
+# $NetBSD: md.evbarm,v 1.3 2015/10/17 19:20:51 christos Exp $

Index: src/distrib/sets/lists/xcomp/md.i386
diff -u src/distrib/sets/lists/xcomp/md.i386:1.48 src/distrib/sets/lists/xcomp/md.i386:1.49
--- src/distrib/sets/lists/xcomp/md.i386:1.48	Tue Oct 13 00:33:22 2015
+++ src/distrib/sets/lists/xcomp/md.i386	Sat Oct 17 15:20:51 2015
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.48 2015/10/13 04:33:22 mrg Exp $
+# $NetBSD: md.i386,v 1.49 2015/10/17 19:20:51 christos Exp $
 #./usr/libdata/lint/llib-lIntelXvMC.ln			-unknown-	lint,xorg
 ./usr/X11R6/include/xf86Optrec.h			-unknown-	x11
 ./usr/X11R6/include/xf86Parser.h			-unknown-	x11
@@ -95,19 +95,5 @@
 ./usr/libdata/lint/llib-lI810XvMC.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lchromeXvMC.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lchromeXvMCPro.ln		-unknown-	lint,xorg
-./usr/libdata/lint/llib-ldbe.ln-unknown-	lint,xorg
-./usr/libdata/lint/llib-ldri.ln-unknown-	lint,xorg
-./usr/libdata/lint/llib-ldri2.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-ldrm_intel.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-ldrm_nouveau.ln			-unknown-	lint,xorg
-./usr/libdata/lint/llib-lexa.ln-unknown-	lint,xorg
-./usr/libdata/lint/llib-lextmod.ln			-unknown-	lint,xorg
-./usr/libdata/lint/llib-lfb.ln-unknown-	lint,xorg
-./usr/libdata/lint/llib-lglx.ln-unknown-	lint,xorg
-./usr/libdata/lint/llib-lint10.ln			-unknown-	lint,xorg
-./usr/libdata/lint/llib-lrecord.ln			-unknown-	lint,xorg
-./usr/libdata/lint/llib-lshadow.ln			-unknown-	lint,xorg
-./usr/libdata/lint/llib-lshadowfb.ln			-unknown-	lint,xorg
-./usr/libdata/lint/llib-lvbe.l

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

2015-10-17 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sat Oct 17 18:51:32 UTC 2015

Modified Files:
src/sys/arch/sparc64/sparc64: cpu_in_cksum.S

Log Message:
LDPTR is defined in machine/asm.h.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sparc64/sparc64/cpu_in_cksum.S

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/cpu_in_cksum.S
diff -u src/sys/arch/sparc64/sparc64/cpu_in_cksum.S:1.3 src/sys/arch/sparc64/sparc64/cpu_in_cksum.S:1.4
--- src/sys/arch/sparc64/sparc64/cpu_in_cksum.S:1.3	Sat Dec 22 20:08:08 2012
+++ src/sys/arch/sparc64/sparc64/cpu_in_cksum.S	Sat Oct 17 18:51:32 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_in_cksum.S,v 1.3 2012/12/22 20:08:08 nakayama Exp $ */
+/*	$NetBSD: cpu_in_cksum.S,v 1.4 2015/10/17 18:51:32 nakayama Exp $ */
 
 /*
  * Copyright (c) 2001 Eduardo Horvath
@@ -27,12 +27,6 @@
 #include "assym.h"
 #include 
 
-#ifdef __arch64__
-#define	LDPTR	ldx
-#else
-#define	LDPTR	lduw
-#endif
-
 /*
  * int cpu_in_cksum(struct mbuf *m, int len, int off, uint32_t initial_sum);
  *



CVS commit: src/sys/external/bsd/drm2/nouveau

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 17:32:18 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/nouveau: files.nouveau

Log Message:
nouveau_pci.c depends on nouveau_pci condition, not nouveau


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/drm2/nouveau/files.nouveau

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

Modified files:

Index: src/sys/external/bsd/drm2/nouveau/files.nouveau
diff -u src/sys/external/bsd/drm2/nouveau/files.nouveau:1.9 src/sys/external/bsd/drm2/nouveau/files.nouveau:1.10
--- src/sys/external/bsd/drm2/nouveau/files.nouveau:1.9	Sat Oct 17 12:02:44 2015
+++ src/sys/external/bsd/drm2/nouveau/files.nouveau	Sat Oct 17 17:32:18 2015
@@ -1,10 +1,10 @@
-#	$NetBSD: files.nouveau,v 1.9 2015/10/17 12:02:44 jmcneill Exp $
+#	$NetBSD: files.nouveau,v 1.10 2015/10/17 17:32:18 jmcneill Exp $
 
 define	nouveaufbbus	{ }
 device	nouveau: drmkms, drmkms_ttm, nouveaufbbus
 
 attach	nouveau at pci with nouveau_pci: drmkms_pci
-file	external/bsd/drm2/nouveau/nouveau_pci.c			nouveau
+file	external/bsd/drm2/nouveau/nouveau_pci.c			nouveau_pci
 
 device	nouveaufb: nouveaufbbus, drmfb, drmfb_pci, wsemuldisplaydev
 attach	nouveaufb at nouveaufbbus



CVS commit: src/sys/arch

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 16:34:43 UTC 2015

Modified Files:
src/sys/arch/arm/include: cpufunc.h
src/sys/arch/arm/xscale: pxa2x0_lcd.c
src/sys/arch/shark/ofw: ofw.c

Log Message:
remove tlb_flush define and change callers to use cpu_tlb_flushID directly, ok 
matt@


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/arm/include/cpufunc.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/xscale/pxa2x0_lcd.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/shark/ofw/ofw.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/include/cpufunc.h
diff -u src/sys/arch/arm/include/cpufunc.h:1.74 src/sys/arch/arm/include/cpufunc.h:1.75
--- src/sys/arch/arm/include/cpufunc.h:1.74	Sun Apr 20 16:06:05 2014
+++ src/sys/arch/arm/include/cpufunc.h	Sat Oct 17 16:34:43 2015
@@ -230,7 +230,6 @@ void	cpufunc_domains		(u_int);
 u_int	cpufunc_faultstatus	(void);
 u_int	cpufunc_faultaddress	(void);
 
-#define tlb_flush	cpu_tlb_flushID
 #define setttb		cpu_setttb
 #define drain_writebuf	cpu_drain_writebuf
 

Index: src/sys/arch/arm/xscale/pxa2x0_lcd.c
diff -u src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.35 src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.36
--- src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.35	Sat Feb 22 19:03:06 2014
+++ src/sys/arch/arm/xscale/pxa2x0_lcd.c	Sat Oct 17 16:34:43 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: pxa2x0_lcd.c,v 1.35 2014/02/22 19:03:06 matt Exp $ */
+/* $NetBSD: pxa2x0_lcd.c,v 1.36 2015/10/17 16:34:43 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2002  Genetec Corporation.  All rights reserved.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.35 2014/02/22 19:03:06 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.36 2015/10/17 16:34:43 jmcneill Exp $");
 
 #include "opt_pxa2x0_lcd.h"
 
@@ -566,7 +566,7 @@ pxa2x0_lcd_new_screen(struct pxa2x0_lcd_
 			PTE_SYNC(ptep);
 			va += PAGE_SIZE;
 		}
-		tlb_flush();
+		cpu_tlb_flushID();
 	}
 
 	memset(scr->buf_va, 0, scr->buf_size);

Index: src/sys/arch/shark/ofw/ofw.c
diff -u src/sys/arch/shark/ofw/ofw.c:1.63 src/sys/arch/shark/ofw/ofw.c:1.64
--- src/sys/arch/shark/ofw/ofw.c:1.63	Sat Feb 22 18:55:53 2014
+++ src/sys/arch/shark/ofw/ofw.c	Sat Oct 17 16:34:43 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw.c,v 1.63 2014/02/22 18:55:53 matt Exp $	*/
+/*	$NetBSD: ofw.c,v 1.64 2015/10/17 16:34:43 jmcneill Exp $	*/
 
 /*
  * Copyright 1997
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw.c,v 1.63 2014/02/22 18:55:53 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw.c,v 1.64 2015/10/17 16:34:43 jmcneill Exp $");
 
 #include 
 #include 
@@ -1062,7 +1062,7 @@ ofw_callbackhandler(void *v)
 		}
 
 		/* Clean out tlb. */
-		tlb_flush();
+		cpu_tlb_flushID();
 
 		args_n_results[nargs + 1] = 0;
 		args->nreturns = 2;
@@ -1106,7 +1106,7 @@ ofw_callbackhandler(void *v)
 		}
 
 		/* Clean out tlb. */
-		tlb_flush();
+		cpu_tlb_flushID();
 
 		args->nreturns = 1;
 	} else if (strcmp(name, "translate") == 0) {



CVS commit: src/sys/external/bsd/drm2/drm

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 16:19:38 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/drm: drm_drv.c

Log Message:
fix __OS_HAS_AGP=0 build


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/external/bsd/drm2/drm/drm_drv.c

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

Modified files:

Index: src/sys/external/bsd/drm2/drm/drm_drv.c
diff -u src/sys/external/bsd/drm2/drm/drm_drv.c:1.15 src/sys/external/bsd/drm2/drm/drm_drv.c:1.16
--- src/sys/external/bsd/drm2/drm/drm_drv.c:1.15	Sun Mar  8 23:37:56 2015
+++ src/sys/external/bsd/drm2/drm/drm_drv.c	Sat Oct 17 16:19:38 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_drv.c,v 1.15 2015/03/08 23:37:56 riastradh Exp $	*/
+/*	$NetBSD: drm_drv.c,v 1.16 2015/10/17 16:19:38 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.15 2015/03/08 23:37:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.16 2015/10/17 16:19:38 jmcneill Exp $");
 
 #include 
 #include 
@@ -87,6 +87,7 @@ static drm_ioctl_t	drm_version;
 		.cmd_drv = 0,		\
 	}
 
+#if __OS_HAS_AGP
 /* XXX Kludge for AGP.  */
 static drm_ioctl_t	drm_agp_acquire_hook_ioctl;
 static drm_ioctl_t	drm_agp_release_hook_ioctl;
@@ -105,6 +106,7 @@ static drm_ioctl_t	drm_agp_unbind_hook_i
 #define	drm_agp_free_ioctl	drm_agp_free_hook_ioctl
 #define	drm_agp_bind_ioctl	drm_agp_bind_hook_ioctl
 #define	drm_agp_unbind_ioctl	drm_agp_unbind_hook_ioctl
+#endif
 
 /* Table copied verbatim from dist/drm/drm_drv.c.  */
 static const struct drm_ioctl_desc drm_ioctls[] = {
@@ -805,6 +807,8 @@ drm_agp_clear_hook(struct drm_device *de
 	(*hooks->agph_clear)(dev);
 }
 
+#if __OS_HAS_AGP
+
 #define	DEFINE_AGP_HOOK_IOCTL(NAME, HOOK)  \
 static int  \
 NAME(struct drm_device *dev, void *data, struct drm_file *file)		  \
@@ -825,3 +829,5 @@ DEFINE_AGP_HOOK_IOCTL(drm_agp_alloc_hook
 DEFINE_AGP_HOOK_IOCTL(drm_agp_free_hook_ioctl, agph_free_ioctl)
 DEFINE_AGP_HOOK_IOCTL(drm_agp_bind_hook_ioctl, agph_bind_ioctl)
 DEFINE_AGP_HOOK_IOCTL(drm_agp_unbind_hook_ioctl, agph_unbind_ioctl)
+
+#endif



CVS commit: src/sys/external/bsd/drm2/dist/include/drm

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 16:17:22 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm: drm_agpsupport.h

Log Message:
fix __OS_HAS_AGP=0 build


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/include/drm/drm_agpsupport.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/external/bsd/drm2/dist/include/drm/drm_agpsupport.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drm_agpsupport.h:1.4 src/sys/external/bsd/drm2/dist/include/drm/drm_agpsupport.h:1.5
--- src/sys/external/bsd/drm2/dist/include/drm/drm_agpsupport.h:1.4	Sat Nov 22 19:18:07 2014
+++ src/sys/external/bsd/drm2/dist/include/drm/drm_agpsupport.h	Sat Oct 17 16:17:22 2015
@@ -53,6 +53,8 @@ int drm_agp_bind_ioctl(struct drm_device
 		   struct drm_file *file_priv);
 #else /* __OS_HAS_AGP */
 
+#if !defined(__NetBSD__)
+
 static inline void drm_free_agp(struct agp_memory * handle, int pages)
 {
 }
@@ -67,6 +69,8 @@ static inline int drm_unbind_agp(struct 
 	return -ENODEV;
 }
 
+#endif
+
 static inline struct agp_memory *drm_agp_bind_pages(struct drm_device *dev,
 	  struct page **pages,
 	  unsigned long num_pages,



CVS commit: src/sys/external/bsd/drm2/linux

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 15:57:33 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/linux: linux_work.c

Log Message:
include sys/cpu.h for CPU_INFO_ITERATOR


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/drm2/linux/linux_work.c

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

Modified files:

Index: src/sys/external/bsd/drm2/linux/linux_work.c
diff -u src/sys/external/bsd/drm2/linux/linux_work.c:1.10 src/sys/external/bsd/drm2/linux/linux_work.c:1.11
--- src/sys/external/bsd/drm2/linux/linux_work.c:1.10	Thu Jan  1 01:15:43 2015
+++ src/sys/external/bsd/drm2/linux/linux_work.c	Sat Oct 17 15:57:32 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_work.c,v 1.10 2015/01/01 01:15:43 mrg Exp $	*/
+/*	$NetBSD: linux_work.c,v 1.11 2015/10/17 15:57:32 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.10 2015/01/01 01:15:43 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.11 2015/10/17 15:57:32 jmcneill Exp $");
 
 #include 
 #include 
@@ -44,6 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_work.c
 #include 
 #include 
 #include 
+#include 
 
 #include 
 



CVS commit: src/sys/arch

2015-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Oct 17 15:30:14 UTC 2015

Modified Files:
src/sys/arch/arm/allwinner: awin_board.c awin_reg.h awin_var.h
src/sys/arch/evbarm/awin: awin_machdep.c
src/sys/arch/evbarm/conf: BPI CUBIEBOARD

Log Message:
Implement CPU frequency switching for A20.
This requires adjusting the CPU voltage, so enable the axp20x driver for
A20 boards.
In evbarm/awin/awin_machdep.c, the DCDC powering up the CPU cores needs to
be defined for each board. The board machine-dependant code (at this time,
only awin_machdep.c) has to provide a awin_set_mpu_volt() function
which calls the right PMU driver to change the CPU core voltage.

The CPU frequency/voltage table in awin_board.c comes from various
sources: linux kernel, device tree and fex scripts, and experiments on
olimex lime2 and cubieboard 2.
The following sysctls are provided (compatible with estd):
machdep.frequency.min,machdep.frequency.max: writable lower and upper
   bounds of the useable frequencies. Affects machdep.frequency.available.
   Lower bound defaults to 700Mhz, as does linux.
   Upper bound defaults to 960Mhz, which is the boot frequency
   on the boards I tested. There is a 1008Mhz entry available,
   but requires an out of spec CPU voltage (more than 1.4V) so it's
   not available by default.
machdep.frequency.available: list of available frequencies. This is
   the CPU frequency/voltage table, bound by machdep.frequency.{min,max}.
machdep.frequency.current: current CPU speed. Write a new value to change
  the CPU speed, only values from machdep.frequency.available are
  accepted.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/arm/allwinner/awin_board.c
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/arm/allwinner/awin_reg.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/allwinner/awin_var.h
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/evbarm/awin/awin_machdep.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/conf/BPI
cvs rdiff -u -r1.41 -r1.42 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/arm/allwinner/awin_board.c
diff -u src/sys/arch/arm/allwinner/awin_board.c:1.38 src/sys/arch/arm/allwinner/awin_board.c:1.39
--- src/sys/arch/arm/allwinner/awin_board.c:1.38	Sat Oct 17 15:02:55 2015
+++ src/sys/arch/arm/allwinner/awin_board.c	Sat Oct 17 15:30:14 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: awin_board.c,v 1.38 2015/10/17 15:02:55 bouyer Exp $	*/
+/*	$NetBSD: awin_board.c,v 1.39 2015/10/17 15:30:14 bouyer Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,12 +36,16 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.38 2015/10/17 15:02:55 bouyer Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.39 2015/10/17 15:30:14 bouyer Exp $");
 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 
 #include 
 
@@ -129,6 +133,257 @@ static struct consdev awin_earlycons = {
 };
 #endif /* AWIN_CONSOLE_EARLY */
 
+struct awin_cpu_freq {
+	uint	freq; /* this frequency in hz */
+	int	mvolt; /* minimum millivolt for this freq */
+	int	pll_n, pll_k, pll_m, pll_p; /* pll parameters */
+	int	axi_div, ahb_div, abp0_div;
+};
+
+struct awin_cpu_freq awin_current_freq;
+const struct awin_cpu_freq *awin_freqs;
+
+#define A20_PLL1_ENTRY(n, k, m, p) \
+	.freq = (((AWIN_REF_FREQ * n * (k + 1)) / (m + 1)) >> p) / 100, \
+	.pll_n = (n), \
+	.pll_k = (k), \
+	.pll_m = (m), \
+	.pll_p = (p)
+
+static const struct awin_cpu_freq awin_a20_cpus_freqs[] = {
+	{
+		A20_PLL1_ENTRY(13, 0, 0, 0), /* 312 Mhz */
+		.mvolt = 1100,
+		.axi_div  = 0, /* /1, 312 Mhz */
+		.ahb_div  = 1, /* /2, 156 Mhz */
+		.abp0_div = 0, /* /2, 78 Mhz */
+	},
+	{
+		A20_PLL1_ENTRY(22, 0, 0, 0), /* 528 Mhz */
+		.mvolt = 1100,
+		.axi_div  = 1, /* /2, 264 Mhz */
+		.ahb_div  = 1, /* /2, 132 Mhz */
+		.abp0_div = 0, /* /2, 66 Mhz */
+	},
+	{
+		A20_PLL1_ENTRY(30, 0, 0, 0), /* 720 Mhz */
+		.mvolt = 1200,
+		.axi_div  = 1, /* /2, 360Mhz */
+		.ahb_div  = 1, /* /2, 180 Mhz */
+		.abp0_div = 0, /* /2, 90 Mhz */
+	},
+	{
+		A20_PLL1_ENTRY(18, 1, 0, 0), /* 864 Mhz */
+		.mvolt = 1300,
+		.axi_div  = 2, /* /3, 288 Mhz */
+		.ahb_div  = 1, /* /2, 144 Mhz */
+		.abp0_div = 0, /* /2, 72 Mhz */
+	},
+	{
+		A20_PLL1_ENTRY(19, 1, 0, 0), /* 912 Mhz */
+		.mvolt = 1400,
+		.axi_div  = 2, /* /3, 304Mhz */
+		.ahb_div  = 1, /* /2, 152 Mhz */
+		.abp0_div = 0, /* /2, 76 Mhz */
+	},
+	{
+		A20_PLL1_ENTRY(20, 1, 0, 0), /* 960 Mhz */
+		.mvolt = 1400,
+		.axi_div  = 2, /* /3, 320Mhz */
+		.ahb_div  = 1, /* /2, 160 Mhz */
+		.abp0_div = 0, /* /2, 80 Mhz */
+	},
+	{
+		A20_PLL1_ENTRY(21, 1, 0, 0), /* 1008 Mhz */
+		.mvolt = 1425,
+		.axi_div  = 2, /* /3, 336 Mhz */
+		.ahb_div  = 1, /* /2, 168 Mhz */
+		.abp0_div = 0, /* /2, 84 Mhz */
+	},
+	{
+		.freq = 0, /* end of array */
+		.mvolt = 0,
+		.pll_n = 0,
+		.pll_k = 0,

CVS commit: [nick-nhusb] src/sys/dev/usb

2015-10-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 17 15:25:38 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: ehci.c

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.234.2.56 -r1.234.2.57 src/sys/dev/usb/ehci.c

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.234.2.56 src/sys/dev/usb/ehci.c:1.234.2.57
--- src/sys/dev/usb/ehci.c:1.234.2.56	Fri Oct 16 17:05:19 2015
+++ src/sys/dev/usb/ehci.c	Sat Oct 17 15:25:38 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.234.2.56 2015/10/16 17:05:19 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.234.2.57 2015/10/17 15:25:38 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.56 2015/10/16 17:05:19 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.57 2015/10/17 15:25:38 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -385,7 +385,7 @@ ehci_init(ehci_softc_t *sc)
 
 	vers = EREAD2(sc, EHCI_HCIVERSION);
 	aprint_verbose("%s: EHCI version %x.%x\n", device_xname(sc->sc_dev),
-	   vers >> 8, vers & 0xff);
+	vers >> 8, vers & 0xff);
 
 	sparams = EREAD4(sc, EHCI_HCSPARAMS);
 	USBHIST_LOG(ehcidebug, "sparams=%#x", sparams, 0, 0, 0);
@@ -925,8 +925,8 @@ ehci_check_itd_intr(ehci_softc_t *sc, st
 	 */
 
 	usb_syncmem(&itd->dma, itd->offs + offsetof(ehci_itd_t, itd_ctl),
-		sizeof(itd->itd.itd_ctl), BUS_DMASYNC_POSTWRITE |
-		BUS_DMASYNC_POSTREAD);
+	sizeof(itd->itd.itd_ctl),
+	BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
 
 	for (i = 0; i < EHCI_ITD_NUFRAMES; i++) {
 		if (le32toh(itd->itd.itd_ctl[i]) & EHCI_ITD_ACTIVE)
@@ -979,8 +979,8 @@ ehci_check_sitd_intr(ehci_softc_t *sc, s
 	 */
 
 	usb_syncmem(&sitd->dma, sitd->offs + offsetof(ehci_sitd_t, sitd_trans),
-	sizeof(sitd->sitd.sitd_trans), BUS_DMASYNC_POSTWRITE |
-		BUS_DMASYNC_POSTREAD);
+	sizeof(sitd->sitd.sitd_trans),
+	BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
 
 	if (le32toh(sitd->sitd.sitd_trans) & EHCI_SITD_ACTIVE)
 		return;
@@ -1775,8 +1775,8 @@ ehci_dump_sqh(ehci_soft_qh_t *sqh)
 	USBHIST_LOGN(ehcidebug, 10, "Overlay qTD:", 0, 0, 0, 0);
 	ehci_dump_qtd(&qh->qh_qtd);
 
-	usb_syncmem(&sqh->dma, sqh->offs,
-	sizeof(sqh->qh), BUS_DMASYNC_PREREAD);
+	usb_syncmem(&sqh->dma, sqh->offs, sizeof(sqh->qh),
+	BUS_DMASYNC_PREREAD);
 }
 
 Static void
@@ -3044,8 +3044,8 @@ ehci_alloc_sitd(ehci_softc_t *sc)
 	LIST_REMOVE(sitd, free_list);
 	memset(&sitd->sitd, 0, sizeof(ehci_sitd_t));
 	usb_syncmem(&sitd->dma, sitd->offs + offsetof(ehci_sitd_t, sitd_next),
-		sizeof(sitd->sitd.sitd_next), BUS_DMASYNC_PREWRITE |
-		BUS_DMASYNC_PREREAD);
+	sizeof(sitd->sitd.sitd_next),
+	BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 
 	sitd->frame_list.next = NULL;
 	sitd->frame_list.prev = NULL;
@@ -4255,7 +4255,7 @@ ehci_device_fs_isoc_start(struct usbd_xf
 	stop->xfer_next = NULL;
 
 	usb_syncmem(&exfer->ex_xfer.ux_dmabuf, 0, total_length,
-		BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+	BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 
 	/*
 	 * Part 2: Transfer descriptors have now been set up, now they must
@@ -4583,7 +4583,7 @@ ehci_device_isoc_start(struct usbd_xfer 
 	stop->xfer_next = NULL;
 
 	usb_syncmem(&exfer->ex_xfer.ux_dmabuf, 0, total_length,
-		BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+	BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 
 	/*
 	 * Part 2: Transfer descriptors have now been set up, now they must



CVS commit: src/sys/external/bsd/drm2/drm

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 15:13:39 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/drm: drm_memory.c

Log Message:
build on platforms without agp_i810


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/drm/drm_memory.c

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

Modified files:

Index: src/sys/external/bsd/drm2/drm/drm_memory.c
diff -u src/sys/external/bsd/drm2/drm/drm_memory.c:1.7 src/sys/external/bsd/drm2/drm/drm_memory.c:1.8
--- src/sys/external/bsd/drm2/drm/drm_memory.c:1.7	Wed Apr 29 04:38:55 2015
+++ src/sys/external/bsd/drm2/drm/drm_memory.c	Sat Oct 17 15:13:39 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_memory.c,v 1.7 2015/04/29 04:38:55 riastradh Exp $	*/
+/*	$NetBSD: drm_memory.c,v 1.8 2015/10/17 15:13:39 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,14 +30,24 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_memory.c,v 1.7 2015/04/29 04:38:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_memory.c,v 1.8 2015/10/17 15:13:39 jmcneill Exp $");
+
+#if defined(__i386__) || defined(__x86_64__)
+#define HAS_AGP_I810	1
+#else
+#define HAS_AGP_I810	0
+#endif
 
 #ifdef _KERNEL_OPT
-#include "agp_i810.h"
-#include "genfb.h"
+# if HAS_AGP_I810 > 0
+#  include "agp_i810.h"
+# else
+#  define NAGP_I810	0
+# endif
+# include "genfb.h"
 #else
-#define	NAGP_I810	1	/* XXX WTF?  */
-#define	NGENFB		0	/* XXX WTF?  */
+# define NAGP_I810	HAS_AGP_I810	/* XXX WTF?  */
+# define NGENFB		0	/* XXX WTF?  */
 #endif
 
 #include 



CVS commit: src/sys/external/bsd/drm2/drm

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 15:13:19 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/drm: drm_cache.c

Log Message:
machine/cpufunc.h is MD, move it to i386/amd64 block


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/drm/drm_cache.c

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

Modified files:

Index: src/sys/external/bsd/drm2/drm/drm_cache.c
diff -u src/sys/external/bsd/drm2/drm/drm_cache.c:1.6 src/sys/external/bsd/drm2/drm/drm_cache.c:1.7
--- src/sys/external/bsd/drm2/drm/drm_cache.c:1.6	Fri Mar  6 12:24:36 2015
+++ src/sys/external/bsd/drm2/drm/drm_cache.c	Sat Oct 17 15:13:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_cache.c,v 1.6 2015/03/06 12:24:36 riastradh Exp $	*/
+/*	$NetBSD: drm_cache.c,v 1.7 2015/10/17 15:13:19 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,15 +30,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_cache.c,v 1.6 2015/03/06 12:24:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_cache.c,v 1.7 2015/10/17 15:13:19 jmcneill Exp $");
 
 #include 
 #include 
 
 #include 
 
-#include 
-
 #include 
 
 #include 
@@ -97,6 +95,8 @@ drm_clflush_virt_range(const void *vaddr
 
 #if defined(__i386__) || defined(__x86_64__)
 
+#include 
+
 static bool
 drm_md_clflush_finegrained_p(void)
 {



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

2015-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Oct 17 15:02:55 UTC 2015

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

Log Message:
The A20 manual says that the pll6 output is (AWIN_REF_FREQ * n * k) / 2,
not (AWIN_REF_FREQ * n * k) / m (m is only used for the SATA clock).
On the boards I tested, m happens to be 2 so the correct value was returned
anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/arm/allwinner/awin_board.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.37 src/sys/arch/arm/allwinner/awin_board.c:1.38
--- src/sys/arch/arm/allwinner/awin_board.c:1.37	Sat Oct 17 15:00:45 2015
+++ src/sys/arch/arm/allwinner/awin_board.c	Sat Oct 17 15:02:55 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: awin_board.c,v 1.37 2015/10/17 15:00:45 bouyer Exp $	*/
+/*	$NetBSD: awin_board.c,v 1.38 2015/10/17 15:02:55 bouyer 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.37 2015/10/17 15:00:45 bouyer Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.38 2015/10/17 15:02:55 bouyer Exp $");
 
 #include 
 #include 
@@ -570,7 +570,7 @@ awin_pll6_get_rate(void)
 	} else {
 		n = __SHIFTOUT(cfg, AWIN_PLL_CFG_FACTOR_N);
 		k = __SHIFTOUT(cfg, AWIN_PLL_CFG_FACTOR_K) + 1;
-		m = __SHIFTOUT(cfg, AWIN_PLL_CFG_FACTOR_M) + 1;
+		m = 2;
 	}
 
 	return (AWIN_REF_FREQ * n * k) / m;



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

2015-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Oct 17 15:00:45 UTC 2015

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

Log Message:
Factor out reading/writing CCM registers in macros


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/allwinner/awin_board.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.36 src/sys/arch/arm/allwinner/awin_board.c:1.37
--- src/sys/arch/arm/allwinner/awin_board.c:1.36	Sat Oct 17 14:46:01 2015
+++ src/sys/arch/arm/allwinner/awin_board.c	Sat Oct 17 15:00:45 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: awin_board.c,v 1.36 2015/10/17 14:46:01 bouyer Exp $	*/
+/*	$NetBSD: awin_board.c,v 1.37 2015/10/17 15:00:45 bouyer 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.36 2015/10/17 14:46:01 bouyer Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.37 2015/10/17 15:00:45 bouyer Exp $");
 
 #include 
 #include 
@@ -86,6 +86,11 @@ struct arm32_bus_dma_tag awin_coherent_d
 	_BUS_DMATAG_FUNCS,
 };
 
+#define CCM_READ4(reg) bus_space_read_4(&armv7_generic_bs_tag, \
+awin_core_bsh, AWIN_CCM_OFFSET + (reg))
+#define CCM_WRITE4(reg, v) bus_space_write_4(&armv7_generic_bs_tag, \
+awin_core_bsh, AWIN_CCM_OFFSET + (reg), (v))
+
 #ifdef AWIN_CONSOLE_EARLY
 #include 
 #include 
@@ -128,9 +133,9 @@ 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)
+	bus_space_tag_t bst = &armv7_generic_bs_tag;
 	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;
@@ -141,8 +146,8 @@ 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(bst, awin_core_bsh,
-	AWIN_CCM_OFFSET + reg);
+	const uint32_t cpu0_cfg = CCM_READ4(reg);
+
 	switch (__SHIFTOUT(cpu0_cfg, AWIN_CPU_CLK_SRC_SEL)) {
 	case AWIN_CPU_CLK_SRC_SEL_LOSC:
 		ci->ci_data.cpu_cc_freq = 32768;
@@ -151,8 +156,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(bst,
-		awin_core_bsh, AWIN_CCM_OFFSET + AWIN_PLL1_CFG_REG);
+		const uint32_t pll1_cfg = CCM_READ4(AWIN_PLL1_CFG_REG);
 		u_int p, n, k, m;
 		if (awin_chip_id() == AWIN_CHIP_ID_A31) {
 			p = 0;
@@ -350,16 +354,12 @@ awin_chip_name(void)
 void
 awin_pll6_enable(void)
 {
-	bus_space_tag_t bst = &armv7_generic_bs_tag;
-	bus_space_handle_t bsh = awin_core_bsh;
-
 	KASSERT(awin_chip_id() != AWIN_CHIP_ID_A80);
 
 	/*
 	 * SATA needs PLL6 to be a 100MHz clock.
 	 */
-	const uint32_t ocfg = bus_space_read_4(bst, bsh,
-	AWIN_CCM_OFFSET + AWIN_PLL6_CFG_REG);
+	const uint32_t ocfg = CCM_READ4(AWIN_PLL6_CFG_REG);
 
 	/*
 	 * Output freq is 24MHz * n * k / m / 6.
@@ -380,13 +380,11 @@ awin_pll6_enable(void)
 	}
 	ncfg |= AWIN_PLL_CFG_ENABLE;
 	if (ncfg != ocfg) {
-		bus_space_write_4(bst, bsh,
-		AWIN_CCM_OFFSET + AWIN_PLL6_CFG_REG, ncfg);
+		CCM_WRITE4(AWIN_PLL6_CFG_REG, ncfg);
 
 		if (awin_chip_id() == AWIN_CHIP_ID_A31) {
 			do {
-ncfg = bus_space_read_4(bst, bsh,
-AWIN_CCM_OFFSET + AWIN_PLL6_CFG_REG);
+ncfg = CCM_READ4(AWIN_PLL6_CFG_REG);
 			} while ((ncfg & AWIN_A31_PLL6_CFG_LOCK) == 0);
 		}
 	}
@@ -402,14 +400,10 @@ awin_pll6_enable(void)
 void
 awin_pll2_enable(void)
 {
-	bus_space_tag_t bst = &armv7_generic_bs_tag;
-	bus_space_handle_t bsh = awin_core_bsh;
-
 	/*
   	 * AC (at 48kHz) needs PLL2 to be 24576000 Hz
   	 */
-	const uint32_t ocfg = bus_space_read_4(bst, bsh,
-	AWIN_CCM_OFFSET + AWIN_PLL2_CFG_REG);
+	const uint32_t ocfg = CCM_READ4(AWIN_PLL2_CFG_REG);
 
 	uint32_t ncfg = ocfg;
 
@@ -432,13 +426,11 @@ awin_pll2_enable(void)
 	}
 
 	if (ncfg != ocfg) {
-		bus_space_write_4(bst, bsh,
-		AWIN_CCM_OFFSET + AWIN_PLL2_CFG_REG, ncfg);
+		CCM_WRITE4(AWIN_PLL2_CFG_REG, ncfg);
 
 		if (awin_chip_id() == AWIN_CHIP_ID_A31) {
 			do {
-ncfg = bus_space_read_4(bst, bsh,
-AWIN_CCM_OFFSET + AWIN_PLL2_CFG_REG);
+ncfg = CCM_READ4(AWIN_PLL2_CFG_REG);
 			} while ((ncfg & AWIN_A31_PLL2_CFG_LOCK) == 0);
 		}
 	}
@@ -447,14 +439,10 @@ awin_pll2_enable(void)
 void
 awin_pll3_enable(void)
 {
-	bus_space_tag_t bst = &armv7_generic_bs_tag;
-	bus_space_handle_t bsh = awin_core_bsh;
-
 	/*
 	 * HDMI needs PLL3 to be 2970 Hz
 	 */
-	const uint32_t ocfg = bus_space_read_4(bst, bsh,
-	AWIN_CCM_OFFSET + AWIN_PLL3_CFG_REG);
+	const uint32_t ocfg = CCM_READ4(AWIN_PLL3_CFG_REG);
 
 	uint32_t ncfg = ocfg;
 
@@ -470,13 +4

CVS commit: src/sys/external/bsd/drm2/include/linux

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 14:54:10 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/include/linux: pci.h

Log Message:
Don't include ACPI headers unless NACPICA > 0


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/external/bsd/drm2/include/linux/pci.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/external/bsd/drm2/include/linux/pci.h
diff -u src/sys/external/bsd/drm2/include/linux/pci.h:1.19 src/sys/external/bsd/drm2/include/linux/pci.h:1.20
--- src/sys/external/bsd/drm2/include/linux/pci.h:1.19	Wed Jun 24 19:46:30 2015
+++ src/sys/external/bsd/drm2/include/linux/pci.h	Sat Oct 17 14:54:10 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci.h,v 1.19 2015/06/24 19:46:30 riastradh Exp $	*/
+/*	$NetBSD: pci.h,v 1.20 2015/10/17 14:54:10 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -54,8 +54,12 @@
 #include 
 #include 
 
+#if NACPICA > 0
 #include 
 #include 
+#else
+struct acpi_devnode;
+#endif
 
 #include 
 #include 



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

2015-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Oct 17 14:46:01 UTC 2015

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

Log Message:
awin_cpu_clk(): Fix reading of CPU_CLK_SRC_CEL bits: doing a shiftin followed
by a shiftout ends up reading bits(0,1) instead of AWIN_CPU_CLK_SRC_SEL.
It happens that these bits (AWIN_AXI_CLK_DIV_RATIO) are 2 (divide by 3) at boot
(at last on cubieboard2 and olimex lime2), which matches
AWIN_CPU_CLK_SRC_SEL_PLL1, so this has gone  unnoticed.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/allwinner/awin_board.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.35 src/sys/arch/arm/allwinner/awin_board.c:1.36
--- src/sys/arch/arm/allwinner/awin_board.c:1.35	Mon Apr 20 01:33:22 2015
+++ src/sys/arch/arm/allwinner/awin_board.c	Sat Oct 17 14:46:01 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: awin_board.c,v 1.35 2015/04/20 01:33:22 matt Exp $	*/
+/*	$NetBSD: awin_board.c,v 1.36 2015/10/17 14:46:01 bouyer 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.35 2015/04/20 01:33:22 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.36 2015/10/17 14:46:01 bouyer Exp $");
 
 #include 
 #include 
@@ -143,8 +143,7 @@ awin_cpu_clk(void)
   AWIN_CPU_AHB_APB0_CFG_REG;
 	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)) {
+	switch (__SHIFTOUT(cpu0_cfg, AWIN_CPU_CLK_SRC_SEL)) {
 	case AWIN_CPU_CLK_SRC_SEL_LOSC:
 		ci->ci_data.cpu_cc_freq = 32768;
 		break;



CVS commit: src/sys/net/npf

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 13:53:40 UTC 2015

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

Log Message:
mark this MODULE_CLASS_MISC as npf_init cannot run when builtin driver modules 
are initialized


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/net/npf/npf.c

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

Modified files:

Index: src/sys/net/npf/npf.c
diff -u src/sys/net/npf/npf.c:1.23 src/sys/net/npf/npf.c:1.24
--- src/sys/net/npf/npf.c:1.23	Thu Aug 20 14:40:19 2015
+++ src/sys/net/npf/npf.c	Sat Oct 17 13:53:40 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf.c,v 1.23 2015/08/20 14:40:19 christos Exp $	*/
+/*	$NetBSD: npf.c,v 1.24 2015/10/17 13:53:40 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2009-2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.23 2015/08/20 14:40:19 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.24 2015/10/17 13:53:40 jmcneill Exp $");
 
 #include 
 #include 
@@ -59,7 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.23
 /*
  * Module and device structures.
  */
-MODULE(MODULE_CLASS_DRIVER, npf, NULL);
+MODULE(MODULE_CLASS_MISC, npf, NULL);
 
 static int	npf_fini(void);
 static int	npf_dev_open(dev_t, int, int, lwp_t *);



CVS commit: src/sys/kern

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 13:52:52 UTC 2015

Modified Files:
src/sys/kern: init_main.c

Log Message:
initialize MODULE_CLASS_DRIVER modules before the drivers themselves are loaded 
during autoconfiguration


To generate a diff of this commit:
cvs rdiff -u -r1.470 -r1.471 src/sys/kern/init_main.c

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

Modified files:

Index: src/sys/kern/init_main.c
diff -u src/sys/kern/init_main.c:1.470 src/sys/kern/init_main.c:1.471
--- src/sys/kern/init_main.c:1.470	Mon Sep 14 01:40:03 2015
+++ src/sys/kern/init_main.c	Sat Oct 17 13:52:52 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.470 2015/09/14 01:40:03 uebayasi Exp $	*/
+/*	$NetBSD: init_main.c,v 1.471 2015/10/17 13:52:52 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.470 2015/09/14 01:40:03 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.471 2015/10/17 13:52:52 jmcneill Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ipsec.h"
@@ -739,6 +739,9 @@ configure(void)
 	drvctl_init();
 #endif
 
+	/* Initialize driver modules */
+	module_init_class(MODULE_CLASS_DRIVER);
+
 	userconf_init();
 	if (boothowto & RB_USERCONF)
 		userconf_prompt();



CVS commit: src/sys/external/bsd/drm2/nouveau

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 12:02:44 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/nouveau: files.nouveau nouveau_module.c
nouveau_pci.c nouveau_pci.h nouveaufb.c

Log Message:
Split nouveau@pci from nouveau so we can attach it to other busses.
nouveaufb still depends on nouveau_pci, but it is not applicable to
non-PCI devices anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/nouveau/files.nouveau
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/nouveau/nouveau_module.c \
src/sys/external/bsd/drm2/nouveau/nouveau_pci.c
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/drm2/nouveau/nouveau_pci.h
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/nouveau/nouveaufb.c

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

Modified files:

Index: src/sys/external/bsd/drm2/nouveau/files.nouveau
diff -u src/sys/external/bsd/drm2/nouveau/files.nouveau:1.8 src/sys/external/bsd/drm2/nouveau/files.nouveau:1.9
--- src/sys/external/bsd/drm2/nouveau/files.nouveau:1.8	Fri Mar  6 01:43:07 2015
+++ src/sys/external/bsd/drm2/nouveau/files.nouveau	Sat Oct 17 12:02:44 2015
@@ -1,14 +1,15 @@
-#	$NetBSD: files.nouveau,v 1.8 2015/03/06 01:43:07 riastradh Exp $
+#	$NetBSD: files.nouveau,v 1.9 2015/10/17 12:02:44 jmcneill Exp $
 
 define	nouveaufbbus	{ }
-device	nouveau: drmkms, drmkms_pci, drmkms_ttm, nouveaufbbus
-attach	nouveau at pci
+device	nouveau: drmkms, drmkms_ttm, nouveaufbbus
+
+attach	nouveau at pci with nouveau_pci: drmkms_pci
+file	external/bsd/drm2/nouveau/nouveau_pci.c			nouveau
 
 device	nouveaufb: nouveaufbbus, drmfb, drmfb_pci, wsemuldisplaydev
 attach	nouveaufb at nouveaufbbus
 
 # Local additions.  External sources are listd below.
-file	external/bsd/drm2/nouveau/nouveau_pci.c			nouveau
 file	external/bsd/drm2/nouveau/nouveau_sysfs.c		nouveau
 file	external/bsd/drm2/nouveau/nouveau_vga.c			nouveau
 file	external/bsd/drm2/nouveau/nouveaufb.c			nouveaufb

Index: src/sys/external/bsd/drm2/nouveau/nouveau_module.c
diff -u src/sys/external/bsd/drm2/nouveau/nouveau_module.c:1.3 src/sys/external/bsd/drm2/nouveau/nouveau_module.c:1.4
--- src/sys/external/bsd/drm2/nouveau/nouveau_module.c:1.3	Wed Nov 12 03:14:00 2014
+++ src/sys/external/bsd/drm2/nouveau/nouveau_module.c	Sat Oct 17 12:02:44 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_module.c,v 1.3 2014/11/12 03:14:00 christos Exp $	*/
+/*	$NetBSD: nouveau_module.c,v 1.4 2015/10/17 12:02:44 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,13 +30,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_module.c,v 1.3 2014/11/12 03:14:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_module.c,v 1.4 2015/10/17 12:02:44 jmcneill Exp $");
 
 #include 
 #include 
-#ifndef _MODULE
-#include 
-#endif
 #include 
 
 #include 
@@ -45,7 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: nouveau_modu
 #include 
 #include 
 
-MODULE(MODULE_CLASS_DRIVER, nouveau, "drmkms,drmkms_pci"); /* XXX drmkms_i2c, drmkms_ttm */
+MODULE(MODULE_CLASS_DRIVER, nouveau, "drmkms"); /* XXX drmkms_i2c, drmkms_ttm */
 
 #ifdef _MODULE
 #include "ioconf.c"
@@ -58,53 +55,20 @@ extern struct drm_driver *const nouveau_
 static int
 nouveau_init(void)
 {
-	extern int drm_guarantee_initialized(void);
-	int error;
-
-	error = drm_guarantee_initialized();
-	if (error)
-		return error;
-
-	error = drm_pci_init(nouveau_drm_driver, NULL);
-	if (error) {
-		aprint_error("nouveau: failed to init pci: %d\n", error);
-		return error;
-	}
-
 	nouveau_objects_init();
 	nouveau_devices_init();
-#if 0/* XXX nouveau acpi */
-	nouveau_register_dsm_handler();
-#endif
 	drm_sysctl_init(&nouveau_def);
 
 	return 0;
 }
 
-int	nouveau_guarantee_initialized(void); /* XXX */
-int
-nouveau_guarantee_initialized(void)
-{
-#ifdef _MODULE
-	return 0;
-#else
-	static ONCE_DECL(nouveau_init_once);
-
-	return RUN_ONCE(&nouveau_init_once, &nouveau_init);
-#endif
-}
-
 static void
 nouveau_fini(void)
 {
 
 	drm_sysctl_fini(&nouveau_def);
-#if 0/* XXX nouveau acpi */
-	nouveau_unregister_dsm_handler();
-#endif
 	nouveau_devices_fini();
 	nouveau_objects_fini();
-	drm_pci_exit(nouveau_drm_driver, NULL);
 }
 
 static int
@@ -114,11 +78,7 @@ nouveau_modcmd(modcmd_t cmd, void *arg _
 
 	switch (cmd) {
 	case MODULE_CMD_INIT:
-#ifdef _MODULE
 		error = nouveau_init();
-#else
-		error = nouveau_guarantee_initialized();
-#endif
 		if (error) {
 			aprint_error("nouveau: failed to initialize: %d\n",
 			error);
Index: src/sys/external/bsd/drm2/nouveau/nouveau_pci.c
diff -u src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.3 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.4
--- src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.3	Fri Mar  6 15:39:28 2015
+++ src/sys/external/bsd/drm2/nouveau/nouveau_pci.c	Sat Oct 17 12:02:44 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_pci.c,v 1.3 2015/03/06 15:39:28 riastradh Exp $	*/
+/*	$NetBSD: nouve

CVS commit: [nick-nhusb] src/sys/dev/usb

2015-10-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 17 10:24:59 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: TODO.usbmp if_athn_usb.c if_athn_usb.h

Log Message:
Remove a tsleep


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.2 -r1.8.4.3 src/sys/dev/usb/TODO.usbmp
cvs rdiff -u -r1.6.8.6 -r1.6.8.7 src/sys/dev/usb/if_athn_usb.c
cvs rdiff -u -r1.2.16.2 -r1.2.16.3 src/sys/dev/usb/if_athn_usb.h

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

Modified files:

Index: src/sys/dev/usb/TODO.usbmp
diff -u src/sys/dev/usb/TODO.usbmp:1.8.4.2 src/sys/dev/usb/TODO.usbmp:1.8.4.3
--- src/sys/dev/usb/TODO.usbmp:1.8.4.2	Mon Apr  6 15:18:13 2015
+++ src/sys/dev/usb/TODO.usbmp	Sat Oct 17 10:24:58 2015
@@ -1,4 +1,4 @@
-$NetBSD: TODO.usbmp,v 1.8.4.2 2015/04/06 15:18:13 skrll Exp $
+$NetBSD: TODO.usbmp,v 1.8.4.3 2015/10/17 10:24:58 skrll Exp $
 
 
 the majority of the USB MP device interface is documented in usbdivar.h.
@@ -90,7 +90,6 @@ splusb drivers:
   - udsir.c
 
 wakeup/tsleep drivers:
-  - if_athn_usb.c
   - if_otus.c
   - if_run.c
   - if_upgt.c

Index: src/sys/dev/usb/if_athn_usb.c
diff -u src/sys/dev/usb/if_athn_usb.c:1.6.8.6 src/sys/dev/usb/if_athn_usb.c:1.6.8.7
--- src/sys/dev/usb/if_athn_usb.c:1.6.8.6	Tue Oct  6 21:32:15 2015
+++ src/sys/dev/usb/if_athn_usb.c	Sat Oct 17 10:24:59 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_athn_usb.c,v 1.6.8.6 2015/10/06 21:32:15 skrll Exp $	*/
+/*	$NetBSD: if_athn_usb.c,v 1.6.8.7 2015/10/17 10:24:59 skrll Exp $	*/
 /*	$OpenBSD: if_athn_usb.c,v 1.12 2013/01/14 09:50:31 jsing Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.6.8.6 2015/10/06 21:32:15 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.6.8.7 2015/10/17 10:24:59 skrll Exp $");
 
 #ifdef	_KERNEL_OPT
 #include "opt_inet.h"
@@ -267,6 +267,7 @@ athn_usb_attach(device_t parent, device_
 	sc->sc_ops.write = athn_usb_write;
 	sc->sc_ops.write_barrier = athn_usb_write_barrier;
 
+	cv_init(&usc->usc_task_cv, "athntsk");
 	mutex_init(&usc->usc_task_mtx, MUTEX_DEFAULT, IPL_NET);
 	mutex_init(&usc->usc_tx_mtx, MUTEX_DEFAULT, IPL_NONE);
 
@@ -466,6 +467,7 @@ athn_usb_detach(device_t self, int flags
 
 	mutex_destroy(&usc->usc_tx_mtx);
 	mutex_destroy(&usc->usc_task_mtx);
+	cv_destroy(&usc->usc_task_cv);
 
 	usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, usc->usc_udev, sc->sc_dev);
 	return 0;
@@ -781,8 +783,10 @@ athn_usb_wait_async(struct athn_usb_soft
 	DPRINTFN(DBG_FN, usc, "\n");
 
 	/* Wait for all queued asynchronous commands to complete. */
+	mutex_spin_enter(&usc->usc_task_mtx);
 	while (usc->usc_cmdq.queued > 0)
-		tsleep(&usc->usc_cmdq, 0, "cmdq", 0);
+		cv_wait(&usc->usc_task_cv, &usc->usc_task_mtx);
+	mutex_spin_exit(&usc->usc_task_mtx);
 }
 
 Static int

Index: src/sys/dev/usb/if_athn_usb.h
diff -u src/sys/dev/usb/if_athn_usb.h:1.2.16.2 src/sys/dev/usb/if_athn_usb.h:1.2.16.3
--- src/sys/dev/usb/if_athn_usb.h:1.2.16.2	Thu Mar 19 17:26:42 2015
+++ src/sys/dev/usb/if_athn_usb.h	Sat Oct 17 10:24:59 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_athn_usb.h,v 1.2.16.2 2015/03/19 17:26:42 skrll Exp $	*/
+/*	$NetBSD: if_athn_usb.h,v 1.2.16.3 2015/10/17 10:24:59 skrll Exp $	*/
 /*	$OpenBSD: if_athn_usb.h,v 1.3 2012/11/10 14:35:06 mikeb Exp $	*/
 
 /*-
@@ -443,6 +443,7 @@ struct athn_usb_softc {
 
 	intusc_athn_attached;
 
+	kcondvar_t			usc_task_cv;
 	kmutex_t			usc_task_mtx;
 	kmutex_t			usc_tx_mtx;