CVS commit: src/distrib/sets/lists

2019-12-30 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Tue Dec 31 05:01:49 UTC 2019

Modified Files:
src/distrib/sets/lists/xdebug: md.shark shl.mi
src/distrib/sets/lists/xserver: md.dreamcast md.evbmips md.hpcarm
md.hpcmips md.hpcsh md.ibmnws md.shark md.zaurus

Log Message:
Done giving syspkg names without xorg_server_ver=110


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/distrib/sets/lists/xdebug/md.shark
cvs rdiff -u -r1.53 -r1.54 src/distrib/sets/lists/xdebug/shl.mi
cvs rdiff -u -r1.27 -r1.28 src/distrib/sets/lists/xserver/md.dreamcast
cvs rdiff -u -r1.12 -r1.13 src/distrib/sets/lists/xserver/md.evbmips
cvs rdiff -u -r1.26 -r1.27 src/distrib/sets/lists/xserver/md.hpcarm
cvs rdiff -u -r1.32 -r1.33 src/distrib/sets/lists/xserver/md.hpcmips
cvs rdiff -u -r1.25 -r1.26 src/distrib/sets/lists/xserver/md.hpcsh
cvs rdiff -u -r1.7 -r1.8 src/distrib/sets/lists/xserver/md.ibmnws
cvs rdiff -u -r1.54 -r1.55 src/distrib/sets/lists/xserver/md.shark
cvs rdiff -u -r1.22 -r1.23 src/distrib/sets/lists/xserver/md.zaurus

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/xdebug/md.shark
diff -u src/distrib/sets/lists/xdebug/md.shark:1.17 src/distrib/sets/lists/xdebug/md.shark:1.18
--- src/distrib/sets/lists/xdebug/md.shark:1.17	Mon Dec 30 05:37:19 2019
+++ src/distrib/sets/lists/xdebug/md.shark	Tue Dec 31 05:01:49 2019
@@ -1,4 +1,4 @@
-# $NetBSD: md.shark,v 1.17 2019/12/30 05:37:19 uki Exp $
+# $NetBSD: md.shark,v 1.18 2019/12/31 05:01:49 uki Exp $
 ./usr/X11R7/lib/modules/extensions/libcfb32_g.a		xdebug-obsolete	xorg,obsolete
 ./usr/X11R7/lib/modules/extensions/libcfb_g.a		xdebug-obsolete	xorg,obsolete
 ./usr/X11R7/lib/modules/extensions/libdbe_g.a		xdebug-obsolete	xorg,obsolete
@@ -34,7 +34,7 @@
 ./usr/libdata/debug/usr/X11R7/bin/gtf.debug	xdebug-xorg-server-debug	xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/chips_drv.so.1.debug		xdebug-xf86-video-chips-debug	xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/igs_drv.so.0.debug		-unknown-	xorg,debug,xorg_server_ver=110
-./usr/libdata/debug/usr/X11R7/lib/modules/drivers/igs_drv.so.0.debug		-unknown-	xorg,debug,xorg_server_ver=120
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/igs_drv.so.0.debug		xdebug-xf86-video-igs-debug	xorg,debug,xorg_server_ver=120
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/kbd_drv.so.1.debug		xdebug-xf86-input-keyboard-debug	xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libchips_drv.so.1.debug	xdebug-obsolete	xorg,obsolete
 ./usr/libdata/debug/usr/X11R7/lib/modules/drivers/libigs_drv.so.0.debug	xdebug-obsolete	xorg,obsolete

Index: src/distrib/sets/lists/xdebug/shl.mi
diff -u src/distrib/sets/lists/xdebug/shl.mi:1.53 src/distrib/sets/lists/xdebug/shl.mi:1.54
--- src/distrib/sets/lists/xdebug/shl.mi:1.53	Sun Nov  3 01:35:47 2019
+++ src/distrib/sets/lists/xdebug/shl.mi	Tue Dec 31 05:01:49 2019
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.53 2019/11/03 01:35:47 uki Exp $
+# $NetBSD: shl.mi,v 1.54 2019/12/31 05:01:49 uki Exp $
 ./usr/libdata/debug/usr/X11R7/lib	base-sys-usr		xorg,debug,compatx11dir
 ./usr/libdata/debug/usr/X11R7/lib/X11/locale/lib/common/libximcp.so.2.0.debug	xorg,obsolete		xorg,obsolete
 ./usr/libdata/debug/usr/X11R7/lib/X11/locale/lib/common/libxlcDef.so.2.0.debug	xorg,obsolete		xorg,obsolete
@@ -26,7 +26,7 @@
 ./usr/libdata/debug/usr/X11R7/lib/libXTrap.so.7.0.debug	xdebug-libXTrap-debug		xorg,debug,compatx11file
 ./usr/libdata/debug/usr/X11R7/lib/libXau.so.7.0.debug	xdebug-libXau-debug		xorg,debug,compatx11file
 ./usr/libdata/debug/usr/X11R7/lib/libXaw6.so.7.0.debug	xdebug-libXaw6-debug		xorg,debug,compatx11file
-./usr/libdata/debug/usr/X11R7/lib/libXaw7.so.10.0.debug	-unknown		xorg,debug,compatx11file
+./usr/libdata/debug/usr/X11R7/lib/libXaw7.so.10.0.debug	xdebug-libXaw7-debug		xorg,debug,compatx11file
 ./usr/libdata/debug/usr/X11R7/lib/libXcomposite.so.2.0.debug	xdebug-libXcomposite-debug		xorg,debug,compatx11file
 ./usr/libdata/debug/usr/X11R7/lib/libXcursor.so.2.0.debug	xdebug-libXcursor-debug		xorg,debug,compatx11file
 ./usr/libdata/debug/usr/X11R7/lib/libXdamage.so.2.0.debug	xdebug-libXdamage-debug		xorg,debug,compatx11file

Index: src/distrib/sets/lists/xserver/md.dreamcast
diff -u src/distrib/sets/lists/xserver/md.dreamcast:1.27 src/distrib/sets/lists/xserver/md.dreamcast:1.28
--- src/distrib/sets/lists/xserver/md.dreamcast:1.27	Sat Oct 26 07:31:39 2019
+++ src/distrib/sets/lists/xserver/md.dreamcast	Tue Dec 31 05:01:49 2019
@@ -1,6 +1,6 @@
-#	$NetBSD: md.dreamcast,v 1.27 2019/10/26 07:31:39 uki Exp $
-./etc/X11/xorg.conf.jpkbd-unknown-	xorg
-./etc/X11/xorg.conf.uskbd-unknown-	xorg
+#	$NetBSD: md.dreamcast,v 1.28 2019/12/31 05:01:49 uki Exp $
+./etc/X11/xorg.conf.jpkbdxserver-xorg-server-etc	xorg
+./etc/X11/xorg.conf.uskbdxserver-xorg-server-etc	xorg
 ./usr/X11R7/bin/X	xserver-xorg-server-bin	xorg

CVS commit: src/distrib/sets/lists

2019-12-30 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Tue Dec 31 05:01:49 UTC 2019

Modified Files:
src/distrib/sets/lists/xdebug: md.shark shl.mi
src/distrib/sets/lists/xserver: md.dreamcast md.evbmips md.hpcarm
md.hpcmips md.hpcsh md.ibmnws md.shark md.zaurus

Log Message:
Done giving syspkg names without xorg_server_ver=110


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/distrib/sets/lists/xdebug/md.shark
cvs rdiff -u -r1.53 -r1.54 src/distrib/sets/lists/xdebug/shl.mi
cvs rdiff -u -r1.27 -r1.28 src/distrib/sets/lists/xserver/md.dreamcast
cvs rdiff -u -r1.12 -r1.13 src/distrib/sets/lists/xserver/md.evbmips
cvs rdiff -u -r1.26 -r1.27 src/distrib/sets/lists/xserver/md.hpcarm
cvs rdiff -u -r1.32 -r1.33 src/distrib/sets/lists/xserver/md.hpcmips
cvs rdiff -u -r1.25 -r1.26 src/distrib/sets/lists/xserver/md.hpcsh
cvs rdiff -u -r1.7 -r1.8 src/distrib/sets/lists/xserver/md.ibmnws
cvs rdiff -u -r1.54 -r1.55 src/distrib/sets/lists/xserver/md.shark
cvs rdiff -u -r1.22 -r1.23 src/distrib/sets/lists/xserver/md.zaurus

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



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

2019-12-30 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Tue Dec 31 01:54:19 UTC 2019

Modified Files:
src/distrib/sets/lists/xserver: md.macppc

Log Message:
Give syspkg name to macppc machine dependency files


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/distrib/sets/lists/xserver/md.macppc

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/xserver/md.macppc
diff -u src/distrib/sets/lists/xserver/md.macppc:1.80 src/distrib/sets/lists/xserver/md.macppc:1.81
--- src/distrib/sets/lists/xserver/md.macppc:1.80	Sat Oct 26 07:31:39 2019
+++ src/distrib/sets/lists/xserver/md.macppc	Tue Dec 31 01:54:19 2019
@@ -1,4 +1,4 @@
-# $NetBSD: md.macppc,v 1.80 2019/10/26 07:31:39 uki Exp $
+# $NetBSD: md.macppc,v 1.81 2019/12/31 01:54:19 uki Exp $
 ./usr/X11R7/bin/X	xserver-xorg-server-bin	xorg
 ./usr/X11R7/bin/Xorg	xserver-xorg-server-bin	xorg
 ./usr/X11R7/bin/cvt	xserver-xorg-server-bin	xorg
@@ -31,8 +31,8 @@
 ./usr/X11R7/lib/modules/drivers/ati_drv.so.6		xserver-xf86-video-ati-drivers	xorg
 ./usr/X11R7/lib/modules/drivers/chips_drv.so		xserver-xf86-video-chips-drivers	xorg
 ./usr/X11R7/lib/modules/drivers/chips_drv.so.1		xserver-xf86-video-chips-drivers	xorg
-./usr/X11R7/lib/modules/drivers/glint_drv.so		-unknown-	xorg
-./usr/X11R7/lib/modules/drivers/glint_drv.so.1		-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/glint_drv.so		xserver-xf86-video-glint-drivers	xorg
+./usr/X11R7/lib/modules/drivers/glint_drv.so.1		xserver-xf86-video-glint-drivers	xorg
 ./usr/X11R7/lib/modules/drivers/imstt_drv.so		xserver-obsolete	obsolete
 ./usr/X11R7/lib/modules/drivers/imstt_drv.so.1		xserver-obsolete	obsolete
 ./usr/X11R7/lib/modules/drivers/kbd_drv.so		xserver-xf86-input-keyboard-drivers	xorg
@@ -186,7 +186,7 @@
 ./usr/X11R7/man/cat4/ati.0xserver-xf86-video-ati-catman	.cat,xorg
 ./usr/X11R7/man/cat4/chips.0xserver-xf86-video-chips-catman	.cat,xorg
 ./usr/X11R7/man/cat4/exa.0xserver-xf86-video-exa-catman	.cat,xorg
-./usr/X11R7/man/cat4/glint.0-unknown-	.cat,xorg
+./usr/X11R7/man/cat4/glint.0xserver-xf86-video-glint-catman	.cat,xorg
 ./usr/X11R7/man/cat4/imstt.0xserver-obsolete	obsolete
 ./usr/X11R7/man/cat4/kbd.0xserver-xf86-input-keyboard-catman	.cat,xorg
 ./usr/X11R7/man/cat4/mga.0xserver-xf86-video-mga-catman	.cat,xorg
@@ -208,7 +208,7 @@
 ./usr/X11R7/man/html4/ati.htmlxserver-xf86-video-ati-htmlman	html,xorg
 ./usr/X11R7/man/html4/chips.html			xserver-xf86-video-chips-htmlman	html,xorg
 ./usr/X11R7/man/html4/exa.htmlxserver-xf86-video-exa-htmlman	html,xorg
-./usr/X11R7/man/html4/glint.html			-unknown-	html,xorg
+./usr/X11R7/man/html4/glint.html			xserver-xf86-video-glint-htmlman	html,xorg
 ./usr/X11R7/man/html4/imstt.html			xserver-obsolete	obsolete
 ./usr/X11R7/man/html4/kbd.htmlxserver-xf86-input-keyboard-htmlman	html,xorg
 ./usr/X11R7/man/html4/mga.htmlxserver-xf86-video-mga-htmlman	html,xorg
@@ -230,7 +230,7 @@
 ./usr/X11R7/man/man4/ati.4xserver-xf86-video-ati-man	.man,xorg
 ./usr/X11R7/man/man4/chips.4xserver-xf86-video-chips-man	.man,xorg
 ./usr/X11R7/man/man4/exa.4xserver-xf86-video-exa-man	.man,xorg
-./usr/X11R7/man/man4/glint.4-unknown-	.man,xorg
+./usr/X11R7/man/man4/glint.4xserver-xf86-video-glint-man	.man,xorg
 ./usr/X11R7/man/man4/imstt.4xserver-obsolete	obsolete
 ./usr/X11R7/man/man4/kbd.4xserver-xf86-input-keyboard-man	.man,xorg
 ./usr/X11R7/man/man4/mga.4xserver-xf86-video-mga-man	.man,xorg



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

2019-12-30 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Tue Dec 31 01:54:19 UTC 2019

Modified Files:
src/distrib/sets/lists/xserver: md.macppc

Log Message:
Give syspkg name to macppc machine dependency files


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/distrib/sets/lists/xserver/md.macppc

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



CVS commit: src/distrib/sets/lists

2019-12-30 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Tue Dec 31 01:20:06 UTC 2019

Modified Files:
src/distrib/sets/lists/xdebug: md.x68k
src/distrib/sets/lists/xserver: md.x68k

Log Message:
Give syspkg name to x68k machine dependency files


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/sets/lists/xdebug/md.x68k
cvs rdiff -u -r1.20 -r1.21 src/distrib/sets/lists/xserver/md.x68k

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/xdebug/md.x68k
diff -u src/distrib/sets/lists/xdebug/md.x68k:1.4 src/distrib/sets/lists/xdebug/md.x68k:1.5
--- src/distrib/sets/lists/xdebug/md.x68k:1.4	Thu Jun 13 13:37:56 2019
+++ src/distrib/sets/lists/xdebug/md.x68k	Tue Dec 31 01:20:06 2019
@@ -1,2 +1,2 @@
-# $NetBSD: md.x68k,v 1.4 2019/06/13 13:37:56 christos Exp $
-./usr/libdata/debug/usr/X11R7/bin/X68k.debug	-unknown-	xorg,debug
+# $NetBSD: md.x68k,v 1.5 2019/12/31 01:20:06 uki Exp $
+./usr/libdata/debug/usr/X11R7/bin/X68k.debug	xdebug-xorg-server-debug	xorg,debug

