CVS commit: src

2023-05-14 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun May 14 16:13:05 UTC 2023

Modified Files:
src/distrib/amiga/stand: loadbsd.uue
src/sys/arch/amiga/stand/loadbsd: Makefile README loadbsd.c
Added Files:
src/sys/arch/amiga/stand/loadbsd: startit.s vmakefile

Log Message:
Update loadbsd source and distribution binary to version 3.3.
- Loading the kernel to the highest priority memory segment is default now.
- New option -l to revert the to the previous behaviour of largest segment.
- New option -M to define a minimum size for the memory segment.
- Fixed some warnings and typos.
- Put assembler inline source into its own source text startit.s.
- Can be built with Bebbo's gcc6 Amiga port or with vbcc.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/amiga/stand/loadbsd.uue
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amiga/stand/loadbsd/Makefile
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/amiga/stand/loadbsd/README
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/amiga/stand/loadbsd/loadbsd.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/amiga/stand/loadbsd/startit.s \
src/sys/arch/amiga/stand/loadbsd/vmakefile

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

Modified files:

Index: src/distrib/amiga/stand/loadbsd.uue
diff -u src/distrib/amiga/stand/loadbsd.uue:1.3 src/distrib/amiga/stand/loadbsd.uue:1.4
--- src/distrib/amiga/stand/loadbsd.uue:1.3	Tue Sep  6 17:50:18 2022
+++ src/distrib/amiga/stand/loadbsd.uue	Sun May 14 16:13:05 2023
@@ -1,611 +1,614 @@
 begin 755 loadbsd