Index: src/distrib/sets/lists/xserver/md.x68k
diff -u src/distrib/sets/lists/xserver/md.x68k:1.20 src/distrib/sets/lists/xserver/md.x68k:1.21
--- src/distrib/sets/lists/xserver/md.x68k:1.20	Sat Oct 26 07:31:39 2019
+++ src/distrib/sets/lists/xserver/md.x68k	Tue Dec 31 01:20:06 2019
@@ -1,6 +1,6 @@
-# $NetBSD: md.x68k,v 1.20 2019/10/26 07:31:39 uki Exp $
+# $NetBSD: md.x68k,v 1.21 2019/12/31 01:20:06 uki Exp $
 ./usr/X11R7/bin/X	xserver-xorg-server-bin	xorg
-./usr/X11R7/bin/X68k	-unknown-	xorg
-./usr/X11R7/man/cat1/X68k.0-unknown-	.cat,xorg
-./usr/X11R7/man/html1/X68k.html-unknown-	html,xorg
-./usr/X11R7/man/man1/X68k.1-unknown-	.man,xorg
+./usr/X11R7/bin/X68k	xserver-xorg-server-bin	xorg
+./usr/X11R7/man/cat1/X68k.0xserver-xorg-server-catman	.cat,xorg
+./usr/X11R7/man/html1/X68k.htmlxserver-xorg-server-htmlman	html,xorg
+./usr/X11R7/man/man1/X68k.1xserver-xorg-server-man	.man,xorg



CVS commit: src/distrib/sets/lists

2019-12-30 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Tue Dec 31 01:20:06 UTC 2019

Modified Files:
src/distrib/sets/lists/xdebug: md.x68k
src/distrib/sets/lists/xserver: md.x68k

Log Message:
Give syspkg name to x68k machine dependency files


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/sets/lists/xdebug/md.x68k
cvs rdiff -u -r1.20 -r1.21 src/distrib/sets/lists/xserver/md.x68k

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



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

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Dec 31 01:00:23 UTC 2019

Modified Files:
src/sys/external/bsd/vchiq/conf: files.vchiq
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm:
vchiq_kmod_netbsd.c vchiq_netbsd.h
Added Files:
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm:
vchiq_netbsd_acpi.c vchiq_netbsd_fdt.c

Log Message:
Split vchiq into separate fdt and acpi attachments.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/vchiq/conf/files.vchiq
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kmod_netbsd.c
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd.h
cvs rdiff -u -r0 -r1.1 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_acpi.c \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_fdt.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/vchiq/conf/files.vchiq
diff -u src/sys/external/bsd/vchiq/conf/files.vchiq:1.3 src/sys/external/bsd/vchiq/conf/files.vchiq:1.4
--- src/sys/external/bsd/vchiq/conf/files.vchiq:1.3	Sun Dec 10 21:38:27 2017
+++ src/sys/external/bsd/vchiq/conf/files.vchiq	Tue Dec 31 01:00:22 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.vchiq,v 1.3 2017/12/10 21:38:27 skrll Exp $
+#	$NetBSD: files.vchiq,v 1.4 2019/12/31 01:00:22 jmcneill Exp $
 #
 # Broadcom VideoCore IV
 #
@@ -6,7 +6,6 @@
 define	vchiqbus { }
 
 device	vchiq: vchiqbus
-attach	vchiq at fdt
 file	external/bsd/vchiq/dist/interface/compat/vchi_bsd.c		vchiq
 file	external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c	vchiq
 file	external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c		vchiq
@@ -17,4 +16,12 @@ file	external/bsd/vchiq/dist/interface/v
 file	external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kern_lib.c	vchiq
 file	external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kmod_netbsd.c	vchiq
 
+attach	vchiq at fdt with vchiq_fdt
+file	external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_fdt.c	vchiq_fdt
+
+ifdef acpinodebus
+attach	vchiq at acpinodebus with vchiq_acpi
+file	external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_acpi.c	vchiq_acpi
+endif
+
 makeoptions	vchiq	CPPFLAGS+="-I$S/external/bsd/vchiq/dist -I$S/external/bsd/common/include -DVCOS_VERIFY_BKPTS=1 -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x0400 -DVCHIQ_ENABLE_DEBUG=1 -DVCHIQ_LOG_DEFAULT=5"

Index: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kmod_netbsd.c
diff -u src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kmod_netbsd.c:1.10 src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kmod_netbsd.c:1.11
--- src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kmod_netbsd.c:1.10	Sun Dec 10 21:38:27 2017
+++ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kmod_netbsd.c	Tue Dec 31 01:00:23 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: vchiq_kmod_netbsd.c,v 1.10 2017/12/10 21:38:27 skrll Exp $ */
+/* $NetBSD: vchiq_kmod_netbsd.c,v 1.11 2019/12/31 01:00:23 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vchiq_kmod_netbsd.c,v 1.10 2017/12/10 21:38:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vchiq_kmod_netbsd.c,v 1.11 2019/12/31 01:00:23 jmcneill Exp $");
 
 #include 
 #include 
@@ -42,122 +42,26 @@ __KERNEL_RCSID(0, "$NetBSD: vchiq_kmod_n
 #include 
 #include 
 
-#include 
-
 #include "vchiq_arm.h"
 #include "vchiq_2835.h"
 #include "vchiq_netbsd.h"
 
 extern VCHIQ_STATE_T g_state;
 
-struct vchiq_softc {
-	device_t sc_dev;
-	device_t sc_audiodev;
-
-	bus_space_tag_t sc_iot;
-	bus_space_handle_t sc_ioh;
-	void *sc_ih;
-
-	int sc_intr;
-	int sc_phandle;
-};
-
 static struct vchiq_softc *vchiq_softc = NULL;
 
-static int vchiq_match(device_t, cfdata_t, void *);
-static void vchiq_attach(device_t, device_t, void *);
-
-static int vchiq_intr(void *);
-static int vchiq_print(void *, const char *);
-static void vchiq_defer(device_t);
-
-/* External functions */
-int vchiq_init(void);
-
-
 #define VCHIQ_DOORBELL0		0x0
 #define VCHIQ_DOORBELL1		0x4
 #define VCHIQ_DOORBELL2		0x8
 #define VCHIQ_DOORBELL3		0xC
 
-
-CFATTACH_DECL_NEW(vchiq, sizeof(struct vchiq_softc),
-vchiq_match, vchiq_attach, NULL, NULL);
-
-static int
-vchiq_match(device_t parent, cfdata_t match, void *aux)
-{
-	const char * const compatible[] = { "brcm,bcm2835-vchiq", NULL };
-	struct fdt_attach_args * const faa = aux;
-
-	return of_match_compatible(faa->faa_phandle, compatible);
-}
-
-static void
-vchiq_attach(device_t parent, device_t self, void *aux)
+void
+vchiq_set_softc(struct vchiq_softc *sc)
 {
-	struct vchiq_softc *sc = device_private(self);
-	struct fdt_attach_args * const faa = aux;
-	const int phandle = faa->faa_phandle;
-
-	aprint_naive("\n");
-	aprint_normal(": BCM2835 VCHIQ\n");
-
-	sc->sc_dev = self;
-	sc->sc_iot = 

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

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Dec 31 01:00:23 UTC 2019

Modified Files:
src/sys/external/bsd/vchiq/conf: files.vchiq
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm:
vchiq_kmod_netbsd.c vchiq_netbsd.h
Added Files:
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm:
vchiq_netbsd_acpi.c vchiq_netbsd_fdt.c

Log Message:
Split vchiq into separate fdt and acpi attachments.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/vchiq/conf/files.vchiq
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kmod_netbsd.c
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd.h
cvs rdiff -u -r0 -r1.1 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_acpi.c \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_fdt.c

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



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

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Dec 31 00:59:27 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: files.bcm2835

Log Message:
acpi glue is conditional on acpinodebus


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/arm/broadcom/files.bcm2835

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

Modified files:

Index: src/sys/arch/arm/broadcom/files.bcm2835
diff -u src/sys/arch/arm/broadcom/files.bcm2835:1.37 src/sys/arch/arm/broadcom/files.bcm2835:1.38
--- src/sys/arch/arm/broadcom/files.bcm2835:1.37	Mon Dec 30 18:53:34 2019
+++ src/sys/arch/arm/broadcom/files.bcm2835	Tue Dec 31 00:59:26 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.bcm2835,v 1.37 2019/12/30 18:53:34 jmcneill Exp $
+#	$NetBSD: files.bcm2835,v 1.38 2019/12/31 00:59:26 jmcneill Exp $
 #
 # Configuration info for Broadcom BCM2835 ARM Peripherals
 #
@@ -19,8 +19,11 @@ device	bcmmbox: bcmmboxbus
 file	arch/arm/broadcom/bcm2835_mbox.c	bcmmbox
 attach	bcmmbox at fdt with bcmmbox_fdt
 filearch/arm/broadcom/bcm2835_mbox_fdt.c	bcmmbox_fdt
+
+ifdef acpinodebus
 attach  bcmmbox at acpinodebus with bcmmbox_acpi
 file	arch/arm/broadcom/bcm2835_mbox_acpi.c	bcmmbox_acpi
+endif
 
 # System Timer (BCM2835_TIMER_BASE)
 device	bcmtmr
@@ -56,8 +59,10 @@ file	arch/arm/broadcom/bcm2835_com.c		bc
 attach	sdhc at fdt with bcmemmc
 file	arch/arm/broadcom/bcm2835_emmc.c	bcmemmc
 
+ifdef acpinodebus
 attach	sdhc at acpinodebus with bcmemmc_acpi
 file	arch/arm/broadcom/bcm2835_emmc_acpi.c	bcmemmc_acpi
+endif
 
 # SD Host Controller (BCM2835_SDHOST_BASE)
 device	bcmsdhost: sdmmcbus



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

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Dec 31 00:59:27 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: files.bcm2835

Log Message:
acpi glue is conditional on acpinodebus


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/arm/broadcom/files.bcm2835

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



CVS commit: src/sys/arch

2019-12-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 30 23:32:30 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: genassym.cf vector.S
src/sys/arch/i386/i386: genassym.cf vector.S
src/sys/arch/x86/include: cpu.h
src/sys/arch/x86/x86: intr.c

Log Message:
Fix a problem with intr_unmask() that can cause a forever-loop:
- When handling the source-is-masked case in the interrupt vector, set the
  interrupt bit in a new ci_imasked field and ensure the bit is cleared
  from ci_ipending.
- In intr_unmask(), transfer the bit from ci_imasked to ci_ipending for
  non-level-sensitive interrupts (the PIC does the work for us in the
  level-sensitive case), and only force pending interrupts to be processed
  in this case.  (In all cases, make sure the now-unmasked bit is cleared
  from ci_imasked.)

Before, the bit was left in ci_ipending so as not to use edge-triggered
interrupts while the source is masked, but Xspllower() relies on the
pending bits getting cleared.

Tested by forcing all wm(4) interrupts on my test system though an
intr_mask() / softint / intr_unmask() cycle and exercising the network
heavily.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/amd64/amd64/genassym.cf
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/amd64/amd64/vector.S
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/i386/i386/genassym.cf
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/i386/i386/vector.S
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/x86/x86/intr.c

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



CVS commit: src/sys/arch

2019-12-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 30 23:32:30 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: genassym.cf vector.S
src/sys/arch/i386/i386: genassym.cf vector.S
src/sys/arch/x86/include: cpu.h
src/sys/arch/x86/x86: intr.c

Log Message:
Fix a problem with intr_unmask() that can cause a forever-loop:
- When handling the source-is-masked case in the interrupt vector, set the
  interrupt bit in a new ci_imasked field and ensure the bit is cleared
  from ci_ipending.
- In intr_unmask(), transfer the bit from ci_imasked to ci_ipending for
  non-level-sensitive interrupts (the PIC does the work for us in the
  level-sensitive case), and only force pending interrupts to be processed
  in this case.  (In all cases, make sure the now-unmasked bit is cleared
  from ci_imasked.)

Before, the bit was left in ci_ipending so as not to use edge-triggered
interrupts while the source is masked, but Xspllower() relies on the
pending bits getting cleared.

Tested by forcing all wm(4) interrupts on my test system though an
intr_mask() / softint / intr_unmask() cycle and exercising the network
heavily.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/amd64/amd64/genassym.cf
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/amd64/amd64/vector.S
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/i386/i386/genassym.cf
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/i386/i386/vector.S
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/x86/x86/intr.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/amd64/amd64/genassym.cf
diff -u src/sys/arch/amd64/amd64/genassym.cf:1.79 src/sys/arch/amd64/amd64/genassym.cf:1.80
--- src/sys/arch/amd64/amd64/genassym.cf:1.79	Sun Dec 22 15:09:39 2019
+++ src/sys/arch/amd64/amd64/genassym.cf	Mon Dec 30 23:32:29 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.79 2019/12/22 15:09:39 thorpej Exp $
+#	$NetBSD: genassym.cf,v 1.80 2019/12/30 23:32:29 thorpej Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -252,6 +252,7 @@ define	CPU_INFO_ILEVEL		offsetof(struct 
 define	CPU_INFO_IDEPTH		offsetof(struct cpu_info, ci_idepth)
 if !defined(XENPV)
 define	CPU_INFO_IPENDING	offsetof(struct cpu_info, ci_ipending)
+define	CPU_INFO_IMASKED	offsetof(struct cpu_info, ci_imasked)
 define	CPU_INFO_IMASK		offsetof(struct cpu_info, ci_imask)
 define	CPU_INFO_IUNMASK	offsetof(struct cpu_info, ci_iunmask)
 define	CPU_INFO_ISOURCES	offsetof(struct cpu_info, ci_isources)

Index: src/sys/arch/amd64/amd64/vector.S
diff -u src/sys/arch/amd64/amd64/vector.S:1.72 src/sys/arch/amd64/amd64/vector.S:1.73
--- src/sys/arch/amd64/amd64/vector.S:1.72	Sun Dec 22 15:09:39 2019
+++ src/sys/arch/amd64/amd64/vector.S	Mon Dec 30 23:32:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.72 2019/12/22 15:09:39 thorpej Exp $	*/
+/*	$NetBSD: vector.S,v 1.73 2019/12/30 23:32:29 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -392,7 +392,7 @@ IDTVEC(handle_ ## name ## num)		;\
 	incl	CPUVAR(IDEPTH)		;\
 	movq	IS_HANDLERS(%r14),%rbx	;\
 	cmpl	$0,IS_MASK_COUNT(%r14)	/* source currently masked? */	;\
-	jne	7f			/* yes, hold it */		;\
+	jne	12f			/* yes, hold it */		;\
 6:	\
 	movl	IH_LEVEL(%rbx),%r12d	;\
 	cmpl	%r13d,%r12d		;\
@@ -406,7 +406,7 @@ IDTVEC(handle_ ## name ## num)		;\
 	jnz	6b			;\
 5:	\
 	cmpl	$0,IS_MASK_COUNT(%r14)	/* source now masked? */	;\
-	jne	7f			/* yes, deal */			;\
+	jne	12f			/* yes, deal */			;\
 	cli;\
 	unmask(num)			/* unmask it in hardware */	;\
 	late_ack(num)			;\
@@ -415,10 +415,15 @@ IDTVEC(handle_ ## name ## num)		;\
 7:	\
 	cli;\
 	orl	$(1 << num),CPUVAR(IPENDING);\
-	level_mask(num)			;\
+8:	level_mask(num)			;\
 	late_ack(num)			;\
 	sti;\
 	jmp	_C_LABEL(Xdoreti)	/* lower spl and do ASTs */	;\
+12:	\
+	cli;\
+	orl	$(1 << num),CPUVAR(IMASKED);\
+	btrl	$(num),CPUVAR(IPENDING)	;\
+	jmp	8b			;\
 10:	\
 	cli;\
 	orl	$(1 << num),CPUVAR(IPENDING);\

Index: src/sys/arch/i386/i386/genassym.cf
diff -u src/sys/arch/i386/i386/genassym.cf:1.116 src/sys/arch/i386/i386/genassym.cf:1.117
--- src/sys/arch/i386/i386/genassym.cf:1.116	Sun Dec 22 15:09:39 2019
+++ src/sys/arch/i386/i386/genassym.cf	Mon Dec 30 23:32:29 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.116 2019/12/22 15:09:39 thorpej Exp $
+#	$NetBSD: genassym.cf,v 1.117 2019/12/30 23:32:29 thorpej Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -274,6 +274,7 @@ define	CPU_INFO_SIGNATURE	offsetof(struc
 define	CPU_INFO_GDT		offsetof(struct cpu_info, ci_gdt)
 if !defined(XENPV)
 define	CPU_INFO_IPENDING	offsetof(struct cpu_info, ci_ipending)
+define	CPU_INFO_IMASKED	offsetof(struct cpu_info, ci_imasked)

CVS commit: src/sys/arch/sparc

2019-12-30 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Dec 30 22:13:47 UTC 2019

Modified Files:
src/sys/arch/sparc/dev: apc.c
src/sys/arch/sparc/include: cpu.h
src/sys/arch/sparc/sparc: clkctrl.c lock_stubs.s locore.s msiiep.c

Log Message:
PR port-sparc/54789: Sparc boot fails with "Trap 0x21 while interrupts disabled"

Remove assumption that cpu_info is smaller than 1kB.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sparc/dev/apc.c
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/sparc/include/cpu.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc/sparc/clkctrl.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sparc/sparc/lock_stubs.s
cvs rdiff -u -r1.274 -r1.275 src/sys/arch/sparc/sparc/locore.s
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/sparc/sparc/msiiep.c

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

Modified files:

Index: src/sys/arch/sparc/dev/apc.c
diff -u src/sys/arch/sparc/dev/apc.c:1.1 src/sys/arch/sparc/dev/apc.c:1.2
--- src/sys/arch/sparc/dev/apc.c:1.1	Fri Jan 15 20:57:12 2010
+++ src/sys/arch/sparc/dev/apc.c	Mon Dec 30 22:13:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: apc.c,v 1.1 2010/01/15 20:57:12 bouyer Exp $	*/
+/*	$NetBSD: apc.c,v 1.2 2019/12/30 22:13:46 ad Exp $	*/
 
 /*
  * Copyright (c) 2010 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: apc.c,v 1.1 2010/01/15 20:57:12 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apc.c,v 1.2 2019/12/30 22:13:46 ad Exp $");
 
 
 /*
@@ -45,7 +45,7 @@ __KERNEL_RCSID(0, "$NetBSD: apc.c,v 1.1 
 
 static int apcmatch(device_t, struct cfdata *, void *);
 static void apcattach(device_t, device_t, void *);
-static void apc_cpu_sleep(struct cpu_info *);
+static void apc_cpu_sleep(void);
 
 struct apc_softc {
 	device_t	sc_dev;
@@ -86,7 +86,7 @@ apcattach(device_t parent, device_t self
 }
 
 static void
-apc_cpu_sleep(struct cpu_info *ci)
+apc_cpu_sleep(void)
 {
 	uint8_t val;
 	if (apc == NULL)

Index: src/sys/arch/sparc/include/cpu.h
diff -u src/sys/arch/sparc/include/cpu.h:1.103 src/sys/arch/sparc/include/cpu.h:1.104
--- src/sys/arch/sparc/include/cpu.h:1.103	Sun Dec  1 15:34:45 2019
+++ src/sys/arch/sparc/include/cpu.h	Mon Dec 30 22:13:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.103 2019/12/01 15:34:45 ad Exp $ */
+/*	$NetBSD: cpu.h,v 1.104 2019/12/30 22:13:47 ad Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -374,7 +374,7 @@ struct cpu_info {
 	 * unrecoverable faults end up here.
 	 */
 	void		(*memerr)(unsigned, u_int, u_int, struct trapframe *);
-	void		(*idlespin)(struct cpu_info *);
+	void		(*idlespin)(void);
 	/* Module Control Registers */
 	/*bus_space_handle_t*/ long ci_mbusport;
 	/*bus_space_handle_t*/ long ci_mxccregs;

Index: src/sys/arch/sparc/sparc/clkctrl.c
diff -u src/sys/arch/sparc/sparc/clkctrl.c:1.5 src/sys/arch/sparc/sparc/clkctrl.c:1.6
--- src/sys/arch/sparc/sparc/clkctrl.c:1.5	Sun Jul 17 23:32:37 2011
+++ src/sys/arch/sparc/sparc/clkctrl.c	Mon Dec 30 22:13:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: clkctrl.c,v 1.5 2011/07/17 23:32:37 mrg Exp $	*/
+/*	$NetBSD: clkctrl.c,v 1.6 2019/12/30 22:13:47 ad Exp $	*/
 
 /*
  * Copyright (c) 2005 Michael Lorenz
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clkctrl.c,v 1.5 2011/07/17 23:32:37 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clkctrl.c,v 1.6 2019/12/30 22:13:47 ad Exp $");
 
 #include 
 #include 
@@ -44,7 +44,7 @@ static void clkctrl_attach(device_t, dev
 CFATTACH_DECL_NEW(clkctrl, 0,
  clkctrl_match, clkctrl_attach, NULL, NULL);
 
-static void tadpole_cpu_sleep(struct cpu_info *);
+static void tadpole_cpu_sleep(void);
 volatile uint8_t *clkctrl_reg = NULL;
 
 static int
@@ -91,8 +91,9 @@ clkctrl_attach(device_t parent, device_t
 
 /* ARGSUSED */
 static void
-tadpole_cpu_sleep(struct cpu_info *ci)
+tadpole_cpu_sleep(void)
 {
+
 	if (clkctrl_reg == 0)
 		return;
 	*clkctrl_reg = 0;

Index: src/sys/arch/sparc/sparc/lock_stubs.s
diff -u src/sys/arch/sparc/sparc/lock_stubs.s:1.12 src/sys/arch/sparc/sparc/lock_stubs.s:1.13
--- src/sys/arch/sparc/sparc/lock_stubs.s:1.12	Sun May 25 15:56:12 2008
+++ src/sys/arch/sparc/sparc/lock_stubs.s	Mon Dec 30 22:13:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs.s,v 1.12 2008/05/25 15:56:12 chs Exp $	*/
+/*	$NetBSD: lock_stubs.s,v 1.13 2019/12/30 22:13:47 ad Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -122,10 +122,10 @@ ENTRY(mutex_exit)
  * void mutex_spin_enter(kmutex_t *);
  */
 ENTRY(mutex_spin_enter)
-	sethi	%hi(CPUINFO_VA), %o4
-	ld	[ %o4 + CPUINFO_MTX_COUNT ], %o5
+	sethi	%hi(CPUINFO_VA+CPUINFO_MTX_COUNT), %o4
+	ld	[ %o4 + %lo(CPUINFO_VA+CPUINFO_MTX_COUNT) ], %o5
 	sub	%o5, 1, %o1
-	st	%o1, [ %o4 + CPUINFO_MTX_COUNT ]
+	st	%o1, [ %o4 + %lo(CPUINFO_VA+CPUINFO_MTX_COUNT) ]
 	ldub	[ %o0 + MTX_IPL ], %o2
 	rd	%psr, %o1
 	sll	%o2, 8, %o2
@@ -140,8 +140,9 @@ ENTRY(mutex_spin_enter)
 	nop
 	tst	%o5
 1:
+	sethi	%hi(CPUINFO_VA+CPUINFO_MTX_OLDSPL), %o4
 	bz,a	2f
-	 st	%o3, [ %o4 + 

CVS commit: src/sys/arch/sparc

2019-12-30 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Dec 30 22:13:47 UTC 2019

Modified Files:
src/sys/arch/sparc/dev: apc.c
src/sys/arch/sparc/include: cpu.h
src/sys/arch/sparc/sparc: clkctrl.c lock_stubs.s locore.s msiiep.c

Log Message:
PR port-sparc/54789: Sparc boot fails with "Trap 0x21 while interrupts disabled"

Remove assumption that cpu_info is smaller than 1kB.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sparc/dev/apc.c
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/sparc/include/cpu.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc/sparc/clkctrl.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sparc/sparc/lock_stubs.s
cvs rdiff -u -r1.274 -r1.275 src/sys/arch/sparc/sparc/locore.s
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/sparc/sparc/msiiep.c

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



CVS commit: src/sys/dev/acpi

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 30 19:52:11 UTC 2019

Modified Files:
src/sys/dev/acpi: acpi.c

Log Message:
Hide ACPI0004 devices on aarch64


To generate a diff of this commit:
cvs rdiff -u -r1.280 -r1.281 src/sys/dev/acpi/acpi.c

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



CVS commit: src/sys/dev/acpi

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 30 19:52:11 UTC 2019

Modified Files:
src/sys/dev/acpi: acpi.c

Log Message:
Hide ACPI0004 devices on aarch64


To generate a diff of this commit:
cvs rdiff -u -r1.280 -r1.281 src/sys/dev/acpi/acpi.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/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.280 src/sys/dev/acpi/acpi.c:1.281
--- src/sys/dev/acpi/acpi.c:1.280	Mon Dec 30 19:49:38 2019
+++ src/sys/dev/acpi/acpi.c	Mon Dec 30 19:52:11 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.280 2019/12/30 19:49:38 jmcneill Exp $	*/
+/*	$NetBSD: acpi.c,v 1.281 2019/12/30 19:52:11 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.280 2019/12/30 19:49:38 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.281 2019/12/30 19:52:11 jmcneill Exp $");
 
 #include "pci.h"
 #include "opt_acpi.h"
@@ -175,6 +175,7 @@ static const char * const acpi_ignored_i
 	"PNP0C04",	/* FPU is handled internally */
 #endif
 #if defined(__aarch64__)
+	"ACPI0004",	/* ACPI module devices are handled internally */
 	"ACPI0007",	/* ACPI CPUs are attached via MADT GICC subtables */
 	"PNP0C0F",	/* ACPI PCI link devices are handled internally */
 #endif



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

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 30 19:50:29 UTC 2019

Modified Files:
src/sys/arch/arm/acpi: acpi_machdep.c

Log Message:
If a device node is a child of a module device, and the module device declares 
DMA range restrictions, use them.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/acpi/acpi_machdep.c

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



CVS commit: src/sys/dev/acpi

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 30 19:49:38 UTC 2019

Modified Files:
src/sys/dev/acpi: acpi.c

Log Message:
MD code may allocate a new dma tag for attach args, so destroy it if the device 
node is not claimed


To generate a diff of this commit:
cvs rdiff -u -r1.279 -r1.280 src/sys/dev/acpi/acpi.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/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.279 src/sys/dev/acpi/acpi.c:1.280
--- src/sys/dev/acpi/acpi.c:1.279	Sun Dec 29 23:47:56 2019
+++ src/sys/dev/acpi/acpi.c	Mon Dec 30 19:49:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.279 2019/12/29 23:47:56 jmcneill Exp $	*/
+/*	$NetBSD: acpi.c,v 1.280 2019/12/30 19:49:38 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.279 2019/12/29 23:47:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.280 2019/12/30 19:49:38 jmcneill Exp $");
 
 #include "pci.h"
 #include "opt_acpi.h"
@@ -899,6 +899,13 @@ acpi_rescan_early(struct acpi_softc *sc)
 
 		ad->ad_device = config_found_ia(sc->sc_dev,
 		"acpinodebus", , acpi_print);
+
+		if (ad->ad_device == NULL) {
+			if (aa.aa_dmat != NULL)
+bus_dmatag_destroy(aa.aa_dmat);
+			if (aa.aa_dmat64 != NULL)
+bus_dmatag_destroy(aa.aa_dmat64);
+		}
 	}
 }
 
@@ -961,6 +968,13 @@ acpi_rescan_nodes(struct acpi_softc *sc)
 
 		ad->ad_device = config_found_ia(sc->sc_dev,
 		"acpinodebus", , acpi_print);
+
+		if (ad->ad_device == NULL) {
+			if (aa.aa_dmat != NULL)
+bus_dmatag_destroy(aa.aa_dmat);
+			if (aa.aa_dmat64 != NULL)
+bus_dmatag_destroy(aa.aa_dmat64);
+		}
 	}
 }
 



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

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 30 19:50:29 UTC 2019

Modified Files:
src/sys/arch/arm/acpi: acpi_machdep.c

Log Message:
If a device node is a child of a module device, and the module device declares 
DMA range restrictions, use them.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/acpi/acpi_machdep.c

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

Modified files:

Index: src/sys/arch/arm/acpi/acpi_machdep.c
diff -u src/sys/arch/arm/acpi/acpi_machdep.c:1.14 src/sys/arch/arm/acpi/acpi_machdep.c:1.15
--- src/sys/arch/arm/acpi/acpi_machdep.c:1.14	Sun Dec 29 23:47:56 2019
+++ src/sys/arch/arm/acpi/acpi_machdep.c	Mon Dec 30 19:50:29 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.14 2019/12/29 23:47:56 jmcneill Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.15 2019/12/30 19:50:29 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "pci.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.14 2019/12/29 23:47:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.15 2019/12/30 19:50:29 jmcneill Exp $");
 
 #include 
 #include 
@@ -367,18 +367,74 @@ acpi_md_callback(struct acpi_softc *sc)
 		config_found_ia(sc->sc_dev, "acpisdtbus", hdrp, NULL);
 }
 
+static const char * const module_hid[] = {
+	"ACPI0004",	/* Module device */
+	NULL
+};
+
+static bus_dma_tag_t
+arm_acpi_dma_tag_subregion(struct acpi_softc *sc, bus_dma_tag_t dmat,
+ACPI_HANDLE handle)
+{
+	struct acpi_resources res;
+	struct acpi_mem *mem;
+	bus_dma_tag_t newtag;
+	ACPI_STATUS rv;
+	int error;
+
+	rv = acpi_resource_parse(sc->sc_dev, handle, "_DMA", ,
+	_resource_parse_ops_quiet);
+	if (ACPI_FAILURE(rv))
+		return dmat;	/* no translation required */
+
+	mem = acpi_res_mem(, 0);
+	if (mem == NULL)
+		goto done;
+
+	aprint_debug_dev(sc->sc_dev, "_DMA range %#lx-%#lx\n",
+	mem->ar_base, mem->ar_base + mem->ar_length - 1);
+
+	error = bus_dmatag_subregion(dmat,
+	mem->ar_base, mem->ar_base + mem->ar_length - 1,
+	, BUS_DMA_WAITOK);
+	if (error != 0) {
+		aprint_error_dev(sc->sc_dev,
+		"_DMA subregion failed: %d\n", error);
+		goto done;
+	}
+	dmat = newtag;
+
+done:
+	acpi_resource_cleanup();
+
+	return dmat;
+}
+
 bus_dma_tag_t
 arm_acpi_dma_tag(struct acpi_softc *sc, struct acpi_devnode *ad)
 {
 	ACPI_INTEGER cca;
+	bus_dma_tag_t dmat;
 
 	if (ACPI_FAILURE(acpi_eval_integer(ad->ad_handle, "_CCA", )))
 		cca = 1;
 
 	if (cca)
-		return _coherent_dma_tag;
+		dmat = _coherent_dma_tag;
 	else
-		return _generic_dma_tag;
+		dmat = _generic_dma_tag;
+
+	/*
+	 * If the parent device is a bus, it may define valid DMA ranges
+	 * and translations for child nodes.
+	 */
+	if (ad->ad_parent != NULL &&
+	acpi_match_hid(ad->ad_parent->ad_devinfo, module_hid)) {
+		dmat = arm_acpi_dma_tag_subregion(sc, dmat,
+		ad->ad_parent->ad_handle);
+	}
+
+	return dmat;
 }
 __strong_alias(acpi_get_dma_tag,arm_acpi_dma_tag);
 __strong_alias(acpi_get_dma64_tag,arm_acpi_dma_tag);



CVS commit: src/sys/dev/acpi

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 30 19:49:38 UTC 2019

Modified Files:
src/sys/dev/acpi: acpi.c

Log Message:
MD code may allocate a new dma tag for attach args, so destroy it if the device 
node is not claimed


To generate a diff of this commit:
cvs rdiff -u -r1.279 -r1.280 src/sys/dev/acpi/acpi.c

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



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

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 30 18:53:34 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: files.bcm2835
Added Files:
src/sys/arch/arm/broadcom: bcm2835_emmc_acpi.c

Log Message:
Add BCM2835 EMMC acpi glue


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/broadcom/bcm2835_emmc_acpi.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/broadcom/files.bcm2835

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



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

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 30 18:53:54 UTC 2019

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

Log Message:
Add bcmmbox at acpi


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/sys/arch/evbarm/conf/GENERIC64

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



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

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 30 18:53:54 UTC 2019

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

Log Message:
Add bcmmbox at acpi


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/sys/arch/evbarm/conf/GENERIC64

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/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.120 src/sys/arch/evbarm/conf/GENERIC64:1.121
--- src/sys/arch/evbarm/conf/GENERIC64:1.120	Sun Dec 29 12:49:03 2019
+++ src/sys/arch/evbarm/conf/GENERIC64	Mon Dec 30 18:53:54 2019
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.120 2019/12/29 12:49:03 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.121 2019/12/30 18:53:54 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -223,6 +223,7 @@ tegramc*	at fdt?	pass 4		# NVIDIA Tegra 
 
 # Firmware devices
 bcmmbox*	at fdt?			# Broadcom VideoCore IV mailbox
+bcmmbox*	at acpi?
 vcmbox*		at bcmmbox?
 qemufwcfg*	at fdt?			# QEMU Firmware Configuration device
 qemufwcfg*	at acpi?



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

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 30 18:53:34 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: files.bcm2835
Added Files:
src/sys/arch/arm/broadcom: bcm2835_emmc_acpi.c

Log Message:
Add BCM2835 EMMC acpi glue


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/broadcom/bcm2835_emmc_acpi.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/broadcom/files.bcm2835

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

Modified files:

Index: src/sys/arch/arm/broadcom/files.bcm2835
diff -u src/sys/arch/arm/broadcom/files.bcm2835:1.36 src/sys/arch/arm/broadcom/files.bcm2835:1.37
--- src/sys/arch/arm/broadcom/files.bcm2835:1.36	Mon Dec 30 18:43:38 2019
+++ src/sys/arch/arm/broadcom/files.bcm2835	Mon Dec 30 18:53:34 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.bcm2835,v 1.36 2019/12/30 18:43:38 jmcneill Exp $
+#	$NetBSD: files.bcm2835,v 1.37 2019/12/30 18:53:34 jmcneill Exp $
 #
 # Configuration info for Broadcom BCM2835 ARM Peripherals
 #
@@ -56,6 +56,9 @@ file	arch/arm/broadcom/bcm2835_com.c		bc
 attach	sdhc at fdt with bcmemmc
 file	arch/arm/broadcom/bcm2835_emmc.c	bcmemmc
 
+attach	sdhc at acpinodebus with bcmemmc_acpi
+file	arch/arm/broadcom/bcm2835_emmc_acpi.c	bcmemmc_acpi
+
 # SD Host Controller (BCM2835_SDHOST_BASE)
 device	bcmsdhost: sdmmcbus
 attach	bcmsdhost at fdt with bcmsdhost

Added files:

Index: src/sys/arch/arm/broadcom/bcm2835_emmc_acpi.c
diff -u /dev/null src/sys/arch/arm/broadcom/bcm2835_emmc_acpi.c:1.1
--- /dev/null	Mon Dec 30 18:53:34 2019
+++ src/sys/arch/arm/broadcom/bcm2835_emmc_acpi.c	Mon Dec 30 18:53:34 2019
@@ -0,0 +1,215 @@
+/*	$NetBSD: bcm2835_emmc_acpi.c,v 1.1 2019/12/30 18:53:34 jmcneill Exp $	*/
+
+/*
+ * Copyright (c) 2016 Kimihiro Nonaka 
+ * 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. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc_acpi.c,v 1.1 2019/12/30 18:53:34 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#define _COMPONENT	ACPI_RESOURCE_COMPONENT
+ACPI_MODULE_NAME	("bcmemmc_acpi")
+
+static int	bcmemmc_acpi_match(device_t, cfdata_t, void *);
+static void	bcmemmc_acpi_attach(device_t, device_t, void *);
+static void	bcmemmc_acpi_attach1(device_t);
+
+static u_int	bcmemmc_acpi_emmc_clock_rate(void);
+
+static const char * const compatible[] = {
+	"BCM2847",
+	NULL
+};
+
+static struct {
+	struct vcprop_buffer_hdr	vb_hdr;
+	struct vcprop_tag_clockrate	vbt_emmcclockrate;
+	struct vcprop_tag end;
+} vb_emmc __cacheline_aligned = {
+	.vb_hdr = {
+		.vpb_len = sizeof(vb_emmc),
+		.vpb_rcode = VCPROP_PROCESS_REQUEST,
+	},
+	.vbt_emmcclockrate = {
+		.tag = {
+			.vpt_tag = VCPROPTAG_GET_CLOCKRATE,
+			.vpt_len = VCPROPTAG_LEN(vb_emmc.vbt_emmcclockrate),
+			.vpt_rcode = VCPROPTAG_REQUEST
+		},
+		.id = VCPROP_CLK_EMMC
+	},
+	.end = {
+		.vpt_tag = VCPROPTAG_NULL
+	}
+};
+
+struct bcmemmc_acpi_softc {
+	struct sdhc_softc sc;
+	bus_space_tag_t sc_memt;
+	bus_space_handle_t sc_memh;
+	bus_size_t sc_memsize;
+	void *sc_ih;
+	struct sdhc_host *sc_hosts[1];
+};
+
+CFATTACH_DECL_NEW(bcmemmc_acpi, sizeof(struct bcmemmc_acpi_softc),
+bcmemmc_acpi_match, bcmemmc_acpi_attach, NULL, NULL);
+
+static int
+bcmemmc_acpi_match(device_t parent, cfdata_t match, void *opaque)
+{
+	struct acpi_attach_args *aa = opaque;
+
+	if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
+		return 0;
+
+	return acpi_match_hid(aa->aa_node->ad_devinfo, compatible);
+}
+
+static void
+bcmemmc_acpi_attach(device_t parent, device_t self, void *opaque)
+{
+	struct bcmemmc_acpi_softc *sc = device_private(self);
+	struct acpi_attach_args *aa = opaque;
+	struct acpi_resources res;
+	

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

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 30 18:43:38 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_mbox.c bcm2835_mbox.h files.bcm2835
Added Files:
src/sys/arch/arm/broadcom: bcm2835_mbox_acpi.c bcm2835_mbox_fdt.c

Log Message:
Split bcm2835 mbox driver into separate fdt and acpi frontends.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/broadcom/bcm2835_mbox.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/broadcom/bcm2835_mbox.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/broadcom/bcm2835_mbox_acpi.c \
src/sys/arch/arm/broadcom/bcm2835_mbox_fdt.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/broadcom/files.bcm2835

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

Modified files:

Index: src/sys/arch/arm/broadcom/bcm2835_mbox.c
diff -u src/sys/arch/arm/broadcom/bcm2835_mbox.c:1.13 src/sys/arch/arm/broadcom/bcm2835_mbox.c:1.14
--- src/sys/arch/arm/broadcom/bcm2835_mbox.c:1.13	Sun Aug 19 09:18:48 2018
+++ src/sys/arch/arm/broadcom/bcm2835_mbox.c	Mon Dec 30 18:43:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_mbox.c,v 1.13 2018/08/19 09:18:48 rin Exp $	*/
+/*	$NetBSD: bcm2835_mbox.c,v 1.14 2019/12/30 18:43:38 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_mbox.c,v 1.13 2018/08/19 09:18:48 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_mbox.c,v 1.14 2019/12/30 18:43:38 jmcneill Exp $");
 
 #include 
 #include 
@@ -43,103 +43,10 @@ __KERNEL_RCSID(0, "$NetBSD: bcm2835_mbox
 #include 
 #include 
 #include 
-
-#include 
-
-struct bcm2835mbox_softc {
-	device_t sc_dev;
-	device_t sc_platdev;
-
-	bus_space_tag_t sc_iot;
-	bus_space_handle_t sc_ioh;
-	bus_dma_tag_t sc_dmat;
-	void *sc_intrh;
-
-	kmutex_t sc_lock;
-	kmutex_t sc_intr_lock;
-	kcondvar_t sc_chan[BCM2835_MBOX_NUMCHANNELS];
-	uint32_t sc_mbox[BCM2835_MBOX_NUMCHANNELS];
-};
+#include 
 
 static struct bcm2835mbox_softc *bcm2835mbox_sc;
 
-static int bcmmbox_match(device_t, cfdata_t, void *);
-static void bcmmbox_attach(device_t, device_t, void *);
-static int bcmmbox_intr1(struct bcm2835mbox_softc *, int);
-static int bcmmbox_intr(void *);
-
-CFATTACH_DECL_NEW(bcmmbox, sizeof(struct bcm2835mbox_softc),
-bcmmbox_match, bcmmbox_attach, NULL, NULL);
-
-/* ARGSUSED */
-static int
-bcmmbox_match(device_t parent, cfdata_t match, void *aux)
-{
-	const char * const compatible[] = { "brcm,bcm2835-mbox", NULL };
-	struct fdt_attach_args * const faa = aux;
-
-	return of_match_compatible(faa->faa_phandle, compatible);
-}
-
-static void
-bcmmbox_attach(device_t parent, device_t self, void *aux)
-{
-	struct bcm2835mbox_softc *sc = device_private(self);
-	struct fdt_attach_args * const faa = aux;
-	struct bcmmbox_attach_args baa;
-	const int phandle = faa->faa_phandle;
-	int i;
-
-	aprint_naive("\n");
-	aprint_normal(": VC mailbox\n");
-
-	sc->sc_dev = self;
-	sc->sc_iot = faa->faa_bst;
-	sc->sc_dmat = faa->faa_dmat;
-	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_NONE);
-	mutex_init(>sc_intr_lock, MUTEX_DEFAULT, IPL_VM);
-	for (i = 0; i < BCM2835_MBOX_NUMCHANNELS; ++i)
-		cv_init(>sc_chan[i], "bcmmbox");
-
-	bus_addr_t addr;
-	bus_size_t size;
-
-	if (fdtbus_get_reg(phandle, 0, , ) != 0) {
-		aprint_error(": couldn't get register address\n");
-		return;
-	}
-
-	if (bus_space_map(faa->faa_bst, addr, size, 0, >sc_ioh) != 0) {
-		aprint_error_dev(sc->sc_dev, "unable to map device\n");
-		return;
-	}
-
-	char intrstr[128];
-	if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) {
-		aprint_error(": failed to decode interrupt\n");
-		return;
-	}
-
-	sc->sc_intrh = fdtbus_intr_establish(phandle, 0, IPL_VM, 0,
-	bcmmbox_intr, sc);
-	if (sc->sc_intrh == NULL) {
-		aprint_error_dev(self, "failed to establish interrupt %s\n",
-		intrstr);
-		return;
-	}
-	aprint_normal_dev(self, "interrupting on %s\n", intrstr);
-
-	/* enable mbox interrupt */
-	bus_space_write_4(sc->sc_iot, sc->sc_ioh, BCM2835_MBOX_CFG,
-	BCM2835_MBOX_CFG_DATAIRQEN);
-
-	if (bcm2835mbox_sc == NULL)
-		bcm2835mbox_sc = sc;
-
-	baa.baa_dmat = sc->sc_dmat;
-	sc->sc_platdev = config_found_ia(self, "bcmmboxbus", , NULL);
-}
-
 static int
 bcmmbox_intr1(struct bcm2835mbox_softc *sc, int cv)
 {
@@ -175,7 +82,29 @@ bcmmbox_intr1(struct bcm2835mbox_softc *
 	return ret;
 }
 
-static int
+void
+bcmmbox_attach(struct bcm2835mbox_softc *sc)
+{
+	struct bcmmbox_attach_args baa;
+	int i;
+
+	if (bcm2835mbox_sc == NULL)
+		bcm2835mbox_sc = sc;
+
+	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(>sc_intr_lock, MUTEX_DEFAULT, IPL_VM);
+	for (i = 0; i < BCM2835_MBOX_NUMCHANNELS; ++i)
+		cv_init(>sc_chan[i], "bcmmbox");
+
+	/* enable mbox interrupt */
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh, BCM2835_MBOX_CFG,
+	BCM2835_MBOX_CFG_DATAIRQEN);
+
+	baa.baa_dmat = sc->sc_dmat;
+	sc->sc_platdev = config_found_ia(sc->sc_dev, "bcmmboxbus", , NULL);
+}
+
+int

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

2019-12-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 30 18:43:38 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_mbox.c bcm2835_mbox.h files.bcm2835
Added Files:
src/sys/arch/arm/broadcom: bcm2835_mbox_acpi.c bcm2835_mbox_fdt.c

Log Message:
Split bcm2835 mbox driver into separate fdt and acpi frontends.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/broadcom/bcm2835_mbox.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/broadcom/bcm2835_mbox.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/broadcom/bcm2835_mbox_acpi.c \
src/sys/arch/arm/broadcom/bcm2835_mbox_fdt.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/broadcom/files.bcm2835

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



CVS commit: src/sys/uvm/pmap

2019-12-30 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Dec 30 18:28:06 UTC 2019

Modified Files:
src/sys/uvm/pmap: vmpagemd.h

Log Message:
pg->phys_addr -> VM_PAGE_TO_PHYS().


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/uvm/pmap/vmpagemd.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/uvm/pmap/vmpagemd.h
diff -u src/sys/uvm/pmap/vmpagemd.h:1.15 src/sys/uvm/pmap/vmpagemd.h:1.16
--- src/sys/uvm/pmap/vmpagemd.h:1.15	Sun Oct 20 08:29:38 2019
+++ src/sys/uvm/pmap/vmpagemd.h	Mon Dec 30 18:28:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmpagemd.h,v 1.15 2019/10/20 08:29:38 skrll Exp $	*/
+/*	$NetBSD: vmpagemd.h,v 1.16 2019/12/30 18:28:06 ad Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -149,7 +149,7 @@ pmap_pvlist_locked_p(struct vm_page_md *
 do {	\
 	(pg)->mdpage.mdpg_first.pv_next = NULL;\
 	(pg)->mdpage.mdpg_first.pv_pmap = NULL;\
-	(pg)->mdpage.mdpg_first.pv_va = (pg)->phys_addr;		\
+	(pg)->mdpage.mdpg_first.pv_va = VM_PAGE_TO_PHYS(pg);		\
 	(pg)->mdpage.mdpg_attrs = 0;	\
 	VM_PAGEMD_PVLIST_LOCK_INIT(&(pg)->mdpage);			\
 } while (/* CONSTCOND */ 0)



CVS commit: xsrc/external/mit/xf86-video-wsfb/dist/src

2019-12-30 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Mon Dec 30 18:27:50 UTC 2019

Modified Files:
xsrc/external/mit/xf86-video-wsfb/dist/src: wsfb_driver.c

Log Message:
Add missing newlines in log messages.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 \
xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c

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



CVS commit: xsrc/external/mit/xf86-video-wsfb/dist/src

2019-12-30 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Mon Dec 30 18:27:50 UTC 2019

Modified Files:
xsrc/external/mit/xf86-video-wsfb/dist/src: wsfb_driver.c

Log Message:
Add missing newlines in log messages.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 \
xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c
diff -u xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.36 xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.37
--- xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.36	Wed Dec 25 14:36:34 2019
+++ xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c	Mon Dec 30 18:27:50 2019
@@ -611,12 +611,12 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags
 		if (xf86ReturnOptValBool(fPtr->Options,
 	 OPTION_SHADOW_FB, FALSE)) {
 			xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-   "Shadow FB option ignored on depth < 8");
+   "Shadow FB option ignored on depth < 8\n");
 		}
 	if (fPtr->fbi.fbi_flags & WSFB_VRAM_IS_SPLIT) {
 		if (!fPtr->shadowFB) {
 			xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-   "Shadow FB forced on for split framebuffer");
+   "Shadow FB forced on for split framebuffer\n");
 			fPtr->shadowFB = TRUE;
 		}
 	}