-M```#\P`#``(``!22ZP``/I```4DB/(
+M```#\P`#``(``!0```&!.KO\N(GD$(`EG"BQY
-M8$ZN_F(B>0@@"6<*+'D```!@3J[^8BQ?3G5G0!E>'!A;G-I;VXN;0!C86XG="!O<&5N(&5X<&%NF4])3`X;'@@871TF4Z("5L9`H`9F%I;&5D(&%L;&]C("5D`'5N86)L92!T
-M;R!L;V%D(2!N
-M97=E`H`
-M2V5R;F5L(&%T("4P.+"!&87-T;65M('5S960@870@)3`X;'@*`$-A;B=T
-M(&-O<'D@=7!W87)D6]U2!A9V%I;B!/4B!T2!T:&4@+5H@;W!T:6]N
-M"!T;R!&87-T;65M("4P.("HJ
-M*@H`2V5R;F5L('-I>F4@)6QD(&5X8V5E9',@0VAI<"!-96UO``43KH39BQY8$*`0_K[Q4ZN_=@CP`1T
-M`DJ`9@``D$AZ^\%@U#!\_[_1P'`UL(AEJ#`[B@9.^P`"`;;_H`'T`9;_H/^@
-M_Z#_H`(`_Z#_H/^@_Z#_H/^@_Z#_H/^@`8K_H/^@`6K_H/^@_Z`"'/^@_Z#_
-MH/^@_Z#_H`$2`1H!GO^@_Z#_H/^@`BC_H/^@`_H`$Z`<+_H`$B`5K_H`%6
-M`2[_H`%B<`$CP6Q(>OMT+PHO`TZY```GYD_O``QZ_[J`9@#_8"(Y
-M="`!Y8G5P9:`<`@V8`_OXJ$D*#+@,L>01R_R`!($-.KO^X)@!F``%N
-M3KH(N$AM_^!(;?_<2_Y$ZZ!8).N@I"*T/_Z$_O``Q*N0```6AF``%*(#P`
-M``\`+P!'[?_H+PLO!4ZY```9ND_O``Q2@&8``31(>OKV8`#^L'#]Q(!@`/]<
-M<`&$@&``_U1P`2/`E&``_TAP`2/`F&``_SPO.0```8!.N0``,3CA
-MB.6((\!X6(]@`/\@<`)@P@C"`!!@`/\4",(`$6``_PQ(>OF<2'KZ5B\P
-M`?(```"H``Q.N0``,``00JB`\```_`&``_K8B+?_\5H%P_$GYH,*`*!0@!-B$V(#E
-MC-*$*`?IC-B'Y8S8@2P$4(9*N0```)AG&$7L``2=SKW494@O!DAZ^>).N0``
-M-ZQ0CR`\```!`-"Y;-"&(\"0(CP`!``$+'D```!@3J[_.B/`
-M?&8X+P9(>OFZ2'@`%$ZZ$:@`*4HXO"$*`,"H`""\`+RH`!"\:+PY(>OE%
-M3KD``#>L4(I/[P`88(HK0/_H<#]*N0```6AF!!`\``\O`"\++P5.N0``&;I/
-M[P`,4H!F"$AZ^6Y@`/RJ("W__%:`OE$3KD``#>L6(\B
-M+?_@OEA
-M3KD``#@46(]*N0```)AF#G)I1@$L>0```YA.KO\Z2KD```"89@QR9"QY```#
-MF$ZN_SHF;?_\("W_^"(M_^A"K?_8LH!G#@Q%``%C>B!+D<$K2/_8)L='ZP`@
-M1>O_X"QY!'+_(`$@0TZN_[@F`&98(\H```"$))0V?``$MI1E``"P#$4`
-M`F,``2!*N0```(AF``$6('D```!\("W_Y+"(8P``IB\`+PA(>OH.3KD``#>L
-M2'KZ+$AX`!1.N@[>0D5@`/]:)D!@BB!#<`,DV"38)-@DV%'(__8DV$*`$#D`
-M``"`OF.3KD``#>L4(\@$P:`
-M`P```":`2KD```"89PXO`$AZ^9!.N0``-ZQ0CT?K`$1@`/\J0?*X`$/TN``@
-MV2#9(-E2@T?K``Q@`/\V1?!)(`$(+SD```!L2'H&;B\*3KD``#6`+'D```!@
-M3J[]A"\M_^0O.0```'Q(>OG,3KD``#>L3^\`&$JYF&8,0```YA.
-MKO\Z2KD```"89P``BD*G3KD```!D("W_X+"&8A8O`"\&2'KYN4ZY```WK$AZ
-M^=M@`/[R<`$CP(@O.0```'Q(>OGI3KD``#>L4(]%^@7B8+!Z"NJH,'P`
-M2R\!+PDO""\`2'KW'4ZY```WK#HU`6+_[/_^3^\`%`Q%3G-G`/ZL#$4`"6,`
-M_=H_!4)G2'KW'V``_0"3R2QY"$ZN_R)*N0```(A7P$G`1(`O`"\Y
-MG"\Y```!9"\YC"\Y@"\M_]@O`B\M_^`O+?_<+RW_Y"`M_^R0K?_H
-M+P`O!B\Y?$Z20H!,[5S\_[!.74YU5')A;G-L871E9"`E,#AX('-Z("4P
-M.'@@=&\@)3`X>"!S>B`E,#AX"@!Z:VEC:R!M96UO0```&!.KO]V3-]\_$_O``Q.=29J`!@F*@`4
-M0^\`.)?#(PLL>0```&!"@"!#3J[]!DOO`#@B92X`E\G6B2`)9@8D;P`P8+!*
-MN0```)AG("\)+P=('VX@&8``,93B2`)`(``#___*@!2A2]%`#0H`9B%#(1`9UHB
-M`E*!(`'0@="!,:H`#@VPH"`"T(+0@N6(0?0(`!`J``E(@#%```XA10`(
-M(40`!"H"5(4O2P`T+'D```!@($-P`B)-3J[]!B)O`#0N`)?)UHDD!6``_T0R
-M?``!T\)!\9@`T``43KH)B'+_1D'"@&=H(@!T&.2I%#P`
-M?;2!9R9"0$A`#(2P9QIB'@R"6&<0#(/H9P@,@?1F'B0?
-M+%].=0R+N&?R#(^@9^H,@```!]!GXB\`2'K^^$ZY```WK$AX``%.
-MN0```&1#^O\)3J[_H$J`9R@`N0^@``"`(CD```"`(`%"04A!2H%FI@"`
-M!]```"/`@&"80_K^X2QY8$ZN_Z!*@&;&0_K^VRQY8$ZN_Z!*
-M@&:T0_K^U2QY8$ZN_Z!*@&<,`+D+N```@&"@0_K^PRQY8$ZN
-M_Z!*@&;B0_K^O2QY8$ZN_@Y*@&0```&`,
-M:``D`!1C"B/H`C@```",3G4(,``"`?((`,]F#B`\``KLA2/`C$YU
-M(#P`"M,#8/!.=29/+'@`!$OZ``9.[O_B1OPG`$_Z_^PB:P`$)"L`""QK``P@
-M:P`0("L`%"(K`!@N*P`<*`("HK`"0H*P`H)BL`+"1K`#`L*P`TF\T,*P!]
-M`"1G``!<,_P"``#?\)8(!0`#9P``))?+3GNP`TY[N`9.>[@'3GNP!$Y[L`5.

CVS commit: src

2023-05-14 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun May 14 16:13:05 UTC 2023

Modified Files:
src/distrib/amiga/stand: loadbsd.uue
src/sys/arch/amiga/stand/loadbsd: Makefile README loadbsd.c
Added Files:
src/sys/arch/amiga/stand/loadbsd: startit.s vmakefile

Log Message:
Update loadbsd source and distribution binary to version 3.3.
- Loading the kernel to the highest priority memory segment is default now.
- New option -l to revert the to the previous behaviour of largest segment.
- New option -M to define a minimum size for the memory segment.
- Fixed some warnings and typos.
- Put assembler inline source into its own source text startit.s.
- Can be built with Bebbo's gcc6 Amiga port or with vbcc.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/amiga/stand/loadbsd.uue
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amiga/stand/loadbsd/Makefile
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/amiga/stand/loadbsd/README
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/amiga/stand/loadbsd/loadbsd.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/amiga/stand/loadbsd/startit.s \
src/sys/arch/amiga/stand/loadbsd/vmakefile

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



CVS commit: src

2023-05-03 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed May  3 13:49:30 UTC 2023

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4/man4.amiga: Makefile
src/sys/arch/amiga/amiga: conf.c
src/sys/arch/amiga/conf: WSCONS files.amiga
src/sys/arch/amiga/dev: zbus.c
Added Files:
src/share/man/man4/man4.amiga: zz9k.4
src/sys/arch/amiga/dev: zz9k.c zz9k_ax.c zz9k_fb.c zz9k_if.c zz9k_usb.c
zz9kreg.h zz9kvar.h

Log Message:
Driver for the MNT ZZ9000 Zorro board. Submitted by Alain Runa.

It was formerly known as mntzz, which Alain released three years ago.
Since then, the ZZ9000 had several firmware updates which changed some
hardware interface details rendering the former driver non functional in some
aspects. Also the audio card plug-in ZZ9000AX became available from MNT
Research. Considering the major rewrite of the driver in some areas he
decided to rename it to zz9k(9). The driver consists of several sub-drivers
each addressing different functionality of the MNT ZZ9000 & ZZ9000AX combo
card.

zz9k* is the main card driver and need to be enabled if any of the sub-driver
is enabled. zz9k on its own is not very useful, it only provides a common
zz9kbus for the other sub-drivers to connect to, so only enable it if one of
the zz9k sub-drivers are enabled.
zzfb* represents the graphics driver for the boot console and the dumb
framebuffer for X11 based on WSCONS. ZZFB_CONSOLE option enables the ZZ9000
to become the boot console.
zz* represents the ethernet interface of the ZZ9000. It basically works but
is considered experimental.
zzax* represents the ZZ9000AX audio card driver, audio* attaches to it to
provide audio output and input functionality. The driver is not functional
yet.
zzusb* represents the ZZ9000AX usb driver. It was not implemented yet and
probably never will.


To generate a diff of this commit:
cvs rdiff -u -r1.1758 -r1.1759 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.33 -r1.34 src/share/man/man4/man4.amiga/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/man4.amiga/zz9k.4
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/amiga/amiga/conf.c
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/amiga/conf/WSCONS
cvs rdiff -u -r1.184 -r1.185 src/sys/arch/amiga/conf/files.amiga
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/amiga/dev/zbus.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/amiga/dev/zz9k.c \
src/sys/arch/amiga/dev/zz9k_ax.c src/sys/arch/amiga/dev/zz9k_fb.c \
src/sys/arch/amiga/dev/zz9k_if.c src/sys/arch/amiga/dev/zz9k_usb.c \
src/sys/arch/amiga/dev/zz9kreg.h src/sys/arch/amiga/dev/zz9kvar.h

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/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1758 src/distrib/sets/lists/man/mi:1.1759
--- src/distrib/sets/lists/man/mi:1.1758	Thu Dec 22 11:05:54 2022
+++ src/distrib/sets/lists/man/mi	Wed May  3 13:49:29 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1758 2022/12/22 11:05:54 nat Exp $
+# $NetBSD: mi,v 1.1759 2023/05/03 13:49:29 phx Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -870,6 +870,7 @@
 ./usr/share/man/cat4/amiga/xsurf.0		man-sys-catman		.cat
 ./usr/share/man/cat4/amiga/z3rambd.0		man-sys-catman		.cat
 ./usr/share/man/cat4/amiga/zssc.0		man-sys-catman		.cat
+./usr/share/man/cat4/amiga/zz9k.0		man-sys-catman		.cat
 ./usr/share/man/cat4/amr.0			man-sys-catman		.cat
 ./usr/share/man/cat4/ams.0			man-sys-catman		.cat
 ./usr/share/man/cat4/an.0			man-sys-catman		.cat
@@ -4180,6 +4181,7 @@
 ./usr/share/man/html4/amiga/xsurf.html		man-sys-htmlman		html
 ./usr/share/man/html4/amiga/z3rambd.html	man-sys-htmlman		html
 ./usr/share/man/html4/amiga/zssc.html		man-sys-htmlman		html
+./usr/share/man/html4/amiga/zz9k.html		man-sys-htmlman		html
 ./usr/share/man/html4/amr.html			man-sys-htmlman		html
 ./usr/share/man/html4/ams.html			man-sys-htmlman		html
 ./usr/share/man/html4/an.html			man-sys-htmlman		html
@@ -7186,6 +7188,7 @@
 ./usr/share/man/man4/amiga/xsurf.4		man-sys-man		.man
 ./usr/share/man/man4/amiga/z3rambd.4		man-sys-man		.man
 ./usr/share/man/man4/amiga/zssc.4		man-sys-man		.man
+./usr/share/man/man4/amiga/zz9k.4		man-sys-man		.man
 ./usr/share/man/man4/amr.4			man-sys-man		.man
 ./usr/share/man/man4/ams.4			man-sys-man		.man
 ./usr/share/man/man4/an.4			man-sys-man		.man

Index: src/share/man/man4/man4.amiga/Makefile
diff -u src/share/man/man4/man4.amiga/Makefile:1.33 src/share/man/man4/man4.amiga/Makefile:1.34
--- src/share/man/man4/man4.amiga/Makefile:1.33	Mon Sep 21 08:46:07 2020
+++ src/share/man/man4/man4.amiga/Makefile	Wed May  3 13:49:30 2023
@@ -1,12 +1,12 @@
 # 	from: @(#)Makefile	8.2 (Berkeley) 2/16/94
-#	$NetBSD: Makefile,v 1.33 2020/09/21 08:46:07 kim Exp $
+#	$NetBSD: Makefile,v 1.34 2023/05/03 13:49:30 phx Exp $
 
 MAN=a1k2cp.4 a2kbbc.4 a34kbbc.4 acafh.4 afsc.4 ahsc.4 amidisplaycc.4 \
 	atzsc.4 autoconf.4 console.4 

CVS commit: src

2023-05-03 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed May  3 13:49:30 UTC 2023

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4/man4.amiga: Makefile
src/sys/arch/amiga/amiga: conf.c
src/sys/arch/amiga/conf: WSCONS files.amiga
src/sys/arch/amiga/dev: zbus.c
Added Files:
src/share/man/man4/man4.amiga: zz9k.4
src/sys/arch/amiga/dev: zz9k.c zz9k_ax.c zz9k_fb.c zz9k_if.c zz9k_usb.c
zz9kreg.h zz9kvar.h

Log Message:
Driver for the MNT ZZ9000 Zorro board. Submitted by Alain Runa.

It was formerly known as mntzz, which Alain released three years ago.
Since then, the ZZ9000 had several firmware updates which changed some
hardware interface details rendering the former driver non functional in some
aspects. Also the audio card plug-in ZZ9000AX became available from MNT
Research. Considering the major rewrite of the driver in some areas he
decided to rename it to zz9k(9). The driver consists of several sub-drivers
each addressing different functionality of the MNT ZZ9000 & ZZ9000AX combo
card.

zz9k* is the main card driver and need to be enabled if any of the sub-driver
is enabled. zz9k on its own is not very useful, it only provides a common
zz9kbus for the other sub-drivers to connect to, so only enable it if one of
the zz9k sub-drivers are enabled.
zzfb* represents the graphics driver for the boot console and the dumb
framebuffer for X11 based on WSCONS. ZZFB_CONSOLE option enables the ZZ9000
to become the boot console.
zz* represents the ethernet interface of the ZZ9000. It basically works but
is considered experimental.
zzax* represents the ZZ9000AX audio card driver, audio* attaches to it to
provide audio output and input functionality. The driver is not functional
yet.
zzusb* represents the ZZ9000AX usb driver. It was not implemented yet and
probably never will.


To generate a diff of this commit:
cvs rdiff -u -r1.1758 -r1.1759 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.33 -r1.34 src/share/man/man4/man4.amiga/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/man4.amiga/zz9k.4
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/amiga/amiga/conf.c
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/amiga/conf/WSCONS
cvs rdiff -u -r1.184 -r1.185 src/sys/arch/amiga/conf/files.amiga
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/amiga/dev/zbus.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/amiga/dev/zz9k.c \
src/sys/arch/amiga/dev/zz9k_ax.c src/sys/arch/amiga/dev/zz9k_fb.c \
src/sys/arch/amiga/dev/zz9k_if.c src/sys/arch/amiga/dev/zz9k_usb.c \
src/sys/arch/amiga/dev/zz9kreg.h src/sys/arch/amiga/dev/zz9kvar.h

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



CVS commit: src

2022-09-06 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Tue Sep  6 17:50:18 UTC 2022

Modified Files:
src/distrib/amiga/stand: loadbsd.uue
src/sys/arch/amiga/stand/loadbsd: Makefile README loadbsd.c

Log Message:
Update loadbsd source and distribution binary to version 3.2.
Including the following changes by Gunther Nikl:
- Added detection of A600.
- Fix handling of multiple -n options.
Make it compile with recent AmigaOS gcc ports (for example gcc6), as
older ports no longer work with current NetBSD header files.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/amiga/stand/loadbsd.uue
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amiga/stand/loadbsd/Makefile
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amiga/stand/loadbsd/README
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/amiga/stand/loadbsd/loadbsd.c

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

Modified files:

Index: src/distrib/amiga/stand/loadbsd.uue
diff -u src/distrib/amiga/stand/loadbsd.uue:1.2 src/distrib/amiga/stand/loadbsd.uue:1.3
--- src/distrib/amiga/stand/loadbsd.uue:1.2	Wed Nov 11 16:13:55 2015
+++ src/distrib/amiga/stand/loadbsd.uue	Tue Sep  6 17:50:18 2022
@@ -1,484 +1,611 @@
 begin 755 loadbsd
-M```#\P`"``$``!"D```!70```^D``!"D,CP!0$GY``!_
-M_F<*0^R$-D*964%F^BE(A&8I0(1N*4^%2BQX``0I3H1JD\E.KO[:)D!*JP"L
-M9A1!ZP!<3J[^@$'K`%Q.KOZ,*4"$8D7L@]8D<<)EHB:P`$("R#TDZN_=@F
-M@&8&2'@`%&$B4X)FY$7L@^982G3_850O+(5"+RR$2B\LA%IA``3Z+T``!$7L
-MA`982G0`838L;(1J1>R#UB0:9Q`B6B`19P8B0$ZN_F)3@F;P)"R$8F<*3J[_
-M?")"3J[^AB`O``0N;(5*3G4F2DOLA#8@0!E>'!A;G-I;VXN;
-M0!C86XG="!O<&5N(&5X<&%N"!A='1R:6)U=&4])3`T;'@@<')I
-M/25D"@!K97)N96P@"P@)6QD32!#2$E0345-
-M"@!N97=E6]U('-H;W5L9`HJ*BH@=7!D871E('1O(&$@;F5W97(@=F5R`H`2V5R;F5L(&%T("4P.+"!&87-T;65M('5S
-M960@870@)3`X;'@*`$-A;B=T(&-O<'D@=7!W87)D6]U2!A9V%I;B!/4B!T2!T:&4@+5H@;W!T:6]N"!T
-M;R!&87-T;65M("4P.("HJ*@H`2V5R;F5L('-I>F4@)6QD(&5X8V5E9',@
-M0VAI<"!-96UO`)8CW`!L(-M!&$`#+9%[(`*+$:D/Z^Y1"@$ZN
-M_=@D@&8,2'K[ETAX`!1A`!-.1>R`!BQLA#^ON?0H!.KOW8)(!F``%\2'K[
-MH4AX`!1A`!,JR%1B\LA6YA`"Y4<@KCJ&!0<`*(@&```*@(Q``08```H`C$`!%@``"8
-M2'KZ)$AZ^NT@;(!&+R@`"&$`(F)/[P`,8'QR`2E!A59@='!`B(!@;D7LA6(O
-M+(5N80`N`DA`0D`D@%B/8%AR`8.LA6I@4"\LA6YA`"WH)`!8CW`#L()E"B`"
-MT("!K(5J8#1(>OJ32'@`%&$`$>1(>``00JR`$I:0
-M(!!'\PP`<`@V<$80`*U"X380`'S$AM_^A(;?_D2_X&$`!'9A``D880`)
-M2D*&0H5/[P`,+`!B!&OEI2'@`%&$`$!P@+?_\5H!R_,*`*T'__$JLA3YG
-M$`:M`$```/_@!JW_P```_^1![(5&2I!G#")0L^W_Y&($*TG_Y`@$``!G"DAZ
-M^4IA`"6&6(\@+?_HOD580`E1B!M__`T*/_^3^\`%`Q"3G-F`D)"
-M#$(`"6,0/P)"9TAZ^1M(>``480`/;`Q"``-C'$AZ^25A`"4.6(]*K(5>9@PL
-M;(.V9@HL;(.VOF[80`D=%"/("H`(`:``P```"5``"!*K(5>9PPO`$AZ^;UA`"144(]%
-MZ@!$8)0I2H520>R$=B(())"7R[?09")#\[H`(`GEB"1!0_((!"!LA5+1P%B(
-M(-D@V2"14HNWTF7>#$(``F,``(9*K(5F9GY![(4Z)%"U[?_@9!HO+?_@+PI(
-M>OEC80`C\$AZ^8-(>``480`.-$?LA3H@;?_4T=,K2/_OF?80`CHD_O``Q*
-MK(5>9D0L;(.VOG"
-M2'@`%&$`#;AP`2E`A68O+(4Z2'KYT&$`(U90CTJLA5YG!D*G80#T\BQL@`J3
-MR4ZN_R)*K(5F5\!)P$2`+P`O+(1R+RR%:B\LA%(O+(5B+P,O!"\M_^@O+?_D
-M+RW_X"(M__"2K?_L+P$O+?_4+RR%.B!M_]Q.D$*`3^\`-$SM3/S_L$Y=3G54
-M"!T;R`E,#AX('-Z("4P.'@*`'IK:6-K
-M(6]R>0!/[__L2.<_-I?+'WP`@``S(&\`1""+(F\`2"*+1>R$:BQ23J[_
-M?"!2)&@!0BI22HUG``)N0>R$=EB(+T@`*B@J`!0J*@`8FH0O10`T+$:B!$
-M0^\`-$*`3J[]!B0`FJ\`--BO`#1*KP`T9P`"*D'LA'9!Z``,+T@`+D'LA'9^
-M#MZ(+`A0ADJLA5YG(B\O`#0O`B`%T*\`/"\`(@22KP!`+P%(>O\F80`B"D_O
-M`!0F`M:O`#0,+`!]A6)F``"4("\`-%.``(``#___4H`O0``T)`.4@`R"0```
-M`&6((&\`+C``X(`!(J``E(@2!',8$(`")&([P`
-M(```"``@;P`J(8((`%*+!H(`(```!J__X#1![(1V0_.Z`"`)(@#EB2)O
-M`"XSJ@`.&``0*@`)2(`B1S.`&`!#Z``((Z\`-!@`6(@A@A@`,"H`#@)```8,
-M0``"9C!"L!@`("\`-`:```?__P*`__@``"]``#0C@!@`(F\`-"!O`$BST&,`
-M`+0@B6```*X"0N``!H,``!__`D/@``R#!_@``&8&)CP(#((`*```9B`@
-M:@`*0_K^!T*!0H`0&!(9D(%F#$H!9O)*@&8$="!(0B`"`H#_\```#(`1
-M9@(D`):"+T,`-$'SN@`@".6((F\`*B.""``@1B`#0(``RO`!___P`T8RY!
-M[(5.2I!G#&``480`)ED'LA6(@$$)`2H!G>"`0
-M#!``?6<``1Y"0$A`#(2P9P`!$&(D#()89P`!!&(,#('T9P``
-M^&`N#(/H9P``[&`B#(NX9P``X&(,#(?09P``U&`*#(^@
-M9P``R$*`,"R%8B\`2'K^Y&$`'LI(>``!80#P;$7LA/Z_O-.KO^@2H!F
-M'"Q20_K^\4ZN_Z!*@&8.+%)#^O[O3J[_H$J`9PH`K`^@``"%8F!H1>R$:BQ2
-M0_K^WTZN_Z!*@&8.+%)#^O[=3J[_H$J`9PH`K`NX``"%8F`^+$:D/Z_L].
-MKOX.2H!G"@"L!+```(5B8"0L;(1J0_K^PTZN_@Y*@&<4(#P``'T`@#D"```)
-M2$!"0()![(5B2E!F!@"0!]```"1?+%].=2!LA,:``D`!1C""EH`CB$
-M4DYU0^R$4B!L@`H@/``*[(4(*``"`,]G!B`\``K3`R*`3G5.<4YU3G$F3RQX
-M``1+^@`&3N[_XD;\)P!/^O_L(FL`!"0K``@L:P`,(`$"`K`!0B*P`8+BL`
-M'"AK`"`J*P`D*"L`*"8K`"PD:P`P+"L`-)O-#"L`?0`D9U0S_`(``-_PE@@%
-M``-G()?+3GNP`TY[N`9.>[@'3GNP!$Y[L`5.>[`&3GNP!V`F1_H`C/`30`!'
-M^@"`\!-,`/`32``(!0`"9PQ'^@!R\!,(`/`3#`!*AF<$*DC=R"K968)D^D/Z
-M`!PO#71`*ME9@F3Z"`4``V<"]/AT`$Y[(`).=20%X9H,`@!]9AZ7RTY[L`-.
-M>[@&3GNX!TY[L`1.>[`%3GNP!DY[L`=T`'P`(D8F1BI&+DXL1D[7?_\``0``
-M``!U2!M;V1E+"!I9B!A
-M=F%I;&%B;&4N"@DM8B`@07-K(&9O7!E+B!;92YG
-M(#,P,#`[('5S92`S,C`P,"M.(&9O2P@9F]R(&9I;F1I;F<@;6EN
-M:6UU;2!A;6]U;G0*"2`@("!O9B!M96UO71E2!F87-T97(*"2`@("`H:2YE
-M+B`S,B!B:70@;65M;W)Y*2P@8G5T('-O;64@<&5O<(=F4@2X*"2UQ("!";V]T('5P

CVS commit: src

2022-09-06 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Tue Sep  6 17:50:18 UTC 2022

Modified Files:
src/distrib/amiga/stand: loadbsd.uue
src/sys/arch/amiga/stand/loadbsd: Makefile README loadbsd.c

Log Message:
Update loadbsd source and distribution binary to version 3.2.
Including the following changes by Gunther Nikl:
- Added detection of A600.
- Fix handling of multiple -n options.
Make it compile with recent AmigaOS gcc ports (for example gcc6), as
older ports no longer work with current NetBSD header files.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/amiga/stand/loadbsd.uue
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amiga/stand/loadbsd/Makefile
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amiga/stand/loadbsd/README
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/amiga/stand/loadbsd/loadbsd.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/ofppc/conf

2020-11-29 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Nov 29 12:38:44 UTC 2020

Modified Files:
src/sys/arch/ofppc/conf: GENERIC

Log Message:
Message buffer is too small, since timestamps were enforced.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/arch/ofppc/conf/GENERIC

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/ofppc/conf/GENERIC
diff -u src/sys/arch/ofppc/conf/GENERIC:1.173 src/sys/arch/ofppc/conf/GENERIC:1.174
--- src/sys/arch/ofppc/conf/GENERIC:1.173	Sun Sep 27 13:48:53 2020
+++ src/sys/arch/ofppc/conf/GENERIC	Sun Nov 29 12:38:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.173 2020/09/27 13:48:53 roy Exp $
+# $NetBSD: GENERIC,v 1.174 2020/11/29 12:38:44 phx Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	"arch/ofppc/conf/std.ofppc"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.173 $"
+#ident 		"GENERIC-$Revision: 1.174 $"
 
 maxusers	32
 
@@ -60,6 +60,7 @@ options 	DDB		# in-kernel debugger
 options 	DDB_HISTORY_SIZE=512	# enable history editing in DDB
 options 	DDB_VERBOSE_HELP
 options 	TRAP_PANICWAIT
+options 	MSGBUFSIZE=32768
 
 makeoptions	DEBUG="-g"	# compile full symbol table
 



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

2020-11-29 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Nov 29 12:38:44 UTC 2020

Modified Files:
src/sys/arch/ofppc/conf: GENERIC

Log Message:
Message buffer is too small, since timestamps were enforced.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/arch/ofppc/conf/GENERIC

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



CVS commit: sunscripts

2020-06-30 Thread Frank Wille
Module Name:sunscripts
Committed By:   phx
Date:   Tue Jun 30 12:35:50 UTC 2020

Removed Files:
sunscripts: LICENSE.vasm LICENSE.vlink buildvasm.sh buildvlink.sh
lastversion.sh srcexport.sh

Log Message:
erroneously committed


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r0 sunscripts/LICENSE.vasm sunscripts/LICENSE.vlink \
sunscripts/buildvasm.sh sunscripts/buildvlink.sh \
sunscripts/lastversion.sh sunscripts/srcexport.sh

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



CVS commit: sunscripts

2020-06-30 Thread Frank Wille
Module Name:sunscripts
Committed By:   phx
Date:   Tue Jun 30 12:35:50 UTC 2020

Removed Files:
sunscripts: LICENSE.vasm LICENSE.vlink buildvasm.sh buildvlink.sh
lastversion.sh srcexport.sh

Log Message:
erroneously committed


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r0 sunscripts/LICENSE.vasm sunscripts/LICENSE.vlink \
sunscripts/buildvasm.sh sunscripts/buildvlink.sh \
sunscripts/lastversion.sh sunscripts/srcexport.sh

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



CVS import: sunscripts

2020-06-30 Thread Frank Wille
Module Name:sunscripts
Committed By:   phx
Date:   Tue Jun 30 12:25:49 UTC 2020

Update of /cvsroot/sunscripts
In directory ivanova.netbsd.org:/tmp/cvs-serv10195

Log Message:
initial

Status:

Vendor Tag: sun
Release Tags:   initial

N sunscripts/buildvasm.sh
N sunscripts/buildvlink.sh
N sunscripts/lastversion.sh
N sunscripts/srcexport.sh
N sunscripts/LICENSE.vasm
N sunscripts/LICENSE.vlink

No conflicts created by this import



CVS import: sunscripts

2020-06-30 Thread Frank Wille
Module Name:sunscripts
Committed By:   phx
Date:   Tue Jun 30 12:25:49 UTC 2020

Update of /cvsroot/sunscripts
In directory ivanova.netbsd.org:/tmp/cvs-serv10195

Log Message:
initial

Status:

Vendor Tag: sun
Release Tags:   initial

N sunscripts/buildvasm.sh
N sunscripts/buildvlink.sh
N sunscripts/lastversion.sh
N sunscripts/srcexport.sh
N sunscripts/LICENSE.vasm
N sunscripts/LICENSE.vlink

No conflicts created by this import



CVS commit: src/sys/arch/powerpc/oea

2019-01-06 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Jan  6 11:20:53 UTC 2019

Modified Files:
src/sys/arch/powerpc/oea: cpu_subr.c

Log Message:
Only execute dssall when the CPU has the Altivec instruction set extension.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/powerpc/oea/cpu_subr.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/powerpc/oea/cpu_subr.c
diff -u src/sys/arch/powerpc/oea/cpu_subr.c:1.97 src/sys/arch/powerpc/oea/cpu_subr.c:1.98
--- src/sys/arch/powerpc/oea/cpu_subr.c:1.97	Fri Jun 15 23:11:39 2018
+++ src/sys/arch/powerpc/oea/cpu_subr.c	Sun Jan  6 11:20:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_subr.c,v 1.97 2018/06/15 23:11:39 uwe Exp $	*/
+/*	$NetBSD: cpu_subr.c,v 1.98 2019/01/06 11:20:53 phx Exp $	*/
 
 /*-
  * Copyright (c) 2001 Matt Thomas.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.97 2018/06/15 23:11:39 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.98 2019/01/06 11:20:53 phx Exp $");
 
 #include "opt_ppcparam.h"
 #include "opt_ppccache.h"
@@ -329,10 +329,12 @@ cpu_idlespin(void)
 	if (powersave <= 0)
 		return;
 
-	__asm volatile(
 #if defined(_ARCH_PPC64) || defined (PPC_OEA64_BRIDGE)
-		"dssall;"
+	if (cpu_altivec)
+		__asm volatile("dssall");
 #endif
+
+	__asm volatile(
 		"sync;"
 		"mfmsr	%0;"
 		"oris	%0,%0,%1@h;"	/* enter power saving mode */



CVS commit: src/sys/arch/powerpc/oea

2019-01-06 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Jan  6 11:20:53 UTC 2019

Modified Files:
src/sys/arch/powerpc/oea: cpu_subr.c

Log Message:
Only execute dssall when the CPU has the Altivec instruction set extension.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/powerpc/oea/cpu_subr.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/powerpc/powerpc

2018-05-02 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed May  2 08:24:40 UTC 2018

Modified Files:
src/sys/arch/powerpc/powerpc: trap_subr.S

Log Message:
Fixed non-critical typo in tlbdsmiss: %r8 -> 8.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/powerpc/powerpc/trap_subr.S

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

Modified files:

Index: src/sys/arch/powerpc/powerpc/trap_subr.S
diff -u src/sys/arch/powerpc/powerpc/trap_subr.S:1.78 src/sys/arch/powerpc/powerpc/trap_subr.S:1.79
--- src/sys/arch/powerpc/powerpc/trap_subr.S:1.78	Tue Jul 29 16:19:45 2014
+++ src/sys/arch/powerpc/powerpc/trap_subr.S	Wed May  2 08:24:40 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap_subr.S,v 1.78 2014/07/29 16:19:45 joerg Exp $	*/
+/*	$NetBSD: trap_subr.S,v 1.79 2018/05/02 08:24:40 phx Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -598,7 +598,7 @@ _C_LABEL(tlbdlmsize) = .-_C_LABEL(tlbdlm
 	.globl	_C_LABEL(tlbdsmiss),_C_LABEL(tlbdsmsize)
 _C_LABEL(tlbdsmiss):
 	mfspr	%r2,SPR_HASH1		/* get first pointer */
-	li	%r1,%r8
+	li	%r1,8
 	mfctr	%r0			/* save counter */
 	mfspr	%r3,SPR_DCMP		/* get first compare value */
 	addi	%r2,%r2,-8		/* predec pointer */



CVS commit: src/sys/arch/powerpc/powerpc

2018-05-02 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed May  2 08:24:40 UTC 2018

Modified Files:
src/sys/arch/powerpc/powerpc: trap_subr.S

Log Message:
Fixed non-critical typo in tlbdsmiss: %r8 -> 8.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/powerpc/powerpc/trap_subr.S

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



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

2017-09-18 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep 18 23:21:15 UTC 2017

Modified Files:
src/sys/arch/powerpc/include: fenv.h

Log Message:
Fixed feholdexcept() by copying the actual contents of FPSCR to the fenv_t
instead of a double precision floating point representation of it.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/include/fenv.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/powerpc/include

2017-09-18 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep 18 23:21:15 UTC 2017

Modified Files:
src/sys/arch/powerpc/include: fenv.h

Log Message:
Fixed feholdexcept() by copying the actual contents of FPSCR to the fenv_t
instead of a double precision floating point representation of it.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/include/fenv.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/powerpc/include/fenv.h
diff -u src/sys/arch/powerpc/include/fenv.h:1.3 src/sys/arch/powerpc/include/fenv.h:1.4
--- src/sys/arch/powerpc/include/fenv.h:1.3	Wed Mar 22 23:11:09 2017
+++ src/sys/arch/powerpc/include/fenv.h	Mon Sep 18 23:21:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.3 2017/03/22 23:11:09 chs Exp $	*/
+/*	$NetBSD: fenv.h,v 1.4 2017/09/18 23:21:15 phx Exp $	*/
 
 /*-
  * Copyright (c) 2004-2005 David Schultz 
@@ -242,7 +242,7 @@ feholdexcept(fenv_t *__envp)
 	uint32_t msr;
 
 	__mffs(&__r.__d);
-	*__envp = __r.__d;
+	*__envp = __r.__bits.__reg;
 	__r.__bits.__reg &= ~(FE_ALL_EXCEPT | _ENABLE_MASK);
 	__mtfsf(__r.__d);
 	__updatemsr(__r.__bits.__reg);



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

2017-09-13 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Sep 13 09:55:35 UTC 2017

Modified Files:
src/sys/arch/m68k/include: fenv.h

Log Message:
The __fgetenv() macro operates on a fenv_t, not on a fenv_t *.
Fixes a segfault in fegetenv() and feholdexcept().


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/m68k/include/fenv.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/m68k/include

2017-09-13 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Sep 13 09:55:35 UTC 2017

Modified Files:
src/sys/arch/m68k/include: fenv.h

Log Message:
The __fgetenv() macro operates on a fenv_t, not on a fenv_t *.
Fixes a segfault in fegetenv() and feholdexcept().


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/m68k/include/fenv.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/m68k/include/fenv.h
diff -u src/sys/arch/m68k/include/fenv.h:1.6 src/sys/arch/m68k/include/fenv.h:1.7
--- src/sys/arch/m68k/include/fenv.h:1.6	Wed Mar 22 23:11:09 2017
+++ src/sys/arch/m68k/include/fenv.h	Wed Sep 13 09:55:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.6 2017/03/22 23:11:09 chs Exp $	*/
+/*	$NetBSD: fenv.h,v 1.7 2017/09/13 09:55:35 phx Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -210,7 +210,7 @@ fesetround(int __round)
 __fenv_static inline int
 fegetenv(fenv_t *__envp)
 {
-	__fgetenv(__envp);
+	__fgetenv(*__envp);
 
 	return 0;
 }
@@ -220,7 +220,7 @@ feholdexcept(fenv_t *__envp)
 {
 	fexcept_t __fpcr, __fpsr;
 
-	__fgetenv(__envp);
+	__fgetenv(*__envp);
 	__fpsr = __envp->fpsr & ~FE_ALL_EXCEPT;
 	__set_fpsr(__fpsr);	/* clear all */
 	__fpcr = __envp->fpcr & ~(FE_ALL_EXCEPT << 6);



CVS commit: src/sys/arch/amiga/dev

2017-09-04 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep  4 17:26:06 UTC 2017

Modified Files:
src/sys/arch/amiga/dev: efa.c efavar.h wdc_acafh.c wdc_xsurf.c

Log Message:
Remove double device pointers. The pointer is already part of sc_wdcdev.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/amiga/dev/efa.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amiga/dev/efavar.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amiga/dev/wdc_acafh.c \
src/sys/arch/amiga/dev/wdc_xsurf.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/amiga/dev/efa.c
diff -u src/sys/arch/amiga/dev/efa.c:1.12 src/sys/arch/amiga/dev/efa.c:1.13
--- src/sys/arch/amiga/dev/efa.c:1.12	Fri Jan  3 00:33:06 2014
+++ src/sys/arch/amiga/dev/efa.c	Mon Sep  4 17:26:06 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: efa.c,v 1.12 2014/01/03 00:33:06 rkujawa Exp $ */
+/*	$NetBSD: efa.c,v 1.13 2017/09/04 17:26:06 phx Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -136,8 +136,6 @@ efa_attach(device_t parent, device_t sel
 
 	gayle_init();
 
-	sc->sc_dev = self;
-
 	efa_set_opts(sc);
 
 	if (!efa_mapbase(sc)) {
@@ -200,6 +198,12 @@ efa_attach(device_t parent, device_t sel
 static void
 efa_attach_channel(struct efa_softc *sc, int chnum) 
 {
+#ifdef EFA_DEBUG
+	device_t self;
+
+	self = sc->sc_wdcdev.sc_atac.atac_dev;
+#endif /* EFA_DEBUG */
+
 	sc->sc_chanlist[chnum] = >sc_ports[chnum].chan;
 
 	sc->sc_ports[chnum].chan.ch_channel = chnum;
@@ -216,7 +220,7 @@ efa_attach_channel(struct efa_softc *sc,
 	wdcattach(>sc_ports[chnum].chan);	
 
 #ifdef EFA_DEBUG
-	aprint_normal_dev(sc->sc_dev, "done init for channel %d\n", chnum);
+	aprint_normal_dev(self, "done init for channel %d\n", chnum);
 #endif
 
 }
@@ -238,6 +242,10 @@ efa_poll_kthread(void *arg)
 static void
 efa_set_opts(struct efa_softc *sc)
 {
+	device_t self;
+
+	self = sc->sc_wdcdev.sc_atac.atac_dev;
+
 #ifdef EFA_32BIT_IO 
 	sc->sc_32bit_io = true;	
 #else
@@ -251,10 +259,10 @@ efa_set_opts(struct efa_softc *sc)
 #endif /* EFA_NO_INTR */
 
 	if (sc->sc_no_intr)
-		aprint_verbose_dev(sc->sc_dev, "hardware interrupt disabled\n");
+		aprint_verbose_dev(self, "hardware interrupt disabled\n");
 
 	if (sc->sc_32bit_io)
-		aprint_verbose_dev(sc->sc_dev, "32-bit I/O enabled\n");
+		aprint_verbose_dev(self, "32-bit I/O enabled\n");
 }
 
 int
@@ -301,9 +309,14 @@ efa_intr(void *arg)
 static bool
 efa_mapbase(struct efa_softc *sc) 
 {
-	int i, j;
 	static struct bus_space_tag fata_cmd_iot;
 	static struct bus_space_tag gayle_cmd_iot;
+	int i, j;
+#ifdef EFA_DEBUG
+	device_t self;
+
+	self = sc->sc_wdcdev.sc_atac.atac_dev;
+#endif /* EFA_DEBUG */
 	
 	gayle_cmd_iot.base = (bus_addr_t) ztwomap(GAYLE_IDE_BASE + 2);
 	gayle_cmd_iot.absm = _bus_stride_4swap;
@@ -311,7 +324,7 @@ efa_mapbase(struct efa_softc *sc) 
 	fata_cmd_iot.absm = _bus_stride_4swap;
 
 #ifdef EFA_DEBUG
-	aprint_normal_dev(sc->sc_dev, "Gayle %x -> %x, FastATA %x -> %x\n",
+	aprint_normal_dev(self, "Gayle %x -> %x, FastATA %x -> %x\n",
 	GAYLE_IDE_BASE, gayle_cmd_iot.base, FATA1_BASE, fata_cmd_iot.base);
 #endif
 
@@ -370,9 +383,14 @@ efa_mapreg_gayle(struct efa_softc *sc)
 static bool
 efa_mapreg_native(struct efa_softc *sc) 
 {
-	int i,j;
 	struct wdc_regs *wdr_gayle = >sc_gayle_wdc_regs;
 	struct wdc_regs *wdr_fata;
+	int i,j;
+#ifdef EFA_DEBUG
+	device_t self;
+
+	self = sc->sc_wdcdev.sc_atac.atac_dev;
+#endif /* EFA_DEBUG */
 
 	for (i = 0; i < FATA1_CHANNELS; i++) {
 
@@ -383,7 +401,7 @@ efa_mapreg_native(struct efa_softc *sc) 
 
 			if (pio_offsets[j] == PIO_NSUPP) {
 #ifdef EFA_DEBUG
-aprint_normal_dev(sc->sc_dev, 
+aprint_normal_dev(self, 
 "Skipping mapping for PIO mode %x\n", j);
 #endif
 continue;
@@ -395,7 +413,7 @@ efa_mapreg_native(struct efa_softc *sc) 
 			return false;
 			}
 #ifdef EFA_DEBUG
-			aprint_normal_dev(sc->sc_dev, 
+			aprint_normal_dev(self, 
 			"Chan %x PIO mode %x mapped %x -> %x\n",
 			i, j, (bus_addr_t) kvtop((void*) 
 			wdr_fata->cmd_baseioh), (unsigned int) 
@@ -465,15 +483,20 @@ efa_setup_channel(struct ata_channel *ch
 	struct ata_drive_datas *drvp;
 	struct efa_softc *sc;
 	int ipl;
+#ifdef EFA_DEBUG
+	device_t self;
+#endif /* EFA_DEBUG */
 
 	chnum = chp->ch_channel;
 	atac = chp->ch_atac;
+
 	sc = device_private(atac->atac_dev);
 
 	mode = 5; /* start with fastest possible setting */
 
 #ifdef EFA_DEBUG
-	aprint_normal_dev(sc->sc_dev, "efa_setup_channel for ch %d\n",
+	self = sc->sc_wdcdev.sc_atac.atac_dev;
+	aprint_normal_dev(self, "efa_setup_channel for ch %d\n",
 	chnum);
 #endif /* EFA_DEBUG */
 
@@ -492,7 +515,7 @@ efa_setup_channel(struct ata_channel *ch
 		/* TODO: check if sc_ports->mode_ok */
 
 #ifdef EFA_DEBUG
-		aprint_normal_dev(sc->sc_dev, "drive %d supports %d\n",
+		aprint_normal_dev(self, "drive %d supports %d\n",
 		drive, drvp->PIO_cap);
 #endif /* EFA_DEBUG */
 
@@ -511,12 +534,17 @@ static 

CVS commit: src/sys/arch/amiga/dev

2017-09-04 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep  4 17:26:06 UTC 2017

Modified Files:
src/sys/arch/amiga/dev: efa.c efavar.h wdc_acafh.c wdc_xsurf.c

Log Message:
Remove double device pointers. The pointer is already part of sc_wdcdev.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/amiga/dev/efa.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amiga/dev/efavar.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amiga/dev/wdc_acafh.c \
src/sys/arch/amiga/dev/wdc_xsurf.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/amiga/dev

2017-09-04 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep  4 14:39:00 UTC 2017

Modified Files:
src/sys/arch/amiga/dev: wdc_xsurf.c

Log Message:
Set the correct device data size wdc_xsurf_softc instead of wdc_softc.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amiga/dev/wdc_xsurf.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/amiga/dev/wdc_xsurf.c
diff -u src/sys/arch/amiga/dev/wdc_xsurf.c:1.2 src/sys/arch/amiga/dev/wdc_xsurf.c:1.3
--- src/sys/arch/amiga/dev/wdc_xsurf.c:1.2	Wed Nov 21 22:37:03 2012
+++ src/sys/arch/amiga/dev/wdc_xsurf.c	Mon Sep  4 14:39:00 2017
@@ -1,4 +1,4 @@
-/*  $NetBSD: wdc_xsurf.c,v 1.2 2012/11/21 22:37:03 rkujawa Exp $ */
+/*  $NetBSD: wdc_xsurf.c,v 1.3 2017/09/04 14:39:00 phx Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -92,7 +92,7 @@ void		wdc_xsurf_attach_channel(struct wd
 void		wdc_xsurf_map_channel(struct wdc_xsurf_softc *, int);
 int		wdc_xsurf_intr(void *arg);
 
-CFATTACH_DECL_NEW(wdc_xsurf, sizeof(struct wdc_softc),
+CFATTACH_DECL_NEW(wdc_xsurf, sizeof(struct wdc_xsurf_softc),
 wdc_xsurf_match, wdc_xsurf_attach, NULL, NULL);
 
 static const unsigned int wdc_xsurf_wdr_offsets[] = {



CVS commit: src/sys/arch/amiga/dev

2017-09-04 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep  4 14:39:00 UTC 2017

Modified Files:
src/sys/arch/amiga/dev: wdc_xsurf.c

Log Message:
Set the correct device data size wdc_xsurf_softc instead of wdc_softc.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amiga/dev/wdc_xsurf.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/sandpoint/stand/altboot

2017-08-03 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Aug  3 19:51:00 UTC 2017

Modified Files:
src/sys/arch/sandpoint/stand/altboot: skg.c

Log Message:
This driver should also support Schneider & Koch SK-9821 v2.0, besides
Marvell SKnet.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sandpoint/stand/altboot/skg.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/sandpoint/stand/altboot/skg.c
diff -u src/sys/arch/sandpoint/stand/altboot/skg.c:1.4 src/sys/arch/sandpoint/stand/altboot/skg.c:1.5
--- src/sys/arch/sandpoint/stand/altboot/skg.c:1.4	Sun Oct 30 21:08:33 2011
+++ src/sys/arch/sandpoint/stand/altboot/skg.c	Thu Aug  3 19:51:00 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: skg.c,v 1.4 2011/10/30 21:08:33 phx Exp $ */
+/* $NetBSD: skg.c,v 1.5 2017/08/03 19:51:00 phx Exp $ */
 
 /*-
  * Copyright (c) 2010 Frank Wille.
@@ -193,6 +193,7 @@ skg_match(unsigned tag, void *data)
 
 	v = pcicfgread(tag, PCI_ID_REG);
 	switch (v) {
+	case PCI_DEVICE(0x1148, 0x4320):
 	case PCI_DEVICE(0x11ab, 0x4320):
 		return 1;
 	}



CVS commit: src/sys/arch/sandpoint/stand/altboot

2017-08-03 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Aug  3 19:51:00 UTC 2017

Modified Files:
src/sys/arch/sandpoint/stand/altboot: skg.c

Log Message:
This driver should also support Schneider & Koch SK-9821 v2.0, besides
Marvell SKnet.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sandpoint/stand/altboot/skg.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/sandpoint/stand/altboot

2017-08-03 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Aug  3 19:22:15 UTC 2017

Modified Files:
src/sys/arch/sandpoint/stand/altboot: brdsetup.c siisata.c version

Log Message:
Some Synology network devices show vendor 0x1148 (Schneider & Koch) instead
of 0x11ab (Marvell). Detect both.
Improve spinning up of both disk drives on Synology DS20x by adding some
more delays (directly at the start and after powering up the second drive).


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/sandpoint/stand/altboot/brdsetup.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sandpoint/stand/altboot/siisata.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sandpoint/stand/altboot/version

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



CVS commit: src/sys/arch/sandpoint/stand/altboot

2017-08-03 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Aug  3 19:22:15 UTC 2017

Modified Files:
src/sys/arch/sandpoint/stand/altboot: brdsetup.c siisata.c version

Log Message:
Some Synology network devices show vendor 0x1148 (Schneider & Koch) instead
of 0x11ab (Marvell). Detect both.
Improve spinning up of both disk drives on Synology DS20x by adding some
more delays (directly at the start and after powering up the second drive).


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/sandpoint/stand/altboot/brdsetup.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sandpoint/stand/altboot/siisata.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sandpoint/stand/altboot/version

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/sandpoint/stand/altboot/brdsetup.c
diff -u src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.38 src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.39
--- src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.38	Thu Aug  3 09:42:34 2017
+++ src/sys/arch/sandpoint/stand/altboot/brdsetup.c	Thu Aug  3 19:22:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.38 2017/08/03 09:42:34 phx Exp $ */
+/* $NetBSD: brdsetup.c,v 1.39 2017/08/03 19:22:15 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -269,7 +269,8 @@ brdsetup(void)
 brdtype = BRD_KUROBOXT4;
 		}
 	}
-	else if (PCI_VENDOR(pcicfgread(dev15, PCI_ID_REG)) == 0x11ab) {
+	else if (PCI_VENDOR(pcicfgread(dev15, PCI_ID_REG)) == 0x1148
+	|| PCI_VENDOR(pcicfgread(dev15, PCI_ID_REG)) == 0x11ab) {
 		/* SKnet/Marvell (sk) at dev 15 */
 		brdtype = BRD_SYNOLOGY;
 	}
@@ -873,8 +874,11 @@ synopcifix(struct brdprop *brd)
 		 * with several seconds delay, but no CPLD register to
 		 * monitor the power state. So all we can do is to
 		 * wait some more seconds during SATA-init.
+		 * Also wait some seconds now, to make sure the first
+		 * disk is ready after a cold start.
 		 */
 		sata_delay[1] = SYNO_DISK_DELAY;
+		delay(10 * 1024 * 1024);
 	}
 
   cpld_done:

Index: src/sys/arch/sandpoint/stand/altboot/siisata.c
diff -u src/sys/arch/sandpoint/stand/altboot/siisata.c:1.6 src/sys/arch/sandpoint/stand/altboot/siisata.c:1.7
--- src/sys/arch/sandpoint/stand/altboot/siisata.c:1.6	Wed Sep 30 14:14:32 2015
+++ src/sys/arch/sandpoint/stand/altboot/siisata.c	Thu Aug  3 19:22:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.6 2015/09/30 14:14:32 phx Exp $ */
+/* $NetBSD: siisata.c,v 1.7 2017/08/03 19:22:15 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -125,6 +125,15 @@ siisata_init(unsigned tag, void *data)
 			if (l->presense[n] == 0) {
 DPRINTF(("port %d not present\n", n));
 continue;
+			} else {
+/*
+ * XXX perform_atareset() does not work
+ * when the drive is not completely spun up?
+ * So insert another delay here.
+ */
+printf("Waiting 15 seconds for port %d "
+"to spin up.\n", n);
+delay(15 * 1000 * 1000);
 			}
 		}
 		if (atachkpwr(l, n) != ATA_PWR_ACTIVE) {

Index: src/sys/arch/sandpoint/stand/altboot/version
diff -u src/sys/arch/sandpoint/stand/altboot/version:1.8 src/sys/arch/sandpoint/stand/altboot/version:1.9
--- src/sys/arch/sandpoint/stand/altboot/version:1.8	Wed Sep 30 14:14:32 2015
+++ src/sys/arch/sandpoint/stand/altboot/version	Thu Aug  3 19:22:15 2017
@@ -18,3 +18,5 @@
 	NIC.
 1.11:	Pass precise model information and flags with bootinfo.
 	Synology DS207/209 LED and 2nd disk power-up support.
+1.12:	Some more Synology DS20x fixes, to make sure both drives have been
+	spun up. Also detect PCI-vendor 0x1148 (S) as Synology.



CVS commit: src/sys/arch/sandpoint/stand/altboot

2017-08-03 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Aug  3 09:42:34 UTC 2017

Modified Files:
src/sys/arch/sandpoint/stand/altboot: brdsetup.c

Log Message:
Fixed overflow in delay() for delays greater than 2 seconds.
Replaced u_long by uint32_t and u_quad by uint64_t whenever the exact
32- or 64-bit word is needed.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/sandpoint/stand/altboot/brdsetup.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/sandpoint/stand/altboot/brdsetup.c
diff -u src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.37 src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.38
--- src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.37	Thu Oct 15 12:00:02 2015
+++ src/sys/arch/sandpoint/stand/altboot/brdsetup.c	Thu Aug  3 09:42:34 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.37 2015/10/15 12:00:02 nisimura Exp $ */
+/* $NetBSD: brdsetup.c,v 1.38 2017/08/03 09:42:34 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@ static void send_iomega(int, int, int, i
 static inline uint32_t mfmsr(void);
 static inline void mtmsr(uint32_t);
 static inline uint32_t cputype(void);
-static inline u_quad_t mftb(void);
+static inline uint64_t mftb(void);
 static void init_uart(unsigned, unsigned, uint8_t);
 static void send_sat(char *);
 static unsigned mpc107memsize(void);
@@ -1012,7 +1012,7 @@ _rtt(void)
 satime_t
 getsecs(void)
 {
-	u_quad_t tb = mftb();
+	uint64_t tb = mftb();
 
 	return (tb / ticks_per_sec);
 }
@@ -1021,13 +1021,13 @@ getsecs(void)
  * Wait for about n microseconds (at least!).
  */
 void
-delay(u_int n)
+delay(unsigned n)
 {
-	u_quad_t tb;
-	u_long scratch, tbh, tbl;
+	uint64_t tb;
+	uint32_t scratch, tbh, tbl;
 
 	tb = mftb();
-	tb += (n * 1000 + ns_per_tick - 1) / ns_per_tick;
+	tb += ((uint64_t)n * 1000 + ns_per_tick - 1) / ns_per_tick;
 	tbh = tb >> 32;
 	tbl = tb;
 	asm volatile ("1: mftbu %0; cmpw %0,%1; blt 1b; bgt 2f; mftb %0; cmpw 0, %0,%2; blt 1b; 2:" : "="(scratch) : "r"(tbh), "r"(tbl));
@@ -1113,11 +1113,11 @@ cputype(void)
 	return pvr >> 16;
 }
 
-static inline u_quad_t
+static inline uint64_t
 mftb(void)
 {
-	u_long scratch;
-	u_quad_t tb;
+	uint32_t scratch;
+	uint64_t tb;
 
 	asm ("1: mftbu %0; mftb %0+1; mftbu %1; cmpw %0,%1; bne 1b"
 	: "=r"(tb), "=r"(scratch));



CVS commit: src/sys/arch/sandpoint/stand/altboot

2017-08-03 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Aug  3 09:42:34 UTC 2017

Modified Files:
src/sys/arch/sandpoint/stand/altboot: brdsetup.c

Log Message:
Fixed overflow in delay() for delays greater than 2 seconds.
Replaced u_long by uint32_t and u_quad by uint64_t whenever the exact
32- or 64-bit word is needed.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/sandpoint/stand/altboot/brdsetup.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/spi

2016-11-20 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Nov 20 12:38:04 UTC 2016

Modified Files:
src/sys/dev/spi: mcp3k.c

Log Message:
Fixed typo in name for MCP3304.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/spi/mcp3k.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/spi/mcp3k.c
diff -u src/sys/dev/spi/mcp3k.c:1.1 src/sys/dev/spi/mcp3k.c:1.2
--- src/sys/dev/spi/mcp3k.c:1.1	Tue Aug 18 15:54:20 2015
+++ src/sys/dev/spi/mcp3k.c	Sun Nov 20 12:38:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcp3k.c,v 1.1 2015/08/18 15:54:20 phx Exp $ */
+/*	$NetBSD: mcp3k.c,v 1.2 2016/11/20 12:38:04 phx Exp $ */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -163,7 +163,7 @@ static struct mcp3kadc_model mcp3k_model
 		.flags = M3K_SIGNED | M3K_SGLDIFF | M3K_D2D1D0
 	},
 	{
-		.name = 3204,
+		.name = 3304,
 		.bits = 13,
 		.channels = 8,
 		.lead = 2,



CVS commit: src/sys/dev/spi

2016-11-20 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Nov 20 12:38:04 UTC 2016

Modified Files:
src/sys/dev/spi: mcp3k.c

Log Message:
Fixed typo in name for MCP3304.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/spi/mcp3k.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/amiga

2016-11-04 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Nov  4 18:06:08 UTC 2016

Modified Files:
src/sys/arch/amiga/conf: WSCONS
src/sys/arch/amiga/dev: grf_et.c

Log Message:
wscons and Xorg support for Tseng ET4000/W32 based boards (grf6).


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/amiga/conf/WSCONS
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/amiga/dev/grf_et.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/amiga/conf/WSCONS
diff -u src/sys/arch/amiga/conf/WSCONS:1.70 src/sys/arch/amiga/conf/WSCONS:1.71
--- src/sys/arch/amiga/conf/WSCONS:1.70	Mon Oct  3 14:26:02 2016
+++ src/sys/arch/amiga/conf/WSCONS	Fri Nov  4 18:06:08 2016
@@ -1,4 +1,4 @@
-# $NetBSD: WSCONS,v 1.70 2016/10/03 14:26:02 rkujawa Exp $
+# $NetBSD: WSCONS,v 1.71 2016/11/04 18:06:08 phx Exp $
 
 # GENERIC with wscons(4)
 #
@@ -28,12 +28,10 @@ no grfcc0	at mainbus0
 no grfrt0	at zbus0
 no grfrh0	at zbus0
 no grful0	at zbus0
-no grfet*	at zbus0
 no grf0		at grfcc0
 no grf1		at grfrt0
 no grf2		at grfrh0
 no grf4		at grful0
-no grf6		at grfet?
 
 # Disable ite(4) for all grf(4) drivers.
 no ite0		at grf0

Index: src/sys/arch/amiga/dev/grf_et.c
diff -u src/sys/arch/amiga/dev/grf_et.c:1.32 src/sys/arch/amiga/dev/grf_et.c:1.33
--- src/sys/arch/amiga/dev/grf_et.c:1.32	Wed Jan 22 00:25:16 2014
+++ src/sys/arch/amiga/dev/grf_et.c	Fri Nov  4 18:06:08 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf_et.c,v 1.32 2014/01/22 00:25:16 christos Exp $ */
+/*	$NetBSD: grf_et.c,v 1.33 2016/11/04 18:06:08 phx Exp $ */
 
 /*
  * Copyright (c) 1997 Klaus Burkert
@@ -37,10 +37,11 @@
 #include "opt_amigacons.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: grf_et.c,v 1.32 2014/01/22 00:25:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf_et.c,v 1.33 2016/11/04 18:06:08 phx Exp $");
 
 #include "grfet.h"
 #include "ite.h"
+#include "wsdisplay.h"
 #if NGRFET > 0
 
 /*
@@ -72,6 +73,12 @@ __KERNEL_RCSID(0, "$NetBSD: grf_et.c,v 1
 
 #include 
 #include 
+#if NWSDISPLAY > 0
+#include 
+#include 
+#include 
+#include 
+#endif
 #ifdef TSENGCONSOLE
 #include 
 #endif
@@ -81,34 +88,50 @@ __KERNEL_RCSID(0, "$NetBSD: grf_et.c,v 1
 #include 
 #include 
 
-int	et_mondefok(struct grfvideo_mode *gv);
-void	et_boardinit(struct grf_softc *gp);
-static void et_CompFQ(u_int fq, u_char *num, u_char *denom);
-int	et_getvmode(struct grf_softc *gp, struct grfvideo_mode *vm);
-int	et_setvmode(struct grf_softc *gp, unsigned int mode);
-int	et_toggle(struct grf_softc *gp, unsigned short);
-int	et_getcmap(struct grf_softc *gfp, struct grf_colormap *cmap);
-int	et_putcmap(struct grf_softc *gfp, struct grf_colormap *cmap);
+int	et_mondefok(struct grfvideo_mode *);
+void	et_boardinit(struct grf_softc *);
+static void et_CompFQ(u_int fq, u_char *, u_char *);
+int	et_getvmode(struct grf_softc *, struct grfvideo_mode *);
+int	et_setvmode(struct grf_softc *, unsigned int);
+int	et_toggle(struct grf_softc *, unsigned short);
+int	et_getcmap(struct grf_softc *, struct grf_colormap *);
+int	et_putcmap(struct grf_softc *, struct grf_colormap *);
 #ifndef TSENGCONSOLE
-void	et_off(struct grf_softc *gp);
+void	et_off(struct grf_softc *);
 #endif
-void	et_inittextmode(struct grf_softc *gp);
-int	et_ioctl(register struct grf_softc *gp, u_long cmd, void *data);
-int	et_getmousepos(struct grf_softc *gp, struct grf_position *data);
-void	et_writesprpos(volatile char *ba, short x, short y);
-int	et_setmousepos(struct grf_softc *gp, struct grf_position *data);
-static int et_setspriteinfo(struct grf_softc *gp, struct grf_spriteinfo *data);
-int	et_getspriteinfo(struct grf_softc *gp, struct grf_spriteinfo *data);
-static int et_getspritemax(struct grf_softc *gp, struct grf_position *data);
-int	et_setmonitor(struct grf_softc *gp, struct grfvideo_mode *gv);
-int	et_blank(struct grf_softc *gp, int *on);
-static int et_getControllerType(struct grf_softc *gp);
-static int et_getDACType(struct grf_softc *gp);
+void	et_inittextmode(struct grf_softc *);
+int	et_ioctl(register struct grf_softc *, u_long cmd, void *);
+int	et_getmousepos(struct grf_softc *, struct grf_position *);
+void	et_writesprpos(volatile char *ba, short, short);
+int	et_setmousepos(struct grf_softc *, struct grf_position *);
+static int et_setspriteinfo(struct grf_softc *, struct grf_spriteinfo *);
+int	et_getspriteinfo(struct grf_softc *, struct grf_spriteinfo *);
+static int et_getspritemax(struct grf_softc *, struct grf_position *);
+int	et_setmonitor(struct grf_softc *, struct grfvideo_mode *);
+int	et_blank(struct grf_softc *, int);
+int	et_isblank(struct grf_softc *);
+static int et_getControllerType(struct grf_softc *);
+static int et_getDACType(struct grf_softc *);
 
 int	grfetmatch(device_t, cfdata_t, void *);
 void	grfetattach(device_t, device_t, void *);
 int	grfetprint(void *, const char *);
-void	et_memset(volatile unsigned char *d, unsigned char c, int l);
+void	et_memset(volatile unsigned char 

CVS commit: src/sys/arch/amiga

2016-11-04 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Nov  4 18:06:08 UTC 2016

Modified Files:
src/sys/arch/amiga/conf: WSCONS
src/sys/arch/amiga/dev: grf_et.c

Log Message:
wscons and Xorg support for Tseng ET4000/W32 based boards (grf6).


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/amiga/conf/WSCONS
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/amiga/dev/grf_et.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/amiga/dev

2016-10-23 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Oct 23 18:40:52 UTC 2016

Modified Files:
src/sys/arch/amiga/dev: mntva.c

Log Message:
Fixed WSCONS kernels. The cnprobe function must only be called when
MNTVA_CONSOLE is defined.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amiga/dev/mntva.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/amiga/dev

2016-10-23 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Oct 23 18:40:52 UTC 2016

Modified Files:
src/sys/arch/amiga/dev: mntva.c

Log Message:
Fixed WSCONS kernels. The cnprobe function must only be called when
MNTVA_CONSOLE is defined.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amiga/dev/mntva.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/amiga/dev/mntva.c
diff -u src/sys/arch/amiga/dev/mntva.c:1.1 src/sys/arch/amiga/dev/mntva.c:1.2
--- src/sys/arch/amiga/dev/mntva.c:1.1	Mon Oct  3 14:26:02 2016
+++ src/sys/arch/amiga/dev/mntva.c	Sun Oct 23 18:40:52 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mntva.c,v 1.1 2016/10/03 14:26:02 rkujawa Exp $	*/
+/*	$NetBSD: mntva.c,v 1.2 2016/10/23 18:40:52 phx Exp $	*/
 
 /*
  * Copyright (c) 2012, 2016 The NetBSD Foundation, Inc.		
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mntva.c,v 1.1 2016/10/03 14:26:02 rkujawa Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mntva.c,v 1.2 2016/10/23 18:40:52 phx Exp $");
 
 #include 
 #include 
@@ -593,6 +593,7 @@ mntvacninit(struct consdev *cd) 
 void 
 mntvacnprobe(struct consdev *cd)
 {
+#ifdef MNTVA_CONSOLE
 	/* 
 	 * This isn't exactly true, but cons.h does not define anything
 	 * that would fit our case exactly.
@@ -600,6 +601,7 @@ mntvacnprobe(struct consdev *cd)
 	cd->cn_pri = CN_INTERNAL;
 
 	cd->cn_dev = NODEV; /* Filled later by wscons. */
+#endif /* MNTVA_CONSOLE */
 }
 
 /* ARGSUSED */



CVS commit: src/sys/arch/amiga/dev

2016-06-17 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Jun 17 07:41:56 UTC 2016

Modified Files:
src/sys/arch/amiga/dev: grf_cv3d.c grf_cv3dreg.h

Log Message:
Remove the "totally untested" comments for the ZorroII frame buffer
select macro. The card is confirmed to work in an A2000.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/amiga/dev/grf_cv3d.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/amiga/dev/grf_cv3dreg.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/amiga/dev

2016-06-17 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Jun 17 07:41:56 UTC 2016

Modified Files:
src/sys/arch/amiga/dev: grf_cv3d.c grf_cv3dreg.h

Log Message:
Remove the "totally untested" comments for the ZorroII frame buffer
select macro. The card is confirmed to work in an A2000.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/amiga/dev/grf_cv3d.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/amiga/dev/grf_cv3dreg.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/amiga/dev/grf_cv3d.c
diff -u src/sys/arch/amiga/dev/grf_cv3d.c:1.33 src/sys/arch/amiga/dev/grf_cv3d.c:1.34
--- src/sys/arch/amiga/dev/grf_cv3d.c:1.33	Mon Nov 16 21:24:06 2015
+++ src/sys/arch/amiga/dev/grf_cv3d.c	Fri Jun 17 07:41:56 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf_cv3d.c,v 1.33 2015/11/16 21:24:06 phx Exp $ */
+/*	$NetBSD: grf_cv3d.c,v 1.34 2016/06/17 07:41:56 phx Exp $ */
 
 /*
  * Copyright (c) 1995 Michael Teske
@@ -33,7 +33,7 @@
 #include "opt_amigacons.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: grf_cv3d.c,v 1.33 2015/11/16 21:24:06 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf_cv3d.c,v 1.34 2016/06/17 07:41:56 phx Exp $");
 
 #include "grfcv3d.h"
 #include "ite.h"
@@ -1490,7 +1490,6 @@ cv3d_load_mon(struct grf_softc *gp, stru
 		gp->g_fbkva = (volatile char *)cv3d_boardaddr + 0x0400 +
 (0x0040 * fb_flag);
 	} else {
-		/* XXX This is totaly untested */
 		Select_Zorro2_FrameBuffer(fb_flag);
 	}
 

Index: src/sys/arch/amiga/dev/grf_cv3dreg.h
diff -u src/sys/arch/amiga/dev/grf_cv3dreg.h:1.12 src/sys/arch/amiga/dev/grf_cv3dreg.h:1.13
--- src/sys/arch/amiga/dev/grf_cv3dreg.h:1.12	Wed Jan 22 00:25:16 2014
+++ src/sys/arch/amiga/dev/grf_cv3dreg.h	Fri Jun 17 07:41:56 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf_cv3dreg.h,v 1.12 2014/01/22 00:25:16 christos Exp $	*/
+/*	$NetBSD: grf_cv3dreg.h,v 1.13 2016/06/17 07:41:56 phx Exp $	*/
 
 /*
  * Copyright (c) 1995 Michael Teske
@@ -101,7 +101,6 @@ struct grfcv3dtext_mode {
 #define vgaw16(ba, reg, val) \
 	*((volatile unsigned short *) (((volatile char *)ba)+reg)) = val
 
-/* XXX This is totaly untested */
 #define	Select_Zorro2_FrameBuffer(flag) \
 	do { \
 		*(((volatile char *)cv3d_vcode_switch_base) + \



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2016-01-04 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Jan  4 14:10:15 UTC 2016

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: amigatypes.h main.c

Log Message:
Make the -p option work, like with loadbsd.
Otherwise the kernel could load into a low-priority 512MB Z3 RAM segment.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amiga/stand/bootblock/boot/amigatypes.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/amiga/stand/bootblock/boot/main.c

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

Modified files:

Index: src/sys/arch/amiga/stand/bootblock/boot/amigatypes.h
diff -u src/sys/arch/amiga/stand/bootblock/boot/amigatypes.h:1.7 src/sys/arch/amiga/stand/bootblock/boot/amigatypes.h:1.8
--- src/sys/arch/amiga/stand/bootblock/boot/amigatypes.h:1.7	Mon Apr 28 20:23:13 2008
+++ src/sys/arch/amiga/stand/bootblock/boot/amigatypes.h	Mon Jan  4 14:10:15 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: amigatypes.h,v 1.7 2008/04/28 20:23:13 martin Exp $ */
+/* $NetBSD: amigatypes.h,v 1.8 2016/01/04 14:10:15 phx Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@ struct Library {
 struct MemHead {
 	struct MemHead *next;
 	u_int8_t Dmy1[  9-  4];
-	u_int8_t Pri;
+	int8_t Pri;
 	u_int8_t Dmy2[ 14- 10];
 	u_int16_t Attribs;
 	u_int32_t First, Lower, Upper, Free;

Index: src/sys/arch/amiga/stand/bootblock/boot/main.c
diff -u src/sys/arch/amiga/stand/bootblock/boot/main.c:1.29 src/sys/arch/amiga/stand/bootblock/boot/main.c:1.30
--- src/sys/arch/amiga/stand/bootblock/boot/main.c:1.29	Sat Mar 29 12:49:15 2014
+++ src/sys/arch/amiga/stand/bootblock/boot/main.c	Mon Jan  4 14:10:15 2016
@@ -1,5 +1,5 @@
 /*
- * $NetBSD: main.c,v 1.29 2014/03/29 12:49:15 mlelstv Exp $
+ * $NetBSD: main.c,v 1.30 2016/01/04 14:10:15 phx Exp $
  *
  *
  * Copyright (c) 1996,1999 Ignatios Souvatzis
@@ -122,6 +122,7 @@ pain(void *aio,	void *cons)
 	struct MemHead *mh;
 	u_int32_t from, size, vfrom, vsize;
 	int contflag, mapped1to1;
+	int8_t mempri;
 
 	int ncd, nseg;
 	char c;
@@ -200,7 +201,7 @@ again:
 	(get_number() & 3) << 1;
 	break;
 case 'p':	/* Select fastmem by priority */
-	p_flag++;
+	p_flag = 1;
 	break;
 case 'q':
 	boothowto |= AB_QUIET;
@@ -274,6 +275,7 @@ again:
 	vfrom = mh->Lower & -__PGSZ;
 	vsize = (mh->Upper & -__PGSZ) - vfrom;
 	contflag = mapped1to1 = 0;
+	mempri = -128;
 
 	do {
 		size = vsize;
@@ -318,9 +320,12 @@ again:
 			size += from;
 			cmemsz = size;
 			from = 0;
-		} else if ((fmemsz < size) && mapped1to1) {
+		} else if (mapped1to1 && ((!p_flag && fmemsz < size) ||
+		(p_flag && (mempri < mh->Pri ||
+		(mempri == mh->Pri && fmemsz < size) {
 			fmem = from;
 			fmemsz = size;
+			mempri = mh->Pri;
 		}
 
 		memseg[nseg].ms_start = from;



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2016-01-04 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Jan  4 14:10:15 UTC 2016

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: amigatypes.h main.c

Log Message:
Make the -p option work, like with loadbsd.
Otherwise the kernel could load into a low-priority 512MB Z3 RAM segment.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amiga/stand/bootblock/boot/amigatypes.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/amiga/stand/bootblock/boot/main.c

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



CVS commit: src/sys/fs/adosfs

2015-11-18 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Nov 18 22:06:25 UTC 2015

Modified Files:
src/sys/fs/adosfs: advfsops.c

Log Message:
Patch by hannken@ to fix a bug which has been introduced with 1.71.
The kernel crashed with uvm fault when mounting an ados file system.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/fs/adosfs/advfsops.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/fs/adosfs/advfsops.c
diff -u src/sys/fs/adosfs/advfsops.c:1.74 src/sys/fs/adosfs/advfsops.c:1.75
--- src/sys/fs/adosfs/advfsops.c:1.74	Mon Apr 20 13:44:16 2015
+++ src/sys/fs/adosfs/advfsops.c	Wed Nov 18 22:06:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: advfsops.c,v 1.74 2015/04/20 13:44:16 riastradh Exp $	*/
+/*	$NetBSD: advfsops.c,v 1.75 2015/11/18 22:06:25 phx Exp $	*/
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: advfsops.c,v 1.74 2015/04/20 13:44:16 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: advfsops.c,v 1.75 2015/11/18 22:06:25 phx Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -369,9 +369,12 @@ adosfs_statvfs(struct mount *mp, struct 
 int
 adosfs_vget(struct mount *mp, ino_t an, struct vnode **vpp)
 {
+	u_long block;
 	int error;
 
-	error = vcache_get(mp, , sizeof(an), vpp);
+	block = an;
+	KASSERT(block == an);
+	error = vcache_get(mp, , sizeof(block), vpp);
 	if (error)
 		return error;
 	error = vn_lock(*vpp, LK_EXCLUSIVE);
@@ -394,7 +397,7 @@ adosfs_loadvnode(struct mount *mp, struc
 	struct adosfsmount *amp;
 	struct anode *ap;
 	struct buf *bp;
-	ino_t an;
+	u_long an;
 	char *nam, *tmp;
 	int namlen, error;
 



CVS commit: src/sys/fs/adosfs

2015-11-18 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Nov 18 22:06:25 UTC 2015

Modified Files:
src/sys/fs/adosfs: advfsops.c

Log Message:
Patch by hannken@ to fix a bug which has been introduced with 1.71.
The kernel crashed with uvm fault when mounting an ados file system.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/fs/adosfs/advfsops.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/amiga/dev

2015-11-16 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Nov 16 21:24:06 UTC 2015

Modified Files:
src/sys/arch/amiga/dev: grf_cv.c grf_cv3d.c

Log Message:
Fixed bug in wsdisplay copyrows textop.
Fixed WSDISPLAYIO_SVIDEO, which had inverted functionality.
Improved FBINFO setup. 15 and 16 bits depth both have 16bpp now.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/amiga/dev/grf_cv.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/amiga/dev/grf_cv3d.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/amiga/dev/grf_cv.c
diff -u src/sys/arch/amiga/dev/grf_cv.c:1.58 src/sys/arch/amiga/dev/grf_cv.c:1.59
--- src/sys/arch/amiga/dev/grf_cv.c:1.58	Thu Nov 12 12:01:53 2015
+++ src/sys/arch/amiga/dev/grf_cv.c	Mon Nov 16 21:24:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf_cv.c,v 1.58 2015/11/12 12:01:53 phx Exp $ */
+/*	$NetBSD: grf_cv.c,v 1.59 2015/11/16 21:24:06 phx Exp $ */
 
 /*
  * Copyright (c) 1995 Michael Teske
@@ -33,7 +33,7 @@
 #include "opt_amigacons.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: grf_cv.c,v 1.58 2015/11/12 12:01:53 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf_cv.c,v 1.59 2015/11/16 21:24:06 phx Exp $");
 
 #include "grfcv.h"
 #include "ite.h"
@@ -543,8 +543,10 @@ grfcvattach(device_t parent, device_t se
 		gp->g_defaultscr = _defaultscreen;
 		gp->g_scrlist = _screenlist;
 #else
+#if NITE > 0
 		grfcv_iteinit(gp);
 #endif
+#endif /* NWSDISPLAY > 0 */
 		(void)cv_load_mon(gp, _mode);
 #endif
 	}
@@ -2387,7 +2389,7 @@ cv_wscopyrows(void *c, int srcrow, int d
 	gp = scr->scr_cookie;
 	src = dst = gp->g_fbkva;
 	n = ri->ri_cols * nrows;
-	if (src < dst) {
+	if (srcrow < dstrow) {
 		/* need to copy backwards */
 		src += gp->g_rowoffset[srcrow + nrows] << 1;
 		dst += gp->g_rowoffset[dstrow + nrows] << 1;
@@ -2485,7 +2487,7 @@ cv_wsioctl(void *v, void *vs, u_long cmd
 		return 0;
 
 	case WSDISPLAYIO_SVIDEO:
-		return cv_blank(gp, *(u_int *)data == WSDISPLAYIO_VIDEO_OFF);
+		return cv_blank(gp, *(u_int *)data == WSDISPLAYIO_VIDEO_ON);
 
 	case WSDISPLAYIO_SMODE:
 		if ((*(int *)data) != gp->g_wsmode) {
@@ -2525,34 +2527,34 @@ cv_get_fbinfo(struct grf_softc *gp, stru
 	md = monitor_current;
 	abits = 0;
 
-	fbi->fbi_width = md->disp_width;
-	fbi->fbi_height = md->disp_height;
-	fbi->fbi_bitsperpixel = md->depth;
-
 	switch (md->depth) {
 	case 8:
-		fbi->fbi_stride = md->disp_width;
+		fbi->fbi_bitsperpixel = 8;
 		rbits = gbits = bbits = 6;  /* keep gcc happy */
 		break;
 	case 15:
-		fbi->fbi_stride = md->disp_width * 2;
+		fbi->fbi_bitsperpixel = 16;
 		rbits = gbits = bbits = 5;
 		break;
 	case 16:
-		fbi->fbi_stride = md->disp_width * 2;
+		fbi->fbi_bitsperpixel = 16;
 		rbits = bbits = 5;
 		gbits = 6;
 		break;
 	case 32:
 		abits = 8;
 	case 24:
-		fbi->fbi_stride = md->disp_width * 4;
+		fbi->fbi_bitsperpixel = 32;
 		rbits = gbits = bbits = 8;
 		break;
 	default:
 		return EINVAL;
 	}
 
+	fbi->fbi_stride = (fbi->fbi_bitsperpixel / 8) * md->disp_width;
+	fbi->fbi_width = md->disp_width;
+	fbi->fbi_height = md->disp_height;
+
 	if (md->depth > 8) {
 		fbi->fbi_pixeltype = WSFB_RGB;
 		fbi->fbi_subtype.fbi_rgbmasks.red_offset = bbits + gbits;

Index: src/sys/arch/amiga/dev/grf_cv3d.c
diff -u src/sys/arch/amiga/dev/grf_cv3d.c:1.32 src/sys/arch/amiga/dev/grf_cv3d.c:1.33
--- src/sys/arch/amiga/dev/grf_cv3d.c:1.32	Thu Nov 12 12:01:53 2015
+++ src/sys/arch/amiga/dev/grf_cv3d.c	Mon Nov 16 21:24:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf_cv3d.c,v 1.32 2015/11/12 12:01:53 phx Exp $ */
+/*	$NetBSD: grf_cv3d.c,v 1.33 2015/11/16 21:24:06 phx Exp $ */
 
 /*
  * Copyright (c) 1995 Michael Teske
@@ -33,11 +33,11 @@
 #include "opt_amigacons.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: grf_cv3d.c,v 1.32 2015/11/12 12:01:53 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf_cv3d.c,v 1.33 2015/11/16 21:24:06 phx Exp $");
 
+#include "grfcv3d.h"
 #include "ite.h"
 #include "wsdisplay.h"
-#include "grfcv3d.h"
 #if NGRFCV3D > 0
 
 /*
@@ -493,7 +493,9 @@ grfcv3dattach(device_t parent, device_t 
 		gp->g_defaultscr = _defaultscreen;
 		gp->g_scrlist = _screenlist;
 #else
+#if NITE > 0
 		grfcv3d_iteinit(gp);
+#endif
 #endif /* NWSDISPLAY > 0 */
 		(void)cv3d_load_mon(gp, _mode);		
 #endif
@@ -2242,7 +2244,7 @@ cv3d_wscopyrows(void *c, int srcrow, int
 	gp = scr->scr_cookie;
 	src = dst = gp->g_fbkva;
 	n = ri->ri_cols * nrows;
-	if (src < dst) {
+	if (srcrow < dstrow) {
 		/* need to copy backwards */
 		src += gp->g_rowoffset[srcrow + nrows] << 1;
 		dst += gp->g_rowoffset[dstrow + nrows] << 1;
@@ -2340,7 +2342,7 @@ cv3d_wsioctl(void *v, void *vs, u_long c
 		return 0;
 
 	case WSDISPLAYIO_SVIDEO:
-		return cv3d_blank(gp, *(u_int *)data == WSDISPLAYIO_VIDEO_OFF);
+		return cv3d_blank(gp, *(u_int *)data == WSDISPLAYIO_VIDEO_ON);
 
 	case WSDISPLAYIO_SMODE:
 		if ((*(int *)data) != gp->g_wsmode) {
@@ -2380,34 +2382,34 @@ cv3d_get_fbinfo(struct grf_softc *gp, st
 	md = monitor_current;
 	

CVS commit: src/sys/arch/amiga/dev

2015-11-16 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Nov 16 21:24:06 UTC 2015

Modified Files:
src/sys/arch/amiga/dev: grf_cv.c grf_cv3d.c

Log Message:
Fixed bug in wsdisplay copyrows textop.
Fixed WSDISPLAYIO_SVIDEO, which had inverted functionality.
Improved FBINFO setup. 15 and 16 bits depth both have 16bpp now.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/amiga/dev/grf_cv.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/amiga/dev/grf_cv3d.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/amiga

2015-11-16 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Nov 16 21:25:34 UTC 2015

Modified Files:
src/sys/arch/amiga/conf: WSCONS
src/sys/arch/amiga/dev: grf_cl.c

Log Message:
wscons and Xorg support for CirrusLogic GD542x based boards (grf3).


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/amiga/conf/WSCONS
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/amiga/dev/grf_cl.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/amiga/conf/WSCONS
diff -u src/sys/arch/amiga/conf/WSCONS:1.68 src/sys/arch/amiga/conf/WSCONS:1.69
--- src/sys/arch/amiga/conf/WSCONS:1.68	Fri Nov 13 16:04:07 2015
+++ src/sys/arch/amiga/conf/WSCONS	Mon Nov 16 21:25:34 2015
@@ -1,4 +1,4 @@
-# $NetBSD: WSCONS,v 1.68 2015/11/13 16:04:07 phx Exp $
+# $NetBSD: WSCONS,v 1.69 2015/11/16 21:25:34 phx Exp $
 
 # GENERIC with wscons(4)
 #
@@ -27,13 +27,11 @@ amidisplaycc0	at mainbus0		# wscons inte
 no grfcc0	at mainbus0
 no grfrt0	at zbus0
 no grfrh0	at zbus0
-no grfcl*	at zbus0
 no grful0	at zbus0
 no grfet*	at zbus0
 no grf0		at grfcc0
 no grf1		at grfrt0
 no grf2		at grfrh0
-no grf3		at grfcl?
 no grf4		at grful0
 no grf6		at grfet?
 

Index: src/sys/arch/amiga/dev/grf_cl.c
diff -u src/sys/arch/amiga/dev/grf_cl.c:1.49 src/sys/arch/amiga/dev/grf_cl.c:1.50
--- src/sys/arch/amiga/dev/grf_cl.c:1.49	Wed Jan 22 00:25:16 2014
+++ src/sys/arch/amiga/dev/grf_cl.c	Mon Nov 16 21:25:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf_cl.c,v 1.49 2014/01/22 00:25:16 christos Exp $ */
+/*	$NetBSD: grf_cl.c,v 1.50 2015/11/16 21:25:34 phx Exp $ */
 
 /*
  * Copyright (c) 1997 Klaus Burkert
@@ -36,10 +36,11 @@
 #include "opt_amigacons.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: grf_cl.c,v 1.49 2014/01/22 00:25:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf_cl.c,v 1.50 2015/11/16 21:25:34 phx Exp $");
 
 #include "grfcl.h"
 #include "ite.h"
+#include "wsdisplay.h"
 #if NGRFCL > 0
 
 /*
@@ -81,6 +82,12 @@ __KERNEL_RCSID(0, "$NetBSD: grf_cl.c,v 1
 
 #include 
 #include 
+#if NWSDISPLAY > 0
+#include 
+#include 
+#include 
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -106,7 +113,8 @@ int	cl_setmousepos(struct grf_softc *, s
 static int cl_setspriteinfo(struct grf_softc *, struct grf_spriteinfo *);
 int	cl_getspriteinfo(struct grf_softc *, struct grf_spriteinfo *);
 static int cl_getspritemax(struct grf_softc *, struct grf_position *);
-int	cl_blank(struct grf_softc *, int *);
+int	cl_blank(struct grf_softc *, int);
+int	cl_isblank(struct grf_softc *);
 int	cl_setmonitor(struct grf_softc *, struct grfvideo_mode *);
 void	cl_writesprpos(volatile char *, short, short);
 void	writeshifted(volatile char *, signed char, signed char);
@@ -120,6 +128,21 @@ int	grfclprint(void *, const char *);
 int	grfclmatch(device_t, cfdata_t, void *);
 void	cl_memset(unsigned char *, unsigned char, int);
 
+#if NWSDISPLAY > 0
+/* wsdisplay acessops, emulops */
+static int	cl_wsioctl(void *, void *, u_long, void *, int, struct lwp *);
+static int	cl_get_fbinfo(struct grf_softc *, struct wsdisplayio_fbinfo *);
+
+static void	cl_wscursor(void *, int, int, int);
+static void	cl_wsputchar(void *, int, int, u_int, long);
+static void	cl_wscopycols(void *, int, int, int, int);
+static void	cl_wserasecols(void *, int, int, int, long);
+static void	cl_wscopyrows(void *, int, int, int);
+static void	cl_wseraserows(void *, int, int, long);
+static int	cl_wsallocattr(void *, int, int, int, long *);
+static int	cl_wsmapchar(void *, int, unsigned int *);
+#endif  /* NWSDISPLAY > 0 */
+
 /* Graphics display definitions.
  * These are filled by 'grfconfig' using GRFIOCSETMON.
  */
@@ -162,6 +185,7 @@ unsigned char clconscolors[3][3] = {	/* 
 int	cltype = 0;		/* Picasso, Spectrum or Piccolo */
 int	cl_64bit = 0;		/* PiccoloSD64 or PicassoIV */
 unsigned char cl_pass_toggle;	/* passthru status tracker */
+static int cl_blanked;		/* true when video is currently blanked out */
 
 /*
  * because all 542x-boards have 2 configdev entries, one for
@@ -188,6 +212,41 @@ struct grf_spriteinfo cl_cursprite;
 static unsigned char cl_imageptr[8 * 64], cl_maskptr[8 * 64];
 static unsigned char cl_sprred[2], cl_sprgreen[2], cl_sprblue[2];
 
+#if NWSDISPLAY > 0
+static struct wsdisplay_accessops cl_accessops = {
+	.ioctl		= cl_wsioctl,
+	.mmap		= grf_wsmmap
+};
+
+static struct wsdisplay_emulops cl_textops = {
+	.cursor		= cl_wscursor,
+	.mapchar	= cl_wsmapchar,
+	.putchar	= cl_wsputchar,
+	.copycols	= cl_wscopycols,
+	.erasecols	= cl_wserasecols,
+	.copyrows	= cl_wscopyrows,
+	.eraserows	= cl_wseraserows,
+	.allocattr	= cl_wsallocattr
+};
+
+static struct wsscreen_descr cl_defaultscreen = {
+	.name		= "default",
+	.textops	= _textops,
+	.fontwidth	= 8,
+	.fontheight	= CIRRUSFONTY,
+	.capabilities	= WSSCREEN_HILIT | WSSCREEN_BLINK |
+			  WSSCREEN_REVERSE | WSSCREEN_UNDERLINE
+};
+
+static const struct wsscreen_descr *cl_screens[] = {
+	_defaultscreen,
+};
+
+static 

CVS commit: src/sys/arch/amiga

2015-11-16 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Nov 16 21:25:34 UTC 2015

Modified Files:
src/sys/arch/amiga/conf: WSCONS
src/sys/arch/amiga/dev: grf_cl.c

Log Message:
wscons and Xorg support for CirrusLogic GD542x based boards (grf3).


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/amiga/conf/WSCONS
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/amiga/dev/grf_cl.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/amiga/conf

2015-11-13 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Nov 13 16:04:07 UTC 2015

Modified Files:
src/sys/arch/amiga/conf: WSCONS

Log Message:
Make sure the graphics device which has the console gets wsdisplay0,
otherwise neither virtual terminals nor Xorg's wsfb driver will work.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/amiga/conf/WSCONS

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



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

2015-11-13 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Nov 13 16:04:07 UTC 2015

Modified Files:
src/sys/arch/amiga/conf: WSCONS

Log Message:
Make sure the graphics device which has the console gets wsdisplay0,
otherwise neither virtual terminals nor Xorg's wsfb driver will work.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/amiga/conf/WSCONS

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/amiga/conf/WSCONS
diff -u src/sys/arch/amiga/conf/WSCONS:1.67 src/sys/arch/amiga/conf/WSCONS:1.68
--- src/sys/arch/amiga/conf/WSCONS:1.67	Thu Oct  3 13:40:26 2013
+++ src/sys/arch/amiga/conf/WSCONS	Fri Nov 13 16:04:07 2015
@@ -1,4 +1,4 @@
-# $NetBSD: WSCONS,v 1.67 2013/10/03 13:40:26 rkujawa Exp $
+# $NetBSD: WSCONS,v 1.68 2015/11/13 16:04:07 phx Exp $
 
 # GENERIC with wscons(4)
 #
@@ -6,8 +6,6 @@ include	"arch/amiga/conf/GENERIC"
 
 # wscons(4)-aware interface to amiga custom chips.
 #
-amidisplaycc0	at mainbus0		# wscons interface to custom chips
-wsdisplay0	at amidisplaycc0 console ?
 options 	WSEMUL_VT100
 options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
 options 	FONT_VT220L8x10
@@ -23,29 +21,23 @@ wsmouse*	at ms?
 ums*		at uhidev? reportid ? 
 wsmouse*	at ums?
 
+amidisplaycc0	at mainbus0		# wscons interface to custom chips
+
+# Disable grf(4) devices without wsdisplay support.
 no grfcc0	at mainbus0
 no grfrt0	at zbus0
 no grfrh0	at zbus0
 no grfcl*	at zbus0
 no grful0	at zbus0
 no grfet*	at zbus0
-#no grfcv0	at zbus0
-#no grfcv3d0	at zbus0
-
-# Disable grf(4) devices for non-wsdisplay drivers.
 no grf0		at grfcc0
 no grf1		at grfrt0
 no grf2		at grfrh0
 no grf3		at grfcl?
 no grf4		at grful0
 no grf6		at grfet?
-#no grf5	at grfcv0
-#no grf7	at grfcv3d0
-
-wsdisplay*	at grf5 console ?	# wsdisplay on top of grf (CV64)
-wsdisplay*	at grf7 console ?	# wsdisplay on top of grf (CV64/3D)
 
-# Disable ite(4) for all drivers.
+# Disable ite(4) for all grf(4) drivers.
 no ite0		at grf0
 no ite1		at grf1
 no ite2		at grf2
@@ -64,8 +56,8 @@ voodoofb*	at pci?			# 3Dfx Voodoo 3 in G
 # G-REX.
 #options		P5PB_CONSOLE
 
+wsdisplay0	at wsemuldisplaydev? console 1
 wsdisplay*	at wsemuldisplaydev? console ?
 
 pseudo-device	wsfont			# wsfont(4) dynamic font loading support
 pseudo-device	wsmux			# mouse & keyboard multiplexor
-



Re: CVS commit: src/sys/arch

2015-11-13 Thread Frank Wille
On Fri, 13 Nov 2015 08:45:29 +1100
matthew green <m...@eterna.com.au> wrote:

> > I didn't manage to make the "wskbd" protocol the default in the X
> > server, so you have to provide a small xorg.conf with Option "Protocol"
> > "wskbd". The standard protocol will not work as the Amiga wskbd cannot
> > be switched into raw mode and has no AT-scancode translation in the
> > kernel.
> 
> try having a look at xorg-server/dist/hw/xfree86/common/xf86AutoConfig.c
> listPossibleVideoDrivers().

As far as I understand this function tries possible video drivers and
finally selects a default one, which is "vesa" for x86 and "wsfb" for the
rest. I'm fine with that.

What I need is -DDEFAULT_TO_WSKBD for the keyboard protocol, which happens
in xf86-input-keyboard/dist/configure. But adding "m68k" and "amiga" there
and in configure.ac didn't help:

case $host_os in
  netbsd*)
case $host in
  *powerpc-*|*sparc-*|*sparc64-*|*vax-*)
OS_FLAGS="$OS_FLAGS -DDEFAULT_TO_WSKBD"
;;
esac
case "$(uname -m 2>&1)" in
  evbarm|sgimips|shark)   
OS_FLAGS="$OS_FLAGS -DDEFAULT_TO_WSKBD"
;;
esac
;;
esac

-- 
Frank Wille


CVS commit: xsrc/external/mit/xf86-input-keyboard/dist/src

2015-11-12 Thread Frank Wille
Module Name:xsrc
Committed By:   phx
Date:   Thu Nov 12 12:03:58 UTC 2015

Modified Files:
xsrc/external/mit/xf86-input-keyboard/dist/src: bsd_KbdMap.c bsd_kbd.c

Log Message:
Scancode translation table for wskbd on Amiga keyboards.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c
cvs rdiff -u -r1.20 -r1.21 \
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.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-input-keyboard/dist/src/bsd_KbdMap.c
diff -u xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c:1.10 xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c:1.11
--- xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c:1.10	Fri Apr  4 12:50:09 2014
+++ xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c	Thu Nov 12 12:03:58 2015
@@ -841,6 +841,122 @@ TransMapRec wsAdb = {
 wsAdbMap
 };
 
+/* Map for amiga keyboards  */
+static CARD8 wsAmigaMap[] = {
+	/* 0 */ KEY_Tilde,
+	/* 1 */ KEY_1,
+	/* 2 */ KEY_2,
+	/* 3 */ KEY_3,
+	/* 4 */ KEY_4,
+	/* 5 */ KEY_5,
+	/* 6 */ KEY_6,
+	/* 7 */ KEY_7,
+	/* 8 */ KEY_8,
+	/* 9 */ KEY_9,
+	/* 10 */ KEY_0,
+	/* 11 */ KEY_Minus,
+	/* 12 */ KEY_Equal,
+	/* 13 */ KEY_BSlash,	/* key in this position only on Amiga */
+	/* 14 */ KEY_NOTUSED,
+	/* 15 */ KEY_KP_0,
+	/* 16 */ KEY_Q,
+	/* 17 */ KEY_W,
+	/* 18 */ KEY_E,
+	/* 19 */ KEY_R,
+	/* 20 */ KEY_T,
+	/* 21 */ KEY_Y,
+	/* 22 */ KEY_U,
+	/* 23 */ KEY_I,
+	/* 24 */ KEY_O,
+	/* 25 */ KEY_P,
+	/* 26 */ KEY_LBrace,
+	/* 27 */ KEY_RBrace,
+	/* 28 */ KEY_NOTUSED,
+	/* 29 */ KEY_KP_1,
+	/* 30 */ KEY_KP_2,
+	/* 31 */ KEY_KP_3,
+	/* 32 */ KEY_A,
+	/* 33 */ KEY_S,
+	/* 34 */ KEY_D,
+	/* 35 */ KEY_F,
+	/* 36 */ KEY_G,
+	/* 37 */ KEY_H,
+	/* 38 */ KEY_J,
+	/* 39 */ KEY_K,
+	/* 40 */ KEY_L,
+	/* 41 */ KEY_SemiColon,
+	/* 42 */ KEY_Quote,
+	/* 43 */ KEY_BSlash,	/* # on international keyboards */
+	/* 44 */ KEY_NOTUSED,
+	/* 45 */ KEY_KP_4,
+	/* 46 */ KEY_KP_5,
+	/* 47 */ KEY_KP_6,
+	/* 48 */ KEY_Less,
+	/* 49 */ KEY_Z,
+	/* 50 */ KEY_X,
+	/* 51 */ KEY_C,
+	/* 52 */ KEY_V,
+	/* 53 */ KEY_B,
+	/* 54 */ KEY_N,
+	/* 55 */ KEY_M,
+	/* 56 */ KEY_Comma,
+	/* 57 */ KEY_Period,
+	/* 58 */ KEY_Slash,
+	/* 59 */ KEY_NOTUSED,
+	/* 60 */ KEY_KP_Decimal,
+	/* 61 */ KEY_KP_7,
+	/* 62 */ KEY_KP_8,
+	/* 63 */ KEY_KP_9,
+	/* 64 */ KEY_Space,
+	/* 65 */ KEY_BackSpace,
+	/* 66 */ KEY_Tab,
+	/* 67 */ KEY_KP_Enter,
+	/* 68 */ KEY_Enter,
+	/* 69 */ KEY_Escape,
+	/* 70 */ KEY_Delete,
+	/* 71 */ KEY_NOTUSED,
+	/* 72 */ KEY_NOTUSED, 
+	/* 73 */ KEY_NOTUSED,
+	/* 74 */ KEY_KP_Minus,
+	/* 75 */ KEY_NOTUSED,
+	/* 76 */ KEY_Up,
+	/* 77 */ KEY_Down,
+	/* 78 */ KEY_Right,
+	/* 79 */ KEY_Left,
+	/* 80 */ KEY_F1,
+	/* 81 */ KEY_F2,
+	/* 82 */ KEY_F3,
+	/* 83 */ KEY_F4,
+	/* 84 */ KEY_F5,
+	/* 85 */ KEY_F6,
+	/* 86 */ KEY_F7,
+	/* 87 */ KEY_F8,
+	/* 88 */ KEY_F9,
+	/* 89 */ KEY_F10,
+	/* 90 */ KEY_UNKNOWN,		/* Keypad [ */
+	/* 91 */ KEY_UNKNOWN,		/* Keypad ] */
+	/* 92 */ KEY_KP_Divide,
+	/* 93 */ KEY_KP_Multiply,
+	/* 94 */ KEY_KP_Plus,
+	/* 95 */ KEY_Help,
+	/* 96 */ KEY_ShiftL,
+	/* 97 */ KEY_ShiftR,
+	/* 98 */ KEY_NOTUSED,
+	/* 99 */ KEY_LCtrl,
+	/* 100 */ KEY_Alt,
+	/* 101 */ KEY_AltLang,
+	/* 102 */ KEY_LMeta,
+	/* 103 */ KEY_RMeta
+};
+#define WS_AMIGA_MAP_SIZE (sizeof(wsAmigaMap)/sizeof(*wsAmigaMap))
+
+static
+TransMapRec wsAmiga = {
+0,
+WS_AMIGA_MAP_SIZE,
+wsAmigaMap
+};
+
 /* Map for LK201 keyboards  */
 static CARD8 wsLk201Map[] = {
 	/* 0 */ KEY_F1,
@@ -1386,6 +1502,11 @@ KbdGetMapping (InputInfoPtr pInfo, KeySy
 pKbd->scancodeMap =  
 break;
 #endif
+#ifdef WSKBD_TYPE_AMIGA
+	   case WSKBD_TYPE_AMIGA:
+pKbd->scancodeMap =  
+break;
+#endif
 #ifdef WSKBD_TYPE_LK201
 	   case WSKBD_TYPE_LK201:
 pKbd->scancodeMap = 

Index: xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c
diff -u xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c:1.20 xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c:1.21
--- xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c:1.20	Thu Mar 20 10:27:39 2014
+++ xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c	Thu Nov 12 12:03:58 2015
@@ -459,6 +459,11 @@ OpenKeyboard(InputInfoPtr pInfo)
printWsType("ADB", pInfo->name);
break;
 #endif
+#ifdef WSKBD_TYPE_AMIGA
+   case WSKBD_TYPE_AMIGA:
+   printWsType("Amiga", pInfo->name);
+   break;
+#endif
 #ifdef WSKBD_TYPE_LK201
case WSKBD_TYPE_LK201:
printWsType("LK201", pInfo->name);



CVS commit: xsrc/external/mit/xf86-input-keyboard/dist/src

2015-11-12 Thread Frank Wille
Module Name:xsrc
Committed By:   phx
Date:   Thu Nov 12 12:03:58 UTC 2015

Modified Files:
xsrc/external/mit/xf86-input-keyboard/dist/src: bsd_KbdMap.c bsd_kbd.c

Log Message:
Scancode translation table for wskbd on Amiga keyboards.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c
cvs rdiff -u -r1.20 -r1.21 \
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.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

2015-11-12 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Nov 12 12:01:53 UTC 2015

Modified Files:
src/sys/arch/amiga/amiga: bus.c
src/sys/arch/amiga/dev: grf.c grf_cv.c grf_cv3d.c
src/sys/arch/amiga/include: param.h
src/sys/arch/amigappc/include: param.h

Log Message:
Xorg for amiga via wsfb. Currently available on CV64 and CV64/3D. More
graphics cards will follow, when adding wscons support to them.

I didn't manage to make the "wskbd" protocol the default in the X server,
so you have to provide a small xorg.conf with Option "Protocol" "wskbd".
The standard protocol will not work as the Amiga wskbd cannot be switched
into raw mode and has no AT-scancode translation in the kernel.

On the positive side, wskbd also works with national keymaps under X.

The graphics modes can still be defined via grfconfig(8). Xorg's wsfb
driver uses the current grf video mode, which is usually mode #1.
All resolutions and depths seem to work (tested on CV64).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amiga/amiga/bus.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/amiga/dev/grf.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/amiga/dev/grf_cv.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/amiga/dev/grf_cv3d.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/amiga/include/param.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/amigappc/include/param.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/amiga/amiga/bus.c
diff -u src/sys/arch/amiga/amiga/bus.c:1.1 src/sys/arch/amiga/amiga/bus.c:1.2
--- src/sys/arch/amiga/amiga/bus.c:1.1	Thu Aug  4 17:48:50 2011
+++ src/sys/arch/amiga/amiga/bus.c	Thu Nov 12 12:01:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.1 2011/08/04 17:48:50 rkujawa Exp $ */
+/*	$NetBSD: bus.c,v 1.2 2015/11/12 12:01:53 phx Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -48,11 +48,7 @@ paddr_t
 bus_space_mmap(bus_space_tag_t t, bus_addr_t addr, off_t off, int prot,
 	int flags)
 {
-#if defined(__m68k__)
-	return m68k_btop(addr + off);
-#else
-	return -1; /* FIXME */
-#endif
+	return MD_BTOP(addr + off);
 }
 
 void *
@@ -63,4 +59,3 @@ bus_space_vaddr(bus_space_tag_t space, b
 
 	return va;
 }
-

Index: src/sys/arch/amiga/dev/grf.c
diff -u src/sys/arch/amiga/dev/grf.c:1.63 src/sys/arch/amiga/dev/grf.c:1.64
--- src/sys/arch/amiga/dev/grf.c:1.63	Sat Nov  7 14:29:10 2015
+++ src/sys/arch/amiga/dev/grf.c	Thu Nov 12 12:01:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf.c,v 1.63 2015/11/07 14:29:10 phx Exp $ */
+/*	$NetBSD: grf.c,v 1.64 2015/11/12 12:01:53 phx Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.63 2015/11/07 14:29:10 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.64 2015/11/12 12:01:53 phx Exp $");
 
 /*
  * Graphics display driver for the Amiga
@@ -140,7 +140,6 @@ static struct vcons_screen console_vcons
 static void grf_init_screen(void *, struct vcons_screen *, int, long *);
 static struct rasops_info *grf_setup_rasops(struct grf_softc *,
 struct vcons_screen *);
-static paddr_t grf_wsmmap_md(off_t off);
 
 cons_decl(grf);
 #endif
@@ -369,14 +368,14 @@ grfmmap(dev_t dev, off_t off, int prot)
 	 * control registers
 	 */
 	if (off >= 0 && off < gi->gd_regsize)
-		return(((paddr_t)gi->gd_regaddr + off) >> PGSHIFT);
+		return MD_BTOP((paddr_t)gi->gd_regaddr + off);
 
 	/*
 	 * frame buffer
 	 */
 	if (off >= gi->gd_regsize && off < gi->gd_regsize+gi->gd_fbsize) {
 		off -= gi->gd_regsize;
-		return(((paddr_t)gi->gd_fbaddr + off) >> PGSHIFT);
+		return MD_BTOP((paddr_t)gi->gd_fbaddr + off);
 	}
 	/* bogus */
 	return(-1);
@@ -613,8 +612,12 @@ grf_wsmmap(void *v, void *vs, off_t off,
 
 	/* Normal fb mapping */
 	if (off < gi->gd_fbsize)
-		return grf_wsmmap_md(((bus_addr_t)gp->g_fbkva) + off);
+		return MD_BTOP(((paddr_t)gi->gd_fbaddr) + off);
 
+	/*
+	 * restrict all other mappings to processes with superuser privileges
+	 * or the kernel itself
+	 */
 	if (kauth_authorize_machdep(kauth_cred_get(), KAUTH_MACHDEP_UNMANAGEDMEM,
 	NULL, NULL, NULL, NULL) != 0) {
 		aprint_normal("%s: permission to mmap denied.\n",
@@ -622,28 +625,18 @@ grf_wsmmap(void *v, void *vs, off_t off,
 		return -1;
 	}
 
-	if ((off >= (bus_addr_t)gp->g_fbkva ) &&
-	(off < ( (bus_addr_t)gp->g_fbkva + (size_t)gi->gd_fbsize)))
-		return grf_wsmmap_md(off);
-
 	/* Handle register mapping */
-	if ((off >= (bus_addr_t)gi->gd_regaddr) &&
-	(off < ((bus_addr_t)gi->gd_regaddr + (size_t)gi->gd_regsize)))
-		return grf_wsmmap_md(off);
+	if ((off >= (paddr_t)gi->gd_regaddr) &&
+	(off < ((paddr_t)gi->gd_regaddr + (size_t)gi->gd_regsize)))
+		return MD_BTOP(off);
+
+	if ((off >= (paddr_t)gi->gd_fbaddr) &&
+	(off < ((paddr_t)gi->gd_fbaddr + (size_t)gi->gd_fbsize)))
+		return MD_BTOP(off);
 
 	return -1;
 }
 
-static paddr_t
-grf_wsmmap_md(off_t off) 
-{
-#if defined(__m68k__)
-	return 

CVS commit: src/sys/arch

2015-11-12 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Nov 12 12:01:53 UTC 2015

Modified Files:
src/sys/arch/amiga/amiga: bus.c
src/sys/arch/amiga/dev: grf.c grf_cv.c grf_cv3d.c
src/sys/arch/amiga/include: param.h
src/sys/arch/amigappc/include: param.h

Log Message:
Xorg for amiga via wsfb. Currently available on CV64 and CV64/3D. More
graphics cards will follow, when adding wscons support to them.

I didn't manage to make the "wskbd" protocol the default in the X server,
so you have to provide a small xorg.conf with Option "Protocol" "wskbd".
The standard protocol will not work as the Amiga wskbd cannot be switched
into raw mode and has no AT-scancode translation in the kernel.

On the positive side, wskbd also works with national keymaps under X.

The graphics modes can still be defined via grfconfig(8). Xorg's wsfb
driver uses the current grf video mode, which is usually mode #1.
All resolutions and depths seem to work (tested on CV64).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amiga/amiga/bus.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/amiga/dev/grf.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/amiga/dev/grf_cv.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/amiga/dev/grf_cv3d.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/amiga/include/param.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/amigappc/include/param.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/amiga/dev

2015-11-12 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Nov 12 12:19:50 UTC 2015

Modified Files:
src/sys/arch/amiga/dev: amidisplaycc.c clock.c view.c

Log Message:
Use the MD_BTOP() macro as replacement for m68k_btop() in all device
drivers which are shared with amigappc.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/amiga/dev/amidisplaycc.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/amiga/dev/clock.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/amiga/dev/view.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/amiga/dev

2015-11-12 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Nov 12 12:19:50 UTC 2015

Modified Files:
src/sys/arch/amiga/dev: amidisplaycc.c clock.c view.c

Log Message:
Use the MD_BTOP() macro as replacement for m68k_btop() in all device
drivers which are shared with amigappc.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/amiga/dev/amidisplaycc.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/amiga/dev/clock.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/amiga/dev/view.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/amiga/dev/amidisplaycc.c
diff -u src/sys/arch/amiga/dev/amidisplaycc.c:1.28 src/sys/arch/amiga/dev/amidisplaycc.c:1.29
--- src/sys/arch/amiga/dev/amidisplaycc.c:1.28	Wed Aug  5 07:02:20 2015
+++ src/sys/arch/amiga/dev/amidisplaycc.c	Thu Nov 12 12:19:49 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: amidisplaycc.c,v 1.28 2015/08/05 07:02:20 mrg Exp $ */
+/*	$NetBSD: amidisplaycc.c,v 1.29 2015/11/12 12:19:49 phx Exp $ */
 
 /*-
  * Copyright (c) 2000 Jukka Andberg.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amidisplaycc.c,v 1.28 2015/08/05 07:02:20 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amidisplaycc.c,v 1.29 2015/11/12 12:19:49 phx Exp $");
 
 /*
  * wscons interface to amiga custom chips. Contains the necessary functions
@@ -1183,7 +1183,7 @@ amidisplaycc_mmap(void *dp, void *vs, of
 	rv = (paddr_t)bm->hardware_address;
 	rv += off;
 
-	return (rv >> PGSHIFT);
+	return MD_BTOP(rv);
 }
 
 

Index: src/sys/arch/amiga/dev/clock.c
diff -u src/sys/arch/amiga/dev/clock.c:1.54 src/sys/arch/amiga/dev/clock.c:1.55
--- src/sys/arch/amiga/dev/clock.c:1.54	Sat Oct 27 17:17:28 2012
+++ src/sys/arch/amiga/dev/clock.c	Thu Nov 12 12:19:49 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.54 2012/10/27 17:17:28 chs Exp $ */
+/*	$NetBSD: clock.c,v 1.55 2015/11/12 12:19:49 phx Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.54 2012/10/27 17:17:28 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.55 2015/11/12 12:19:49 phx Exp $");
 
 #include 
 #include 
@@ -475,7 +475,7 @@ clockioctl(dev_t dev, u_long cmd, void *
 void
 clockmap(dev_t dev, int off, int prot)
 {
-	return((off + (INTIOBASE+CLKBASE+CLKSR-1)) >> PGSHIFT);
+	return MD_BTOP(off + (INTIOBASE+CLKBASE+CLKSR-1));
 }
 
 int

Index: src/sys/arch/amiga/dev/view.c
diff -u src/sys/arch/amiga/dev/view.c:1.32 src/sys/arch/amiga/dev/view.c:1.33
--- src/sys/arch/amiga/dev/view.c:1.32	Thu Aug 20 14:40:16 2015
+++ src/sys/arch/amiga/dev/view.c	Thu Nov 12 12:19:49 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: view.c,v 1.32 2015/08/20 14:40:16 christos Exp $ */
+/*	$NetBSD: view.c,v 1.33 2015/11/12 12:19:49 phx Exp $ */
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -38,7 +38,7 @@
  * a interface to graphics. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: view.c,v 1.32 2015/08/20 14:40:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: view.c,v 1.33 2015/11/12 12:19:49 phx Exp $");
 
 #include 
 #include 
@@ -405,7 +405,7 @@ viewmmap(dev_t dev, off_t off, int prot)
 	bmd_size = bm->bytes_per_row*bm->rows*bm->depth;
 
 	if (off >= 0 && off < bmd_size)
-		return(((paddr_t)bmd_start + off) >> PGSHIFT);
+		return MD_BTOP((paddr_t)bmd_start + off);
 
 	return(-1);
 }



CVS commit: src/doc

2015-11-12 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Nov 12 15:13:03 UTC 2015

Modified Files:
src/doc: CHANGES

Log Message:
Amiga Xorg support.


To generate a diff of this commit:
cvs rdiff -u -r1.2112 -r1.2113 src/doc/CHANGES

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



CVS commit: src/doc

2015-11-12 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Nov 12 15:13:03 UTC 2015

Modified Files:
src/doc: CHANGES

Log Message:
Amiga Xorg support.


To generate a diff of this commit:
cvs rdiff -u -r1.2112 -r1.2113 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.2112 src/doc/CHANGES:1.2113
--- src/doc/CHANGES:1.2112	Sat Nov  7 23:16:00 2015
+++ src/doc/CHANGES	Thu Nov 12 15:13:03 2015
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2112 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2113 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -215,3 +215,8 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 		created. Provide support for a poll based svc_run() and the
 		global variables svc_pollfd and svc_pollfd_max.
 		[christos 20151107]
+	amiga: wsdisplay(4) virtual terminals are working on CV64 and
+		CV64/3D. [phx 20151112]
+	amiga: Build the Xorg server with wsfb(4) driver.
+		Added wsfb(4) support for CV64 and CV64/3D graphics cards.
+		[phx 20151112]



CVS commit: src/share/man/man4

2015-11-12 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Nov 12 17:45:12 UTC 2015

Modified Files:
src/share/man/man4: ddb.4

Log Message:
Add sandpoint ddb-entry method.


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/share/man/man4/ddb.4

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

Modified files:

Index: src/share/man/man4/ddb.4
diff -u src/share/man/man4/ddb.4:1.156 src/share/man/man4/ddb.4:1.157
--- src/share/man/man4/ddb.4:1.156	Thu Jun 12 13:47:58 2014
+++ src/share/man/man4/ddb.4	Thu Nov 12 17:45:12 2015
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ddb.4,v 1.156 2014/06/12 13:47:58 christos Exp $
+.\"	$NetBSD: ddb.4,v 1.157 2015/11/12 17:45:12 phx Exp $
 .\"
 .\" Copyright (c) 1997 - 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -149,6 +149,8 @@ Abort switch on CPU card.
 rcons console.
 .It ""
 \*[Lt]Break\*[Gt] on serial console.
+.It sandpoint
+\*[Lt]Break\*[Gt] on serial console.
 .It sparc
 \*[Lt]L1\*[Gt]-A, or \*[Lt]Stop\*[Gt]-A on a
 .Tn Sun



CVS commit: src/share/man/man4

2015-11-12 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Thu Nov 12 17:45:12 UTC 2015

Modified Files:
src/share/man/man4: ddb.4

Log Message:
Add sandpoint ddb-entry method.


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/share/man/man4/ddb.4

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



CVS commit: src/distrib/amiga/stand

2015-11-11 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Nov 11 16:13:55 UTC 2015

Modified Files:
src/distrib/amiga/stand: Makefile loadbsd.uue
Removed Files:
src/distrib/amiga/stand: loadbsd-2.14.uue loadbsd-2.16.uue
loadbsd.gz.uue

Log Message:
Update loadbsd to 2.17, which can load ELF kernels.
Remove obsolete loadbsd binaries from installation/misc as they
have become useless (and can only load a.out kernels).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/amiga/stand/Makefile
cvs rdiff -u -r1.1 -r0 src/distrib/amiga/stand/loadbsd-2.14.uue \
src/distrib/amiga/stand/loadbsd-2.16.uue \
src/distrib/amiga/stand/loadbsd.gz.uue
cvs rdiff -u -r1.1 -r1.2 src/distrib/amiga/stand/loadbsd.uue

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



CVS commit: src/distrib/amiga/stand

2015-11-11 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Nov 11 16:13:55 UTC 2015

Modified Files:
src/distrib/amiga/stand: Makefile loadbsd.uue
Removed Files:
src/distrib/amiga/stand: loadbsd-2.14.uue loadbsd-2.16.uue
loadbsd.gz.uue

Log Message:
Update loadbsd to 2.17, which can load ELF kernels.
Remove obsolete loadbsd binaries from installation/misc as they
have become useless (and can only load a.out kernels).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/amiga/stand/Makefile
cvs rdiff -u -r1.1 -r0 src/distrib/amiga/stand/loadbsd-2.14.uue \
src/distrib/amiga/stand/loadbsd-2.16.uue \
src/distrib/amiga/stand/loadbsd.gz.uue
cvs rdiff -u -r1.1 -r1.2 src/distrib/amiga/stand/loadbsd.uue

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

Modified files:

Index: src/distrib/amiga/stand/Makefile
diff -u src/distrib/amiga/stand/Makefile:1.3 src/distrib/amiga/stand/Makefile:1.4
--- src/distrib/amiga/stand/Makefile:1.3	Mon Jun 23 02:16:53 2008
+++ src/distrib/amiga/stand/Makefile	Wed Nov 11 16:13:55 2015
@@ -1,10 +1,9 @@
-#   $NetBSD: Makefile,v 1.3 2008/06/23 02:16:53 matt Exp $
+#   $NetBSD: Makefile,v 1.4 2015/11/11 16:13:55 phx Exp $
 #
 
 MISC_FILES=	runbootblock.README
 UUDECODE_FILES=	device-streams.tar.gz \
-		loadbsd loadbsd-2.14 loadbsd-2.16 \
-		rdbinfo runbootblock xstreamtodev
+		loadbsd rdbinfo runbootblock xstreamtodev
 
 .include 
 .include 

Index: src/distrib/amiga/stand/loadbsd.uue
diff -u src/distrib/amiga/stand/loadbsd.uue:1.1 src/distrib/amiga/stand/loadbsd.uue:1.2
--- src/distrib/amiga/stand/loadbsd.uue:1.1	Wed Jun 16 02:31:27 2004
+++ src/distrib/amiga/stand/loadbsd.uue	Wed Nov 11 16:13:55 2015
@@ -1,203 +1,484 @@
 begin 755 loadbsd
-M```#\P`#``(```=["0```)/I```'>T[Z`.``
-M`0$'```=["0```)``"0``"\")"\`#"(O`!`@+P`4
-M(^\`"@!(>0```?A(>0```BPO`"\!+P).N0``'3C>_``4)!].=6EX96UU
-M;"YL:6)R87)Y`$-O;G1I;G5E`"YL:6)R87)Y('=A

CVS commit: src/sys/arch/amiga/stand/loadbsd

2015-11-11 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Nov 11 16:08:52 UTC 2015

Modified Files:
src/sys/arch/amiga/stand/loadbsd: Makefile README

Log Message:
Build instructions and Makefile for loadbsd 3.0.
Submitted by Gunther Nikl.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amiga/stand/loadbsd/Makefile \
src/sys/arch/amiga/stand/loadbsd/README

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/amiga/stand/loadbsd/Makefile
diff -u src/sys/arch/amiga/stand/loadbsd/Makefile:1.2 src/sys/arch/amiga/stand/loadbsd/Makefile:1.3
--- src/sys/arch/amiga/stand/loadbsd/Makefile:1.2	Mon Jan  5 20:51:30 1998
+++ src/sys/arch/amiga/stand/loadbsd/Makefile	Wed Nov 11 16:08:52 2015
@@ -1,13 +1,13 @@
-#	$NetBSD: Makefile,v 1.2 1998/01/05 20:51:30 perry Exp $
+#	$NetBSD: Makefile,v 1.3 2015/11/11 16:08:52 phx Exp $
 #
-CC = gcc
-CFLAGS = -m68030 -O2 -D__progname=program_name -noixemul
+TARGET	= loadbsd
 
-OBJS = loadbsd.o getopt.o
-LIBS = -lamiga
+CC	= gcc
+CFLAGS	= -D_STANDALONE -I./include -O -fomit-frame-pointer -msmall-code
+LDFLAGS	= -noixemul
+LDLIBS	=
 
-loadbsd: $(OBJS)
-	$(CC) $(CFLAGS) $(LDFLAGS) -o loadbsd $(OBJS) $(LIBS)
+OBJS	= loadbsd.o loadfile.o loadfile_aout.o loadfile_elf32.o getopt.o
 
-clean:
-	delete $(OBJS) loadbsd
+$(TARGET): $(OBJS)
+	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
Index: src/sys/arch/amiga/stand/loadbsd/README
diff -u src/sys/arch/amiga/stand/loadbsd/README:1.2 src/sys/arch/amiga/stand/loadbsd/README:1.3
--- src/sys/arch/amiga/stand/loadbsd/README:1.2	Mon Jan  5 20:51:31 1998
+++ src/sys/arch/amiga/stand/loadbsd/README	Wed Nov 11 16:08:52 2015
@@ -1,22 +1,167 @@
-#	$NetBSD: README,v 1.2 1998/01/05 20:51:31 perry Exp $
+#	$NetBSD: README,v 1.3 2015/11/11 16:08:52 phx Exp $
 
-This was prepared to compile with gcc 2.7.0 for AmigaOS and 
-libnix 1.0. You don't need ixemul or special directories to run the
-binary, if compiled that way.
+BUILD INSTRUCTIONS
 
-With very old versions of gcc, you might need to add +2-. to relative
-offsets in the assembler part, but honestly, I suggest you upgrade your
-assembler (and compiler) instead, even if you know what I'm talking about 
-and how to identify the lines.
-
-You'll need the (unchanged) getopt.c from src/lib/libc/stdlib, too.
-
-With newer libnix or the ADE version of gcc, or when removing the
--noixemul option from CFLAGS, you might need (or want) to delete the 
-sleep() function at the bottom of loadbsd, or getopt.o from the 
-"OBJS =" line of Makefile.
-
-[Sorry, but I didn't dare to risk my gcc installation a few weeks 
- before the release by trying to install ADE]
-
-	Ignatios Souvatzis
+Building LoadBSD isn't easy since several sources from the NetBSD repository
+are required. Compiling these sources under AmigaOS without clashes with the
+native GCC headers requires some knowledge. This document tries to describe
+the steps necessary to rebuild LoadBSD with an AmigaOS gcc. These instructions
+do only apply for LoadBSD versions using the loadfile() interface. Previous
+version do only require getopt.c and reboot.h.
+
+Note: Its not possible to build LoadBSD with the native NetBSD compiler!
+  LoadBSD is an *AmigaOS* program and must be built with an AmigaOS
+  compiler. Of course, a properly setup cross-compiler does work.
+
+Required sources from NetBSD (either HEAD or from a release branch)
+
+   From src/sys/lib/libsa: loadfile.h,loadfile.c,loadfile_elf32.c,loadfile_aout.c
+   From src/lib/libc/stdlib: getopt.c
+
+  place these files in the directory where you have loadbsd.c
+
+   From src/sys/arch/m68k/include: aout_machdep.h,elf_machdep.h
+
+  place these files in: /include/m68k
+
+   From src/sys/arch/amiga/include: aout_machdep.h,elf_machdep.h,loadfile_machdep.h
+
+  place these files in: /include/machine
+
+   From src/sys/sys: exec.h,exec_elf.h,exec_aout.h,reboot.h
+
+  place these files in: /include/sys
+
+   Additional headers (see below): inttypes.h,namespace.h,lib/libsa/stand.h,lib/libkern/libkern.h
+
+  place these files in: /include
+
+If all the mentioned files are placed at the correct place, loadfile_machdep.h
+must be modfied. The patch is included below. Another small patch to
+loadfile_aout.c must be applied to fix an incompatibility for LoadBSD.
+However, that patch breaks loadfile() for other architectures using a.out!
+Note: This patch is required to be able to suppress loaded symbols when
+  booting ancient a.out kernels that don't support them. Without the
+  patch symbol suppressing doesn't work! That also means ELF isn't
+  affected and LoadBSD could handle it differently but then it could
+  probably break in other unpredictable ways...
+
+Then it should be possible to recompile LoadBSD by typing "make". If make
+fails, fix the problem and try again :-P
+
+Good luck!
+
+--- Missing files/patches ---
+
+  

CVS commit: src/sys/arch/amiga/stand/loadbsd

2015-11-11 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Nov 11 16:08:52 UTC 2015

Modified Files:
src/sys/arch/amiga/stand/loadbsd: Makefile README

Log Message:
Build instructions and Makefile for loadbsd 3.0.
Submitted by Gunther Nikl.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amiga/stand/loadbsd/Makefile \
src/sys/arch/amiga/stand/loadbsd/README

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



CVS commit: src/sys/arch/amiga/dev

2015-11-07 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sat Nov  7 14:29:10 UTC 2015

Modified Files:
src/sys/arch/amiga/dev: grf.c grf_cv.c grf_cv3d.c grfvar.h
Removed Files:
src/sys/arch/amiga/dev: grfws.h

Log Message:
Improved wscons support. Virtual screens are now working.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/amiga/dev/grf.c
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/amiga/dev/grf_cv.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/amiga/dev/grf_cv3d.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/amiga/dev/grfvar.h
cvs rdiff -u -r1.1 -r0 src/sys/arch/amiga/dev/grfws.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/amiga/dev/grf.c
diff -u src/sys/arch/amiga/dev/grf.c:1.62 src/sys/arch/amiga/dev/grf.c:1.63
--- src/sys/arch/amiga/dev/grf.c:1.62	Fri Jul 25 08:10:31 2014
+++ src/sys/arch/amiga/dev/grf.c	Sat Nov  7 14:29:10 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf.c,v 1.62 2014/07/25 08:10:31 dholland Exp $ */
+/*	$NetBSD: grf.c,v 1.63 2015/11/07 14:29:10 phx Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.62 2014/07/25 08:10:31 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.63 2015/11/07 14:29:10 phx Exp $");
 
 /*
  * Graphics display driver for the Amiga
@@ -76,7 +76,6 @@ __KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.62
 #include 	/* DEBUG */
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -182,11 +181,11 @@ grfattach(device_t parent, device_t self
 	grfsp[gp->g_unit] = gp;
 
 	/*
-	 * find our major device number
+	 * find our major device number, make device
 	 */
 	maj = cdevsw_lookup_major(_cdevsw);
-
 	gp->g_grfdev = makedev(maj, gp->g_unit);
+
 	if (self != NULL) {
 		printf(": width %d height %d", gp->g_display.gd_dwidth,
 		gp->g_display.gd_dheight);
@@ -194,23 +193,25 @@ grfattach(device_t parent, device_t self
 			printf(" monochrome\n");
 		else
 			printf(" colors %d\n", gp->g_display.gd_colors);
+
 #if NWSDISPLAY > 0
-		vcons_init(>g_vd, gp, gp->g_screens[0], gp->g_accessops);
+		vcons_init(>g_vd, gp, gp->g_defaultscr, gp->g_accessops);
 		gp->g_vd.init_screen = grf_init_screen;
+
 		if (gp->g_flags & GF_CONSOLE) {
 			console_vcons.scr_flags |= VCONS_SCREEN_IS_STATIC;
 			vcons_init_screen(>g_vd,
 			_vcons, 1, );
-			gp->g_screens[0]->textops =
+			gp->g_defaultscr->textops =
 			_vcons.scr_ri.ri_ops;
-			wsdisplay_cnattach(gp->g_screens[0],
+			wsdisplay_cnattach(gp->g_defaultscr,
 			_vcons.scr_ri, 0, 0, defattr);
 			vcons_replay_msgbuf(_vcons);
 		}
 
 		/* attach wsdisplay */
 		wa.console = (gp->g_flags & GF_CONSOLE) != 0;
-		wa.scrdata = >g_screenlist;
+		wa.scrdata = gp->g_scrlist;
 		wa.accessops = gp->g_accessops;
 		wa.accesscookie = >g_vd;
 		config_found(self, , wsemuldisplaydevprint);
@@ -477,16 +478,17 @@ grfcninit(struct consdev *cd)
 		gp = grfsp[unit];
 		if (gp != NULL && (gp->g_flags & GF_ALIVE)) {
 			gp->g_flags |= GF_CONSOLE;  /* we are console! */
-			gp->g_screens[0]->ncols = gp->g_display.gd_fbwidth /
-			gp->g_screens[0]->fontwidth;
-			gp->g_screens[0]->nrows = gp->g_display.gd_fbheight /
-			gp->g_screens[0]->fontheight;
+
+			gp->g_defaultscr->ncols = gp->g_display.gd_fbwidth /
+			gp->g_defaultscr->fontwidth;
+			gp->g_defaultscr->nrows = gp->g_display.gd_fbheight /
+			gp->g_defaultscr->fontheight;
 
 			ri = grf_setup_rasops(gp, _vcons);
 			console_vcons.scr_cookie = gp;
 			defattr = 0;  /* XXX */
 
-			wsdisplay_preattach(gp->g_screens[0], ri, 0, 0,
+			wsdisplay_preattach(gp->g_defaultscr, ri, 0, 0,
 			defattr);
 #if NKBD > 0
 			/* tell kbd device it is used as console keyboard */
@@ -519,8 +521,8 @@ grf_setup_rasops(struct grf_softc *gp, s
 	scr->scr_flags |= VCONS_DONT_READ;
 	memset(ri, 0, sizeof(struct rasops_info));
 
-	ri->ri_rows = gp->g_screens[0]->nrows;
-	ri->ri_cols = gp->g_screens[0]->ncols;
+	ri->ri_rows = gp->g_defaultscr->nrows;
+	ri->ri_cols = gp->g_defaultscr->ncols;
 	ri->ri_hw = scr;
 	ri->ri_ops.cursor= gp->g_emulops->cursor;
 	ri->ri_ops.mapchar   = gp->g_emulops->mapchar;
@@ -538,6 +540,66 @@ grf_setup_rasops(struct grf_softc *gp, s
 	return ri;
 }
 
+/*
+ * Called as fallback for ioctls which are not handled by the specific
+ * grf driver.
+ */
+int
+grf_wsioctl(void *v, void *vs, u_long cmd, void *data, int flag, struct lwp *l)
+{
+	struct wsdisplayio_fbinfo *iofbi;
+	struct wsdisplay_fbinfo *fbinfo;
+	struct vcons_data *vd;
+	struct grf_softc *gp;
+	struct vcons_screen *scr;
+	struct grfinfo *gi;
+
+	vd = v;
+	gp = vd->cookie;
+	scr = vd->active;
+
+	switch (cmd) {
+	case WSDISPLAYIO_GET_FBINFO:
+		if (scr != NULL) {
+			iofbi = data;
+			return wsdisplayio_get_fbinfo(>scr_ri, iofbi);
+		}
+		return ENODEV;
+
+	case WSDISPLAYIO_GINFO:
+		if (scr != NULL) {
+			fbinfo = (struct wsdisplay_fbinfo *)data;
+			gi = >g_display;
+
+			/*
+			 * We 

CVS commit: src/sys/arch/amiga/dev

2015-11-07 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sat Nov  7 14:29:10 UTC 2015

Modified Files:
src/sys/arch/amiga/dev: grf.c grf_cv.c grf_cv3d.c grfvar.h
Removed Files:
src/sys/arch/amiga/dev: grfws.h

Log Message:
Improved wscons support. Virtual screens are now working.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/amiga/dev/grf.c
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/amiga/dev/grf_cv.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/amiga/dev/grf_cv3d.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/amiga/dev/grfvar.h
cvs rdiff -u -r1.1 -r0 src/sys/arch/amiga/dev/grfws.h

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



CVS commit: src

2015-11-04 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Nov  4 17:06:23 UTC 2015

Modified Files:
src/distrib/sets/lists/xdebug: md.amiga
src/distrib/sets/lists/xserver: md.amiga
src/external/mit/xorg/server/drivers: Makefile
src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos: Makefile
src/share/mk: bsd.own.mk

Log Message:
Build a wsfb Xorg server for amiga.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/sets/lists/xdebug/md.amiga
cvs rdiff -u -r1.21 -r1.22 src/distrib/sets/lists/xserver/md.amiga
cvs rdiff -u -r1.72 -r1.73 src/external/mit/xorg/server/drivers/Makefile
cvs rdiff -u -r1.39 -r1.40 \
src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos/Makefile
cvs rdiff -u -r1.877 -r1.878 src/share/mk/bsd.own.mk

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.amiga
diff -u src/distrib/sets/lists/xdebug/md.amiga:1.2 src/distrib/sets/lists/xdebug/md.amiga:1.3
--- src/distrib/sets/lists/xdebug/md.amiga:1.2	Mon Aug 10 19:23:32 2015
+++ src/distrib/sets/lists/xdebug/md.amiga	Wed Nov  4 17:06:23 2015
@@ -1,3 +1,23 @@
-# $NetBSD: md.amiga,v 1.2 2015/08/10 19:23:32 mlelstv Exp $
+# $NetBSD: md.amiga,v 1.3 2015/11/04 17:06:23 phx Exp $
 ./usr/libdata/debug/usr/X11R6/bin/Xamiga.debug		-unknown-	x11,debug
 ./usr/libdata/debug/usr/X11R6/bin/Xvfb.debug		-unknown-	x11,debug
+./usr/libdata/debug/usr/X11R7/bin/Xorg.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/bin/cvt.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/bin/gtf.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/kbd_drv.so.1.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/mouse_drv.so.1.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/ws_drv.so.1.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/drivers/wsfb_drv.so.0.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/extensions/libdbe.so.0.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/extensions/libdri.so.0.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/extensions/libdri2.so.0.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/extensions/libextmod.so.0.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/extensions/libglx.so.0.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/extensions/librecord.so.0.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/extensions/libshadow.so.0.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/libexa.so.0.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/libfb.so.0.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/libshadowfb.so.0.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/libvbe.so.0.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/libvgahw.so.0.debug	-unknown-	debug,xorg
+./usr/libdata/debug/usr/X11R7/lib/modules/libxaa.so.0.debug	-unknown-	debug,xorg

Index: src/distrib/sets/lists/xserver/md.amiga
diff -u src/distrib/sets/lists/xserver/md.amiga:1.21 src/distrib/sets/lists/xserver/md.amiga:1.22
--- src/distrib/sets/lists/xserver/md.amiga:1.21	Mon Feb  9 16:28:54 2009
+++ src/distrib/sets/lists/xserver/md.amiga	Wed Nov  4 17:06:23 2015
@@ -1,4 +1,4 @@
-# $NetBSD: md.amiga,v 1.21 2009/02/09 16:28:54 abs Exp $
+# $NetBSD: md.amiga,v 1.22 2015/11/04 17:06:23 phx Exp $
 ./usr/X11R6/bin/X	-unknown-	x11
 ./usr/X11R6/bin/Xamiga	-unknown-	x11
 ./usr/X11R6/lib/modules/libafb.a			-obsolete-	obsolete
@@ -8,3 +8,104 @@
 ./usr/X11R6/man/html1/Xamiga24.html			-unknown-	html,x11
 ./usr/X11R6/man/man1/Xamiga.1-unknown-	.man,x11
 ./usr/X11R6/man/man1/Xamiga24.1-unknown-	.man,x11
+./usr/X11R7/bin/X	-unknown-	xorg
+./usr/X11R7/bin/Xorg	-unknown-	xorg
+./usr/X11R7/bin/cvt	-unknown-	xorg
+./usr/X11R7/bin/gtf	-unknown-	xorg
+./usr/X11R7/lib/X11/doc/README.modes			-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/kbd_drv.so		-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/kbd_drv.so.1		-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/mouse_drv.so		-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/mouse_drv.so.1		-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/ws_drv.so		-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/ws_drv.so.1		-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/wsfb_drv.so		-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/wsfb_drv.so.0		-unknown-	xorg
+./usr/X11R7/lib/modules/extensions/libdbe.a		-unknown-	xorg,obsolete
+./usr/X11R7/lib/modules/extensions/libdbe.so		-unknown-	xorg
+./usr/X11R7/lib/modules/extensions/libdbe.so.0		-unknown-	xorg
+./usr/X11R7/lib/modules/extensions/libdbe_pic.a		-unknown-	xorg,picinstall,obsolete
+./usr/X11R7/lib/modules/extensions/libdri.a		-unknown-	

CVS commit: src

2015-11-04 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Nov  4 17:06:23 UTC 2015

Modified Files:
src/distrib/sets/lists/xdebug: md.amiga
src/distrib/sets/lists/xserver: md.amiga
src/external/mit/xorg/server/drivers: Makefile
src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos: Makefile
src/share/mk: bsd.own.mk

Log Message:
Build a wsfb Xorg server for amiga.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/sets/lists/xdebug/md.amiga
cvs rdiff -u -r1.21 -r1.22 src/distrib/sets/lists/xserver/md.amiga
cvs rdiff -u -r1.72 -r1.73 src/external/mit/xorg/server/drivers/Makefile
cvs rdiff -u -r1.39 -r1.40 \
src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos/Makefile
cvs rdiff -u -r1.877 -r1.878 src/share/mk/bsd.own.mk

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



CVS commit: src/etc

2015-10-31 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sat Oct 31 12:31:37 UTC 2015

Modified Files:
src/etc: rc.subr

Log Message:
PR misc/50046
Remove the expensive tests in _have_rc_postprocessor(), as proposed by apb@.
It more than halves the multiuser boot time on slow machines and brings
it back near to the previous level.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/etc/rc.subr

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

Modified files:

Index: src/etc/rc.subr
diff -u src/etc/rc.subr:1.96 src/etc/rc.subr:1.97
--- src/etc/rc.subr:1.96	Tue Oct  7 19:09:45 2014
+++ src/etc/rc.subr	Sat Oct 31 12:31:37 2015
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.96 2014/10/07 19:09:45 roy Exp $
+# $NetBSD: rc.subr,v 1.97 2015/10/31 12:31:37 phx Exp $
 #
 # Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -814,19 +814,9 @@ $command $rc_flags $command_args"
 _have_rc_postprocessor()
 {
 	# Cheap tests that fd and pid are set, fd is writable.
-	[ -n "${_rc_postprocessor_fd}" ] || return 1
-	[ -n "${_rc_pid}" ] || return 1
-	eval ": >&${_rc_postprocessor_fd}" 2>/dev/null || return 1
-
-	# More expensive test that pid is running.
-	# Unset _rc_pid if this fails.
-	kill -0 "${_rc_pid}" 2>/dev/null \
-	|| { unset _rc_pid; return 1; }
-
-	# More expensive test that pid appears to be
-	# a shell running an rc script.
-	# Unset _rc_pid if this fails.
-	expr "$(ps -p "${_rc_pid}" -o command=)" : ".*sh .*/rc.*" >/dev/null \
+	[ -n "${_rc_pid}" ] || { unset _rc_pid; return 1; }
+	[ -n "${_rc_postprocessor_fd}" ] || { unset _rc_pid; return 1; }
+	eval ": >&${_rc_postprocessor_fd}" 2>/dev/null \
 	|| { unset _rc_pid; return 1; }
 
 	return 0



CVS commit: src/etc

2015-10-31 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sat Oct 31 12:31:37 UTC 2015

Modified Files:
src/etc: rc.subr

Log Message:
PR misc/50046
Remove the expensive tests in _have_rc_postprocessor(), as proposed by apb@.
It more than halves the multiuser boot time on slow machines and brings
it back near to the previous level.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/etc/rc.subr

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



CVS commit: src/sys

2015-10-30 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Oct 30 12:19:08 UTC 2015

Modified Files:
src/sys/arch/amiga/dev: if_bah_zbus.c
src/sys/dev/ic: smc90cx6.c

Log Message:
Fixed format string types to make it compile with BAH_DEBUG again.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/amiga/dev/if_bah_zbus.c
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/ic/smc90cx6.c

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



CVS commit: src/sys

2015-10-30 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Oct 30 12:19:08 UTC 2015

Modified Files:
src/sys/arch/amiga/dev: if_bah_zbus.c
src/sys/dev/ic: smc90cx6.c

Log Message:
Fixed format string types to make it compile with BAH_DEBUG again.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/amiga/dev/if_bah_zbus.c
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/ic/smc90cx6.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/amiga/dev/if_bah_zbus.c
diff -u src/sys/arch/amiga/dev/if_bah_zbus.c:1.15 src/sys/arch/amiga/dev/if_bah_zbus.c:1.16
--- src/sys/arch/amiga/dev/if_bah_zbus.c:1.15	Sat Oct 27 17:17:29 2012
+++ src/sys/arch/amiga/dev/if_bah_zbus.c	Fri Oct 30 12:19:08 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bah_zbus.c,v 1.15 2012/10/27 17:17:29 chs Exp $ */
+/*	$NetBSD: if_bah_zbus.c,v 1.16 2015/10/30 12:19:08 phx Exp $ */
 
 /*-
  * Copyright (c) 1994, 1995, 1998 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bah_zbus.c,v 1.15 2012/10/27 17:17:29 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bah_zbus.c,v 1.16 2015/10/30 12:19:08 phx Exp $");
 
 /*
  * Driver frontend for the Commodore Busines Machines and the
@@ -101,7 +101,7 @@ bah_zbus_attach(device_t parent, device_
 
 	sc->sc_dev = self;
 #if (defined(BAH_DEBUG) && (BAH_DEBUG > 2))
-	printf("\n%s: attach(0x%x, 0x%x, 0x%x)\n",
+	printf("\n%s: attach(0x%p, 0x%p, 0x%p)\n",
 	device_xname(self), parent, self, aux);
 #endif
 	bsc->sc_bst.base = (bus_addr_t)zap->va;

Index: src/sys/dev/ic/smc90cx6.c
diff -u src/sys/dev/ic/smc90cx6.c:1.64 src/sys/dev/ic/smc90cx6.c:1.65
--- src/sys/dev/ic/smc90cx6.c:1.64	Sat Oct 27 17:18:22 2012
+++ src/sys/dev/ic/smc90cx6.c	Fri Oct 30 12:19:08 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: smc90cx6.c,v 1.64 2012/10/27 17:18:22 chs Exp $ */
+/*	$NetBSD: smc90cx6.c,v 1.65 2015/10/30 12:19:08 phx Exp $ */
 
 /*-
  * Copyright (c) 1994, 1995, 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smc90cx6.c,v 1.64 2012/10/27 17:18:22 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smc90cx6.c,v 1.65 2015/10/30 12:19:08 phx Exp $");
 
 /* #define BAHSOFTCOPY */
 #define BAHRETRANSMIT /**/
@@ -152,10 +152,6 @@ bah_attach_subr(struct bah_softc *sc)
 	bus_space_handle_t regs = sc->sc_regs;
 	bus_space_handle_t mem = sc->sc_mem;
 
-#if (defined(BAH_DEBUG) && (BAH_DEBUG > 2))
-	printf("\n%s: attach(0x%x, 0x%x, 0x%x)\n",
-	device_xname(sc->sc_dev), parent, self, aux);
-#endif
 	s = splhigh();
 
 	/*
@@ -265,7 +261,7 @@ bah_reset(struct bah_softc *sc)
 	linkaddress = GETMEM(BAHMACOFF);
 
 #if defined(BAH_DEBUG) && (BAH_DEBUG > 2)
-	printf("%s: reset: card reset, link addr = 0x%02x (%ld)\n",
+	printf("%s: reset: card reset, link addr = 0x%02x (%u)\n",
 	device_xname(sc->sc_dev), linkaddress, linkaddress);
 #endif
 
@@ -393,7 +389,7 @@ bah_start(struct ifnet *ifp)
 #ifdef BAH_DEBUG
 	if (m->m_len < ARC_HDRLEN)
 		m = m_pullup(m, ARC_HDRLEN);/* gcc does structure padding */
-	printf("%s: start: filling %ld from %ld to %ld type %ld\n",
+	printf("%s: start: filling %d from %u to %u type %u\n",
 	device_xname(sc->sc_dev), buffer, mtod(m, u_char *)[0],
 	mtod(m, u_char *)[1], mtod(m, u_char *)[2]);
 #else
@@ -627,7 +623,7 @@ cleanup:
 		PUTREG(BAHSTAT, sc->sc_intmask);
 
 #ifdef BAH_DEBUG
-		printf("%s: srint: restarted rx on buf %ld\n",
+		printf("%s: srint: restarted rx on buf %d\n",
 		device_xname(sc->sc_dev), buffer);
 #endif
 	}
@@ -797,7 +793,7 @@ bahintr(void *arg)
 
 		if (maskedisr & BAH_RI) {
 #if defined(BAH_DEBUG) && (BAH_DEBUG > 1)
-			printf("%s: intr: hard rint, act %ld\n",
+			printf("%s: intr: hard rint, act %d\n",
 			device_xname(sc->sc_dev), sc->sc_rx_act);
 #endif
 
@@ -833,7 +829,7 @@ bahintr(void *arg)
 	/* in RX intr, so mask is ok for RX */
 
 #ifdef BAH_DEBUG
-	printf("%s: strt rx for buf %ld, "
+	printf("%s: strt rx for buf %u, "
 	"stat 0x%02x\n",
 	device_xname(sc->sc_dev), sc->sc_rx_act,
 	GETREG(BAHSTAT));
@@ -895,7 +891,7 @@ bah_ioctl(struct ifnet *ifp, u_long cmd,
 	s = splnet();
 
 #if defined(BAH_DEBUG) && (BAH_DEBUG > 2)
-	printf("%s: ioctl() called, cmd = 0x%x\n",
+	printf("%s: ioctl() called, cmd = 0x%lx\n",
 	device_xname(sc->sc_dev), cmd);
 #endif
 



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

2015-10-30 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Oct 30 12:14:33 UTC 2015

Modified Files:
src/sys/arch/amiga/pci: p5pb.c

Log Message:
Include genfb.h for NGENFB.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/amiga/pci/p5pb.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/amiga/pci/p5pb.c
diff -u src/sys/arch/amiga/pci/p5pb.c:1.14 src/sys/arch/amiga/pci/p5pb.c:1.15
--- src/sys/arch/amiga/pci/p5pb.c:1.14	Fri Oct  2 05:22:49 2015
+++ src/sys/arch/amiga/pci/p5pb.c	Fri Oct 30 12:14:32 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: p5pb.c,v 1.14 2015/10/02 05:22:49 msaitoh Exp $ */
+/*	$NetBSD: p5pb.c,v 1.15 2015/10/30 12:14:32 phx Exp $ */
 
 /*-
  * Copyright (c) 2011, 2012 The NetBSD Foundation, Inc.
@@ -61,6 +61,7 @@
 
 #include "opt_p5pb.h"
 #include "opt_pci.h"
+#include "genfb.h"
 
 /* Initial CVPPC/BVPPC resolution as configured by the firmware */
 #define P5GFX_WIDTH		640
@@ -692,7 +693,7 @@ p5pb_device_register(device_t dev, void 
 prop_dictionary_set_uint32(dict, "depth",
 P5GFX_DEPTH);
 
-#if (NGENFB > 0)
+#if NGENFB > 0
 prop_dictionary_set_uint32(dict, "linebytes",
 P5GFX_LINEBYTES);
 



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

2015-10-30 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Oct 30 12:14:33 UTC 2015

Modified Files:
src/sys/arch/amiga/pci: p5pb.c

Log Message:
Include genfb.h for NGENFB.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/amiga/pci/p5pb.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/amiga/include

2015-09-30 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Sep 30 20:36:28 UTC 2015

Modified Files:
src/sys/arch/amiga/include: vmparam.h

Log Message:
Reduce MAXDSIZ from 416MB back to 224MB.
Due to limitations by the current pmap implementation our virtual address
space is limited to 512MB. A MAXDSIZ of 416MB would leave only a little bit
more than 30MB for shared objects and heap allocations, so 224MB seems like
a good compromise.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/amiga/include/vmparam.h

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

Modified files:

Index: src/sys/arch/amiga/include/vmparam.h
diff -u src/sys/arch/amiga/include/vmparam.h:1.45 src/sys/arch/amiga/include/vmparam.h:1.46
--- src/sys/arch/amiga/include/vmparam.h:1.45	Fri Jun 19 14:55:51 2015
+++ src/sys/arch/amiga/include/vmparam.h	Wed Sep 30 20:36:28 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.45 2015/06/19 14:55:51 mlelstv Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.46 2015/09/30 20:36:28 phx Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
 #define	DFLDSIZ		(64*1024*1024)		/* initial data size limit */
 #endif
 #ifndef MAXDSIZ
-#define	MAXDSIZ		(416*1024*1024)		/* max data size */
+#define	MAXDSIZ		(224*1024*1024)		/* max data size */
 #endif
 #ifndef	DFLSSIZ
 #define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */



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

2015-09-30 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Sep 30 20:36:28 UTC 2015

Modified Files:
src/sys/arch/amiga/include: vmparam.h

Log Message:
Reduce MAXDSIZ from 416MB back to 224MB.
Due to limitations by the current pmap implementation our virtual address
space is limited to 512MB. A MAXDSIZ of 416MB would leave only a little bit
more than 30MB for shared objects and heap allocations, so 224MB seems like
a good compromise.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/amiga/include/vmparam.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/sandpoint

2015-09-30 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Sep 30 14:14:32 UTC 2015

Modified Files:
src/sys/arch/sandpoint/include: bootinfo.h
src/sys/arch/sandpoint/stand/altboot: brdsetup.c globals.h main.c
siisata.c version

Log Message:
Pass a name and flags precisely describing the current model and its
features via a new bootinfo node (currently Synology only). This allows
for example the configuration of model-specific temperature I2C sensors
and fan control.
Support for the Synology DS207 and DS209 drive LEDs and wait until the
2nd drive is completely powered up.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sandpoint/include/bootinfo.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/sandpoint/stand/altboot/brdsetup.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/sandpoint/stand/altboot/globals.h
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/sandpoint/stand/altboot/main.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sandpoint/stand/altboot/siisata.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sandpoint/stand/altboot/version

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



CVS commit: src/sys/arch/sandpoint/sandpoint

2015-09-30 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Sep 30 14:18:54 UTC 2015

Modified Files:
src/sys/arch/sandpoint/sandpoint: autoconf.c machdep.c

Log Message:
Now more than a single I2C device per model may be configured directly.
An additional flags argument makes the configuration depend on the model-
flags in an optional BTINFO_MODEL bootinfo node.
Print the model name together with the vendor name, when known.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/sandpoint/sandpoint/autoconf.c
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/sandpoint/sandpoint/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/sandpoint/sandpoint/autoconf.c
diff -u src/sys/arch/sandpoint/sandpoint/autoconf.c:1.27 src/sys/arch/sandpoint/sandpoint/autoconf.c:1.28
--- src/sys/arch/sandpoint/sandpoint/autoconf.c:1.27	Sun Jul 29 18:05:45 2012
+++ src/sys/arch/sandpoint/sandpoint/autoconf.c	Wed Sep 30 14:18:54 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.27 2012/07/29 18:05:45 mlelstv Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.28 2015/09/30 14:18:54 phx Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.27 2012/07/29 18:05:45 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.28 2015/09/30 14:18:54 phx Exp $");
 
 #include 
 #include 
@@ -55,21 +55,30 @@ static struct btinfo_rootdevice *bi_rdev
 static struct btinfo_bootpath *bi_path;
 static struct btinfo_net *bi_net;
 static struct btinfo_prodfamily *bi_pfam;
+static struct btinfo_model *bi_model;
 
-struct i2cdev {
-	const char *family;
-	const char *name;
-	int addr;
+struct i2c_dev {
+	const char	*name;
+	unsigned	addr;
+	/* only attach when one of these bits in the model flags is set */
+	uint32_t	model_mask;
 };
 
-static struct i2cdev rtcmodel[] = {
-{ "dlink","strtc",  0x68 },
-{ "iomega",   "dsrtc",  0x68 },
-{ "kurobox",  "rs5c372rtc", 0x32 },
-{ "kurot4",   "rs5c372rtc", 0x32 },
-{ "nhnas","pcf8563rtc", 0x51 },
-{ "qnap", "s390rtc",0x30 },
-{ "synology", "rs5c372rtc", 0x32 },
+#define MAXI2CDEVS	4
+struct model_i2c {
+	const char	*family;
+	struct i2c_dev	i2c_devs[MAXI2CDEVS];
+};
+
+static struct model_i2c model_i2c_list[] = {
+	{ "dlink",	{	{ "strtc",	0x68, 0 } } },
+	{ "iomega",	{	{ "dsrtc",	0x68, 0 } } },
+	{ "kurobox",	{	{ "rs5c372rtc", 0x32, 0 } } },
+	{ "kurot4",	{	{ "rs5c372rtc", 0x32, 0 } } },
+	{ "nhnas",	{	{ "pcf8563rtc", 0x51, 0 } } },
+	{ "qnap",	{	{ "s390rtc",0x30, 0 } } },
+	{ "synology",	{	{ "rs5c372rtc", 0x32, 0 },
+{ "lmtemp",	0x48, BI_MODEL_THERMAL } } },
 };
 
 static void add_i2c_child_devices(device_t, const char *);
@@ -85,6 +94,7 @@ cpu_configure(void)
 	bi_path = lookup_bootinfo(BTINFO_BOOTPATH);
 	bi_net = lookup_bootinfo(BTINFO_NET);
 	bi_pfam = lookup_bootinfo(BTINFO_PRODFAMILY);
+	bi_model = lookup_bootinfo(BTINFO_MODEL);
 
 	if (config_rootfound("mainbus", NULL) == NULL)
 		panic("configure: mainbus not configured");
@@ -167,27 +177,38 @@ device_register(device_t dev, void *aux)
 static void
 add_i2c_child_devices(device_t self, const char *family)
 {
-	struct i2cdev *rtc;
+	struct i2c_dev *model_i2c_devs;
 	prop_dictionary_t pd;
 	prop_array_t pa;
 	int i;
 
-	rtc = NULL;
-	for (i = 0; i < (int)(sizeof(rtcmodel)/sizeof(rtcmodel[0])); i++) {
-		if (strcmp(family, rtcmodel[i].family) == 0) {
-			rtc = [i];
+	for (i = 0;
+	i < (int)(sizeof(model_i2c_list) / sizeof(model_i2c_list[0]));
+	i++) {
+		if (strcmp(family, model_i2c_list[i].family) == 0) {
+			model_i2c_devs = model_i2c_list[i].i2c_devs;
 			goto found;
 		}
 	}
 	return;
 
  found:
-	pd = prop_dictionary_create();
+	/* make an i2c-child-devices property list with for direct config. */
 	pa = prop_array_create();
-	prop_dictionary_set_cstring_nocopy(pd, "name", rtc->name);
-	prop_dictionary_set_uint32(pd, "addr", rtc->addr);
-	prop_array_add(pa, pd);
+
+	for (i = 0; i < MAXI2CDEVS && model_i2c_devs[i].name != NULL; i++) {
+		if (model_i2c_devs[i].model_mask != 0 &&
+		!(bi_model->flags & model_i2c_devs[i].model_mask))
+			continue;
+		pd = prop_dictionary_create();
+		prop_dictionary_set_cstring_nocopy(pd, "name",
+		model_i2c_devs[i].name);
+		prop_dictionary_set_uint32(pd, "addr",
+		model_i2c_devs[i].addr);
+		prop_array_add(pa, pd);
+		prop_object_release(pd);
+	}
+
 	prop_dictionary_set(device_properties(self), "i2c-child-devices", pa);
-	prop_object_release(pd);
 	prop_object_release(pa);
 }

Index: src/sys/arch/sandpoint/sandpoint/machdep.c
diff -u src/sys/arch/sandpoint/sandpoint/machdep.c:1.64 src/sys/arch/sandpoint/sandpoint/machdep.c:1.65
--- src/sys/arch/sandpoint/sandpoint/machdep.c:1.64	Mon Sep  7 23:00:08 2015
+++ src/sys/arch/sandpoint/sandpoint/machdep.c	Wed Sep 30 14:18:54 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 

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

2015-09-30 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Sep 30 14:22:02 UTC 2015

Modified Files:
src/sys/arch/sandpoint/conf: GENERIC

Log Message:
Disable CFI in the GENERIC kernel again, as currently only cmdset 1.3
is supported, which is not present in all flash chips.
Add lmtemp(4), an LM75 temperature sensor, which is found in some
Synology NAS models.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/sandpoint/conf/GENERIC

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/sandpoint/conf/GENERIC
diff -u src/sys/arch/sandpoint/conf/GENERIC:1.90 src/sys/arch/sandpoint/conf/GENERIC:1.91
--- src/sys/arch/sandpoint/conf/GENERIC:1.90	Mon Sep 21 23:31:41 2015
+++ src/sys/arch/sandpoint/conf/GENERIC	Wed Sep 30 14:22:02 2015
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.90 2015/09/21 23:31:41 phx Exp $
+# $NetBSD: GENERIC,v 1.91 2015/09/30 14:22:02 phx Exp $
 #
 # machine description file for GENERIC NAS
 # 
@@ -22,7 +22,7 @@ include 	"arch/sandpoint/conf/std.sandpo
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.90 $"
+#ident 		"GENERIC-$Revision: 1.91 $"
 
 maxusers	32
 
@@ -173,9 +173,9 @@ config		netbsd	root on ? type ?
 mainbus0	at root
 cpu*		at mainbus0
 
-cfi0		at mainbus0
-nor*		at cfi?
-flash*		at nor?
+#cfi0		at mainbus0
+#nor*		at cfi?
+#flash*		at nor?
 
 nhpow0		at mainbus0			# NH230/231 power,LED,buttons
 
@@ -189,6 +189,7 @@ com0		at eumb? unit 0			# console at 0x4
 satmgr0 	at eumb? unit 1 		# satmgr at 0x4600
 ociic*		at eumb?
 iic*		at ociic?
+lmtemp*		at iic? addr 0x48		# LM75 temperature sensor
 rs5c372rtc*	at iic? addr 0x32
 s390rtc*	at iic? addr 0x30
 pcf8563rtc*	at iic? addr 0x51



CVS commit: src/sys/arch/sandpoint/sandpoint

2015-09-30 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Sep 30 14:18:54 UTC 2015

Modified Files:
src/sys/arch/sandpoint/sandpoint: autoconf.c machdep.c

Log Message:
Now more than a single I2C device per model may be configured directly.
An additional flags argument makes the configuration depend on the model-
flags in an optional BTINFO_MODEL bootinfo node.
Print the model name together with the vendor name, when known.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/sandpoint/sandpoint/autoconf.c
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/sandpoint/sandpoint/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/sandpoint

2015-09-30 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Sep 30 14:14:32 UTC 2015

Modified Files:
src/sys/arch/sandpoint/include: bootinfo.h
src/sys/arch/sandpoint/stand/altboot: brdsetup.c globals.h main.c
siisata.c version

Log Message:
Pass a name and flags precisely describing the current model and its
features via a new bootinfo node (currently Synology only). This allows
for example the configuration of model-specific temperature I2C sensors
and fan control.
Support for the Synology DS207 and DS209 drive LEDs and wait until the
2nd drive is completely powered up.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sandpoint/include/bootinfo.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/sandpoint/stand/altboot/brdsetup.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/sandpoint/stand/altboot/globals.h
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/sandpoint/stand/altboot/main.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sandpoint/stand/altboot/siisata.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sandpoint/stand/altboot/version

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/sandpoint/include/bootinfo.h
diff -u src/sys/arch/sandpoint/include/bootinfo.h:1.8 src/sys/arch/sandpoint/include/bootinfo.h:1.9
--- src/sys/arch/sandpoint/include/bootinfo.h:1.8	Tue Jan 11 06:57:35 2011
+++ src/sys/arch/sandpoint/include/bootinfo.h	Wed Sep 30 14:14:32 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootinfo.h,v 1.8 2011/01/11 06:57:35 nisimura Exp $	*/
+/*	$NetBSD: bootinfo.h,v 1.9 2015/09/30 14:14:32 phx Exp $	*/
 
 /*
  * Copyright (c) 1997
@@ -45,6 +45,7 @@ struct btinfo_common {
 #define BTINFO_NET		7
 #define BTINFO_PRODFAMILY	8
 #define BTINFO_MODULELIST	9
+#define BTINFO_MODEL		10
 
 struct btinfo_magic {
 	struct btinfo_common common;
@@ -91,6 +92,20 @@ struct btinfo_prodfamily {
 	char name[24];
 };
 
+struct btinfo_model {
+	struct btinfo_common common;
+	char name[28];
+	unsigned flags;			/* model specific flags */
+/* Synology flags: */
+#define BI_MODEL_CPLDVER_MASK	0x07
+#define BI_MODEL_CPLD207	0x08
+#define BI_MODEL_CPLD209	0x10
+#define BI_MODEL_CPLD406	0x18
+#define BI_MODEL_CPLD407	0x20
+#define BI_MODEL_CPLD_MASK	0x38
+#define BI_MODEL_THERMAL	0x40
+};
+
 struct btinfo_modulelist {
 	struct btinfo_common common;
 	int num;

Index: src/sys/arch/sandpoint/stand/altboot/brdsetup.c
diff -u src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.35 src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.36
--- src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.35	Fri Aug  8 21:18:10 2014
+++ src/sys/arch/sandpoint/stand/altboot/brdsetup.c	Wed Sep 30 14:14:32 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.35 2014/08/08 21:18:10 joerg Exp $ */
+/* $NetBSD: brdsetup.c,v 1.36 2015/09/30 14:14:32 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -111,7 +111,14 @@ static unsigned mpc107memsize(void);
 #define IOMEGA_PACKETSIZE	8
 
 /* NH230/231 GPIO */
-#define NHGPIO_WRITE(x)		*((uint8_t *)0x7000) = x
+#define NHGPIO_WRITE(x)		*((volatile uint8_t *)0x7000) = (x)
+
+/* Synology CPLD (2007 and newer models) */
+#define SYNOCPLD_READ(r)	*((volatile uint8_t *)0xff00 + (r))
+#define SYNOCPLD_WRITE(r,x)	do { \
+*((volatile uint8_t *)0xff00 + (r)) = (x); \
+delay(10); \
+} while(0)
 
 static struct brdprop brdlist[] = {
 {
@@ -719,47 +726,183 @@ synobrdfix(struct brdprop *brd)
 	send_sat("247");
 }
 
+#define SYNO_FAN_TIMEOUT	500	/* 500ms to turn the fan off */
+#define SYNO_DISK_DELAY		30	/* 30 seconds to power up 2nd disk */
+
 void
 synopcifix(struct brdprop *brd)
 {
-	static const char csmodel[4][7] = {
-		"CS406e", "CS406", "RS406", "CS407e"
+	static const char models207[4][7] = {
+		"???", "DS107e", "DS107", "DS207"
+	};
+	static const char models209[2][7] = {
+		"DS109j", "DS209j"
+	};
+	static const char models406[3][7] = {
+		"CS406e", "CS406", "RS406"
 	};
-	volatile uint8_t *cpld = (volatile uint8_t *)0xff00;
-	uint8_t pwrstate;
+	static const char models407[4][7] = {
+		"???", "CS407e", "CS407", "RS407"
+	};
+	extern struct btinfo_model bi_model;
+	const char *model_name;
+	unsigned cpld, version, flags;
+	uint8_t v, status;
+	int i;
+
+	/*
+	 * Determine if a CPLD is present and whether is has 4-bit
+	 * (models 107, 207, 209)  or 8-bit (models 406, 407) registers.
+	 * The register set repeats every 16 bytes.
+	 */
+	cpld = 0;
+	flags = 0;
+	version = 0;
+	model_name = NULL;
+
+	SYNOCPLD_WRITE(0, 0x00);	/* LEDs blinking yellow (default) */
+	v = SYNOCPLD_READ(0);
+
+	if (v != 0x00) {
+		v &= 0xf0;
+		if (v != 0x00 || (SYNOCPLD_READ(16 + 0) & 0xf0) != v)
+			goto cpld_done;
+
+  cpld4bits:
+		/* 4-bit registers assumed, make LEDs solid yellow */
+		SYNOCPLD_WRITE(0, 0x50);
+		v = SYNOCPLD_READ(0) & 0xf0;
+		if (v != 0x50 || (SYNOCPLD_READ(32 + 0) & 0xf0) != v)
+			goto cpld_done;
+
+		v = SYNOCPLD_READ(2) & 0xf0;
+		if ((SYNOCPLD_READ(48 

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

2015-09-30 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Sep 30 14:22:02 UTC 2015

Modified Files:
src/sys/arch/sandpoint/conf: GENERIC

Log Message:
Disable CFI in the GENERIC kernel again, as currently only cmdset 1.3
is supported, which is not present in all flash chips.
Add lmtemp(4), an LM75 temperature sensor, which is found in some
Synology NAS models.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/sandpoint/conf/GENERIC

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



CVS commit: src/sys/arch/sandpoint/stand/altboot

2015-09-29 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Tue Sep 29 15:12:53 UTC 2015

Modified Files:
src/sys/arch/sandpoint/stand/altboot: dsk.c globals.h

Log Message:
The disk's unittag is not equal to the channel, so we need an additional
unitchan entry to make lba_read() work in all cases.
The libsa-printf() does not seem to support 64-bit output, so cast the
block number to unsigned when printing an error message.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sandpoint/stand/altboot/dsk.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/sandpoint/stand/altboot/globals.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/sandpoint/stand/altboot

2015-09-29 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Tue Sep 29 15:12:53 UTC 2015

Modified Files:
src/sys/arch/sandpoint/stand/altboot: dsk.c globals.h

Log Message:
The disk's unittag is not equal to the channel, so we need an additional
unitchan entry to make lba_read() work in all cases.
The libsa-printf() does not seem to support 64-bit output, so cast the
block number to unsigned when printing an error message.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sandpoint/stand/altboot/dsk.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/sandpoint/stand/altboot/globals.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/sandpoint/stand/altboot/dsk.c
diff -u src/sys/arch/sandpoint/stand/altboot/dsk.c:1.17 src/sys/arch/sandpoint/stand/altboot/dsk.c:1.18
--- src/sys/arch/sandpoint/stand/altboot/dsk.c:1.17	Tue Aug  5 17:55:20 2014
+++ src/sys/arch/sandpoint/stand/altboot/dsk.c	Tue Sep 29 15:12:52 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: dsk.c,v 1.17 2014/08/05 17:55:20 joerg Exp $ */
+/* $NetBSD: dsk.c,v 1.18 2015/09/29 15:12:52 phx Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -125,6 +125,7 @@ disk_scan(void *drv)
 		}
 		d = [ndrive];
 		d->dvops = l;
+		d->unitchan = n;
 		d->unittag = ndrive;
 		snprintf(d->xname, sizeof(d->xname), "wd%d", d->unittag);
 		set_xfermode(l, n);
@@ -404,7 +405,7 @@ lba_read(struct disk *d, int64_t bno, in
 	int error;
 
 	l = d->dvops;
-	n = d->unittag;
+	n = d->unitchan;
 	p = (uint16_t *)buf;
 	chan = >chan[n];
 	error = 0;
@@ -414,7 +415,8 @@ lba_read(struct disk *d, int64_t bno, in
 		(*issue)(chan, bno, rdcnt);
 		for (k = 0; k < rdcnt; k++) {
 			if (spinwait_unbusy(l, n, 1000, ) == 0) {
-printf("%s blk %lld %s\n", d->xname, bno, err);
+printf("%s blk %u %s\n",
+   d->xname, (unsigned)bno, err);
 error = EIO;
 break;
 			}

Index: src/sys/arch/sandpoint/stand/altboot/globals.h
diff -u src/sys/arch/sandpoint/stand/altboot/globals.h:1.19 src/sys/arch/sandpoint/stand/altboot/globals.h:1.20
--- src/sys/arch/sandpoint/stand/altboot/globals.h:1.19	Thu Apr 26 19:59:37 2012
+++ src/sys/arch/sandpoint/stand/altboot/globals.h	Tue Sep 29 15:12:52 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: globals.h,v 1.19 2012/04/26 19:59:37 phx Exp $ */
+/* $NetBSD: globals.h,v 1.20 2015/09/29 15:12:52 phx Exp $ */
 
 #ifdef DEBUG
 #define	DPRINTF(x)	printf x
@@ -172,6 +172,7 @@ NIF_DECL(stg);
 struct disk {
 	char xname[8];
 	void *dvops;
+	unsigned unitchan;
 	unsigned unittag;
 	uint16_t ident[128];
 	uint64_t nsect;



CVS commit: src/sys/dev/i2c

2015-09-27 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Sep 27 13:02:21 UTC 2015

Modified Files:
src/sys/dev/i2c: adm1021.c at24cxx.c lm75.c lm87.c

Log Message:
Direct config: Only match via the list of compatible hardware when we have
such a list available (ia_ncompat > 0). Otherwise fall back to matching
the device name with ia_name.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/i2c/adm1021.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/i2c/at24cxx.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/i2c/lm75.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/lm87.c

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

Modified files:

Index: src/sys/dev/i2c/adm1021.c
diff -u src/sys/dev/i2c/adm1021.c:1.8 src/sys/dev/i2c/adm1021.c:1.9
--- src/sys/dev/i2c/adm1021.c:1.8	Sat Oct 27 17:18:17 2012
+++ src/sys/dev/i2c/adm1021.c	Sun Sep 27 13:02:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: adm1021.c,v 1.8 2012/10/27 17:18:17 chs Exp $ */
+/*	$NetBSD: adm1021.c,v 1.9 2015/09/27 13:02:21 phx Exp $ */
 /*	$OpenBSD: adm1021.c,v 1.27 2007/06/24 05:34:35 dlg Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.8 2012/10/27 17:18:17 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.9 2015/09/27 13:02:21 phx Exp $");
 
 #include 
 #include 
@@ -83,10 +83,15 @@ admtemp_match(device_t parent, cfdata_t 
 	} else {
 		/*
 		 * Direct config - match via the list of compatible
-		 * hardware.
+		 * hardware or simply match the device name.
 		 */
-		if (iic_compat_match(ia, admtemp_compats))
-			return 1;
+		if (ia->ia_ncompat > 0) {
+			if (iic_compat_match(ia, admtemp_compats))
+return 1;
+		} else {
+			if (strcmp(ia->ia_name, "admtemp") == 0)
+return 1;
+		}
 	}
 
 	return 0;

Index: src/sys/dev/i2c/at24cxx.c
diff -u src/sys/dev/i2c/at24cxx.c:1.19 src/sys/dev/i2c/at24cxx.c:1.20
--- src/sys/dev/i2c/at24cxx.c:1.19	Sun May 10 22:54:06 2015
+++ src/sys/dev/i2c/at24cxx.c	Sun Sep 27 13:02:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: at24cxx.c,v 1.19 2015/05/10 22:54:06 jmcneill Exp $	*/
+/*	$NetBSD: at24cxx.c,v 1.20 2015/09/27 13:02:21 phx Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.19 2015/05/10 22:54:06 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.20 2015/09/27 13:02:21 phx Exp $");
 
 #include 
 #include 
@@ -122,8 +122,13 @@ seeprom_match(device_t parent, cfdata_t 
 	struct i2c_attach_args *ia = aux;
 
 	if (ia->ia_name) {
-		if (iic_compat_match(ia, seeprom_compats))
-			return (1);
+		if (ia->ia_ncompat > 0) {
+			if (iic_compat_match(ia, seeprom_compats))
+return (1);
+		} else {
+			if (strcmp(ia->ia_name, "seeprom") == 0)
+return (1);
+		}
 	} else {
 		if ((ia->ia_addr & AT24CXX_ADDRMASK) == AT24CXX_ADDR)
 			return (1);

Index: src/sys/dev/i2c/lm75.c
diff -u src/sys/dev/i2c/lm75.c:1.25 src/sys/dev/i2c/lm75.c:1.26
--- src/sys/dev/i2c/lm75.c:1.25	Sat Oct 27 17:18:17 2012
+++ src/sys/dev/i2c/lm75.c	Sun Sep 27 13:02:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: lm75.c,v 1.25 2012/10/27 17:18:17 chs Exp $	*/
+/*	$NetBSD: lm75.c,v 1.26 2015/09/27 13:02:21 phx Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lm75.c,v 1.25 2012/10/27 17:18:17 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lm75.c,v 1.26 2015/09/27 13:02:21 phx Exp $");
 
 #include 
 #include 
@@ -132,10 +132,15 @@ lmtemp_match(device_t parent, cfdata_t c
 	} else {
 		/*
 		 * Direct config - match via the list of compatible
-		 * hardware.
+		 * hardware or simply match the device name.
 		 */
-		if (iic_compat_match(ia, lmtemp_compats))
-			return 1;
+		if (ia->ia_ncompat > 0) {
+			if (iic_compat_match(ia, lmtemp_compats))
+return 1;
+		} else {
+			if (strcmp(ia->ia_name, "lmtemp") == 0)
+return 1;
+		}
 	}
 
 

Index: src/sys/dev/i2c/lm87.c
diff -u src/sys/dev/i2c/lm87.c:1.4 src/sys/dev/i2c/lm87.c:1.5
--- src/sys/dev/i2c/lm87.c:1.4	Mon Nov  4 15:06:26 2013
+++ src/sys/dev/i2c/lm87.c	Sun Sep 27 13:02:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: lm87.c,v 1.4 2013/11/04 15:06:26 jdc Exp $	*/
+/*	$NetBSD: lm87.c,v 1.5 2015/09/27 13:02:21 phx Exp $	*/
 /*	$OpenBSD: lm87.c,v 1.20 2008/11/10 05:19:48 cnst Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lm87.c,v 1.4 2013/11/04 15:06:26 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lm87.c,v 1.5 2015/09/27 13:02:21 phx Exp $");
 
 #include 
 #include 
@@ -132,10 +132,15 @@ lmenv_match(device_t parent, cfdata_t ma
 	} else {
 		/*
 		 * Direct config - match via the list of compatible
-		 * hardware.
+		 * hardware or simply match the device name.
 		 */
-		if (iic_compat_match(ia, lmenv_compats))
-			return 1;
+		if (ia->ia_ncompat > 0) {
+			if (iic_compat_match(ia, lmenv_compats))
+return 1;
+		} else {
+			if (strcmp(ia->ia_name, "lmenv") == 0)
+return 1;
+		}
 	}
 
 	return 0;



CVS commit: src/sys/dev/i2c

2015-09-27 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Sep 27 13:02:21 UTC 2015

Modified Files:
src/sys/dev/i2c: adm1021.c at24cxx.c lm75.c lm87.c

Log Message:
Direct config: Only match via the list of compatible hardware when we have
such a list available (ia_ncompat > 0). Otherwise fall back to matching
the device name with ia_name.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/i2c/adm1021.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/i2c/at24cxx.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/i2c/lm75.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/lm87.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/sandpoint/conf

2015-09-21 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep 21 23:34:21 UTC 2015

Modified Files:
src/sys/arch/sandpoint/conf: KUROBOX

Log Message:
Remove erroneously entered debug options.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sandpoint/conf/KUROBOX

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/sandpoint/conf/KUROBOX
diff -u src/sys/arch/sandpoint/conf/KUROBOX:1.6 src/sys/arch/sandpoint/conf/KUROBOX:1.7
--- src/sys/arch/sandpoint/conf/KUROBOX:1.6	Mon Sep 21 23:31:41 2015
+++ src/sys/arch/sandpoint/conf/KUROBOX	Mon Sep 21 23:34:21 2015
@@ -1,17 +1,10 @@
-#	$NetBSD: KUROBOX,v 1.6 2015/09/21 23:31:41 phx Exp $
+#	$NetBSD: KUROBOX,v 1.7 2015/09/21 23:34:21 phx Exp $
 #
 # KuroBox/LinkStation support
 #
 
 include "arch/sandpoint/conf/GENERIC"
 
-options 	DIAGNOSTIC  # cheap kernel consistency checks
-options 	DEBUG   # expensive debugging checks/support
-makeoptions	DEBUG="-g"
-
-options		NOR_DEBUG
-options		NOR_VERBOSE
-
 no com0
 no satmgr0
 com0	at eumb? unit 1			# console at 0x4600



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

2015-09-21 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep 21 23:34:21 UTC 2015

Modified Files:
src/sys/arch/sandpoint/conf: KUROBOX

Log Message:
Remove erroneously entered debug options.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sandpoint/conf/KUROBOX

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



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

2015-09-21 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep 21 23:31:41 UTC 2015

Modified Files:
src/sys/arch/sandpoint/conf: GENERIC KUROBOX

Log Message:
double vlan pseudo-device removed


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/sandpoint/conf/GENERIC
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sandpoint/conf/KUROBOX

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/sandpoint/conf/GENERIC
diff -u src/sys/arch/sandpoint/conf/GENERIC:1.89 src/sys/arch/sandpoint/conf/GENERIC:1.90
--- src/sys/arch/sandpoint/conf/GENERIC:1.89	Mon Sep  7 23:01:08 2015
+++ src/sys/arch/sandpoint/conf/GENERIC	Mon Sep 21 23:31:41 2015
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.89 2015/09/07 23:01:08 phx Exp $
+# $NetBSD: GENERIC,v 1.90 2015/09/21 23:31:41 phx Exp $
 #
 # machine description file for GENERIC NAS
 # 
@@ -22,7 +22,7 @@ include 	"arch/sandpoint/conf/std.sandpo
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.89 $"
+#ident 		"GENERIC-$Revision: 1.90 $"
 
 maxusers	32
 
@@ -323,7 +323,6 @@ pseudo-device	bpfilter		# packet filter
 #pseudo-device	pf			# PF packet filter
 #pseudo-device	pflog			# PF log if
 #pseudo-device	sl			# Serial Line IP
-#pseudo-device	vlan			# IEEE 802.1q encapsulation
 #pseudo-device	tun			# network tunneling over tty
 #pseudo-device	tap			# virtual Ethernet
 #pseudo-device	gre			# generic L3 over IP tunnel

Index: src/sys/arch/sandpoint/conf/KUROBOX
diff -u src/sys/arch/sandpoint/conf/KUROBOX:1.5 src/sys/arch/sandpoint/conf/KUROBOX:1.6
--- src/sys/arch/sandpoint/conf/KUROBOX:1.5	Sat May 12 10:27:17 2012
+++ src/sys/arch/sandpoint/conf/KUROBOX	Mon Sep 21 23:31:41 2015
@@ -1,10 +1,17 @@
-#	$NetBSD: KUROBOX,v 1.5 2012/05/12 10:27:17 nisimura Exp $
+#	$NetBSD: KUROBOX,v 1.6 2015/09/21 23:31:41 phx Exp $
 #
 # KuroBox/LinkStation support
 #
 
 include "arch/sandpoint/conf/GENERIC"
 
+options 	DIAGNOSTIC  # cheap kernel consistency checks
+options 	DEBUG   # expensive debugging checks/support
+makeoptions	DEBUG="-g"
+
+options		NOR_DEBUG
+options		NOR_VERBOSE
+
 no com0
 no satmgr0
 com0	at eumb? unit 1			# console at 0x4600



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

2015-09-21 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep 21 23:31:41 UTC 2015

Modified Files:
src/sys/arch/sandpoint/conf: GENERIC KUROBOX

Log Message:
double vlan pseudo-device removed


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/sandpoint/conf/GENERIC
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sandpoint/conf/KUROBOX

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



CVS commit: src/sys/dev/nor

2015-09-18 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Sep 18 21:30:02 UTC 2015

Modified Files:
src/sys/dev/nor: cfi.c

Log Message:
Size of erase block is 128 bytes when sector density (z) is zero.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/nor/cfi.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/nor/cfi.c
diff -u src/sys/dev/nor/cfi.c:1.7 src/sys/dev/nor/cfi.c:1.8
--- src/sys/dev/nor/cfi.c:1.7	Sat Dec 17 19:42:41 2011
+++ src/sys/dev/nor/cfi.c	Fri Sep 18 21:30:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cfi.c,v 1.7 2011/12/17 19:42:41 phx Exp $	*/
+/*	$NetBSD: cfi.c,v 1.8 2015/09/18 21:30:02 phx Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,7 +33,7 @@
 #include "opt_cfi.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cfi.c,v 1.7 2011/12/17 19:42:41 phx Exp $"); 
+__KERNEL_RCSID(0, "$NetBSD: cfi.c,v 1.8 2015/09/18 21:30:02 phx Exp $"); 
 
 #include 
 #include 
@@ -476,7 +476,8 @@ cfi_scan_media(device_t self, struct nor
 	 */
 	chip->nc_num_luns = 1;
 	chip->nc_lun_blocks = cfi->cfi_qry_data.erase_blk_info[0].y + 1;
-	chip->nc_block_size = cfi->cfi_qry_data.erase_blk_info[0].z * 256;
+	chip->nc_block_size = cfi->cfi_qry_data.erase_blk_info[0].z ?
+	cfi->cfi_qry_data.erase_blk_info[0].z * 256 : 128;
 
 	switch (cfi->cfi_qry_data.id_pri) {
 	case 0x0002:
@@ -880,7 +881,8 @@ cfi_print(device_t self, struct cfi * co
 	aprint_normal_dev(self, "%d Erase Block Region(s)\n",
 		qryp->erase_blk_regions);
 	for (u_int r=0; r < qryp->erase_blk_regions; r++) {
-		size_t sz = qryp->erase_blk_info[r].z * 256;
+		size_t sz = qryp->erase_blk_info[r].z ?
+		qryp->erase_blk_info[r].z * 256 : 128;
 		format_bytes(pbuf, sizeof(pbuf), sz);
 		aprint_normal("%d: %d blocks, size %s\n", r,
 			qryp->erase_blk_info[r].y + 1, pbuf);



CVS commit: src/sys/dev/nor

2015-09-18 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Sep 18 21:30:02 UTC 2015

Modified Files:
src/sys/dev/nor: cfi.c

Log Message:
Size of erase block is 128 bytes when sector density (z) is zero.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/nor/cfi.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/i2c

2015-09-18 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Sep 18 17:21:43 UTC 2015

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

Log Message:
Declare sensor data invalid when reading the sensor failed (device is gone).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/i2c/hytp14.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/i2c

2015-09-18 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Sep 18 17:21:43 UTC 2015

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

Log Message:
Declare sensor data invalid when reading the sensor failed (device is gone).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/i2c/hytp14.c

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

Modified files:

Index: src/sys/dev/i2c/hytp14.c
diff -u src/sys/dev/i2c/hytp14.c:1.5 src/sys/dev/i2c/hytp14.c:1.6
--- src/sys/dev/i2c/hytp14.c:1.5	Wed Sep  9 17:16:20 2015
+++ src/sys/dev/i2c/hytp14.c	Fri Sep 18 17:21:43 2015
@@ -37,7 +37,7 @@
  */ 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hytp14.c,v 1.5 2015/09/09 17:16:20 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hytp14.c,v 1.6 2015/09/18 17:21:43 phx Exp $");
 
 #include 
 #include 
@@ -230,6 +230,7 @@ hytp14_measurement_request(void *aux)
 			DPRINTF(2, ("%s: %s: failed read from 0x%02x - error %d\n",
 			device_xname(sc->sc_dev), __func__,
 			sc->sc_addr, error));
+			sc->sc_valid = ENVSYS_SINVALID;
 		} else {
 			DPRINTF(3, ("%s(%s): DF success : "
 			"0x%02x%02x%02x%02x\n",
@@ -288,6 +289,7 @@ hytp14_refresh_sensor(struct hytp14_sc *
 			DPRINTF(2, ("%s: %s: failed read from 0x%02x - error %d\n",
 			device_xname(sc->sc_dev), __func__,
 			sc->sc_addr, error));
+			sc->sc_valid = ENVSYS_SINVALID;
 		} else {
 			DPRINTF(3, ("%s(%s): DF success : "
 			"0x%02x%02x%02x%02x\n",
@@ -317,7 +319,7 @@ hytp14_refresh_sensor(struct hytp14_sc *
 		DPRINTF(2, ("%s: %s: failed acquire i2c bus - error %d\n",
 		device_xname(sc->sc_dev), __func__, error));
 	}
-	
+
 	return sc->sc_valid;
 }
 



CVS commit: src

2015-09-09 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Sep  9 17:16:20 UTC 2015

Modified Files:
src/share/man/man4: hythygtemp.4
src/sys/dev/i2c: hytp14.c hytp14var.h

Log Message:
Tests showed that the sensor needs at least 30ms after a MR (measurement
request) to have valid data ready, so the driver didn't work very well.
Now the MR is sent in configurable intervals (hw.hythygtemp0.interval)
using callout(9), so that valid data is immediately available for
sysmon's sensor refresh. When the refresh comes too close after the last
MR, then the previous values are used.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/hythygtemp.4
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/hytp14.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/i2c/hytp14var.h

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

Modified files:

Index: src/share/man/man4/hythygtemp.4
diff -u src/share/man/man4/hythygtemp.4:1.2 src/share/man/man4/hythygtemp.4:1.3
--- src/share/man/man4/hythygtemp.4:1.2	Sun May 18 12:45:03 2014
+++ src/share/man/man4/hythygtemp.4	Wed Sep  9 17:16:20 2015
@@ -1,4 +1,4 @@
-.\"	$NetBSD: hythygtemp.4,v 1.2 2014/05/18 12:45:03 wiz Exp $
+.\"	$NetBSD: hythygtemp.4,v 1.3 2015/09/09 17:16:20 phx Exp $
 .\"
 .\" Copyright (c) 2014 Frank Kardel
 .\" All rights reserved.
@@ -44,13 +44,28 @@ The
 .Ar addr
 argument selects the address at the
 .Xr iic 4
-bus.
+bus. The sampling interval can be changed through the
+.Xr sysctl 8
+node
+.Li hw.hythygtemp0.interval .
+.Pp
 The sensor chips can be reconfigured to respond to other addresses than the
-default value of 0x28.
+default value of 0x28 by external utilities, like for example the
+.Pa pkgsrc/sysutils/hytctl
+package.
+.Sh SYSCTL VARIABLES
+The following
+.Xr sysctl 3
+variables are provided:
+.Bl -tag -width indent
+.It hw.hythygtemp0.interval
+Defines the sensor's sampling interval in seconds. It defaults to 50 seconds.
+.El
 .Sh SEE ALSO
 .Xr envsys 4 ,
 .Xr iic 4 ,
-.Xr envstat 8
+.Xr envstat 8 ,
+.Xr sysctl 8
 .Sh HISTORY
 The
 .Nm
@@ -61,4 +76,6 @@ driver first appeared in
 The
 .Nm
 driver was written by
-.An Frank Kardel Aq Mt kar...@netbsd.org .
+.An Frank Kardel Aq Mt kar...@netbsd.org
+and
+.An Frank Wille Aq p...@netbsd.org .

Index: src/sys/dev/i2c/hytp14.c
diff -u src/sys/dev/i2c/hytp14.c:1.4 src/sys/dev/i2c/hytp14.c:1.5
--- src/sys/dev/i2c/hytp14.c:1.4	Thu Apr 23 23:23:00 2015
+++ src/sys/dev/i2c/hytp14.c	Wed Sep  9 17:16:20 2015
@@ -37,16 +37,16 @@
  */ 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hytp14.c,v 1.4 2015/04/23 23:23:00 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hytp14.c,v 1.5 2015/09/09 17:16:20 phx Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
-
 #include 
 #include 
 #include 
@@ -54,12 +54,14 @@ __KERNEL_RCSID(0, "$NetBSD: hytp14.c,v 1
 static int hytp14_match(device_t, cfdata_t, void *);
 static void hytp14_attach(device_t, device_t, void *);
 static int hytp14_detach(device_t, int);
+static void hytp14_measurement_request(void *);
 static int hytp14_refresh_sensor(struct hytp14_sc *sc);
 static void hytp14_refresh(struct sysmon_envsys *, envsys_data_t *);
 static void hytp14_refresh_humidity(struct hytp14_sc *, envsys_data_t *);
 static void hytp14_refresh_temp(struct hytp14_sc *, envsys_data_t *);
+static int sysctl_hytp14_interval(SYSCTLFN_ARGS);
 
-/* #define HYT_DEBUG 3 */
+/*#define HYT_DEBUG 3*/
 #ifdef HYT_DEBUG
 volatile int hythygtemp_debug = HYT_DEBUG;
 
@@ -91,7 +93,9 @@ static struct hytp14_sensor hytp14_senso
 static int
 hytp14_match(device_t parent, cfdata_t match, void *aux)
 {
-	struct i2c_attach_args *ia = aux;
+	struct i2c_attach_args *ia;
+
+	ia = aux;
 
 	if (ia->ia_name) {
 		/* direct config - check name */
@@ -108,14 +112,17 @@ hytp14_match(device_t parent, cfdata_t m
 static void
 hytp14_attach(device_t parent, device_t self, void *aux)
 {
-	struct hytp14_sc *sc = device_private(self);
-	struct i2c_attach_args *ia = aux;
+	const struct sysctlnode *rnode, *node;
+	struct hytp14_sc *sc;
+	struct i2c_attach_args *ia;
 	int i;
 
+	ia = aux;
+	sc = device_private(self);
+
 	sc->sc_dev = self;
 	sc->sc_tag = ia->ia_tag;
 	sc->sc_addr = ia->ia_addr;
-	sc->sc_refresh = 0;
 	sc->sc_valid = ENVSYS_SINVALID;
 	sc->sc_numsensors = __arraycount(hytp14_sensors);
 
@@ -134,7 +141,7 @@ hytp14_attach(device_t parent, device_t 
 		sc->sc_sensors[i].state = ENVSYS_SINVALID;
 		
 		DPRINTF(2, ("hytp14_attach: registering sensor %d (%s)\n", i,
-			sc->sc_sensors[i].desc));
+		sc->sc_sensors[i].desc));
 		
 		if (sysmon_envsys_sensor_attach(sc->sc_sme, >sc_sensors[i])) {
 			aprint_error_dev(sc->sc_dev,
@@ -157,80 +164,158 @@ hytp14_attach(device_t parent, device_t 
 		return;
 	}
 
+	/* create a sysctl node for setting the measurement interval */
+	rnode = node = NULL;
+	sy

CVS commit: src

2015-09-09 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Sep  9 17:16:20 UTC 2015

Modified Files:
src/share/man/man4: hythygtemp.4
src/sys/dev/i2c: hytp14.c hytp14var.h

Log Message:
Tests showed that the sensor needs at least 30ms after a MR (measurement
request) to have valid data ready, so the driver didn't work very well.
Now the MR is sent in configurable intervals (hw.hythygtemp0.interval)
using callout(9), so that valid data is immediately available for
sysmon's sensor refresh. When the refresh comes too close after the last
MR, then the previous values are used.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/hythygtemp.4
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/hytp14.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/i2c/hytp14var.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/sandpoint/conf

2015-09-07 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep  7 23:01:08 UTC 2015

Modified Files:
src/sys/arch/sandpoint/conf: GENERIC

Log Message:
Enable cfi/nor/flash devices as reading from flash seems to work now.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/sandpoint/conf/GENERIC

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



CVS commit: src/etc/etc.sandpoint

2015-09-07 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep  7 23:02:07 UTC 2015

Modified Files:
src/etc/etc.sandpoint: MAKEDEV.conf

Log Message:
Create /dev/flashN device nodes for all_md.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/etc/etc.sandpoint/MAKEDEV.conf

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

Modified files:

Index: src/etc/etc.sandpoint/MAKEDEV.conf
diff -u src/etc/etc.sandpoint/MAKEDEV.conf:1.16 src/etc/etc.sandpoint/MAKEDEV.conf:1.17
--- src/etc/etc.sandpoint/MAKEDEV.conf:1.16	Thu Aug 16 13:31:26 2012
+++ src/etc/etc.sandpoint/MAKEDEV.conf	Mon Sep  7 23:02:07 2015
@@ -1,4 +1,4 @@
-# $NetBSD: MAKEDEV.conf,v 1.16 2012/08/16 13:31:26 abs Exp $
+# $NetBSD: MAKEDEV.conf,v 1.17 2015/09/07 23:02:07 phx Exp $
 
 init)
 	makedev std bpf tty00 tty01 opty ptm pty0
@@ -14,6 +14,7 @@ all_md)
 	makedev	usbs
 	makedev scsibus0 scsibus1
 	makedev pci0 altq sysmon kttcp cfs satmgr
+	makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
 	;;
 
 ramdisk|floppy)



CVS commit: src/etc/etc.sandpoint

2015-09-07 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep  7 23:02:07 UTC 2015

Modified Files:
src/etc/etc.sandpoint: MAKEDEV.conf

Log Message:
Create /dev/flashN device nodes for all_md.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/etc/etc.sandpoint/MAKEDEV.conf

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



CVS commit: src/sys/arch/sandpoint/sandpoint

2015-09-07 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep  7 23:00:08 UTC 2015

Modified Files:
src/sys/arch/sandpoint/sandpoint: flash_cfi.c machdep.c mainbus.c

Log Message:
Fix nor-flash bus space: extent limit should not be zero and bus space is
definitely big-endian. Reading the flash via /dev/flash0 works now.
Writing is untested.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sandpoint/sandpoint/flash_cfi.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/sandpoint/sandpoint/machdep.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/sandpoint/sandpoint/mainbus.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/sandpoint/sandpoint/flash_cfi.c
diff -u src/sys/arch/sandpoint/sandpoint/flash_cfi.c:1.3 src/sys/arch/sandpoint/sandpoint/flash_cfi.c:1.4
--- src/sys/arch/sandpoint/sandpoint/flash_cfi.c:1.3	Mon Jan 30 15:47:01 2012
+++ src/sys/arch/sandpoint/sandpoint/flash_cfi.c	Mon Sep  7 23:00:08 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: flash_cfi.c,v 1.3 2012/01/30 15:47:01 phx Exp $ */
+/* $NetBSD: flash_cfi.c,v 1.4 2015/09/07 23:00:08 phx Exp $ */
 
 /*-
  * Copyright (c) 2011 Frank Wille.
@@ -32,7 +32,7 @@
  * NOR CFI driver support for sandpoint
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: flash_cfi.c,v 1.3 2012/01/30 15:47:01 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: flash_cfi.c,v 1.4 2015/09/07 23:00:08 phx Exp $");
 
 #include 
 #include 
@@ -63,7 +63,7 @@ sandpointcfi_probe(device_t parent, cfda
 {
 	extern struct cfdriver cfi_cd;
 	struct mainbus_attach_args *ma = aux;
-	const bus_size_t tmpsize = CFI_QRY_MIN_MAP_SIZE;
+	const bus_size_t qrysize = CFI_QRY_MIN_MAP_SIZE;
 	struct cfi cfi;
 	int error, rv;
 
@@ -74,11 +74,12 @@ sandpointcfi_probe(device_t parent, cfda
 
 	cfi.cfi_bst = ma->ma_bst;
 
-	error = bus_space_map(cfi.cfi_bst, ma->ma_addr, tmpsize, 0,
+	/* flash should be at least 2 MiB in size at 0xffe0 */
+	error = bus_space_map(cfi.cfi_bst, 0xffe0, qrysize, 0,
 	_bsh);
 	if (error != 0) {
 		aprint_error("%s: cannot map %d at offset %#x, error %d\n",
-		__func__, tmpsize, ma->ma_addr, error);
+		__func__, qrysize, ma->ma_addr, error);
 		return 0;
 	}
 
@@ -90,7 +91,7 @@ sandpointcfi_probe(device_t parent, cfda
 	} else
 		rv = 1;
 
-	bus_space_unmap(cfi.cfi_bst, cfi.cfi_bsh, tmpsize);
+	bus_space_unmap(cfi.cfi_bst, cfi.cfi_bsh, qrysize);
 	return rv;
 }
 
@@ -99,7 +100,7 @@ sandpointcfi_attach(device_t parent, dev
 {
 	struct mainbus_attach_args *ma = aux;
 	struct sandpointcfi_softc *sc;
-	const bus_size_t tmpsize = CFI_QRY_MIN_MAP_SIZE;
+	const bus_size_t qrysize = CFI_QRY_MIN_MAP_SIZE;
 	bus_addr_t addr;
 	bool found;
 	int error;
@@ -112,7 +113,7 @@ sandpointcfi_attach(device_t parent, dev
 	sc->sc_cfi.cfi_bst = ma->ma_bst;
 
 	/* map enough to identify, remap later when size is known */
-	error = bus_space_map(sc->sc_cfi.cfi_bst, ma->ma_addr, tmpsize, 0,
+	error = bus_space_map(sc->sc_cfi.cfi_bst, 0xffe0, qrysize, 0,
 	>sc_cfi.cfi_bsh);
 	if (error != 0) {
 		aprint_error_dev(self, "could not map error %d\n", error);
@@ -122,7 +123,7 @@ sandpointcfi_attach(device_t parent, dev
 	/* identify the NOR flash */
 	found = cfi_identify(>sc_cfi);
 
-	bus_space_unmap(sc->sc_cfi.cfi_bst, sc->sc_cfi.cfi_bsh, tmpsize);
+	bus_space_unmap(sc->sc_cfi.cfi_bst, sc->sc_cfi.cfi_bsh, qrysize);
 	if (!found) {
 		/* should not happen, we already probed OK in match */
 		aprint_error_dev(self, "could not map error %d\n", error);
@@ -132,7 +133,7 @@ sandpointcfi_attach(device_t parent, dev
 	/* get size of flash in bytes */
 	sc->sc_size = 1 << sc->sc_cfi.cfi_qry_data.device_size;
 
-	/* real base address */
+	/* determine real base address */
 	addr = (0x - sc->sc_size) + 1;
 
 	sc->sc_nor_if = nor_interface_cfi;

Index: src/sys/arch/sandpoint/sandpoint/machdep.c
diff -u src/sys/arch/sandpoint/sandpoint/machdep.c:1.63 src/sys/arch/sandpoint/sandpoint/machdep.c:1.64
--- src/sys/arch/sandpoint/sandpoint/machdep.c:1.63	Sun Apr 21 15:42:12 2013
+++ src/sys/arch/sandpoint/sandpoint/machdep.c	Mon Sep  7 23:00:08 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.63 2013/04/21 15:42:12 kiyohara Exp $	*/
+/*	$NetBSD: machdep.c,v 1.64 2015/09/07 23:00:08 phx Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.63 2013/04/21 15:42:12 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.64 2015/09/07 23:00:08 phx Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -450,8 +450,8 @@ struct powerpc_bus_space sandpoint_eumb_
 	0xfc00, 0x, 0x0010,
 };
 struct powerpc_bus_space sandpoint_flash_space_tag = {
-	_BUS_SPACE_LITTLE_ENDIAN|_BUS_SPACE_MEM_TYPE,
-	0x, 0xff00

CVS commit: src/sys/arch/sandpoint/sandpoint

2015-09-07 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep  7 23:00:08 UTC 2015

Modified Files:
src/sys/arch/sandpoint/sandpoint: flash_cfi.c machdep.c mainbus.c

Log Message:
Fix nor-flash bus space: extent limit should not be zero and bus space is
definitely big-endian. Reading the flash via /dev/flash0 works now.
Writing is untested.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sandpoint/sandpoint/flash_cfi.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/sandpoint/sandpoint/machdep.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/sandpoint/sandpoint/mainbus.c

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



  1   2   3   4   5   6   7   8   >