@@ -649,7 +649,7 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags
 			}
 		} else {
 			xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-			"Option \"Rotate\" ignored on depth < 8");
+			"Option \"Rotate\" ignored on depth < 8\n");
 		}
 	}
 
@@ -1037,7 +1037,7 @@ WsfbScreenInit(SCREEN_INIT_ARGS_DECL)
 		break;
 	default:
 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-			   "Unsupported bpp: %d", pScrn->bitsPerPixel);
+			   "Unsupported bpp: %d\n", pScrn->bitsPerPixel);
 		return FALSE;
 	} /* case */
 
@@ -1062,7 +1062,7 @@ WsfbScreenInit(SCREEN_INIT_ARGS_DECL)
 	if (pScrn->bitsPerPixel >= 8) {
 		if (!fbPictureInit(pScreen, NULL, 0))
 			xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-   "RENDER extension initialisation failed.");
+   "RENDER extension initialisation failed.\n");
 	}
 	if (fPtr->shadowFB && !WsfbShadowInit(pScreen)) {
 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,



CVS commit: src/sys/uvm/pmap

2019-12-30 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Dec 30 18:28:06 UTC 2019

Modified Files:
src/sys/uvm/pmap: vmpagemd.h

Log Message:
pg->phys_addr -> VM_PAGE_TO_PHYS().


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/uvm/pmap/vmpagemd.h

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



CVS commit: src/sys/uvm

2019-12-30 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Dec 30 18:18:03 UTC 2019

Modified Files:
src/sys/uvm: uvm_pdpolicy_clock.c

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/uvm/uvm_pdpolicy_clock.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/uvm/uvm_pdpolicy_clock.c
diff -u src/sys/uvm/uvm_pdpolicy_clock.c:1.24 src/sys/uvm/uvm_pdpolicy_clock.c:1.25
--- src/sys/uvm/uvm_pdpolicy_clock.c:1.24	Mon Dec 30 18:08:38 2019
+++ src/sys/uvm/uvm_pdpolicy_clock.c	Mon Dec 30 18:18:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pdpolicy_clock.c,v 1.24 2019/12/30 18:08:38 ad Exp $	*/
+/*	$NetBSD: uvm_pdpolicy_clock.c,v 1.25 2019/12/30 18:18:03 ad Exp $	*/
 /*	NetBSD: uvm_pdaemon.c,v 1.72 2006/01/05 10:47:33 yamt Exp $	*/
 
 /*
@@ -69,7 +69,7 @@
 #else /* defined(PDSIM) */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clock.c,v 1.24 2019/12/30 18:08:38 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clock.c,v 1.25 2019/12/30 18:18:03 ad Exp $");
 
 #include 
 #include 
@@ -353,7 +353,6 @@ uvmpdpol_balancequeue(int swap_shortage)
 		/*
 		 * now prepare to move on to the next page.
 		 */
-
 		TAILQ_REMOVE(_state.s_activeq, , pdqueue);
 		TAILQ_INSERT_AFTER(_state.s_activeq, p, ,
 		pdqueue);
@@ -384,7 +383,6 @@ uvmpdpol_balancequeue(int swap_shortage)
 		/*
 		 * if there's a shortage of inactive pages, deactivate.
 		 */
-
 		if (inactive_shortage > 0) {
 			uvmpdpol_pagedeactivate_locked(p);
 			uvmexp.pddeact++;



CVS commit: src/sys/uvm

2019-12-30 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Dec 30 18:18:03 UTC 2019

Modified Files:
src/sys/uvm: uvm_pdpolicy_clock.c

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/uvm/uvm_pdpolicy_clock.c

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



CVS commit: src/sys/uvm

2019-12-30 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Dec 30 18:08:38 UTC 2019

Modified Files:
src/sys/uvm: uvm_pdaemon.c uvm_pdaemon.h uvm_pdpolicy.h
uvm_pdpolicy_clock.c uvm_pdpolicy_clockpro.c

Log Message:
pagedaemon:

- Use marker pages to keep place in the queue when scanning, rather than
  relying on assumptions.

- In uvmpdpol_balancequeue(), lock the object once instead of twice.

- When draining pools, the situation is getting desperate, but try to avoid
  saturating the system with xcall, lock and interrupt activity by sleeping
  for 1 clock tick if being continually awoken and all pools have been
  cycled through at least once.

- Pause & resume the freelist cache during pool draining.

PR kern/54209: NetBSD 8 large memory performance extremely low
PR kern/54210: NetBSD-8 processes presumably not exiting
PR kern/54727: writing a large file causes unreasonable system behaviour


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/uvm/uvm_pdaemon.c
cvs rdiff -u -r1.17 -r1.18 src/sys/uvm/uvm_pdaemon.h
cvs rdiff -u -r1.4 -r1.5 src/sys/uvm/uvm_pdpolicy.h
cvs rdiff -u -r1.23 -r1.24 src/sys/uvm/uvm_pdpolicy_clock.c
cvs rdiff -u -r1.19 -r1.20 src/sys/uvm/uvm_pdpolicy_clockpro.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/uvm/uvm_pdaemon.c
diff -u src/sys/uvm/uvm_pdaemon.c:1.118 src/sys/uvm/uvm_pdaemon.c:1.119
--- src/sys/uvm/uvm_pdaemon.c:1.118	Sat Dec 21 16:10:20 2019
+++ src/sys/uvm/uvm_pdaemon.c	Mon Dec 30 18:08:37 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pdaemon.c,v 1.118 2019/12/21 16:10:20 ad Exp $	*/
+/*	$NetBSD: uvm_pdaemon.c,v 1.119 2019/12/30 18:08:37 ad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.118 2019/12/21 16:10:20 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.119 2019/12/30 18:08:37 ad Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_readahead.h"
@@ -83,6 +83,7 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.
 
 #include 
 #include 
+#include 
 
 #ifdef UVMHIST
 UVMHIST_DEFINE(pdhist);
@@ -598,7 +599,7 @@ swapcluster_nused(struct swapcluster *sw
  * => return true if a page had an associated slot.
  */
 
-static bool
+bool
 uvmpd_dropswap(struct vm_page *pg)
 {
 	bool result = false;
@@ -622,50 +623,6 @@ uvmpd_dropswap(struct vm_page *pg)
 	return result;
 }
 
-/*
- * uvmpd_trydropswap: try to free any swap allocated to this page.
- *
- * => return true if a slot is successfully freed.
- * => page interlock must be held, and will be dropped.
- */
-
-bool
-uvmpd_trydropswap(struct vm_page *pg)
-{
-	kmutex_t *slock;
-	bool result;
-
-	if ((pg->flags & PG_BUSY) != 0) {
-		mutex_exit(>interlock);
-		return false;
-	}
-
-	/*
-	 * lock the page's owner.
-	 * this will drop pg->interlock.
-	 */
-
-	slock = uvmpd_trylockowner(pg);
-	if (slock == NULL) {
-		return false;
-	}
-
-	/*
-	 * skip this page if it's busy.
-	 */
-
-	if ((pg->flags & PG_BUSY) != 0) {
-		mutex_exit(slock);
-		return false;
-	}
-
-	result = uvmpd_dropswap(pg);
-
-	mutex_exit(slock);
-
-	return result;
-}
-
 #endif /* defined(VMSWAP) */
 
 /*
@@ -909,6 +866,8 @@ uvmpd_scan_queue(void)
 #endif /* defined(VMSWAP) */
 	}
 
+	uvmpdpol_scanfini();
+
 #if defined(VMSWAP)
 	swapcluster_flush(, true);
 #endif /* defined(VMSWAP) */
@@ -1031,17 +990,44 @@ uvm_estimatepageable(int *active, int *i
 static void
 uvmpd_pool_drain_thread(void *arg)
 {
-	int bufcnt;
+	struct pool *firstpool, *curpool;
+	int bufcnt, lastslept;
+	bool cycled;
 
+	firstpool = NULL;
+	cycled = true;
 	for (;;) {
+		/*
+		 * sleep until awoken by the pagedaemon.
+		 */
 		mutex_enter(_lock);
 		if (!uvmpd_pool_drain_run) {
+			lastslept = hardclock_ticks;
 			cv_wait(_pool_drain_cv, _lock);
+			if (hardclock_ticks != lastslept) {
+cycled = false;
+firstpool = NULL;
+			}
 		}
 		uvmpd_pool_drain_run = false;
 		mutex_exit(_lock);
 
 		/*
+		 * rate limit draining, otherwise in desperate circumstances
+		 * this can totally saturate the system with xcall activity.
+		 */
+		if (cycled) {
+			kpause("uvmpdlmt", false, 1, NULL);
+			cycled = false;
+			firstpool = NULL;
+		}
+
+		/*
+		 * drain and temporarily disable the freelist cache.
+		 */
+		uvm_pgflcache_pause();
+
+		/*
 		 * kill unused metadata buffers.
 		 */
 		bufcnt = uvmexp.freetarg - uvm_free();
@@ -1053,9 +1039,16 @@ uvmpd_pool_drain_thread(void *arg)
 		mutex_exit(_lock);
 
 		/*
-		 * drain a pool.
+		 * drain a pool, and then re-enable the freelist cache. 
 		 */
-		pool_drain(NULL);
+		(void)pool_drain();
+		KASSERT(curpool != NULL);
+		if (firstpool == NULL) {
+			firstpool = curpool;
+		} else if (firstpool == curpool) {
+			cycled = true;
+		}
+		uvm_pgflcache_resume();
 	}
 	/*NOTREACHED*/
 }

Index: src/sys/uvm/uvm_pdaemon.h
diff -u src/sys/uvm/uvm_pdaemon.h:1.17 src/sys/uvm/uvm_pdaemon.h:1.18
--- 

CVS commit: src/sys/uvm

2019-12-30 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Dec 30 18:08:38 UTC 2019

Modified Files:
src/sys/uvm: uvm_pdaemon.c uvm_pdaemon.h uvm_pdpolicy.h
uvm_pdpolicy_clock.c uvm_pdpolicy_clockpro.c

Log Message:
pagedaemon:

- Use marker pages to keep place in the queue when scanning, rather than
  relying on assumptions.

- In uvmpdpol_balancequeue(), lock the object once instead of twice.

- When draining pools, the situation is getting desperate, but try to avoid
  saturating the system with xcall, lock and interrupt activity by sleeping
  for 1 clock tick if being continually awoken and all pools have been
  cycled through at least once.

- Pause & resume the freelist cache during pool draining.

PR kern/54209: NetBSD 8 large memory performance extremely low
PR kern/54210: NetBSD-8 processes presumably not exiting
PR kern/54727: writing a large file causes unreasonable system behaviour


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/uvm/uvm_pdaemon.c
cvs rdiff -u -r1.17 -r1.18 src/sys/uvm/uvm_pdaemon.h
cvs rdiff -u -r1.4 -r1.5 src/sys/uvm/uvm_pdpolicy.h
cvs rdiff -u -r1.23 -r1.24 src/sys/uvm/uvm_pdpolicy_clock.c
cvs rdiff -u -r1.19 -r1.20 src/sys/uvm/uvm_pdpolicy_clockpro.c

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



CVS commit: src/sys/uvm

2019-12-30 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Dec 30 17:47:06 UTC 2019

Modified Files:
src/sys/uvm: uvm_pgflcache.c

Log Message:
Freelist cache: drain using a high-priority xcall and re-enable now that
the pagedaemon starvation problem should be fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/uvm/uvm_pgflcache.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/uvm/uvm_pgflcache.c
diff -u src/sys/uvm/uvm_pgflcache.c:1.3 src/sys/uvm/uvm_pgflcache.c:1.4
--- src/sys/uvm/uvm_pgflcache.c:1.3	Sun Dec 29 15:45:28 2019
+++ src/sys/uvm/uvm_pgflcache.c	Mon Dec 30 17:47:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pgflcache.c,v 1.3 2019/12/29 15:45:28 ad Exp $	*/
+/*	$NetBSD: uvm_pgflcache.c,v 1.4 2019/12/30 17:47:06 ad Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pgflcache.c,v 1.3 2019/12/29 15:45:28 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pgflcache.c,v 1.4 2019/12/30 17:47:06 ad Exp $");
 
 #include "opt_uvm.h"
 #include "opt_multiprocessor.h"
@@ -99,9 +99,7 @@ struct pgflcache {
 };
 
 static kmutex_t		uvm_pgflcache_lock;
-static kcondvar_t	uvm_pgflcache_cv;
 static int		uvm_pgflcache_sem;
-static bool		uvm_pgflcache_draining;
 
 /*
  * uvm_pgflcache_fill: fill specified freelist/color from global list
@@ -318,17 +316,9 @@ uvm_pgflcache_pause(void)
 	/* First one in starts draining.  Everyone else waits. */
 	mutex_enter(_pgflcache_lock);
 	if (uvm_pgflcache_sem++ == 0) {
-		uvm_pgflcache_draining = true;
-		mutex_exit(_pgflcache_lock);
-		where = xc_broadcast(0, uvm_pgflcache_fini_cpu, NULL, NULL);
+		where = xc_broadcast(XC_HIGHPRI, uvm_pgflcache_fini_cpu,
+		(void *)1, NULL);
 		xc_wait(where);
-		mutex_enter(_pgflcache_lock);
-		uvm_pgflcache_draining = false;
-		cv_broadcast(_pgflcache_cv);
-	} else {
-		while (uvm_pgflcache_draining) {
-			cv_wait(_pgflcache_cv, _pgflcache_lock);
-		}
 	}
 	mutex_exit(_pgflcache_lock);
 }
@@ -349,7 +339,6 @@ uvm_pgflcache_resume(void)
 
 	/* Last guy out takes care of business. */
 	mutex_enter(_pgflcache_lock);
-	KASSERT(!uvm_pgflcache_draining);
 	KASSERT(uvm_pgflcache_sem > 0);
 	if (uvm_pgflcache_sem-- > 1) {
 		mutex_exit(_pgflcache_lock);
@@ -406,7 +395,7 @@ uvm_pgflcache_start(void)
 	}
 
 	/* Kick it into action. */
-	/* uvm_pgflcache_resume(); */
+	uvm_pgflcache_resume();
 }
 
 /*
@@ -419,7 +408,6 @@ uvm_pgflcache_init(void)
 
 	uvm_pgflcache_sem = 1;
 	mutex_init(_pgflcache_lock, MUTEX_DEFAULT, IPL_NONE);
-	cv_init(_pgflcache_cv, "flcache");
 }
 
 #else	/* MULTIPROCESSOR */



CVS commit: src/sys/uvm

2019-12-30 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Dec 30 17:47:06 UTC 2019

Modified Files:
src/sys/uvm: uvm_pgflcache.c

Log Message:
Freelist cache: drain using a high-priority xcall and re-enable now that
the pagedaemon starvation problem should be fixed.


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

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



CVS commit: src/sys/uvm

2019-12-30 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Dec 30 17:45:53 UTC 2019

Modified Files:
src/sys/uvm: uvm_page.c

Log Message:
uvm_pagealloc_pgb(): don't fill cache if we're into the reserves.

uvm_pagereplace(): use radix_tree_replace_node() to avoid alloc/free.


To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 src/sys/uvm/uvm_page.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/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.216 src/sys/uvm/uvm_page.c:1.217
--- src/sys/uvm/uvm_page.c:1.216	Sat Dec 28 16:07:41 2019
+++ src/sys/uvm/uvm_page.c	Mon Dec 30 17:45:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.216 2019/12/28 16:07:41 ad Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.217 2019/12/30 17:45:53 ad Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.216 2019/12/28 16:07:41 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.217 2019/12/30 17:45:53 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvm.h"
@@ -1028,6 +1028,7 @@ uvm_pagealloc_pgb(struct uvm_cpu *ucpu, 
 	struct pgflbucket *pgb;
 	struct vm_page *pg;
 	kmutex_t *lock;
+	bool fill;
 
 	/*
 	 * Skip the bucket if empty, no lock needed.  There could be many
@@ -1048,6 +1049,9 @@ uvm_pagealloc_pgb(struct uvm_cpu *ucpu, 
 			mutex_spin_exit(lock);
 		 	return NULL;
 		}
+		fill = false;
+	} else {
+		fill = true;
 	}
 
 	/* Try all page colors as needed. */
@@ -1073,7 +1077,7 @@ uvm_pagealloc_pgb(struct uvm_cpu *ucpu, 
 			 * so if we found pages in this CPU's preferred
 			 * bucket.
 			 */
-			if (__predict_true(b == ucpu->pgflbucket)) {
+			if (__predict_true(b == ucpu->pgflbucket && fill)) {
 uvm_pgflcache_fill(ucpu, f, b, c);
 			}
 			mutex_spin_exit(lock);
@@ -1347,6 +1351,7 @@ void
 uvm_pagereplace(struct vm_page *oldpg, struct vm_page *newpg)
 {
 	struct uvm_object *uobj = oldpg->uobject;
+	struct vm_page *pg __diagused;
 
 	KASSERT((oldpg->flags & PG_TABLED) != 0);
 	KASSERT(uobj != NULL);
@@ -1355,8 +1360,9 @@ uvm_pagereplace(struct vm_page *oldpg, s
 	KASSERT(mutex_owned(uobj->vmobjlock));
 
 	newpg->offset = oldpg->offset;
-	uvm_pageremove_tree(uobj, oldpg);
-	uvm_pageinsert_tree(uobj, newpg);
+	pg = radix_tree_replace_node(>uo_pages,
+	newpg->offset >> PAGE_SHIFT, newpg);
+	KASSERT(pg == oldpg);
 
 	/* take page interlocks during rename */
 	if (oldpg < newpg) {



CVS commit: src/sys/uvm

2019-12-30 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Dec 30 17:45:53 UTC 2019

Modified Files:
src/sys/uvm: uvm_page.c

Log Message:
uvm_pagealloc_pgb(): don't fill cache if we're into the reserves.

uvm_pagereplace(): use radix_tree_replace_node() to avoid alloc/free.


To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 src/sys/uvm/uvm_page.c

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



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

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 16:41:38 UTC 2019

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

Log Message:
Oops, don't match brcm,bcm2711-emmc2 here.

Thanks to jmcneill for pointing out my mistake


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/arm/broadcom/bcm2835_emmc.c

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

Modified files:

Index: src/sys/arch/arm/broadcom/bcm2835_emmc.c
diff -u src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.34 src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.35
--- src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.34	Mon Dec 30 15:31:15 2019
+++ src/sys/arch/arm/broadcom/bcm2835_emmc.c	Mon Dec 30 16:41:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_emmc.c,v 1.34 2019/12/30 15:31:15 skrll Exp $	*/
+/*	$NetBSD: bcm2835_emmc.c,v 1.35 2019/12/30 16:41:38 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.34 2019/12/30 15:31:15 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.35 2019/12/30 16:41:38 skrll Exp $");
 
 #include "bcmdmac.h"
 
@@ -97,7 +97,6 @@ bcmemmc_match(device_t parent, struct cf
 {
 	const char * const compatible[] = {
 	"brcm,bcm2835-sdhci",
-	"brcm,bcm2711-emmc2",
 	NULL
 	};
 	struct fdt_attach_args * const faa = aux;



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

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 16:41:38 UTC 2019

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

Log Message:
Oops, don't match brcm,bcm2711-emmc2 here.

Thanks to jmcneill for pointing out my mistake


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/arm/broadcom/bcm2835_emmc.c

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



CVS commit: src/sys/dev/sdmmc

2019-12-30 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Dec 30 16:28:15 UTC 2019

Modified Files:
src/sys/dev/sdmmc: if_bwfm_sdio.c

Log Message:
Follow the Linux driver an use the FDT "compatible" property to build a
filename for the nvram config file, fall back to the standard filename.

E.g.

# ofctl -p /
[Caching 123 nodes and 1093 properties]
#address-cells  0001    1
#size-cells 0001    1
compatible  73696e6f 766f6970 2c627069 2d6d322d   "sinovoip,bpi-m2-
0010:   7a65726f 00..     zero"
0015:   616c6c77 696e6e65 722c7375 6e38692d   "allwinner,sun8i-
0025:   68322d70 6c757300     h2-plus"
interrupt-parent0001      
model   42616e61 6e612050 69204250 492d4d32   "Banana Pi BPI-M2
0010:   2d5a6572 6f00     -Zero"
name00..      ""
serial-number   30326330 30303432 65636431 36376566   02c00042ecd167ef
0010:   00..      .

-rw-r--r--  1 root  wheel 875 Nov  2 12:06 brcmfmac43430-sdio.AP6212.txt
lrwxr-xr-x  1 root  wheel  29 Dec 30 16:19 
brcmfmac43430-sdio.sinovoip,bpi-m2-zero.txt -> brcmfmac43430-sdio.AP6212.txt
-rw-r--r--  1 root  wheel 874 Jun 30  2019 
brcmfmac43430-sdio.raspberrypi,3-model-b.txt
-rw-r--r--  1 root  wheel1864 Jun 30  2019 
brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt
lrwxr-xr-x  1 root  wheel  29 Dec 30 11:24 
brcmfmac43455-sdio.raspberrypi,4-model-b-plus.txt -> 
brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/sdmmc/if_bwfm_sdio.c

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



CVS commit: src/sys/dev/sdmmc

2019-12-30 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Dec 30 16:28:15 UTC 2019

Modified Files:
src/sys/dev/sdmmc: if_bwfm_sdio.c

Log Message:
Follow the Linux driver an use the FDT "compatible" property to build a
filename for the nvram config file, fall back to the standard filename.

E.g.

# ofctl -p /
[Caching 123 nodes and 1093 properties]
#address-cells  0001    1
#size-cells 0001    1
compatible  73696e6f 766f6970 2c627069 2d6d322d   "sinovoip,bpi-m2-
0010:   7a65726f 00..     zero"
0015:   616c6c77 696e6e65 722c7375 6e38692d   "allwinner,sun8i-
0025:   68322d70 6c757300     h2-plus"
interrupt-parent0001      
model   42616e61 6e612050 69204250 492d4d32   "Banana Pi BPI-M2
0010:   2d5a6572 6f00     -Zero"
name00..      ""
serial-number   30326330 30303432 65636431 36376566   02c00042ecd167ef
0010:   00..      .

-rw-r--r--  1 root  wheel 875 Nov  2 12:06 brcmfmac43430-sdio.AP6212.txt
lrwxr-xr-x  1 root  wheel  29 Dec 30 16:19 
brcmfmac43430-sdio.sinovoip,bpi-m2-zero.txt -> brcmfmac43430-sdio.AP6212.txt
-rw-r--r--  1 root  wheel 874 Jun 30  2019 
brcmfmac43430-sdio.raspberrypi,3-model-b.txt
-rw-r--r--  1 root  wheel1864 Jun 30  2019 
brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt
lrwxr-xr-x  1 root  wheel  29 Dec 30 11:24 
brcmfmac43455-sdio.raspberrypi,4-model-b-plus.txt -> 
brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/sdmmc/if_bwfm_sdio.c

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

Modified files:

Index: src/sys/dev/sdmmc/if_bwfm_sdio.c
diff -u src/sys/dev/sdmmc/if_bwfm_sdio.c:1.9 src/sys/dev/sdmmc/if_bwfm_sdio.c:1.10
--- src/sys/dev/sdmmc/if_bwfm_sdio.c:1.9	Mon Oct 28 06:37:52 2019
+++ src/sys/dev/sdmmc/if_bwfm_sdio.c	Mon Dec 30 16:28:14 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bwfm_sdio.c,v 1.9 2019/10/28 06:37:52 mlelstv Exp $ */
+/* $NetBSD: if_bwfm_sdio.c,v 1.10 2019/12/30 16:28:14 mlelstv Exp $ */
 /* $OpenBSD: if_bwfm_sdio.c,v 1.1 2017/10/11 17:19:50 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -116,6 +116,7 @@ static void	bwfm_sdio_attach(device_t, d
 static int	bwfm_sdio_detach(device_t, int);
 static void	bwfm_sdio_attachhook(device_t);
 static int	bwfm_fdt_find_phandle(device_t, device_t);
+static const char *bwfm_fdt_get_model(void);
 
 static void	bwfm_sdio_backplane(struct bwfm_sdio_softc *, uint32_t);
 static uint8_t	bwfm_sdio_read_1(struct bwfm_sdio_softc *, uint32_t);
@@ -377,7 +378,8 @@ bwfm_sdio_attachhook(device_t self)
 	struct bwfm_sdio_softc *sc = device_private(self);
 	struct bwfm_softc *bwfm = >sc_sc;
 	firmware_handle_t fwh;
-	const char *name, *nvname;
+	const char *name, *nvname, *model;
+	char *nvnamebuf;
 	u_char *ucode, *nvram;
 	size_t size, nvlen, nvsize;
 	uint32_t reg, clk;
@@ -435,6 +437,21 @@ bwfm_sdio_attachhook(device_t self)
 		goto err;
 	}
 
+	/* compute a model specific filename for the NV config */
+	nvnamebuf = NULL;
+	model = bwfm_fdt_get_model();
+	if (model != NULL) {
+		/* assume nvname ends in ".txt" */
+		nvnamebuf = kmem_asprintf("%.*s.%s.txt",
+		(int)(strlen(nvname) - 4),
+		nvname, model);
+	}
+
+	aprint_verbose_dev(self, "Firmware   %s\n", name);
+	aprint_verbose_dev(self, "Default Config %s\n", nvname);
+	if (nvnamebuf != NULL)
+		aprint_verbose_dev(self, "Model Config   %s\n", nvnamebuf);
+
 	if (firmware_open("if_bwfm", name, ) != 0) {
 		printf("%s: failed firmware_open of file %s\n",
 		DEVNAME(sc), name);
@@ -456,7 +473,8 @@ bwfm_sdio_attachhook(device_t self)
 		goto err1;
 	}
 
-	if (firmware_open("if_bwfm", nvname, ) != 0) {
+	if ((nvnamebuf == NULL || firmware_open("if_bwfm", nvnamebuf, ) != 0)
+	&& firmware_open("if_bwfm", nvname, ) != 0) {
 		printf("%s: failed firmware_open of file %s\n",
 		DEVNAME(sc), nvname);
 		goto err1;
@@ -492,6 +510,8 @@ bwfm_sdio_attachhook(device_t self)
 
 	firmware_free(nvram, nvlen);
 	firmware_free(ucode, size);
+	if (nvnamebuf != NULL)
+		kmem_free(nvnamebuf, strlen(nvnamebuf)+1);
 
 	sdmmc_pause(hztoms(1)*1000, NULL);
 
@@ -565,6 +585,8 @@ err2:
 	firmware_free(nvram, nvlen);
 err1:
 	firmware_free(ucode, size);
+	if (nvnamebuf != NULL)
+		kmem_free(nvnamebuf, strlen(nvnamebuf)+1);
 err:
 	return;
 }
@@ -603,6 +625,15 @@ bwfm_fdt_find_phandle(device_t self, dev
 	return phandle;
 }
 
+static const char *
+bwfm_fdt_get_model(void)
+{
+	int phandle;
+
+	phandle = OF_finddevice("/");
+	return fdtbus_get_string_index(phandle, "compatible", 0);
+}
+
 static int
 bwfm_sdio_detach(device_t self, int 

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

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 16:19:27 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: bcm2835reg.h bcm283x_platform.c
bcm283x_platform.h

Log Message:
Fix up ARM_LOCAL for 2711 so that it works now.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/broadcom/bcm2835reg.h
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arm/broadcom/bcm283x_platform.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/broadcom/bcm283x_platform.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/broadcom/bcm2835reg.h
diff -u src/sys/arch/arm/broadcom/bcm2835reg.h:1.28 src/sys/arch/arm/broadcom/bcm2835reg.h:1.29
--- src/sys/arch/arm/broadcom/bcm2835reg.h:1.28	Thu Dec 26 11:09:11 2019
+++ src/sys/arch/arm/broadcom/bcm2835reg.h	Mon Dec 30 16:19:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835reg.h,v 1.28 2019/12/26 11:09:11 skrll Exp $	*/
+/*	$NetBSD: bcm2835reg.h,v 1.29 2019/12/30 16:19:27 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -202,8 +202,14 @@
 
 #define	BCM2835_UART0_CLK		300
 
+#define	BCM2711_ARM_LOCAL_BASE_BUS	0x4000
 #define	BCM2711_ARM_LOCAL_BASE		0xff80
-#define	BCM2711_ARM_LOCAL_SIZE		0x0010	/* 1MByte */
+#define	BCM2711_ARM_LOCAL_SIZE		0x0010	/* 1MBytes */
+
+#define	BCM2711_ARM_LOCAL_PHYS_TO_BUS(a) \
+((a) - BCM2711_ARM_LOCAL_BASE + BCM2711_ARM_LOCAL_BASE_BUS)
+#define	BCM2711_ARM_LOCAL_BUS_TO_PHYS(a) \
+((a) - BCM2711_ARM_LOCAL_BASE_BUS + BCM2711_ARM_LOCAL_BASE)
 
 #define	BCM2836_ARM_LOCAL_BASE		0x4000
 #define	BCM2836_ARM_LOCAL_SIZE		0x1000	/* 4KBytes */

Index: src/sys/arch/arm/broadcom/bcm283x_platform.c
diff -u src/sys/arch/arm/broadcom/bcm283x_platform.c:1.30 src/sys/arch/arm/broadcom/bcm283x_platform.c:1.31
--- src/sys/arch/arm/broadcom/bcm283x_platform.c:1.30	Mon Dec 30 16:06:29 2019
+++ src/sys/arch/arm/broadcom/bcm283x_platform.c	Mon Dec 30 16:19:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm283x_platform.c,v 1.30 2019/12/30 16:06:29 skrll Exp $	*/
+/*	$NetBSD: bcm283x_platform.c,v 1.31 2019/12/30 16:19:27 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.30 2019/12/30 16:06:29 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.31 2019/12/30 16:19:27 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_bcm283x.h"
@@ -187,9 +187,9 @@ bcm2711_bus_to_phys(bus_addr_t ba)
 	ba < BCM283X_PERIPHERALS_BASE_BUS + BCM283X_PERIPHERALS_SIZE)
 		return BCM2711_PERIPHERALS_BUS_TO_PHYS(ba);
 
-	if (ba >= BCM2711_ARM_LOCAL_BASE &&
-	ba < BCM2711_ARM_LOCAL_BASE + BCM2711_ARM_LOCAL_SIZE)
-		return ba;
+	if (ba >= BCM2711_ARM_LOCAL_BASE_BUS &&
+	ba < BCM2711_ARM_LOCAL_BASE_BUS + BCM2711_ARM_LOCAL_SIZE)
+		return BCM2711_ARM_LOCAL_BUS_TO_PHYS(ba);
 
 	return ba & ~BCM2835_BUSADDR_CACHE_MASK;
 }
@@ -333,7 +333,7 @@ bcm2711_platform_devmap(void)
 		BCM2711_ARM_LOCAL_SIZE),
 #if defined(MULTIPROCESSOR) && defined(__aarch64__)
 		/* for fdt cpu spin-table */
-		DEVMAP_ENTRY(BCM2836_ARM_SMP_VBASE, BCM2836_ARM_SMP_BASE,
+		DEVMAP_ENTRY(BCM2711_ARM_SMP_VBASE, BCM2836_ARM_SMP_BASE,
 		BCM2836_ARM_SMP_SIZE),
 #endif
 		DEVMAP_ENTRY_END

Index: src/sys/arch/arm/broadcom/bcm283x_platform.h
diff -u src/sys/arch/arm/broadcom/bcm283x_platform.h:1.4 src/sys/arch/arm/broadcom/bcm283x_platform.h:1.5
--- src/sys/arch/arm/broadcom/bcm283x_platform.h:1.4	Tue Dec 24 14:10:51 2019
+++ src/sys/arch/arm/broadcom/bcm283x_platform.h	Mon Dec 30 16:19:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm283x_platform.h,v 1.4 2019/12/24 14:10:51 skrll Exp $	*/
+/*	$NetBSD: bcm283x_platform.h,v 1.5 2019/12/30 16:19:27 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -58,4 +58,7 @@
 #define	BCM2711_ARM_LOCAL_VBASE \
 	BCM2711_IOPHYSTOVIRT(BCM2711_ARM_LOCAL_BASE)
 
+#define	BCM2711_ARM_SMP_VBASE	\
+	BCM2711_IOPHYSTOVIRT(BCM2836_ARM_SMP_BASE)
+
 #endif /* _ARM_BCM2835REG_PLATFORM_H_ */



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

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 16:19:27 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: bcm2835reg.h bcm283x_platform.c
bcm283x_platform.h

Log Message:
Fix up ARM_LOCAL for 2711 so that it works now.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/broadcom/bcm2835reg.h
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arm/broadcom/bcm283x_platform.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/broadcom/bcm283x_platform.h

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



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

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 16:06:29 UTC 2019

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

Log Message:
Invalidate the cache just before trying to read the results from the
firmware as RPI4 A72s can fill the cache with speculation


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/broadcom/bcm283x_platform.c

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

Modified files:

Index: src/sys/arch/arm/broadcom/bcm283x_platform.c
diff -u src/sys/arch/arm/broadcom/bcm283x_platform.c:1.29 src/sys/arch/arm/broadcom/bcm283x_platform.c:1.30
--- src/sys/arch/arm/broadcom/bcm283x_platform.c:1.29	Mon Dec 30 15:36:37 2019
+++ src/sys/arch/arm/broadcom/bcm283x_platform.c	Mon Dec 30 16:06:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm283x_platform.c,v 1.29 2019/12/30 15:36:37 skrll Exp $	*/
+/*	$NetBSD: bcm283x_platform.c,v 1.30 2019/12/30 16:06:29 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.29 2019/12/30 15:36:37 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.30 2019/12/30 16:06:29 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_bcm283x.h"
@@ -744,6 +744,13 @@ bcm283x_bootparams(bus_space_tag_t iot, 
 
 	bcm2835_mbox_read(iot, ioh, BCMMBOX_CHANARM2VC, );
 
+	/*
+	 * RPI4 has Cortex A72 processors which do speculation, so
+	 * we need to invalidate the cache for an updates done by
+	 * the firmware
+	 */
+	cpu_dcache_inv_range((vaddr_t), sizeof(vb));
+
 	if (!vcprop_buffer_success_p(_hdr)) {
 		bootconfig.dramblocks = 1;
 		bootconfig.dram[0].address = 0x0;



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

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 16:06:29 UTC 2019

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

Log Message:
Invalidate the cache just before trying to read the results from the
firmware as RPI4 A72s can fill the cache with speculation


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/broadcom/bcm283x_platform.c

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



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

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 16:05:16 UTC 2019

Modified Files:
src/sys/arch/aarch64/include: pmap.h

Log Message:
Drop DEVMAP_{TRUNK_ADDR,ROUND_SIZE} to 4KB pages now that pmap_map_chunk
allows this.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/aarch64/include/pmap.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/aarch64/include/pmap.h
diff -u src/sys/arch/aarch64/include/pmap.h:1.28 src/sys/arch/aarch64/include/pmap.h:1.29
--- src/sys/arch/aarch64/include/pmap.h:1.28	Sat Dec 28 17:19:43 2019
+++ src/sys/arch/aarch64/include/pmap.h	Mon Dec 30 16:05:15 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.28 2019/12/28 17:19:43 jmcneill Exp $ */
+/* $NetBSD: pmap.h,v 1.29 2019/12/30 16:05:15 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -198,10 +198,11 @@ paddr_t pmap_alloc_pdp(struct pmap *, st
 #define L1_ROUND_BLOCK(x)	L1_TRUNC_BLOCK((x) + L1_SIZE - 1)
 #define L2_TRUNC_BLOCK(x)	((x) & L2_FRAME)
 #define L2_ROUND_BLOCK(x)	L2_TRUNC_BLOCK((x) + L2_SIZE - 1)
+#define L3_TRUNC_BLOCK(x)	((x) & L3_FRAME)
+#define L3_ROUND_BLOCK(x)	L3_TRUNC_BLOCK((x) + L3_SIZE - 1)
 
-/* devmap use L2 blocks. (2Mbyte) */
-#define DEVMAP_TRUNC_ADDR(x)	L2_TRUNC_BLOCK((x))
-#define DEVMAP_ROUND_SIZE(x)	L2_ROUND_BLOCK((x))
+#define DEVMAP_TRUNC_ADDR(x)	L3_TRUNC_BLOCK((x))
+#define DEVMAP_ROUND_SIZE(x)	L3_ROUND_BLOCK((x))
 
 #define	DEVMAP_ENTRY(va, pa, sz)			\
 	{		\



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

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 16:05:16 UTC 2019

Modified Files:
src/sys/arch/aarch64/include: pmap.h

Log Message:
Drop DEVMAP_{TRUNK_ADDR,ROUND_SIZE} to 4KB pages now that pmap_map_chunk
allows this.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/aarch64/include/pmap.h

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



CVS commit: src/sys/arch/aarch64/aarch64

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 16:03:48 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c

Log Message:
Update pmap_map_chunk to allow L[12] block mappings and L3 page mappings


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/aarch64/aarch64/pmap.c

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



CVS commit: src/sys/arch/aarch64/aarch64

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 16:03:48 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c

Log Message:
Update pmap_map_chunk to allow L[12] block mappings and L3 page mappings


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/aarch64/aarch64/pmap.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/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.59 src/sys/arch/aarch64/aarch64/pmap.c:1.60
--- src/sys/arch/aarch64/aarch64/pmap.c:1.59	Mon Dec 30 15:42:39 2019
+++ src/sys/arch/aarch64/aarch64/pmap.c	Mon Dec 30 16:03:48 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.59 2019/12/30 15:42:39 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.60 2019/12/30 16:03:48 skrll Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.59 2019/12/30 15:42:39 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.60 2019/12/30 16:03:48 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -268,6 +268,12 @@ pm_unlock(struct pmap *pm)
 
 static const struct pmap_devmap *pmap_devmap_table;
 
+#define	L1_BLK_MAPPABLE_P(va, pa, size)	\
+va) | (pa)) & L1_OFFSET) == 0 && (size) >= L1_SIZE)
+
+#define	L2_BLK_MAPPABLE_P(va, pa, size)	\
+va) | (pa)) & L2_OFFSET) == 0 && (size) >= L2_SIZE)
+
 static vsize_t
 pmap_map_chunk(vaddr_t va, paddr_t pa, vsize_t size,
 vm_prot_t prot, u_int flags)
@@ -276,25 +282,40 @@ pmap_map_chunk(vaddr_t va, paddr_t pa, v
 	psize_t blocksize;
 	int rc;
 
-	/* devmap always use L2 mapping */
-	blocksize = L2_SIZE;
+	vsize_t resid = round_page(size);
+	vsize_t mapped = 0;
 
-	attr = _pmap_pte_adjust_prot(L2_BLOCK, prot, VM_PROT_ALL, false);
-	attr = _pmap_pte_adjust_cacheflags(attr, flags);
-	/* user cannot execute, and kernel follows the prot */
-	attr |= (LX_BLKPAG_UXN|LX_BLKPAG_PXN);
-	if (prot & VM_PROT_EXECUTE)
-		attr &= ~LX_BLKPAG_PXN;
+	while (resid > 0) {
+		if (L1_BLK_MAPPABLE_P(va, pa, resid)) {
+			blocksize = L1_SIZE;
+			attr = L1_BLOCK;
+		} else if (L2_BLK_MAPPABLE_P(va, pa, resid)) {
+			blocksize = L2_SIZE;
+			attr = L2_BLOCK;
+		} else {
+			blocksize = L3_SIZE;
+			attr = L3_PAGE;
+		}
+
+		attr = _pmap_pte_adjust_prot(attr, prot, VM_PROT_ALL, false);
+		attr = _pmap_pte_adjust_cacheflags(attr, flags);
 
-	rc = pmapboot_enter(va, pa, size, blocksize, attr,
-	PMAPBOOT_ENTER_NOOVERWRITE, bootpage_alloc, NULL);
-	if (rc != 0)
-		panic("%s: pmapboot_enter failed. %lx is already mapped?\n",
-		__func__, va);
+		rc = pmapboot_enter(va, pa, blocksize, blocksize, attr,
+		PMAPBOOT_ENTER_NOOVERWRITE, bootpage_alloc, NULL);
+		if (rc != 0) {
+			panic("%s: pmapboot_enter failed. %lx is already mapped?\n",
+			__func__, va);
+		}
 
-	aarch64_tlbi_by_va(va);
+		va += blocksize;
+		pa += blocksize;
+		resid -= blocksize;
+		mapped += blocksize;
+
+		aarch64_tlbi_by_va(va);
+	}
 
-	return ((va + size + blocksize - 1) & ~(blocksize - 1)) - va;
+	return mapped;
 }
 
 void



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

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 15:58:12 UTC 2019

Modified Files:
src/sys/arch/evbarm/rpi: vcprop.h

Log Message:
Add emmc2 clock goop from mlelstv@

(missing commit)


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/rpi/vcprop.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/evbarm/rpi/vcprop.h
diff -u src/sys/arch/evbarm/rpi/vcprop.h:1.16 src/sys/arch/evbarm/rpi/vcprop.h:1.17
--- src/sys/arch/evbarm/rpi/vcprop.h:1.16	Sat Jun 17 17:03:40 2017
+++ src/sys/arch/evbarm/rpi/vcprop.h	Mon Dec 30 15:58:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vcprop.h,v 1.16 2017/06/17 17:03:40 jmcneill Exp $	*/
+/*	$NetBSD: vcprop.h,v 1.17 2019/12/30 15:58:12 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -179,6 +179,7 @@ struct vcprop_tag_boardserial {
 #define	VCPROP_CLK_SDRAM	8
 #define	VCPROP_CLK_PIXEL	9
 #define	VCPROP_CLK_PWM		10
+#define	VCPROP_CLK_EMMC2	12
 
 struct vcprop_clock {
 	uint32_t pclk;



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

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 15:58:12 UTC 2019

Modified Files:
src/sys/arch/evbarm/rpi: vcprop.h

Log Message:
Add emmc2 clock goop from mlelstv@

(missing commit)


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/rpi/vcprop.h

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



CVS commit: src/sys/arch/aarch64/aarch64

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 15:54:55 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c

Log Message:
Flush the cache and disable TTBR0 translations once we're done with
them in cpu_kernel_vm_init

The Cortex A72s in RPI4 need the cache flush for some reason.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/aarch64/aarch64/aarch64_machdep.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.35 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.36
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.35	Wed Dec 18 21:45:43 2019
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Mon Dec 30 15:54:55 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.35 2019/12/18 21:45:43 riastradh Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.36 2019/12/30 15:54:55 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.35 2019/12/18 21:45:43 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.36 2019/12/30 15:54:55 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -205,6 +205,13 @@ cpu_kernel_vm_init(uint64_t memory_start
 			left -= mapsize;
 		}
 	}
+	aarch64_dcache_wbinv_all();
+
+	/* Disable translation table walks using TTBR0 */
+	uint64_t tcr = reg_tcr_el1_read();
+	reg_tcr_el1_write(tcr | TCR_EPD0);
+	__asm __volatile("isb" ::: "memory");
+
 	aarch64_tlbi_all();
 
 	/*



CVS commit: src/sys/arch/aarch64/aarch64

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 15:54:55 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c

Log Message:
Flush the cache and disable TTBR0 translations once we're done with
them in cpu_kernel_vm_init

The Cortex A72s in RPI4 need the cache flush for some reason.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/aarch64/aarch64/aarch64_machdep.c

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



CVS commit: src/sys/arch/aarch64/aarch64

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 15:42:40 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c

Log Message:
Remove unnecessary brackets and unwrap a conditional.  Same code before
and after.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/aarch64/aarch64/pmap.c

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



CVS commit: src/sys/arch/aarch64/aarch64

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 15:42:40 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c

Log Message:
Remove unnecessary brackets and unwrap a conditional.  Same code before
and after.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/aarch64/aarch64/pmap.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/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.58 src/sys/arch/aarch64/aarch64/pmap.c:1.59
--- src/sys/arch/aarch64/aarch64/pmap.c:1.58	Sat Dec 28 17:19:43 2019
+++ src/sys/arch/aarch64/aarch64/pmap.c	Mon Dec 30 15:42:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.58 2019/12/28 17:19:43 jmcneill Exp $	*/
+/*	$NetBSD: pmap.c,v 1.59 2019/12/30 15:42:39 skrll Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.58 2019/12/28 17:19:43 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.59 2019/12/30 15:42:39 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -323,8 +323,7 @@ pmap_devmap_bootstrap(vaddr_t l0pt, cons
 		(va < (VM_KERNEL_IO_ADDRESS + VM_KERNEL_IO_SIZE)));
 
 		/* update and check virtual_devmap_addr */
-		if ((virtual_devmap_addr == 0) ||
-		(virtual_devmap_addr > va)) {
+		if (virtual_devmap_addr == 0 || virtual_devmap_addr > va) {
 			virtual_devmap_addr = va;
 		}
 
@@ -423,7 +422,7 @@ pmap_bootstrap(vaddr_t vstart, vaddr_t v
 #endif
 
 	/* devmap already uses last of va? */
-	if ((virtual_devmap_addr != 0) && (virtual_devmap_addr < vend))
+	if (virtual_devmap_addr != 0 && virtual_devmap_addr < vend)
 		vend = virtual_devmap_addr;
 
 	virtual_avail = vstart;



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

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 15:36:37 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_cprman.c bcm2835var.h
bcm283x_platform.c

Log Message:
Add emmc2 clock goop from mlelstv@


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/broadcom/bcm2835_cprman.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/broadcom/bcm2835var.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/broadcom/bcm283x_platform.c

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



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

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 15:36:37 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_cprman.c bcm2835var.h
bcm283x_platform.c

Log Message:
Add emmc2 clock goop from mlelstv@


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/broadcom/bcm2835_cprman.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/broadcom/bcm2835var.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/broadcom/bcm283x_platform.c

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

Modified files:

Index: src/sys/arch/arm/broadcom/bcm2835_cprman.c
diff -u src/sys/arch/arm/broadcom/bcm2835_cprman.c:1.3 src/sys/arch/arm/broadcom/bcm2835_cprman.c:1.4
--- src/sys/arch/arm/broadcom/bcm2835_cprman.c:1.3	Tue Dec 24 13:40:56 2019
+++ src/sys/arch/arm/broadcom/bcm2835_cprman.c	Mon Dec 30 15:36:37 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_cprman.c,v 1.3 2019/12/24 13:40:56 skrll Exp $ */
+/* $NetBSD: bcm2835_cprman.c,v 1.4 2019/12/30 15:36:37 skrll Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_cprman.c,v 1.3 2019/12/24 13:40:56 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_cprman.c,v 1.4 2019/12/30 15:36:37 skrll Exp $");
 
 #include 
 #include 
@@ -56,6 +56,7 @@ enum {
 	CPRMAN_CLOCK_PERIIMAGE = 29,
 	CPRMAN_CLOCK_PWM = 30,
 	CPRMAN_CLOCK_PCM = 31,
+	CPRMAN_CLOCK_EMMC2 = 51,
 	CPRMAN_NCLOCK
 };
 
@@ -133,6 +134,8 @@ cprman_get_rate(void *priv, struct clk *
 		return bcm283x_clk_get_rate_vpu();
 	case CPRMAN_CLOCK_EMMC:
 		return bcm283x_clk_get_rate_emmc();
+	case CPRMAN_CLOCK_EMMC2:
+		return bcm283x_clk_get_rate_emmc2();
 	default:
 		panic("unsupported clock id %d\n", clk->id);
 	}
@@ -179,6 +182,7 @@ cprman_attach(device_t parent, device_t 
 	cprman_add_clock(sc, CPRMAN_CLOCK_UART, "uart");
 	cprman_add_clock(sc, CPRMAN_CLOCK_VPU, "vpu");
 	cprman_add_clock(sc, CPRMAN_CLOCK_EMMC, "emmc");
+	cprman_add_clock(sc, CPRMAN_CLOCK_EMMC2, "emmc2");
 
 	aprint_naive("\n");
 	aprint_normal(": BCM283x Clock Controller\n");

Index: src/sys/arch/arm/broadcom/bcm2835var.h
diff -u src/sys/arch/arm/broadcom/bcm2835var.h:1.4 src/sys/arch/arm/broadcom/bcm2835var.h:1.5
--- src/sys/arch/arm/broadcom/bcm2835var.h:1.4	Sun Apr  1 04:35:03 2018
+++ src/sys/arch/arm/broadcom/bcm2835var.h	Mon Dec 30 15:36:37 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835var.h,v 1.4 2018/04/01 04:35:03 ryo Exp $	*/
+/*	$NetBSD: bcm2835var.h,v 1.5 2019/12/30 15:36:37 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -49,5 +49,6 @@ void bcm2836_cpu_hatch(struct cpu_info *
 u_int bcm283x_clk_get_rate_uart(void);
 u_int bcm283x_clk_get_rate_vpu(void);
 u_int bcm283x_clk_get_rate_emmc(void);
+u_int bcm283x_clk_get_rate_emmc2(void);
 
 #endif	/* _ARM_BROADCOM_BCM2835_VAR_H_ */

Index: src/sys/arch/arm/broadcom/bcm283x_platform.c
diff -u src/sys/arch/arm/broadcom/bcm283x_platform.c:1.28 src/sys/arch/arm/broadcom/bcm283x_platform.c:1.29
--- src/sys/arch/arm/broadcom/bcm283x_platform.c:1.28	Tue Dec 24 14:10:51 2019
+++ src/sys/arch/arm/broadcom/bcm283x_platform.c	Mon Dec 30 15:36:37 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm283x_platform.c,v 1.28 2019/12/24 14:10:51 skrll Exp $	*/
+/*	$NetBSD: bcm283x_platform.c,v 1.29 2019/12/30 15:36:37 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.28 2019/12/24 14:10:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.29 2019/12/30 15:36:37 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_bcm283x.h"
@@ -402,6 +402,7 @@ static struct {
 	struct vcprop_tag_clockrate	vbt_emmcclockrate;
 	struct vcprop_tag_clockrate	vbt_armclockrate;
 	struct vcprop_tag_clockrate	vbt_vpuclockrate;
+	struct vcprop_tag_clockrate	vbt_emmc2clockrate;
 	struct vcprop_tag end;
 } vb __cacheline_aligned = {
 	.vb_hdr = {
@@ -488,6 +489,14 @@ static struct {
 		},
 		.id = VCPROP_CLK_CORE
 	},
+	.vbt_emmc2clockrate = {
+		.tag = {
+			.vpt_tag = VCPROPTAG_GET_CLOCKRATE,
+			.vpt_len = VCPROPTAG_LEN(vb.vbt_emmc2clockrate),
+			.vpt_rcode = VCPROPTAG_REQUEST
+		},
+		.id = VCPROP_CLK_EMMC2
+	},
 	.end = {
 		.vpt_tag = VCPROPTAG_NULL
 	}
@@ -639,6 +648,17 @@ bcm283x_clk_get_rate_emmc(void)
 	return 0;
 }
 
+u_int
+bcm283x_clk_get_rate_emmc2(void)
+{
+
+	if (vcprop_tag_success_p(_emmc2clockrate.tag) &&
+	vb.vbt_emmc2clockrate.rate > 0) {
+		return vb.vbt_emmc2clockrate.rate;
+	}
+	return 0;
+}
+
 
 
 static void
@@ -758,6 +778,15 @@ bcm283x_bootparams(bus_space_tag_t iot, 
 	if (vcprop_tag_success_p(_armclockrate.tag))
 		printf("%s: arm clock%d\n", __func__,
 		vb.vbt_armclockrate.rate);
+	if (vcprop_tag_success_p(_vpuclockrate.tag))
+		printf("%s: vpu clock%d\n", __func__,
+		vb.vbt_vpuclockrate.rate);
+	if (vcprop_tag_success_p(_emmcclockrate.tag))
+		printf("%s: emmc clock   %d\n", 

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

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 15:31:15 UTC 2019

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

Log Message:
Match brcm,bcm2711-emmc2


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/broadcom/bcm2835_emmc.c

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

Modified files:

Index: src/sys/arch/arm/broadcom/bcm2835_emmc.c
diff -u src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.33 src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.34
--- src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.33	Sun Aug 19 09:18:48 2018
+++ src/sys/arch/arm/broadcom/bcm2835_emmc.c	Mon Dec 30 15:31:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_emmc.c,v 1.33 2018/08/19 09:18:48 rin Exp $	*/
+/*	$NetBSD: bcm2835_emmc.c,v 1.34 2019/12/30 15:31:15 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.33 2018/08/19 09:18:48 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.34 2019/12/30 15:31:15 skrll Exp $");
 
 #include "bcmdmac.h"
 
@@ -97,6 +97,7 @@ bcmemmc_match(device_t parent, struct cf
 {
 	const char * const compatible[] = {
 	"brcm,bcm2835-sdhci",
+	"brcm,bcm2711-emmc2",
 	NULL
 	};
 	struct fdt_attach_args * const faa = aux;



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

2019-12-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 30 15:31:15 UTC 2019

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

Log Message:
Match brcm,bcm2711-emmc2


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/broadcom/bcm2835_emmc.c

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



Re: CVS commit: src/sys/arch/amd64

2019-12-30 Thread Emmanuel Dreyfus
On Sat, Dec 28, 2019 at 02:22:21AM +, Emmanuel Dreyfus wrote:
> > Regardless of whether it is needed in this specific case, cutting the 2MBs
> > of zero in the binary is wanted. Unfortunately last I looked at this (two
> > years ago) there were some non-obvious consequences, and it needs to be
> > carefully done.
> 
> Any hints about the problems you encountered? Perhaps we can work it
> around with an . = ALIGN(__LARGEE_PAGE_SIZE); before including .text.user ?

No anwser here? It is difficult to address an unknown problem...

-- 
Emmanuel Dreyfus
m...@netbsd.org


CVS commit: [netbsd-9] src/doc

2019-12-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 30 09:44:46 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Ticket #591


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.150 -r1.1.2.151 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/doc

2019-12-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 30 09:44:46 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Ticket #591


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.150 -r1.1.2.151 src/doc/CHANGES-9.0

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.150 src/doc/CHANGES-9.0:1.1.2.151
--- src/doc/CHANGES-9.0:1.1.2.150	Sun Dec 29 11:14:46 2019
+++ src/doc/CHANGES-9.0	Mon Dec 30 09:44:46 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.150 2019/12/29 11:14:46 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.151 2019/12/30 09:44:46 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -7370,3 +7370,8 @@ sys/dev/usb/uvideo.c1.50-1.52
 	PR kern/53734: avoid zero sized allocations.
 	[mlelstv, ticket #590]
 
+external/mpl/bind/dist/lib/isc/unix/app.c	1.5
+
+	Only ignore signals if we are bind (not dhcpd).
+	[maya, ticket #591]
+



CVS commit: [netbsd-9] src/external/mpl/bind/dist/lib/isc/unix

2019-12-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 30 09:43:59 UTC 2019

Modified Files:
src/external/mpl/bind/dist/lib/isc/unix [netbsd-9]: app.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #591):

external/mpl/bind/dist/lib/isc/unix/app.c: revision 1.5

Only ignore signals if we are bind (not dhcpd).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.4.1 src/external/mpl/bind/dist/lib/isc/unix/app.c

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



CVS commit: [netbsd-9] src/external/mpl/bind/dist/lib/isc/unix

2019-12-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 30 09:43:59 UTC 2019

Modified Files:
src/external/mpl/bind/dist/lib/isc/unix [netbsd-9]: app.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #591):

external/mpl/bind/dist/lib/isc/unix/app.c: revision 1.5

Only ignore signals if we are bind (not dhcpd).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.4.1 src/external/mpl/bind/dist/lib/isc/unix/app.c

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

Modified files:

Index: src/external/mpl/bind/dist/lib/isc/unix/app.c
diff -u src/external/mpl/bind/dist/lib/isc/unix/app.c:1.4 src/external/mpl/bind/dist/lib/isc/unix/app.c:1.4.4.1
--- src/external/mpl/bind/dist/lib/isc/unix/app.c:1.4	Sun Feb 24 20:01:31 2019
+++ src/external/mpl/bind/dist/lib/isc/unix/app.c	Mon Dec 30 09:43:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: app.c,v 1.4 2019/02/24 20:01:31 christos Exp $	*/
+/*	$NetBSD: app.c,v 1.4.4.1 2019/12/30 09:43:59 martin Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -196,6 +196,7 @@ isc_app_ctxstart(isc_appctx_t *ctx0) {
 		goto cleanup;
 #endif
 
+	if (isc_bind9) {
 	/*
 	 * Block SIGHUP, SIGINT, SIGTERM.
 	 *
@@ -224,6 +225,7 @@ isc_app_ctxstart(isc_appctx_t *ctx0) {
 		result = ISC_R_UNEXPECTED;
 		goto cleanup;
 	}
+	}
 
 	return (ISC_R_SUCCESS);