Mon Oct 3 14:26:02 2016 UTC ()
Add a driver for MNTMN VA2000.

Supports accelerated wsdisplay console and running X via wsfb driver.


(rkujawa)
diff -r1.73 -r1.74 src/sys/arch/amiga/amiga/conf.c
diff -r1.69 -r1.70 src/sys/arch/amiga/conf/WSCONS
diff -r1.177 -r1.178 src/sys/arch/amiga/conf/files.amiga
diff -r0 -r1.1 src/sys/arch/amiga/dev/mntva.c
diff -r0 -r1.1 src/sys/arch/amiga/dev/mntvareg.h
diff -r0 -r1.1 src/sys/arch/amiga/dev/mntvavar.h
diff -r1.73 -r1.74 src/sys/arch/amiga/dev/zbus.c

cvs diff -r1.73 -r1.74 src/sys/arch/amiga/amiga/conf.c (switch to unified diff)

--- src/sys/arch/amiga/amiga/conf.c 2011/12/15 14:25:12 1.73
+++ src/sys/arch/amiga/amiga/conf.c 2016/10/03 14:26:02 1.74
@@ -1,72 +1,77 @@ @@ -1,72 +1,77 @@
1/* $NetBSD: conf.c,v 1.73 2011/12/15 14:25:12 phx Exp $ */ 1/* $NetBSD: conf.c,v 1.74 2016/10/03 14:26:02 rkujawa Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1991 The Regents of the University of California. 4 * Copyright (c) 1991 The Regents of the University of California.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors 15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software 16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission. 17 * without specific prior written permission.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 * 30 *
31 * @(#)conf.c 7.9 (Berkeley) 5/28/91 31 * @(#)conf.c 7.9 (Berkeley) 5/28/91
32 */ 32 */
33 33
34#include <sys/cdefs.h> 34#include <sys/cdefs.h>
35__KERNEL_RCSID(0, "$NetBSD: conf.c,v 1.73 2011/12/15 14:25:12 phx Exp $"); 35__KERNEL_RCSID(0, "$NetBSD: conf.c,v 1.74 2016/10/03 14:26:02 rkujawa Exp $");
36 36
37#include <sys/param.h> 37#include <sys/param.h>
38#include <sys/conf.h> 38#include <sys/conf.h>
39 39
40#include <dev/cons.h> 40#include <dev/cons.h>
41 41
42#include "ser.h" 42#include "ser.h"
43#include "ite.h" 43#include "ite.h"
44#include "amidisplaycc.h" 44#include "amidisplaycc.h"
 45#include "mntva.h"
45#include "wsdisplay.h" 46#include "wsdisplay.h"
46 47
47/* 48/*
48 * This entire table could be autoconfig()ed but that would mean that 49 * This entire table could be autoconfig()ed but that would mean that
49 * the kernel's idea of the console would be out of sync with that of 50 * the kernel's idea of the console would be out of sync with that of
50 * the standalone boot. I think it best that they both use the same 51 * the standalone boot. I think it best that they both use the same
51 * known algorithm unless we see a pressing need otherwise. 52 * known algorithm unless we see a pressing need otherwise.
52 */ 53 */
53cons_decl(ser); 54cons_decl(ser);
 55cons_decl(mntva);
54cons_decl(grf); 56cons_decl(grf);
55cons_decl(amidisplaycc_); 57cons_decl(amidisplaycc_);
56cons_decl(ite); 58cons_decl(ite);
57 59
58struct consdev constab[] = { 60struct consdev constab[] = {
59#if NSER > 0 61#if NSER > 0
60 cons_init(ser), 62 cons_init(ser),
61#endif 63#endif
 64#if NMNTVA > 0
 65 cons_init(mntva),
 66#endif
62#if NWSDISPLAY > 0 67#if NWSDISPLAY > 0
63 { dev_init(grf,cnprobe), dev_init(grf,cninit) }, 68 { dev_init(grf,cnprobe), dev_init(grf,cninit) },
64#endif 69#endif
65#if NAMIDISPLAYCC > 0 70#if NAMIDISPLAYCC > 0
66 cons_init(amidisplaycc_), 71 cons_init(amidisplaycc_),
67#endif 72#endif
68#if NITE > 0 73#if NITE > 0
69 cons_init(ite), 74 cons_init(ite),
70#endif 75#endif
71 { 0 }, 76 { 0 },
72}; 77};

cvs diff -r1.69 -r1.70 src/sys/arch/amiga/conf/WSCONS (switch to unified diff)

--- src/sys/arch/amiga/conf/WSCONS 2015/11/16 21:25:34 1.69
+++ src/sys/arch/amiga/conf/WSCONS 2016/10/03 14:26:02 1.70
@@ -1,61 +1,65 @@ @@ -1,61 +1,65 @@
1# $NetBSD: WSCONS,v 1.69 2015/11/16 21:25:34 phx Exp $ 1# $NetBSD: WSCONS,v 1.70 2016/10/03 14:26:02 rkujawa Exp $
2 2
3# GENERIC with wscons(4) 3# GENERIC with wscons(4)
4# 4#
5include "arch/amiga/conf/GENERIC" 5include "arch/amiga/conf/GENERIC"
6 6
7# wscons(4)-aware interface to amiga custom chips. 7# wscons(4)-aware interface to amiga custom chips.
8# 8#
9options WSEMUL_VT100 9options WSEMUL_VT100
10options WSDISPLAY_COMPAT_USL # wsconscfg VT handling 10options WSDISPLAY_COMPAT_USL # wsconscfg VT handling
11options FONT_VT220L8x10 11options FONT_VT220L8x10
12options FONT_VT220ISO8x16 12options FONT_VT220ISO8x16
13 13
14wskbd0 at kbd0 console ? 14wskbd0 at kbd0 console ?
15 15
16ukbd* at uhidev? reportid ?  16ukbd* at uhidev? reportid ?
17wskbd* at ukbd? console ? 17wskbd* at ukbd? console ?
18 18
19wsmouse* at ms? 19wsmouse* at ms?
20 20
21ums* at uhidev? reportid ?  21ums* at uhidev? reportid ?
22wsmouse* at ums? 22wsmouse* at ums?
23 23
24amidisplaycc0 at mainbus0 # wscons interface to custom chips 24amidisplaycc0 at mainbus0 # wscons interface to custom chips
25 25
26# Disable grf(4) devices without wsdisplay support. 26# Disable grf(4) devices without wsdisplay support.
27no grfcc0 at mainbus0 27no grfcc0 at mainbus0
28no grfrt0 at zbus0 28no grfrt0 at zbus0
29no grfrh0 at zbus0 29no grfrh0 at zbus0
30no grful0 at zbus0 30no grful0 at zbus0
31no grfet* at zbus0 31no grfet* at zbus0
32no grf0 at grfcc0 32no grf0 at grfcc0
33no grf1 at grfrt0 33no grf1 at grfrt0
34no grf2 at grfrh0 34no grf2 at grfrh0
35no grf4 at grful0 35no grf4 at grful0
36no grf6 at grfet? 36no grf6 at grfet?
37 37
38# Disable ite(4) for all grf(4) drivers. 38# Disable ite(4) for all grf(4) drivers.
39no ite0 at grf0 39no ite0 at grf0
40no ite1 at grf1 40no ite1 at grf1
41no ite2 at grf2 41no ite2 at grf2
42no ite3 at grf3 42no ite3 at grf3
43no ite4 at grf4 43no ite4 at grf4
44no ite5 at grf5 44no ite5 at grf5
45no ite6 at grf6 45no ite6 at grf6
46no ite7 at grf7 46no ite7 at grf7
47 47
 48mntva* at zbus? # MNTMN VA2000
 49#options MNTVA_CONSOLE
 50
48# PCI framebuffers 51# PCI framebuffers
49#genfb* at pci? # CyberVisionPPC/BlizzardVisionPPC only 52#genfb* at pci? # CyberVisionPPC/BlizzardVisionPPC only
50voodoofb* at pci? # 3Dfx Voodoo 3 in G-REX  53voodoofb* at pci? # 3Dfx Voodoo 3 in G-REX
51#radeonfb* at pci? # untested 54#radeonfb* at pci? # untested
52 55
53# Console support for CyberVisionPPC, BlizzardVisionPPC and 3Dfx Voodoo 3 in  56# Console support for CyberVisionPPC, BlizzardVisionPPC and 3Dfx Voodoo 3 in
54# G-REX. 57# G-REX.
55#options P5PB_CONSOLE 58#options P5PB_CONSOLE
56 59
57wsdisplay0 at wsemuldisplaydev? console 1 60wsdisplay0 at wsemuldisplaydev? console 1
58wsdisplay* at wsemuldisplaydev? console ? 61wsdisplay* at wsemuldisplaydev? console ?
59 62
60pseudo-device wsfont # wsfont(4) dynamic font loading support 63pseudo-device wsfont # wsfont(4) dynamic font loading support
61pseudo-device wsmux # mouse & keyboard multiplexor 64pseudo-device wsmux # mouse & keyboard multiplexor
 65

cvs diff -r1.177 -r1.178 src/sys/arch/amiga/conf/files.amiga (switch to unified diff)

--- src/sys/arch/amiga/conf/files.amiga 2015/03/04 19:10:20 1.177
+++ src/sys/arch/amiga/conf/files.amiga 2016/10/03 14:26:02 1.178
@@ -1,599 +1,606 @@ @@ -1,599 +1,606 @@
1# $NetBSD: files.amiga,v 1.177 2015/03/04 19:10:20 mlelstv Exp $ 1# $NetBSD: files.amiga,v 1.178 2016/10/03 14:26:02 rkujawa Exp $
2 2
3# maxpartitions must be first item in files.${ARCH}.newconf 3# maxpartitions must be first item in files.${ARCH}.newconf
4maxpartitions 16 # NOTE THAT AMIGA IS SPECIAL! 4maxpartitions 16 # NOTE THAT AMIGA IS SPECIAL!
5 5
6defflag opt_m060sp.h M060SP 6defflag opt_m060sp.h M060SP
7defflag PANICBUTTON # panic on kbd NMI if not DDB 7defflag PANICBUTTON # panic on kbd NMI if not DDB
8 8
9maxusers 2 8 64 9maxusers 2 8 64
10 10
11defflag opt_amigaccgrf.h GRF_NTSC 11defflag opt_amigaccgrf.h GRF_NTSC
12defflag opt_amigaccgrf.h GRF_PAL :GRF_NTSC # temporary workaround 12defflag opt_amigaccgrf.h GRF_PAL :GRF_NTSC # temporary workaround
13defflag opt_amigaccgrf.h GRF_ECS GRF_AGA 13defflag opt_amigaccgrf.h GRF_ECS GRF_AGA
14defflag opt_amigaccgrf.h GRF_A2024:GRF_ECS 14defflag opt_amigaccgrf.h GRF_A2024:GRF_ECS
15defflag opt_amigaccgrf.h GRF_AGA_VGA:GRF_AGA 15defflag opt_amigaccgrf.h GRF_AGA_VGA:GRF_AGA
16defflag opt_amigaccgrf.h GRF_SUPER72:GRF_AGA 16defflag opt_amigaccgrf.h GRF_SUPER72:GRF_AGA
17defflag opt_amigaccgrf.h USE_C_BFOPS 17defflag opt_amigaccgrf.h USE_C_BFOPS
18 18
19defflag opt_amigacons.h RETINACONSOLE ULOWELLCONSOLE CL5426CONSOLE 19defflag opt_amigacons.h RETINACONSOLE ULOWELLCONSOLE CL5426CONSOLE
20defflag opt_amigacons.h CV64CONSOLE CV3DCONSOLE TSENGCONSOLE 20defflag opt_amigacons.h CV64CONSOLE CV3DCONSOLE TSENGCONSOLE
21defflag opt_amigacons.h SERCONSOLE 21defflag opt_amigacons.h SERCONSOLE
22 22
 23defflag opt_mntva.h MNTVA_CONSOLE
 24
23defflag opt_kfont.h KFONT_CONS_ISO8859_1 25defflag opt_kfont.h KFONT_CONS_ISO8859_1
24defflag opt_kfont.h KFONT_CONS_ISO8859_2 26defflag opt_kfont.h KFONT_CONS_ISO8859_2
25 27
26defparam opt_retina.h RH_MEMCLK 28defparam opt_retina.h RH_MEMCLK
27defflag opt_retina.h RH_64BIT_SPRITE RH_HARDWARECURSOR 29defflag opt_retina.h RH_64BIT_SPRITE RH_HARDWARECURSOR
28defflag opt_retina.h RETINA_SPEED_HACK 30defflag opt_retina.h RETINA_SPEED_HACK
29 31
30defflag BB060STUPIDROM 32defflag BB060STUPIDROM
31defflag P5PPC68KBOARD 33defflag P5PPC68KBOARD
32defflag LEV6_DEFER 34defflag LEV6_DEFER
33defflag DEVRELOAD 35defflag DEVRELOAD
34 36
35defflag opt_p5pb.h P5PB_DEBUG P5PB_CONSOLE 37defflag opt_p5pb.h P5PB_DEBUG P5PB_CONSOLE
36 38
37defparam IOBZCLOCK 39defparam IOBZCLOCK
38 40
39device mainbus {} 41device mainbus {}
40attach mainbus at root 42attach mainbus at root
41 43
42device cpu 44device cpu
43attach cpu at mainbus 45attach cpu at mainbus
44 46
45# for bus_space 47# for bus_space
46define amibus_bl 48define amibus_bl
47file arch/amiga/amiga/amiga_bus_simple_4.c 49file arch/amiga/amiga/amiga_bus_simple_4.c
48 50
49define amibus_ww 51define amibus_ww
50file arch/amiga/amiga/amiga_bus_simple_2word.c 52file arch/amiga/amiga/amiga_bus_simple_2word.c
51 53
52define amibus_wb 54define amibus_wb
53file arch/amiga/amiga/amiga_bus_simple_1word.c 55file arch/amiga/amiga/amiga_bus_simple_1word.c
54 56
55define amibus_b16 57define amibus_b16
56file arch/amiga/amiga/amiga_bus_simple_16.c amibus_b16 58file arch/amiga/amiga/amiga_bus_simple_16.c amibus_b16
57 59
58define amibus_b800 60define amibus_b800
59file arch/amiga/amiga/amiga_bus_simple_0x800.c amibus_b800 61file arch/amiga/amiga/amiga_bus_simple_0x800.c amibus_b800
60 62
61define amibus_b1000 63define amibus_b1000
62file arch/amiga/amiga/amiga_bus_simple_0x1000.c amibus_b1000 64file arch/amiga/amiga/amiga_bus_simple_0x1000.c amibus_b1000
63 65
64define amibus_b4000 66define amibus_b4000
65file arch/amiga/amiga/amiga_bus_simple_0x4000.c amibus_b4000 67file arch/amiga/amiga/amiga_bus_simple_0x4000.c amibus_b4000
66 68
67define amibus_empb 69define amibus_empb
68file arch/amiga/pci/empb_bsm.c amibus_empb 70file arch/amiga/pci/empb_bsm.c amibus_empb
69 71
70file arch/amiga/amiga/bus.c 72file arch/amiga/amiga/bus.c
71 73
72# zorro expansion bus. 74# zorro expansion bus.
73device zbus {} 75device zbus {}
74attach zbus at mainbus 76attach zbus at mainbus
75file arch/amiga/dev/zbus.c zbus 77file arch/amiga/dev/zbus.c zbus
76 78
77define event {} 79define event {}
78file arch/amiga/dev/event.c event 80file arch/amiga/dev/event.c event
79 81
80device clock 82device clock
81attach clock at mainbus 83attach clock at mainbus
82file arch/amiga/dev/clock.c 84file arch/amiga/dev/clock.c
83 85
84# A2000 internal hwc 86# A2000 internal hwc
85device a2kbbc: msm6242b 87device a2kbbc: msm6242b
86attach a2kbbc at mainbus 88attach a2kbbc at mainbus
87file arch/amiga/dev/a2kbbc.c a2kbbc 89file arch/amiga/dev/a2kbbc.c a2kbbc
88 90
89# A3000/4000 internal hwc 91# A3000/4000 internal hwc
90device a34kbbc 92device a34kbbc
91attach a34kbbc at mainbus 93attach a34kbbc at mainbus
92file arch/amiga/dev/a34kbbc.c a34kbbc 94file arch/amiga/dev/a34kbbc.c a34kbbc
93 95
94# keyboard 96# keyboard
95device kbd: event,wskbddev 97device kbd: event,wskbddev
96attach kbd at mainbus 98attach kbd at mainbus
97file arch/amiga/dev/kbd.c kbd needs-flag 99file arch/amiga/dev/kbd.c kbd needs-flag
98file arch/amiga/dev/wskbdmap_amiga.c kbd 100file arch/amiga/dev/wskbdmap_amiga.c kbd
99 101
100# serial port 102# serial port
101device ser: tty 103device ser: tty
102attach ser at mainbus 104attach ser at mainbus
103file arch/amiga/dev/ser.c ser needs-count 105file arch/amiga/dev/ser.c ser needs-count
104 106
105# parallel port 107# parallel port
106device par 108device par
107attach par at mainbus 109attach par at mainbus
108file arch/amiga/dev/par.c par needs-count 110file arch/amiga/dev/par.c par needs-count
109 111
110# audio 112# audio
111device aucc: audiobus 113device aucc: audiobus
112attach aucc at mainbus 114attach aucc at mainbus
113file arch/amiga/dev/aucc.c aucc needs-flag 115file arch/amiga/dev/aucc.c aucc needs-flag
114 116
115device melody: audiobus, tms320av110 117device melody: audiobus, tms320av110
116attach melody at zbus 118attach melody at zbus
117file arch/amiga/dev/melody.c melody 119file arch/amiga/dev/melody.c melody
118 120
119device repulse: audiobus, ac97, mulaw 121device repulse: audiobus, ac97, mulaw
120attach repulse at zbus 122attach repulse at zbus
121file arch/amiga/dev/repulse.c repulse 123file arch/amiga/dev/repulse.c repulse
122 124
123device toccata: audiobus, ad1848, auconv 125device toccata: audiobus, ad1848, auconv
124attach toccata at zbus 126attach toccata at zbus
125file arch/amiga/dev/toccata.c toccata 127file arch/amiga/dev/toccata.c toccata
126 128
127# mouse 129# mouse
128device ms: event, wsmousedev 130device ms: event, wsmousedev
129attach ms at mainbus 131attach ms at mainbus
130file arch/amiga/dev/ms.c ms needs-flag 132file arch/amiga/dev/ms.c ms needs-flag
131 133
132# floppy 134# floppy
133device fdc { unit = -1 } 135device fdc { unit = -1 }
134attach fdc at mainbus 136attach fdc at mainbus
135 137
136device fd: disk 138device fd: disk
137attach fd at fdc 139attach fd at fdc
138file arch/amiga/dev/fd.c fd needs-flag 140file arch/amiga/dev/fd.c fd needs-flag
139 141
140# graphic devices 142# graphic devices
141define grfbus {} 143define grfbus {}
142 144
143device grf {}: wsemuldisplaydev, vcons 145device grf {}: wsemuldisplaydev, vcons
144attach grf at grfbus 146attach grf at grfbus
145file arch/amiga/dev/grf.c grf needs-count 147file arch/amiga/dev/grf.c grf needs-count
146 148
147device ite: tty 149device ite: tty
148attach ite at grf 150attach ite at grf
149file arch/amiga/dev/ite.c ite needs-flag 151file arch/amiga/dev/ite.c ite needs-flag
150file arch/amiga/dev/kbdmap.c ite 152file arch/amiga/dev/kbdmap.c ite
151file arch/amiga/dev/kf_custom.c kfont_custom 153file arch/amiga/dev/kf_custom.c kfont_custom
152file arch/amiga/dev/kf_iso8859_1_8x8.c kfont_cons_iso8859_1 & 154file arch/amiga/dev/kf_iso8859_1_8x8.c kfont_cons_iso8859_1 &
153 ( ite | wsdisplay) 155 ( ite | wsdisplay)
154file arch/amiga/dev/kf_iso8859_1_8x11.c kfont_cons_iso8859_1 & 156file arch/amiga/dev/kf_iso8859_1_8x11.c kfont_cons_iso8859_1 &
155 kfont_8x11 157 kfont_8x11
156file arch/amiga/dev/kf_iso8859_2_8x8.c kfont_cons_iso8859_2 & 158file arch/amiga/dev/kf_iso8859_2_8x8.c kfont_cons_iso8859_2 &
157 ( ite | wsdisplay ) 159 ( ite | wsdisplay )
158file arch/amiga/dev/kf_iso8859_2_8x11.c kfont_cons_iso8859_2 & 160file arch/amiga/dev/kf_iso8859_2_8x11.c kfont_cons_iso8859_2 &
159 kfont_8x11 161 kfont_8x11
160 162
161# custom chips grf (ite0 grf0) 163# custom chips grf (ite0 grf0)
162device grfcc: grfbus 164device grfcc: grfbus
163attach grfcc at mainbus 165attach grfcc at mainbus
164file arch/amiga/dev/grf_cc.c grfcc needs-flag 166file arch/amiga/dev/grf_cc.c grfcc needs-flag
165file arch/amiga/dev/ite_cc.c grfcc & ite 167file arch/amiga/dev/ite_cc.c grfcc & ite
166 168
167# wscons interface to custom chips 169# wscons interface to custom chips
168device amidisplaycc: wsemuldisplaydev, vcons 170device amidisplaycc: wsemuldisplaydev, vcons
169attach amidisplaycc at mainbus 171attach amidisplaycc at mainbus
170file arch/amiga/dev/amidisplaycc.c amidisplaycc needs-flag 172file arch/amiga/dev/amidisplaycc.c amidisplaycc needs-flag
171 173
172defpseudo view 174defpseudo view
173file arch/amiga/dev/view.c view | grfcc needs-count 175file arch/amiga/dev/view.c view | grfcc needs-count
174file arch/amiga/dev/grfabs.c grfcc | view | amidisplaycc 176file arch/amiga/dev/grfabs.c grfcc | view | amidisplaycc
175file arch/amiga/dev/grfabs_cc.c grfcc | view | amidisplaycc 177file arch/amiga/dev/grfabs_cc.c grfcc | view | amidisplaycc
176file arch/amiga/dev/grfabs_ccglb.c grfcc | view | amidisplaycc 178file arch/amiga/dev/grfabs_ccglb.c grfcc | view | amidisplaycc
177 179
178# retina ZII grf (ite1 grf1) 180# retina ZII grf (ite1 grf1)
179device grfrt: grfbus 181device grfrt: grfbus
180attach grfrt at zbus 182attach grfrt at zbus
181file arch/amiga/dev/grf_rt.c grfrt needs-flag 183file arch/amiga/dev/grf_rt.c grfrt needs-flag
182file arch/amiga/dev/ite_rt.c grfrt & ite 184file arch/amiga/dev/ite_rt.c grfrt & ite
183 185
184# retina ZIII grf (ite2 grf2) 186# retina ZIII grf (ite2 grf2)
185device grfrh: grfbus 187device grfrh: grfbus
186attach grfrh at zbus 188attach grfrh at zbus
187file arch/amiga/dev/grf_rh.c grfrh needs-flag 189file arch/amiga/dev/grf_rh.c grfrh needs-flag
188file arch/amiga/dev/ite_rh.c grfrh & ite 190file arch/amiga/dev/ite_rh.c grfrh & ite
189 191
190# cirrus grf (ite3 grf3) 192# cirrus grf (ite3 grf3)
191device grfcl: grfbus 193device grfcl: grfbus
192attach grfcl at zbus 194attach grfcl at zbus
193file arch/amiga/dev/grf_cl.c grfcl needs-flag 195file arch/amiga/dev/grf_cl.c grfcl needs-flag
194file arch/amiga/dev/ite_cl.c grfcl & ite 196file arch/amiga/dev/ite_cl.c grfcl & ite
195 197
196# A2410 grf (ite4 grf4) 198# A2410 grf (ite4 grf4)
197device grful: grfbus 199device grful: grfbus
198attach grful at zbus 200attach grful at zbus
199file arch/amiga/dev/grf_ul.c grful needs-flag 201file arch/amiga/dev/grf_ul.c grful needs-flag
200file arch/amiga/dev/ite_ul.c grful & ite 202file arch/amiga/dev/ite_ul.c grful & ite
201file arch/amiga/dev/grf_ultms.c grful 203file arch/amiga/dev/grf_ultms.c grful
202 204
203# CyberVison 64 grf (ite5 grf5) 205# CyberVison 64 grf (ite5 grf5)
204device grfcv: grfbus 206device grfcv: grfbus
205attach grfcv at zbus 207attach grfcv at zbus
206file arch/amiga/dev/grf_cv.c grfcv needs-flag 208file arch/amiga/dev/grf_cv.c grfcv needs-flag
207file arch/amiga/dev/ite_cv.c grfcv & ite 209file arch/amiga/dev/ite_cv.c grfcv & ite
208 210
209# Tseng grf (ite6 grf6) 211# Tseng grf (ite6 grf6)
210device grfet: grfbus 212device grfet: grfbus
211attach grfet at zbus 213attach grfet at zbus
212file arch/amiga/dev/grf_et.c grfet needs-flag 214file arch/amiga/dev/grf_et.c grfet needs-flag
213file arch/amiga/dev/ite_et.c grfet & ite 215file arch/amiga/dev/ite_et.c grfet & ite
214 216
215# CyberVison 64/3D grf (ite7 grf7) 217# CyberVison 64/3D grf (ite7 grf7)
216device grfcv3d: grfbus 218device grfcv3d: grfbus
217attach grfcv3d at zbus 219attach grfcv3d at zbus
218file arch/amiga/dev/grf_cv3d.c grfcv3d needs-flag 220file arch/amiga/dev/grf_cv3d.c grfcv3d needs-flag
219file arch/amiga/dev/ite_cv3d.c grfcv3d & ite 221file arch/amiga/dev/ite_cv3d.c grfcv3d & ite
220 222
 223# MNT VA2000
 224device mntva: wsemuldisplaydev, rasops16, rasops32, vcons, videomode
 225attach mntva at zbus
 226file arch/amiga/dev/mntva.c mntva needs-flag
 227
221# device defined in sys/conf/files 228# device defined in sys/conf/files
222# A2065, Ameristar, Ariadne ethernet cards 229# A2065, Ameristar, Ariadne ethernet cards
223attach le at zbus with le_zbus: le24 230attach le at zbus with le_zbus: le24
224file arch/amiga/dev/if_le.c le_zbus needs-flag 231file arch/amiga/dev/if_le.c le_zbus needs-flag
225 232
226# AriadneII ethernet card 233# AriadneII ethernet card
227# device defined in sys/conf/files 234# device defined in sys/conf/files
228attach ne at zbus with ne_zbus: rtl80x9 235attach ne at zbus with ne_zbus: rtl80x9
229file arch/amiga/dev/if_ne_zbus.c ne_zbus needs-flag 236file arch/amiga/dev/if_ne_zbus.c ne_zbus needs-flag
230 237
231# X-Surf 238# X-Surf
232define xsurfbus {} 239define xsurfbus {}
233 240
234device xsurf: xsurfbus  241device xsurf: xsurfbus
235attach xsurf at zbus 242attach xsurf at zbus
236file arch/amiga/dev/xsurf.c xsurf needs-flag 243file arch/amiga/dev/xsurf.c xsurf needs-flag
237 244
238attach ne at xsurfbus with ne_xsurf: rtl80x9 245attach ne at xsurfbus with ne_xsurf: rtl80x9
239file arch/amiga/dev/if_ne_xsurf.c ne_xsurf needs-flag 246file arch/amiga/dev/if_ne_xsurf.c ne_xsurf needs-flag
240 247
241attach wdc at xsurfbus with wdc_xsurf 248attach wdc at xsurfbus with wdc_xsurf
242file arch/amiga/dev/wdc_xsurf.c wdc_xsurf & xsurf 249file arch/amiga/dev/wdc_xsurf.c wdc_xsurf & xsurf
243 250
244define xshbus {} 251define xshbus {}
245 252
246device xsh: xshbus 253device xsh: xshbus
247attach xsh at zbus 254attach xsh at zbus
248file arch/amiga/dev/xsh.c xsh needs-flag 255file arch/amiga/dev/xsh.c xsh needs-flag
249 256
250attach ne at xshbus with ne_xsh: ax88190 257attach ne at xshbus with ne_xsh: ax88190
251file arch/amiga/dev/if_ne_xsh.c ne_xsh needs-flag 258file arch/amiga/dev/if_ne_xsh.c ne_xsh needs-flag
252 259
253# Hydra ethernet card 260# Hydra ethernet card
254device ed: ifnet, ether, arp 261device ed: ifnet, ether, arp
255attach ed at zbus with ed_zbus: dp8390nic 262attach ed at zbus with ed_zbus: dp8390nic
256file arch/amiga/dev/if_ed_zbus.c ed_zbus needs-flag 263file arch/amiga/dev/if_ed_zbus.c ed_zbus needs-flag
257 264
258# C=/Ameristar A2060 / 560 265# C=/Ameristar A2060 / 560
259attach bah at zbus with bah_zbus 266attach bah at zbus with bah_zbus
260file arch/amiga/dev/if_bah_zbus.c bah_zbus 267file arch/amiga/dev/if_bah_zbus.c bah_zbus
261 268
262# CEI A4066 EthernetPLUS 269# CEI A4066 EthernetPLUS
263device es: ifnet, ether, arp 270device es: ifnet, ether, arp
264attach es at zbus 271attach es at zbus
265file arch/amiga/dev/if_es.c es needs-flag 272file arch/amiga/dev/if_es.c es needs-flag
266 273
267# Quicknet ethernet card 274# Quicknet ethernet card
268device qn: ifnet, ether, arp 275device qn: ifnet, ether, arp
269attach qn at zbus 276attach qn at zbus
270file arch/amiga/dev/if_qn.c qn needs-flag 277file arch/amiga/dev/if_qn.c qn needs-flag
271 278
272# A2232 msc serial ports 279# A2232 msc serial ports
273device msc: tty 280device msc: tty
274attach msc at zbus 281attach msc at zbus
275file arch/amiga/dev/msc.c msc needs-count 282file arch/amiga/dev/msc.c msc needs-count
276 283
277# bsc/Alf Data MultiFaceCard 284# bsc/Alf Data MultiFaceCard
278device mfc { unit = -1 } 285device mfc { unit = -1 }
279attach mfc at zbus 286attach mfc at zbus
280 287
281device mfcs: tty 288device mfcs: tty
282attach mfcs at mfc 289attach mfcs at mfc
283device mfcp 290device mfcp
284attach mfcp at mfc 291attach mfcp at mfc
285file arch/amiga/dev/mfc.c mfcs | mfcp needs-count 292file arch/amiga/dev/mfc.c mfcs | mfcp needs-count
286 293
287# direct bus ISA-chip i/o 294# direct bus ISA-chip i/o
288define supio {port = -1} 295define supio {port = -1}
289 296
290# DraCo superio chip 297# DraCo superio chip
291 298
292device drsupio: supio 299device drsupio: supio
293attach drsupio at mainbus 300attach drsupio at mainbus
294file arch/amiga/dev/drsupio.c drsupio 301file arch/amiga/dev/drsupio.c drsupio
295 302
296# ZBus HyperComs: HyperCom Z3, HyperCom 4 303# ZBus HyperComs: HyperCom Z3, HyperCom 4
297device hyper: supio 304device hyper: supio
298attach hyper at zbus 305attach hyper at zbus
299file arch/amiga/dev/hyper.c hyper 306file arch/amiga/dev/hyper.c hyper
300 307
301# IOBlix 308# IOBlix
302device iobl: supio, amibus_b16 309device iobl: supio, amibus_b16
303attach iobl at zbus with iobl_zbus 310attach iobl at zbus with iobl_zbus
304file arch/amiga/dev/ioblix_zbus.c iobl_zbus 311file arch/amiga/dev/ioblix_zbus.c iobl_zbus
305 312
306 313
307attach com at supio with com_supio 314attach com at supio with com_supio
308file arch/amiga/dev/com_supio.c com_supio 315file arch/amiga/dev/com_supio.c com_supio
309 316
310# ISDN Blaster, ISDN Master 317# ISDN Blaster, ISDN Master
311device aster: supio 318device aster: supio
312attach aster at zbus 319attach aster at zbus
313file arch/amiga/dev/aster.c aster 320file arch/amiga/dev/aster.c aster
314 321
315attach isic at supio with isic_supio 322attach isic at supio with isic_supio
316file arch/amiga/dev/isic_supio.c isic_supio 323file arch/amiga/dev/isic_supio.c isic_supio
317 324
318# handle gvp's odd autoconf info.. 325# handle gvp's odd autoconf info..
319device gvpbus {} 326device gvpbus {}
320attach gvpbus at zbus 327attach gvpbus at zbus
321file arch/amiga/dev/gvpbus.c gvpbus 328file arch/amiga/dev/gvpbus.c gvpbus
322 329
323attach lpt at supio with lpt_supio 330attach lpt at supio with lpt_supio
324file arch/amiga/dev/lpt_supio.c lpt_supio 331file arch/amiga/dev/lpt_supio.c lpt_supio
325 332
326include "dev/scsipi/files.scsipi" 333include "dev/scsipi/files.scsipi"
327 334
328# wd 33c93 contrllers 335# wd 33c93 contrllers
329define sbic 336define sbic
330file arch/amiga/dev/sbic.c sbic 337file arch/amiga/dev/sbic.c sbic
331 338
332# GVP series II 339# GVP series II
333device gtsc: scsi, sbic 340device gtsc: scsi, sbic
334attach gtsc at gvpbus 341attach gtsc at gvpbus
335file arch/amiga/dev/gtsc.c gtsc needs-flag 342file arch/amiga/dev/gtsc.c gtsc needs-flag
336 343
337# Amiga 3000 internal 344# Amiga 3000 internal
338device ahsc: scsi, sbic 345device ahsc: scsi, sbic
339attach ahsc at mainbus 346attach ahsc at mainbus
340file arch/amiga/dev/ahsc.c ahsc needs-flag 347file arch/amiga/dev/ahsc.c ahsc needs-flag
341 348
342# C= A2091 349# C= A2091
343device atzsc: scsi, sbic 350device atzsc: scsi, sbic
344attach atzsc at zbus 351attach atzsc at zbus
345file arch/amiga/dev/atzsc.c atzsc needs-flag 352file arch/amiga/dev/atzsc.c atzsc needs-flag
346 353
347# ncr 5380 controllers 354# ncr 5380 controllers
348define sci 355define sci
349file arch/amiga/dev/sci.c sci 356file arch/amiga/dev/sci.c sci
350 357
351# Supra Wordsync II 358# Supra Wordsync II
352device wstsc: scsi, sci 359device wstsc: scsi, sci
353attach wstsc at zbus 360attach wstsc at zbus
354file arch/amiga/dev/wstsc.c wstsc needs-flag 361file arch/amiga/dev/wstsc.c wstsc needs-flag
355 362
356# IVS 363# IVS
357device ivsc: scsi, sci 364device ivsc: scsi, sci
358attach ivsc at zbus 365attach ivsc at zbus
359file arch/amiga/dev/ivsc.c ivsc needs-flag 366file arch/amiga/dev/ivsc.c ivsc needs-flag
360 367
361# MLH 368# MLH
362device mlhsc: scsi, sci 369device mlhsc: scsi, sci
363attach mlhsc at zbus 370attach mlhsc at zbus
364file arch/amiga/dev/mlhsc.c mlhsc needs-flag 371file arch/amiga/dev/mlhsc.c mlhsc needs-flag
365 372
366# CSA twelve gauge. 373# CSA twelve gauge.
367device otgsc: scsi, sci 374device otgsc: scsi, sci
368attach otgsc at zbus 375attach otgsc at zbus
369file arch/amiga/dev/otgsc.c otgsc needs-flag 376file arch/amiga/dev/otgsc.c otgsc needs-flag
370 377
371# ncr 57c710 controllers 378# ncr 57c710 controllers
372define asiop 379define asiop
373file arch/amiga/dev/siop.c asiop 380file arch/amiga/dev/siop.c asiop
374 381
375# PPI Zeus 382# PPI Zeus
376device zssc: scsi, asiop 383device zssc: scsi, asiop
377attach zssc at zbus 384attach zssc at zbus
378file arch/amiga/dev/zssc.c zssc needs-flag 385file arch/amiga/dev/zssc.c zssc needs-flag
379 386
380# CSA Magnum 387# CSA Magnum
381device mgnsc: scsi, asiop 388device mgnsc: scsi, asiop
382attach mgnsc at zbus 389attach mgnsc at zbus
383file arch/amiga/dev/mgnsc.c mgnsc needs-flag 390file arch/amiga/dev/mgnsc.c mgnsc needs-flag
384 391
385# MacroSystems USA Warp Engine 392# MacroSystems USA Warp Engine
386device wesc: scsi, asiop 393device wesc: scsi, asiop
387attach wesc at zbus 394attach wesc at zbus
388file arch/amiga/dev/wesc.c wesc needs-flag 395file arch/amiga/dev/wesc.c wesc needs-flag
389 396
390# C= A4091 & A4000T 397# C= A4091 & A4000T
391device afsc: scsi, asiop 398device afsc: scsi, asiop
392attach afsc at zbus 399attach afsc at zbus
393device aftsc: scsi, asiop 400device aftsc: scsi, asiop
394attach aftsc at mainbus 401attach aftsc at mainbus
395file arch/amiga/dev/afsc.c afsc | aftsc needs-flag 402file arch/amiga/dev/afsc.c afsc | aftsc needs-flag
396 403
397# ncr 57c720/770 controllers 404# ncr 57c720/770 controllers
398define siopng 405define siopng
399file arch/amiga/dev/siop2.c siopng 406file arch/amiga/dev/siop2.c siopng
400 407
401# Emulex ESP216 & FAS216 controllers 408# Emulex ESP216 & FAS216 controllers
402 409
403# FastlaneZ3 410# FastlaneZ3
404device flsc: scsi, ncr53c9x 411device flsc: scsi, ncr53c9x
405attach flsc at zbus 412attach flsc at zbus
406file arch/amiga/dev/flsc.c flsc needs-flag 413file arch/amiga/dev/flsc.c flsc needs-flag
407 414
408# Blizzard1230-I,II 415# Blizzard1230-I,II
409device bzsc: scsi, ncr53c9x 416device bzsc: scsi, ncr53c9x
410attach bzsc at zbus 417attach bzsc at zbus
411file arch/amiga/dev/bzsc.c bzsc needs-flag 418file arch/amiga/dev/bzsc.c bzsc needs-flag
412 419
413# Blizzard12x0-IV 420# Blizzard12x0-IV
414device bzivsc: scsi, ncr53c9x 421device bzivsc: scsi, ncr53c9x
415attach bzivsc at zbus 422attach bzivsc at zbus
416file arch/amiga/dev/bzivsc.c bzivsc needs-flag 423file arch/amiga/dev/bzivsc.c bzivsc needs-flag
417 424
418# Blizzard2060 scsi 425# Blizzard2060 scsi
419device bztzsc: scsi, ncr53c9x 426device bztzsc: scsi, ncr53c9x
420attach bztzsc at zbus 427attach bztzsc at zbus
421file arch/amiga/dev/bztzsc.c bztzsc needs-flag 428file arch/amiga/dev/bztzsc.c bztzsc needs-flag
422 429
423# CyberSCSI [I] scsi 430# CyberSCSI [I] scsi
424device cbsc: scsi, ncr53c9x 431device cbsc: scsi, ncr53c9x
425attach cbsc at zbus 432attach cbsc at zbus
426file arch/amiga/dev/cbsc.c cbsc needs-flag 433file arch/amiga/dev/cbsc.c cbsc needs-flag
427 434
428# CyberSCSI MKII scsi 435# CyberSCSI MKII scsi
429device cbiisc: scsi, ncr53c9x 436device cbiisc: scsi, ncr53c9x
430attach cbiisc at zbus 437attach cbiisc at zbus
431file arch/amiga/dev/cbiisc.c cbiisc needs-flag 438file arch/amiga/dev/cbiisc.c cbiisc needs-flag
432 439
433# EMPLANT 440# EMPLANT
434device empsc: scsi, sci 441device empsc: scsi, sci
435attach empsc at zbus 442attach empsc at zbus
436file arch/amiga/dev/empsc.c empsc needs-flag 443file arch/amiga/dev/empsc.c empsc needs-flag
437 444
438# MacroSystem DraCo internal 445# MacroSystem DraCo internal
439device drsc: scsi, asiop 446device drsc: scsi, asiop
440attach drsc at mainbus 447attach drsc at mainbus
441file arch/amiga/dev/drsc.c drsc needs-flag 448file arch/amiga/dev/drsc.c drsc needs-flag
442 449
443# MacroSystem DraCo internal DS2404 hwc 450# MacroSystem DraCo internal DS2404 hwc
444device drbbc 451device drbbc
445attach drbbc at mainbus 452attach drbbc at mainbus
446file arch/amiga/dev/drbbc.c drbbc 453file arch/amiga/dev/drbbc.c drbbc
447 454
448# kernel floating point emulator 455# kernel floating point emulator
449include "arch/m68k/fpe/files.fpe" 456include "arch/m68k/fpe/files.fpe"
450 457
451# Motorola 68060 support package 458# Motorola 68060 support package
452include "arch/m68k/060sp/files.060sp" 459include "arch/m68k/060sp/files.060sp"
453 460
454# list of standard files... 461# list of standard files...
455 462
456file dev/cons.c 463file dev/cons.c
457file dev/cninit.c 464file dev/cninit.c
458file arch/amiga/amiga/amiga_init.c 465file arch/amiga/amiga/amiga_init.c
459file arch/amiga/amiga/autoconf.c 466file arch/amiga/amiga/autoconf.c
460file arch/amiga/amiga/cia.c 467file arch/amiga/amiga/cia.c
461file arch/amiga/amiga/conf.c 468file arch/amiga/amiga/conf.c
462file arch/amiga/amiga/disksubr.c 469file arch/amiga/amiga/disksubr.c
463file arch/amiga/amiga/dkbad.c 470file arch/amiga/amiga/dkbad.c
464file arch/amiga/amiga/machdep.c 471file arch/amiga/amiga/machdep.c
465file arch/amiga/amiga/pmap_bootstrap.c 472file arch/amiga/amiga/pmap_bootstrap.c
466file arch/amiga/amiga/trap.c 473file arch/amiga/amiga/trap.c
467file arch/amiga/amiga/cc.c 474file arch/amiga/amiga/cc.c
468file dev/md_root.c memory_disk_hooks 475file dev/md_root.c memory_disk_hooks
469file arch/m68k/m68k/cacheops.c 476file arch/m68k/m68k/cacheops.c
470file arch/m68k/m68k/db_memrw.c ddb 477file arch/m68k/m68k/db_memrw.c ddb
471file arch/m68k/m68k/pmap_motorola.c 478file arch/m68k/m68k/pmap_motorola.c
472file arch/m68k/m68k/procfs_machdep.c procfs 479file arch/m68k/m68k/procfs_machdep.c procfs
473file arch/m68k/m68k/sys_machdep.c 480file arch/m68k/m68k/sys_machdep.c
474file arch/m68k/m68k/vm_machdep.c 481file arch/m68k/m68k/vm_machdep.c
475file arch/m68k/m68k/bus_dma.c 482file arch/m68k/m68k/bus_dma.c
476 483
477define gayle 484define gayle
478file arch/amiga/amiga/gayle.c gayle 485file arch/amiga/amiga/gayle.c gayle
479 486
480file arch/amiga/dev/gayle_pcmcia.c pccard 487file arch/amiga/dev/gayle_pcmcia.c pccard
481device pccard: pcmciabus, gayle 488device pccard: pcmciabus, gayle
482attach pccard at mainbus 489attach pccard at mainbus
483 490
484include "dev/pcmcia/files.pcmcia" 491include "dev/pcmcia/files.pcmcia"
485 492
486include "dev/ata/files.ata" 493include "dev/ata/files.ata"
487 494
488# Amiga 4000/1200 IDE using MI wdc 495# Amiga 4000/1200 IDE using MI wdc
489attach wdc at mainbus with wdc_amiga: gayle, amibus_b1000 496attach wdc at mainbus with wdc_amiga: gayle, amibus_b1000
490file arch/amiga/dev/wdc_amiga.c wdc_amiga 497file arch/amiga/dev/wdc_amiga.c wdc_amiga
491 498
492# Buddha wdc 499# Buddha wdc
493attach wdc at zbus with wdc_buddha 500attach wdc at zbus with wdc_buddha
494file arch/amiga/dev/wdc_buddha.c wdc_buddha 501file arch/amiga/dev/wdc_buddha.c wdc_buddha
495 502
496# FastATA  503# FastATA
497device efa: ata, wdc_common, amibus_b1000 504device efa: ata, wdc_common, amibus_b1000
498attach efa at mainbus 505attach efa at mainbus
499file arch/amiga/dev/efa.c efa 506file arch/amiga/dev/efa.c efa
500 507
501# Compatibility modules 508# Compatibility modules
502 509
503# NetBSD m68k a.out Binary Compatibility (COMPAT_AOUT_M68K) 510# NetBSD m68k a.out Binary Compatibility (COMPAT_AOUT_M68K)
504include "compat/aoutm68k/files.aoutm68k" 511include "compat/aoutm68k/files.aoutm68k"
505 512
506# SunOS Binary Compatibility (COMPAT_SUNOS) 513# SunOS Binary Compatibility (COMPAT_SUNOS)
507include "compat/sunos/files.sunos" 514include "compat/sunos/files.sunos"
508file arch/m68k/m68k/sunos_machdep.c compat_sunos 515file arch/m68k/m68k/sunos_machdep.c compat_sunos
509 516
510# SVR4 Binary Compatibility (COMPAT_SVR4) 517# SVR4 Binary Compatibility (COMPAT_SVR4)
511include "compat/svr4/files.svr4" 518include "compat/svr4/files.svr4"
512 519
513# Linux binary compatibility (COMPAT_LINUX) 520# Linux binary compatibility (COMPAT_LINUX)
514include "compat/linux/files.linux" 521include "compat/linux/files.linux"
515include "compat/linux/arch/m68k/files.linux_m68k" 522include "compat/linux/arch/m68k/files.linux_m68k"
516file arch/m68k/m68k/linux_trap.c compat_linux 523file arch/m68k/m68k/linux_trap.c compat_linux
517 524
518# OSS audio driver compatibility 525# OSS audio driver compatibility
519include "compat/ossaudio/files.ossaudio" 526include "compat/ossaudio/files.ossaudio"
520 527
521# Bluetooth stack 528# Bluetooth stack
522include "dev/bluetooth/files.bluetooth" 529include "dev/bluetooth/files.bluetooth"
523 530
524# USB stack 531# USB stack
525include "dev/usb/files.usb" 532include "dev/usb/files.usb"
526 533
527# Phase5 BPPC/CSPPC internal bus 534# Phase5 BPPC/CSPPC internal bus
528device p5bus {} 535device p5bus {}
529attach p5bus at zbus 536attach p5bus at zbus
530file arch/amiga/dev/p5bus.c p5bus 537file arch/amiga/dev/p5bus.c p5bus
531 538
532device p5membar {} 539device p5membar {}
533attach p5membar at zbus 540attach p5membar at zbus
534file arch/amiga/pci/p5membar.c p5membar 541file arch/amiga/pci/p5membar.c p5membar
535 542
536# CyberStorm MKIII scsi 543# CyberStorm MKIII scsi
537device cbiiisc: scsi, siopng 544device cbiiisc: scsi, siopng
538attach cbiiisc at p5bus  545attach cbiiisc at p5bus
539file arch/amiga/dev/cbiiisc.c cbiiisc needs-flag 546file arch/amiga/dev/cbiiisc.c cbiiisc needs-flag
540 547
541# Phase5 Blizzard 603e+ SCSI 548# Phase5 Blizzard 603e+ SCSI
542device bppcsc: scsi, asiop 549device bppcsc: scsi, asiop
543attach bppcsc at p5bus  550attach bppcsc at p5bus
544file arch/amiga/dev/bppcsc.c bppcsc needs-flag 551file arch/amiga/dev/bppcsc.c bppcsc needs-flag
545 552
546# PCI bus 553# PCI bus
547file arch/amiga/pci/pci_machdep.c pci 554file arch/amiga/pci/pci_machdep.c pci
548 555
549device p5pb: pcibus 556device p5pb: pcibus
550attach p5pb at p5bus  557attach p5pb at p5bus
551file arch/amiga/pci/p5pb.c p5pb & pci 558file arch/amiga/pci/p5pb.c p5pb & pci
552 559
553device mppb: pcibus 560device mppb: pcibus
554attach mppb at zbus 561attach mppb at zbus
555file arch/amiga/pci/mppb.c mppb & pci 562file arch/amiga/pci/mppb.c mppb & pci
556 563
557device cv3dpb: pcibus 564device cv3dpb: pcibus
558attach cv3dpb at zbus 565attach cv3dpb at zbus
559file arch/amiga/pci/cv3dpb.c cv3dpb & pci 566file arch/amiga/pci/cv3dpb.c cv3dpb & pci
560 567
561define empmdev { } 568define empmdev { }
562device empm 569device empm
563attach empm at empmdev 570attach empm at empmdev
564file arch/amiga/pci/empm.c empm needs-flag 571file arch/amiga/pci/empm.c empm needs-flag
565 572
566device empb: pcibus, amibus_empb, empmdev 573device empb: pcibus, amibus_empb, empmdev
567attach empb at zbus 574attach empb at zbus
568file arch/amiga/pci/empb.c empb & pci & empm 575file arch/amiga/pci/empb.c empb & pci & empm
569 576
570device em4k: pcibus 577device em4k: pcibus
571attach em4k at zbus 578attach em4k at zbus
572file arch/amiga/pci/em4k.c em4k & pci 579file arch/amiga/pci/em4k.c em4k & pci
573 580
574device emmem {} 581device emmem {}
575attach emmem at zbus 582attach emmem at zbus
576file arch/amiga/pci/emmem.c emmem 583file arch/amiga/pci/emmem.c emmem
577 584
578include "dev/i2o/files.i2o" 585include "dev/i2o/files.i2o"
579include "dev/pci/files.pci" 586include "dev/pci/files.pci"
580 587
581device z3rambd: altmemdev 588device z3rambd: altmemdev
582attach z3rambd at zbus 589attach z3rambd at zbus
583file arch/amiga/dev/z3rambd.c z3rambd needs-flag 590file arch/amiga/dev/z3rambd.c z3rambd needs-flag
584 591
585attach slhci at zbus with slhci_zbus 592attach slhci at zbus with slhci_zbus
586file arch/amiga/dev/slhci_zbus.c slhci_zbus 593file arch/amiga/dev/slhci_zbus.c slhci_zbus
587 594
588define acafhbus {} 595define acafhbus {}
589 596
590device acafh: acafhbus, amibus_b4000 597device acafh: acafhbus, amibus_b4000
591attach acafh at mainbus  598attach acafh at mainbus
592file arch/amiga/dev/acafh.c acafh needs-count  599file arch/amiga/dev/acafh.c acafh needs-count
593 600
594attach wdc at acafhbus with wdc_acafh: gayle, amibus_b1000 601attach wdc at acafhbus with wdc_acafh: gayle, amibus_b1000
595file arch/amiga/dev/wdc_acafh.c wdc_acafh & acafh  602file arch/amiga/dev/wdc_acafh.c wdc_acafh & acafh
596 603
597include "arch/amiga/clockport/files.clockport" 604include "arch/amiga/clockport/files.clockport"
598 605
599include "arch/amiga/conf/majors.amiga" 606include "arch/amiga/conf/majors.amiga"

File Added: src/sys/arch/amiga/dev/mntva.c
/*	$NetBSD: mntva.c,v 1.1 2016/10/03 14:26:02 rkujawa Exp $	*/

/*
 * Copyright (c) 2012, 2016 The NetBSD Foundation, Inc.		
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Lukas F. Hartmann.
 * This code is derived from software contributed to The NetBSD Foundation
 * by Radoslaw Kujawa.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *	notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *	notice, this list of conditions and the following disclaimer in the
 *	documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mntva.c,v 1.1 2016/10/03 14:26:02 rkujawa Exp $");

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/device.h>
#include <sys/endian.h>
#include <sys/bus.h>
#include <sys/cpu.h>
#include <sys/conf.h>

#include <dev/cons.h>

#include <amiga/amiga/device.h>
#include <amiga/amiga/isr.h>

#include <amiga/dev/zbusvar.h>
#include <amiga/dev/mntvavar.h>
#include <amiga/dev/mntvareg.h>
#include <dev/wsfb/genfbvar.h>

#include "opt_amigacons.h"
#include "opt_wsemul.h"
#include "opt_mntva.h"
#include "opt_wsfb.h"

#include "mntva.h"

/* #define MNTVA_DEBUG 1 */

static int mntva_match(device_t, cfdata_t, void *);
static void mntva_attach(device_t, device_t, void *);

static uint16_t mntva_reg_read(struct mntva_softc *sc, uint32_t reg);
static void mntva_reg_write(struct mntva_softc *sc, uint32_t reg, uint32_t val);

static bool mntva_mode_set(struct mntva_softc *sc);

static paddr_t mntva_mmap(void *v, void *vs, off_t offset, int prot);
static int mntva_ioctl(void *v, void *vs, u_long cmd, void *data, int flag,
    struct lwp *l);
static void mntva_init_screen(void *cookie, struct vcons_screen *scr,
    int existing, long *defattr);
static void mntva_init_palette(struct mntva_softc *sc);
/* blitter support */
static void mntva_rectfill(struct mntva_softc *sc, int x, int y, int wi,
    int he, uint32_t color);
static void mntva_bitblt(struct mntva_softc *sc, int xs, int ys, int xd, 
    int yd, int wi, int he);

/* accelerated raster ops */
static void mntva_eraserows(void *cookie, int row, int nrows, long fillattr);
static void mntva_copyrows(void *cookie, int srcrow, int dstrow, int nrows);
static void mntva_copycols(void *cookie, int row, int srccol, int dstcol, 
    int ncols);
static void mntva_erasecols(void *cookie, int row, int startcol, int ncols,
    long fillattr);
#if 0
static void mntva_cursor(void *cookie, int on, int row, int col);
#endif 

/*
 * XXX: these will be called by console handling code, shouldn't they be 
 * included from somewhere else? 
 */
void mntvacninit(struct consdev *cd);
void mntvacnprobe(struct consdev *cd);
void mntvacnputc(dev_t cd, int ch);
int mntvacngetc(dev_t cd);
void mntvacnpollc(dev_t cd, int on);

CFATTACH_DECL_NEW(mntva, sizeof(struct mntva_softc),
    mntva_match, mntva_attach, NULL, NULL);

struct wsdisplay_accessops mntva_accessops = {
	mntva_ioctl,
	mntva_mmap,
	NULL,			// alloc_screen 
	NULL,			// free_screen 
	NULL,			// show_screen 
	NULL,			// load_font 
	NULL,			// pollc 
	NULL			// scroll 
};

static int
mntva_match(device_t parent, cfdata_t match, void *aux)
{
	struct zbus_args *zap = aux;

	if (zap->manid == 0x6d6e && zap->prodid == 1) {
#ifdef MNTVA_DEBUG
		/* XXX: this might not work during console init? */
		aprint_normal("mntva_match... success!\n"); 
#endif /* MNTVA_DEBUG */
		return 1;
	}

	return 0;
}

static void
mntva_attach(device_t parent, device_t self, void *aux)
{
	struct mntva_softc *sc = device_private(self);
	struct wsemuldisplaydev_attach_args ws_aa;
	struct rasops_info *ri;
	struct zbus_args *zap = aux;
	long defattr;

	sc->sc_isconsole = false;
/* this should come from "opt_mntva.h" auto generated by kernel conf system */
#ifdef MNTVA_CONSOLE
	sc->sc_isconsole = true;
#endif /* MNTVA_CONSOLE */

	printf(": MNTMN VA2000");

	if(sc->sc_isconsole)
		printf(" (console)");

	printf("\n");

	sc->sc_dev = self;
	sc->sc_memsize = MNTVA_FB_SIZE;

	sc->sc_bst.base = (bus_addr_t) zap->va;
	sc->sc_bst.absm = &amiga_bus_stride_1;
	sc->sc_iot = &sc->sc_bst;

	if (bus_space_map(sc->sc_iot, MNTVA_OFF_FB, sc->sc_memsize + 0x1000,
	    BUS_SPACE_MAP_LINEAR, &sc->sc_fbh)) {
		aprint_error_dev(sc->sc_dev, "mapping framebuffer failed\n");
		return;
	}
	if (bus_space_map(sc->sc_iot, MNTVA_OFF_REG, MNTVA_REG_SIZE , 0,
	    &sc->sc_regh)) {
		aprint_error_dev(sc->sc_dev, "mapping registers failed\n");
		return;
	}

	sc->sc_regpa = (bus_addr_t) kvtop((void*) sc->sc_regh);
	sc->sc_fbpa = (bus_addr_t) kvtop((void*) sc->sc_fbh);

	/* print the physical and virt addresses for registers and fb */
	aprint_normal_dev(sc->sc_dev, 
	    "registers at pa/va 0x%08x/0x%08x, fb at pa/va 0x%08x/0x%08x\n",
	    (uint32_t) sc->sc_regpa,
	    (uint32_t) bus_space_vaddr(sc->sc_iot, sc->sc_regh), 
	    (uint32_t) sc->sc_fbpa,
	    (uint32_t) bus_space_vaddr(sc->sc_iot, sc->sc_fbh));

	sc->sc_width = 1280;
	sc->sc_height = 720;
	sc->sc_bpp = 16;
	sc->sc_linebytes = 4096;

	aprint_normal_dev(sc->sc_dev, "%zu kB framebuffer memory present\n",
	    sc->sc_memsize / 1024);

	aprint_normal_dev(sc->sc_dev, "setting %dx%d %d bpp resolution\n",
	    sc->sc_width, sc->sc_height, sc->sc_bpp);

	mntva_mode_set(sc);

	sc->sc_defaultscreen_descr = (struct wsscreen_descr) {
	    "default", 0, 0, NULL, 8, 16, 
	    WSSCREEN_WSCOLORS | WSSCREEN_HILIT, NULL };
	sc->sc_screens[0] = &sc->sc_defaultscreen_descr;
	sc->sc_screenlist = (struct wsscreen_list) { 1, sc->sc_screens };
	sc->sc_mode = WSDISPLAYIO_MODE_EMUL;

	vcons_init(&sc->vd, sc, &sc->sc_defaultscreen_descr, &mntva_accessops);
	sc->vd.init_screen = mntva_init_screen;

	ri = &sc->sc_console_screen.scr_ri;

	mntva_init_palette(sc);

	if (sc->sc_isconsole) {
		vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
				&defattr);

		sc->sc_console_screen.scr_flags = VCONS_SCREEN_IS_STATIC;
		vcons_redraw_screen(&sc->sc_console_screen);

		sc->sc_defaultscreen_descr.textops = &ri->ri_ops;
		sc->sc_defaultscreen_descr.capabilities = ri->ri_caps;
		sc->sc_defaultscreen_descr.nrows = ri->ri_rows;
		sc->sc_defaultscreen_descr.ncols = ri->ri_cols;

		wsdisplay_cnattach(&sc->sc_defaultscreen_descr, ri, 0, 0,
				defattr);
		vcons_replay_msgbuf(&sc->sc_console_screen);
	} else {
		if (sc->sc_console_screen.scr_ri.ri_rows == 0) {
			vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
					&defattr);
		} else
			(*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
	}

	ws_aa.console = sc->sc_isconsole;
	ws_aa.scrdata = &sc->sc_screenlist;
	ws_aa.accessops = &mntva_accessops;
	ws_aa.accesscookie = &sc->vd;

	config_found(sc->sc_dev, &ws_aa, wsemuldisplaydevprint);
}

static void
mntva_init_palette(struct mntva_softc *sc)
{
	int i, j;

	j = 0;
	for (i=0; i<256; i++) {
		mntva_reg_write(sc, 0x200+i*2, rasops_cmap[j]);
		mntva_reg_write(sc, 0x400+i*2, rasops_cmap[j+1]);
		mntva_reg_write(sc, 0x600+i*2, rasops_cmap[j+2]);
		j+=3;
	}
}

static void
mntva_init_screen(void *cookie, struct vcons_screen *scr, int existing,
    long *defattr)
{
	struct mntva_softc *sc = cookie;
	struct rasops_info *ri = &scr->scr_ri;

	wsfont_init();

	ri->ri_depth = sc->sc_bpp;
	ri->ri_width = sc->sc_width;
	ri->ri_height = sc->sc_height;
	ri->ri_stride = sc->sc_linebytes;
	ri->ri_flg = 0;

	/*ri->ri_flg = RI_BSWAP;*/

	ri->ri_bits = (char *) bus_space_vaddr(sc->sc_iot, sc->sc_fbh);
#ifdef MNTVA_DEBUG
	aprint_normal_dev(sc->sc_dev, "ri_bits: %p\n", ri->ri_bits);
#endif /* MNTVA_DEBUG */

	scr->scr_flags = VCONS_SCREEN_IS_STATIC;

	rasops_init(ri, 0, 0);
	ri->ri_caps = WSSCREEN_WSCOLORS;
	rasops_reconfig(ri, sc->sc_height / ri->ri_font->fontheight,
	    sc->sc_width / ri->ri_font->fontwidth);

	ri->ri_hw = scr;

	ri->ri_ops.eraserows = mntva_eraserows;
	ri->ri_ops.copyrows = mntva_copyrows;
	ri->ri_ops.erasecols = mntva_erasecols;
	ri->ri_ops.copycols = mntva_copycols;
#if 0
	ri->ri_ops.cursor = mntva_cursor;
#endif
}

static bool
mntva_mode_set(struct mntva_softc *sc)
{
	mntva_reg_write(sc, MNTVA_SCALEMODE, 0);
	mntva_reg_write(sc, MNTVA_SCREENW, sc->sc_width);
	mntva_reg_write(sc, MNTVA_SCREENH, sc->sc_height);

	if (sc->sc_bpp == 8)
		mntva_reg_write(sc, MNTVA_COLORMODE, MNTVA_COLORMODE8);
	else if (sc->sc_bpp == 16)
		mntva_reg_write(sc, MNTVA_COLORMODE, MNTVA_COLORMODE16);
	else if (sc->sc_bpp == 32)
		mntva_reg_write(sc, MNTVA_COLORMODE, MNTVA_COLORMODE32);

	mntva_reg_write(sc, MNTVA_PANPTRHI, 0);
	mntva_reg_write(sc, MNTVA_PANPTRLO, 0);
	mntva_reg_write(sc, MNTVA_BLITTERBASEHI, 0);
	mntva_reg_write(sc, MNTVA_BLITTERBASELO, 0);
	
	/* XXX: should rectfill with bg color taken from wscons? */
	mntva_rectfill(sc, 0, 0, sc->sc_width, sc->sc_height, 0xffffffff);

	return true;
}

static uint16_t
mntva_reg_read(struct mntva_softc *sc, uint32_t reg) 
{
	uint32_t rv;
	rv = bus_space_read_2(sc->sc_iot, sc->sc_regh, reg);
	return rv;
}

static void
mntva_reg_write(struct mntva_softc *sc, uint32_t reg, uint32_t val)
{
	bus_space_write_2(sc->sc_iot, sc->sc_regh, reg, val);
}

static void
mntva_rectfill(struct mntva_softc *sc, int x, int y, int wi, int he,
    uint32_t color)
{
	mntva_reg_write(sc, MNTVA_BLITTERRGB, (uint16_t) color);
	mntva_reg_write(sc, MNTVA_BLITTERX1, (uint16_t) x);
	mntva_reg_write(sc, MNTVA_BLITTERY1, (uint16_t) y);
	mntva_reg_write(sc, MNTVA_BLITTERX2, (uint16_t) x + wi - 1);
	mntva_reg_write(sc, MNTVA_BLITTERY2, (uint16_t) y + he - 1);
	mntva_reg_write(sc, MNTVA_BLITTER_ENABLE, MNTVA_BLITTER_FILL);

	while(mntva_reg_read(sc, MNTVA_BLITTER_ENABLE)) {
		/* busy wait */
	}
}

static void
mntva_bitblt(struct mntva_softc *sc, int xs, int ys, int xd, int yd, int wi,
    int he)
{
	mntva_reg_write(sc, MNTVA_BLITTERX1, (uint16_t) xd);
	mntva_reg_write(sc, MNTVA_BLITTERY1, (uint16_t) yd);
	mntva_reg_write(sc, MNTVA_BLITTERX2, (uint16_t) xd + wi - 1);
	mntva_reg_write(sc, MNTVA_BLITTERY2, (uint16_t) yd + he - 1);
	mntva_reg_write(sc, MNTVA_BLITTERX3, (uint16_t) xs);
	mntva_reg_write(sc, MNTVA_BLITTERY3, (uint16_t) ys);
	mntva_reg_write(sc, MNTVA_BLITTERX4, (uint16_t) xs + wi - 1);
	mntva_reg_write(sc, MNTVA_BLITTERY4, (uint16_t) ys + he - 1);
	mntva_reg_write(sc, MNTVA_BLITTER_ENABLE, MNTVA_BLITTER_COPY);
	
	while(mntva_reg_read(sc, MNTVA_BLITTER_ENABLE)) {
		/* busy wait */
	}
}

static void
mntva_copyrows(void *cookie, int srcrow, int dstrow, int nrows)
{
	struct mntva_softc *sc;
	struct rasops_info *ri;
	struct vcons_screen *scr;
	int x, ys, yd, wi, he;

	ri = cookie;
	scr = ri->ri_hw;
	sc = scr->scr_cookie;

	if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
		x = ri->ri_xorigin;
		ys = ri->ri_yorigin + ri->ri_font->fontheight * srcrow;
		yd = ri->ri_yorigin + ri->ri_font->fontheight * dstrow;
		wi = ri->ri_emuwidth;
		he = ri->ri_font->fontheight * nrows;
		mntva_bitblt(sc, x, ys, x, yd, wi, he);
	}
}

static void
mntva_eraserows(void *cookie, int row, int nrows, long fillattr)
{
	struct mntva_softc *sc;
	struct rasops_info *ri;
	struct vcons_screen *scr;
	int x, y, wi, he, fg, bg, ul;

	ri = cookie;
	scr = ri->ri_hw;
	sc = scr->scr_cookie;

	if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
		rasops_unpack_attr(fillattr, &fg, &bg, &ul);
		if ((row == 0) && (nrows == ri->ri_rows)) 
			mntva_rectfill(sc, 0, 0, ri->ri_width,
			    ri->ri_height, ri->ri_devcmap[bg]);
		else {
			x = ri->ri_xorigin;
			y = ri->ri_yorigin + ri->ri_font->fontheight * row;
			wi = ri->ri_emuwidth;
			he = ri->ri_font->fontheight * nrows;
			mntva_rectfill(sc, x, y, wi, he, ri->ri_devcmap[bg]);
		}
	}
}

static void
mntva_copycols(void *cookie, int row, int srccol, int dstcol, int ncols)
{
	struct mntva_softc *sc;
	struct rasops_info *ri;
	struct vcons_screen *scr;
	int xs, xd, y, w, h;

	ri = cookie;
	scr = ri->ri_hw;
	sc = scr->scr_cookie;

	if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
		xs = ri->ri_xorigin + ri->ri_font->fontwidth * srccol;
		xd = ri->ri_xorigin + ri->ri_font->fontwidth * dstcol;
		y = ri->ri_yorigin + ri->ri_font->fontheight * row;
		w = ri->ri_font->fontwidth * ncols;
		h = ri->ri_font->fontheight;
		mntva_bitblt(sc, xs, y, xd, y, w, h);
	}

}

static void
mntva_erasecols(void *cookie, int row, int startcol, int ncols, long fillattr)
{
	struct mntva_softc *sc;
	struct rasops_info *ri;
	struct vcons_screen *scr;
	int x, y, w, h, fg, bg, ul;

	ri = cookie;
	scr = ri->ri_hw;
	sc = scr->scr_cookie;

	if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
		x = ri->ri_xorigin + ri->ri_font->fontwidth * startcol;
		y = ri->ri_yorigin + ri->ri_font->fontheight * row;
		w = ri->ri_font->fontwidth * ncols;
		h = ri->ri_font->fontheight;
		rasops_unpack_attr(fillattr, &fg, &bg, &ul);
		mntva_rectfill(sc, x, y, w, h, ri->ri_devcmap[bg & 0xf]);
	}
}

static int
mntva_ioctl(void *v, void *vs, u_long cmd, void *data, int flag, struct lwp *l)
{
	struct vcons_data *vd;
	struct mntva_softc *sc;
	struct wsdisplay_fbinfo *wsfbi;
	struct vcons_screen *ms;
	struct wsdisplayio_bus_id *busid;

	vd = v;
	sc = vd->cookie;
	ms = vd->active;
	
	switch (cmd) {
	case WSDISPLAYIO_GTYPE:
		*(u_int *) data = WSDISPLAY_TYPE_UNKNOWN;
		return 0;

	case WSDISPLAYIO_GET_BUSID:
		busid = data;
		busid->bus_type = WSDISPLAYIO_BUS_SOC;
		return 0;

	case WSDISPLAYIO_GINFO:
		if (ms == NULL)
			return ENODEV;

		wsfbi = (void *) data;
		wsfbi->height = ms->scr_ri.ri_height;
		wsfbi->width = ms->scr_ri.ri_width;
		wsfbi->depth = ms->scr_ri.ri_depth;
		wsfbi->cmsize = 256;
		return 0;

	case WSDISPLAYIO_LINEBYTES:
		*(u_int *) data = sc->sc_linebytes;
		return 0;

	case WSDISPLAYIO_SMODE:
		{
			int new_mode = *(int *) data;
			if (new_mode != sc->sc_mode) {
				sc->sc_mode = new_mode;
				if (new_mode == WSDISPLAYIO_MODE_EMUL)
					vcons_redraw_screen(ms);
			}
			return 0;
		}
	case WSDISPLAYIO_GET_FBINFO:
		{
			struct wsdisplayio_fbinfo *fbi = data;
			struct rasops_info *ri;
			int ret;

			ri = &sc->vd.active->scr_ri;
			ret = wsdisplayio_get_fbinfo(ri, fbi);
			return ret;
		}
	}
	
	return EPASSTHROUGH;
}

#if 0
static void
mntva_cursor(void *cookie, int on, int row, int col)
{
	struct mntva_softc *sc;
	struct rasops_info *ri;
	struct vcons_screen *scr;
	int x, y, wi, he;

	ri = cookie;
	scr = ri->ri_hw;
	sc = scr->scr_cookie;

	wi = ri->ri_font->fontwidth;
	he = ri->ri_font->fontheight;

	if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
		x = ri->ri_ccol * wi + ri->ri_xorigin;
		y = ri->ri_crow * he + ri->ri_yorigin;
		if (ri->ri_flg & RI_CURSOR) {
			mntva_bitblt(sc, x, y, x, y, wi, he);
			ri->ri_flg &= ~RI_CURSOR;
		}
		ri->ri_crow = row;
		ri->ri_ccol = col;
		if (on) {
			x = ri->ri_ccol * wi + ri->ri_xorigin;
			y = ri->ri_crow * he + ri->ri_yorigin;
			mntva_bitblt(sc, x, y, x, y, wi, he);
			ri->ri_flg |= RI_CURSOR;
		}
	} else {
		scr->scr_ri.ri_crow = row;
		scr->scr_ri.ri_ccol = col;
		scr->scr_ri.ri_flg &= ~RI_CURSOR;
	}
}
#endif 

static paddr_t
mntva_mmap(void *v, void *vs, off_t offset, int prot)
{
	struct vcons_data *vd;
	struct mntva_softc *sc;
	paddr_t pa;

	vd = v;
	sc = vd->cookie;

	if (offset >= 0 && offset < sc->sc_memsize) {
		pa = bus_space_mmap(sc->sc_iot, sc->sc_fbpa, offset, prot,
			BUS_SPACE_MAP_LINEAR);
		return pa;
	}	

	return -1;
}

void
mntvacninit(struct consdev *cd) 
{
	/*wsdisplay_preattach(sc->sc_defaultscreen, ri, 0, 0, defattr);*/
}

void 
mntvacnprobe(struct consdev *cd)
{
	/* 
	 * This isn't exactly true, but cons.h does not define anything
	 * that would fit our case exactly.
	 */
	cd->cn_pri = CN_INTERNAL;

	cd->cn_dev = NODEV; /* Filled later by wscons. */
}

/* ARGSUSED */
void
mntvacnputc(dev_t cd, int ch)
{
}

/* ARGSUSED */
int
mntvacngetc(dev_t cd)
{
	return(0);
}

/* ARGSUSED */
void
mntvacnpollc(dev_t cd, int on)
{
}


File Added: src/sys/arch/amiga/dev/mntvareg.h
/*	$NetBSD: mntvareg.h,v 1.1 2016/10/03 14:26:02 rkujawa Exp $  */

/*
 * Copyright (c) 2012, 2016 The NetBSD Foundation, Inc. 
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Lukas F. Hartmann.
 * This code is derived from software contributed to The NetBSD Foundation
 * by Radoslaw Kujawa.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef MNTVA2000REG_H
#define MNTVA2000REG_H

/* address space */
#define MNTVA_OFF_REG		0x5f0000	/* memory mapped registers */
#define MNTVA_REG_SIZE		0xFF

#define MNTVA_OFF_FB		0x000000	/* frame buffer */
#define MNTVA_FB_SIZE		0x5f0000

/* registers */
#define MNTVA_SCALEMODE		0x04
#define MNTVA_SCALEMODE1X		0
#define MNTVA_SCALEMODE2X		1
#define MNTVA_SCALEMODE3X		2	
#define MNTVA_SCALEMODE4X		3	

#define MNTVA_SCREENW		0x06
#define MNTVA_SCREENH		0x08

#define MNTVA_BLITTERBASEHI	0x1C	/* [23:16] */
#define MNTVA_BLITTERBASELO	0x1E	/* [15:0] */

#define MNTVA_BLITTERX1		0x20
#define MNTVA_BLITTERY1		0x22
#define MNTVA_BLITTERX2		0x24
#define MNTVA_BLITTERY2		0x26
#define MNTVA_BLITTERRGB	0x28	/* filling for 16bit and 8bit modes */

#define MNTVA_BLITTER_ENABLE	0x2A
#define MNTVA_BLITTER_FILL		__BIT(0) /* fill [x1,y1]-[x2,y2] */
#define MNTVA_BLITTER_COPY		__BIT(1) /* copy [x3,y3]-[x4,y4] to
						         [x1,y1]-[x2,y2] */
#define MNTVA_BLITTERX3		0x2C
#define MNTVA_BLITTERY3		0x2E
#define MNTVA_BLITTERX4		0x30
#define MNTVA_BLITTERY4		0x32
#define MNTVA_BLITTERRGB32HI	0x34	/* filling for 24bit and 32bit modes */
#define MNTVA_BLITTERRGB32LO	0x36	/* filling for 24bit and 32bit modes */

#define MNTVA_COLORMODE 	0x48
#define MNTVA_COLORMODE8		0
#define MNTVA_COLORMODE16		__BIT(0)	
#define MNTVA_COLORMODE32		__BIT(1)

#define MNTVA_PANPTRHI 0x38 /* [23:16] */
#define MNTVA_PANPTRLO 0x3A /* [15:0] */

#define MNTVA_BLITTERX1		0x20
#define MNTVA_BLITTERY1		0x22
#define MNTVA_BLITTERX2		0x24
#define MNTVA_BLITTERY2		0x26
#define MNTVA_BLITTERRGB	0x28	/* filling for 16bit and 8bit modes */

#define MNTVA_BLITTER_ENABLE	0x2A
#define MNTVA_BLITTER_FILL		__BIT(0) /* fill [x1,y1]-[x2,y2] */
#define MNTVA_BLITTER_COPY		__BIT(1) /* copy [x3,y3]-[x4,y4] to
						         [x1,y1]-[x2,y2] */
#define MNTVA_BLITTERX3		0x2C
#define MNTVA_BLITTERY3		0x2E
#define MNTVA_BLITTERX4		0x30
#define MNTVA_BLITTERY4		0x32
#define MNTVA_BLITTERRGB32HI	0x34	/* filling for 24bit and 32bit modes */
#define MNTVA_BLITTERRGB32LO	0x36	/* filling for 24bit and 32bit modes */

#define MNTVA_COLORMODE 	0x48
#define MNTVA_COLORMODE8		0
#define MNTVA_COLORMODE16		__BIT(0)	
#define MNTVA_COLORMODE32		__BIT(1)

#define MNTVA_PANPTRHI 0x38 /* [23:16] */
#define MNTVA_PANPTRLO 0x3A /* [15:0] */

#endif /* MNTVA2000REG_H */

File Added: src/sys/arch/amiga/dev/mntvavar.h
/*  $NetBSD: mntvavar.h,v 1.1 2016/10/03 14:26:02 rkujawa Exp $ */

/*
 * Copyright (c) 2012, 2016 The NetBSD Foundation, Inc. 
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Lukas F. Hartmann.
 * This code is derived from software contributed to The NetBSD Foundation
 * by Radoslaw Kujawa.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef MNTVA2000VAR_H
#define MNTVA2000VAR_H

#include <dev/wscons/wsdisplayvar.h>
#include <dev/wscons/wsconsio.h>
#include <dev/wsfont/wsfont.h>
#include <dev/rasops/rasops.h>
#include <dev/wscons/wsdisplay_vconsvar.h>

struct mntva_softc
{
	device_t sc_dev;

	/* bus attachment, handles */
	struct bus_space_tag sc_bst;

	bus_space_tag_t sc_iot;
	bus_space_handle_t sc_regh;
	bus_space_handle_t sc_fbh;

	bus_addr_t sc_regpa;
	bus_addr_t sc_fbpa;

	size_t sc_memsize;
	int sc_width, sc_height, sc_linebytes, sc_bpp;

	int sc_mode;
	uint32_t sc_bg;

	struct vcons_screen sc_console_screen;
	struct vcons_data vd;
	struct wsscreen_descr sc_defaultscreen_descr;
	const struct wsscreen_descr *sc_screens[1];
	struct wsscreen_list sc_screenlist;

	bool sc_isconsole;

	u_char sc_cmap_red[256];
	u_char sc_cmap_green[256];
	u_char sc_cmap_blue[256];

};

#endif /* MNTVA2000VAR_H */

cvs diff -r1.73 -r1.74 src/sys/arch/amiga/dev/zbus.c (switch to unified diff)

--- src/sys/arch/amiga/dev/zbus.c 2012/11/26 22:58:24 1.73
+++ src/sys/arch/amiga/dev/zbus.c 2016/10/03 14:26:02 1.74
@@ -1,430 +1,433 @@ @@ -1,430 +1,433 @@
1/* $NetBSD: zbus.c,v 1.73 2012/11/26 22:58:24 rkujawa Exp $ */ 1/* $NetBSD: zbus.c,v 1.74 2016/10/03 14:26:02 rkujawa Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1994 Christian E. Hopps 4 * Copyright (c) 1994 Christian E. Hopps
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software 15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement: 16 * must display the following acknowledgement:
17 * This product includes software developed by Christian E. Hopps. 17 * This product includes software developed by Christian E. Hopps.
18 * 4. The name of the author may not be used to endorse or promote products 18 * 4. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission 19 * derived from this software without specific prior written permission
20 * 20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: zbus.c,v 1.73 2012/11/26 22:58:24 rkujawa Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: zbus.c,v 1.74 2016/10/03 14:26:02 rkujawa Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/bus.h> 39#include <sys/bus.h>
40 40
41#include <machine/cpu.h> 41#include <machine/cpu.h>
42#include <machine/pte.h> 42#include <machine/pte.h>
43#include <amiga/amiga/cfdev.h> 43#include <amiga/amiga/cfdev.h>
44#include <amiga/amiga/device.h> 44#include <amiga/amiga/device.h>
45#include <amiga/dev/zbusvar.h> 45#include <amiga/dev/zbusvar.h>
46#include <amiga/dev/z3rambdvar.h> 46#include <amiga/dev/z3rambdvar.h>
47 47
48#include "z3rambd.h" 48#include "z3rambd.h"
49 49
50struct aconfdata { 50struct aconfdata {
51 const char *name; 51 const char *name;
52 int manid; 52 int manid;
53 int prodid; 53 int prodid;
54}; 54};
55 55
56struct preconfdata { 56struct preconfdata {
57 int manid; 57 int manid;
58 int prodid; 58 int prodid;
59 void *vaddr; 59 void *vaddr;
60}; 60};
61 61
62struct quirksdata { 62struct quirksdata {
63 int manid; 63 int manid;
64 int prodid; 64 int prodid;
65 uint8_t quirks; 65 uint8_t quirks;
66}; 66};
67 67
68vaddr_t ZTWOROMADDR; 68vaddr_t ZTWOROMADDR;
69vaddr_t ZTWOMEMADDR; 69vaddr_t ZTWOMEMADDR;
70u_int NZTWOMEMPG; 70u_int NZTWOMEMPG;
71vaddr_t ZBUSADDR; /* kva of Zorro bus I/O pages */ 71vaddr_t ZBUSADDR; /* kva of Zorro bus I/O pages */
72u_int ZBUSAVAIL; /* bytes of Zorro bus I/O space left */ 72u_int ZBUSAVAIL; /* bytes of Zorro bus I/O space left */
73 73
74/* 74/*
75 * explain the names.. 0123456789 => zothfisven 75 * explain the names.. 0123456789 => zothfisven
76 */ 76 */
77static const struct aconfdata aconftab[] = { 77static const struct aconfdata aconftab[] = {
78 /* Commodore Amiga */ 78 /* Commodore Amiga */
79 { "atzee", 513, 1 }, 79 { "atzee", 513, 1 },
80 { "atzsc", 514, 2 }, 80 { "atzsc", 514, 2 },
81 { "atzsc", 514, 3 }, 81 { "atzsc", 514, 3 },
82 { "bah", 514, 9 }, /* A2060 */ 82 { "bah", 514, 9 }, /* A2060 */
83 { "ql", 514, 69 }, 83 { "ql", 514, 69 },
84 { "ql", 514, 70 }, 84 { "ql", 514, 70 },
85 { "atfsc", 514, 84 }, 85 { "atfsc", 514, 84 },
86 { "le", 514, 112 }, 86 { "le", 514, 112 },
87 /* Ameristar */ 87 /* Ameristar */
88 { "le", 1053, 1 }, 88 { "le", 1053, 1 },
89 { "bah", 1053, 9 }, /* A2060 */ 89 { "bah", 1053, 9 }, /* A2060 */
90 { "es", 1053, 10 }, 90 { "es", 1053, 10 },
91 /* University of Lowell */ 91 /* University of Lowell */
92 { "grful", 1030, 0 }, 92 { "grful", 1030, 0 },
93 /* DMI */ 93 /* DMI */
94 { "grfrs", 2129, 1 }, /* Resolver graphics board */ 94 { "grfrs", 2129, 1 }, /* Resolver graphics board */
95 /* Macrosystems */ 95 /* Macrosystems */
96 { "grfrt", 18260, 6 }, 96 { "grfrt", 18260, 6 },
97 { "grfrh", 18260, 16}, /* Retina BLT Z3 */ 97 { "grfrh", 18260, 16}, /* Retina BLT Z3 */
98 { "grfrh", 18260, 19}, /* Altais */ 98 { "grfrh", 18260, 19}, /* Altais */
99 /* Greater valley products */ 99 /* Greater valley products */
100 { "gvpbus", 2017, 2 }, 100 { "gvpbus", 2017, 2 },
101 { "gvpbus", 2017, 11 }, 101 { "gvpbus", 2017, 11 },
102 { "giv", 2017, 32 }, 102 { "giv", 2017, 32 },
103 { "gio", 2017, 255 }, 103 { "gio", 2017, 255 },
104 /* progressive perhiperals */ 104 /* progressive perhiperals */
105 { "zssc", 2026, 150 }, 105 { "zssc", 2026, 150 },
106 { "ppia", 2026, 187 }, 106 { "ppia", 2026, 187 },
107 { "ppta", 2026, 105 }, 107 { "ppta", 2026, 105 },
108 { "ppha", 2026, 1 }, 108 { "ppha", 2026, 1 },
109 { "mrsc", 2026, 0 }, 109 { "mrsc", 2026, 0 },
110 /* CSA */ 110 /* CSA */
111 { "mgnsc", 1058, 17 }, 111 { "mgnsc", 1058, 17 },
112 { "otgsc", 1058, 21 }, 112 { "otgsc", 1058, 21 },
113 /* Microbotics */ 113 /* Microbotics */
114 { "vhzsc", 1010, 69 }, 114 { "vhzsc", 1010, 69 },
115 /* Supra */ 115 /* Supra */
116 { "wstsc", 1056, 12 }, 116 { "wstsc", 1056, 12 },
117 { "wstsc", 1056, 13 }, 117 { "wstsc", 1056, 13 },
118 /* IVS */ 118 /* IVS */
119 { "itrmp", 2112, 48 }, 119 { "itrmp", 2112, 48 },
120 { "itrmp", 2112, 52 }, 120 { "itrmp", 2112, 52 },
121 { "ivasc", 2112, 242 }, 121 { "ivasc", 2112, 242 },
122 { "ivsc", 2112, 243 }, 122 { "ivsc", 2112, 243 },
123 /* Hydra */ 123 /* Hydra */
124 { "ed", 2121, 1 }, 124 { "ed", 2121, 1 },
125 /* ASDG */ 125 /* ASDG */
126 { "ed", 1023, 254 }, 126 { "ed", 1023, 254 },
127 /* Village Tronic Ariadne */ 127 /* Village Tronic Ariadne */
128 { "le", 2167, 201}, 128 { "le", 2167, 201},
129 /* Village Tronic Ariadne II */ 129 /* Village Tronic Ariadne II */
130 { "ne", 2167, 202}, 130 { "ne", 2167, 202},
131 /* bsc/Alf Data */ 131 /* bsc/Alf Data */
132 { "Tandem", 2092, 6 }, /* Tandem AT disk controller */ 132 { "Tandem", 2092, 6 }, /* Tandem AT disk controller */
133 { "mfc", 2092, 16 }, 133 { "mfc", 2092, 16 },
134 { "mfc", 2092, 17 }, 134 { "mfc", 2092, 17 },
135 { "mfc", 2092, 18 }, 135 { "mfc", 2092, 18 },
136 /* Cirrus CL GD 5426 -> Picasso, Piccolo, EGS Spectrum */ 136 /* Cirrus CL GD 5426 -> Picasso, Piccolo, EGS Spectrum */
137 { "grfcl", 2167, 11}, /* PicassoII mem */ 137 { "grfcl", 2167, 11}, /* PicassoII mem */
138 { "grfcl", 2167, 12}, /* PicassoII regs */ 138 { "grfcl", 2167, 12}, /* PicassoII regs */
139 { "grfcl", 2167, 21}, /* PicassoIV Z2 mem1 */ 139 { "grfcl", 2167, 21}, /* PicassoIV Z2 mem1 */
140 { "grfcl", 2167, 22}, /* PicassoIV Z2 mem2 */ 140 { "grfcl", 2167, 22}, /* PicassoIV Z2 mem2 */
141 { "grfcl", 2167, 23}, /* PicassoIV Z2 regs */ 141 { "grfcl", 2167, 23}, /* PicassoIV Z2 regs */
142 { "grfcl", 2167, 24}, /* PicassoIV Z3 */ 142 { "grfcl", 2167, 24}, /* PicassoIV Z3 */
143 { "grfcl", 2193, 2}, /* Spectrum mem */ 143 { "grfcl", 2193, 2}, /* Spectrum mem */
144 { "grfcl", 2193, 1}, /* Spectrum regs */ 144 { "grfcl", 2193, 1}, /* Spectrum regs */
145 { "grfcl", 2195, 5}, /* Piccolo mem */ 145 { "grfcl", 2195, 5}, /* Piccolo mem */
146 { "grfcl", 2195, 6}, /* Piccolo regs */ 146 { "grfcl", 2195, 6}, /* Piccolo regs */
147 { "grfcl", 2195, 10}, /* Piccolo SD64 mem */ 147 { "grfcl", 2195, 10}, /* Piccolo SD64 mem */
148 { "grfcl", 2195, 11}, /* Piccolo SD64 regs */ 148 { "grfcl", 2195, 11}, /* Piccolo SD64 regs */
149 /* MacroSystemsUS */ 149 /* MacroSystemsUS */
150 { "wesc", 2203, 19}, /* Warp engine */ 150 { "wesc", 2203, 19}, /* Warp engine */
151 /* phase 5 digital products */ 151 /* phase 5 digital products */
152 { "flmem", 8512, 10}, /* FastlaneZ3 memory */ 152 { "flmem", 8512, 10}, /* FastlaneZ3 memory */
153 { "flsc", 8512, 11}, /* FastlaneZ3 */ 153 { "flsc", 8512, 11}, /* FastlaneZ3 */
154 { "cbsc", 8512, 12}, /* Cyberstorm Mk I SCSI */ 154 { "cbsc", 8512, 12}, /* Cyberstorm Mk I SCSI */
155 { "bzivsc", 8512, 17}, /* Blizzard IV SCSI */ 155 { "bzivsc", 8512, 17}, /* Blizzard IV SCSI */
156 { "bztzsc", 8512, 24}, /* Blizzard 2060 SCSI */ 156 { "bztzsc", 8512, 24}, /* Blizzard 2060 SCSI */
157 { "cbiisc", 8512, 25}, /* Cyberstorm Mk II SCSI */ 157 { "cbiisc", 8512, 25}, /* Cyberstorm Mk II SCSI */
158 { "grfcv", 8512, 34}, /* CyberVison 64 */ 158 { "grfcv", 8512, 34}, /* CyberVison 64 */
159 { "grfcv3d", 8512, 67}, /* CyberVison 64/3D */ 159 { "grfcv3d", 8512, 67}, /* CyberVison 64/3D */
160 { "cbiiisc", 8512, 100}, /* Cyberstorm Mk III SCSI */ 160 { "cbiiisc", 8512, 100}, /* Cyberstorm Mk III SCSI */
161 { "p5pb", 8512, 101}, /* CyberVisionPPC / BlizzardVisionPPC */ 161 { "p5pb", 8512, 101}, /* CyberVisionPPC / BlizzardVisionPPC */
162 { "bppcsc", 8512, 110}, /* Blizzard 603e+ SCSI */ 162 { "bppcsc", 8512, 110}, /* Blizzard 603e+ SCSI */
163 /* Hacker Inc. */ 163 /* Hacker Inc. */
164 { "mlhsc", 2011, 1 }, 164 { "mlhsc", 2011, 1 },
165 /* Resource Management Force */ 165 /* Resource Management Force */
166 { "qn", 2011, 2 }, /* QuickNet Ethernet */ 166 { "qn", 2011, 2 }, /* QuickNet Ethernet */
167 /* ??? */ 167 /* ??? */
168 { "empsc", 2171, 21 }, /* Emplant SCSI */ 168 { "empsc", 2171, 21 }, /* Emplant SCSI */
169 { "empsc", 2171, 32 }, /* Emplant SCSI */ 169 { "empsc", 2171, 32 }, /* Emplant SCSI */
170 /* Tseng ET4000 boards */ 170 /* Tseng ET4000 boards */
171 { "grfet", 2117, 3 }, /* Merlin mem */ 171 { "grfet", 2117, 3 }, /* Merlin mem */
172 { "grfet", 2117, 4 }, /* Merlin regs */ 172 { "grfet", 2117, 4 }, /* Merlin regs */
173 { "grfet", 2167, 1 }, /* Domino mem */ 173 { "grfet", 2167, 1 }, /* Domino mem */
174 { "grfet", 2167, 2 }, /* Domino regs */ 174 { "grfet", 2167, 2 }, /* Domino regs */
175 { "grfet", 2167, 3 }, /* Domino regs (proto 16M) */ 175 { "grfet", 2167, 3 }, /* Domino regs (proto 16M) */
176 { "grfet", 2181, 0 }, /* oMniBus */ 176 { "grfet", 2181, 0 }, /* oMniBus */
177 /* Advanced Systems */ 177 /* Advanced Systems */
178 { "nxsc", 2102, 1 }, /* Nexus SCSI board */ 178 { "nxsc", 2102, 1 }, /* Nexus SCSI board */
179 /* Masoboshi */ 179 /* Masoboshi */
180 { "mcsc", 8535, 4 }, /* Masoboshi Mastercard 702 */ 180 { "mcsc", 8535, 4 }, /* Masoboshi Mastercard 702 */
181 /* Apollo */ 181 /* Apollo */
182 { "apssc", 8738, 35 }, /* Apollo '060 scsi */ 182 { "apssc", 8738, 35 }, /* Apollo '060 scsi */
183 /* KATO development */ 183 /* KATO development */
184 { "aumld", 2145, 128 }, /* Melody MPEG layer 2 audio board */ 184 { "aumld", 2145, 128 }, /* Melody MPEG layer 2 audio board */
185 /* Individual Computers Jens Schoenfeld */ 185 /* Individual Computers Jens Schoenfeld */
186 { "buddha", 4626, 0 }, 186 { "buddha", 4626, 0 },
187 { "xsurf", 4626, 23 }, /* X-Surf Ethernet */ 187 { "xsurf", 4626, 23 }, /* X-Surf Ethernet */
188 /* VMC Harald Frank */ 188 /* VMC Harald Frank */
189 { "blst", 5001, 1}, /* ISDN Blaster */ 189 { "blst", 5001, 1}, /* ISDN Blaster */
190 { "hyper4", 5001, 2}, /* Hypercom4-Zbus */ 190 { "hyper4", 5001, 2}, /* Hypercom4-Zbus */
191 { "hyper3Z", 5001, 3}, /* Hypercom3-Zbus */ 191 { "hyper3Z", 5001, 3}, /* Hypercom3-Zbus */
192 { "hyper4+", 5001, 6}, /* Hypercom4+ */ 192 { "hyper4+", 5001, 6}, /* Hypercom4+ */
193 { "hyper3+", 5001, 7}, /* Hypercom3+ */ 193 { "hyper3+", 5001, 7}, /* Hypercom3+ */
194 /* Matay Grzegorz Kraszewski */ 194 /* Matay Grzegorz Kraszewski */
195 { "mppb", 44359, 1} /* Prometheus PCI bridge */ 195 { "mppb", 44359, 1}, /* Prometheus PCI bridge */
 196 /* MNTMN */
 197 { "mntva", 28014, 1} /* MNTMN VA2000 */
196}; 198};
197static int naconfent = sizeof(aconftab) / sizeof(struct aconfdata); 199static int naconfent = sizeof(aconftab) / sizeof(struct aconfdata);
198 200
199/* 201/*
200 * Anything listed in this table is subject to pre-configuration, 202 * Anything listed in this table is subject to pre-configuration,
201 * if autoconf.c:config_console() calls amiga_config_found() on 203 * if autoconf.c:config_console() calls amiga_config_found() on
202 * the Zorro III device. 204 * the Zorro III device.
203 */ 205 */
204static struct preconfdata preconftab[] = { 206static struct preconfdata preconftab[] = {
205 {18260, 6, 0 }, /* Retina Z2 */ /* grf1 */ 207 {18260, 6, 0 }, /* Retina Z2 */ /* grf1 */
206 {18260, 16, 0}, /* Retina BLT Z3 */ /* grf2 */ 208 {18260, 16, 0}, /* Retina BLT Z3 */ /* grf2 */
207 {18260, 19, 0}, /* Altais */ 209 {18260, 19, 0}, /* Altais */
208 {2167, 11, 0}, /* PicassoII mem */ /* grf3 */ 210 {2167, 11, 0}, /* PicassoII mem */ /* grf3 */
209 {2167, 12, 0}, /* PicassoII regs */ 211 {2167, 12, 0}, /* PicassoII regs */
210 {2167, 21, 0}, /* PicassoIV Z2 mem1 */ 212 {2167, 21, 0}, /* PicassoIV Z2 mem1 */
211 {2167, 22, 0}, /* PicassoIV Z2 mem2 */ 213 {2167, 22, 0}, /* PicassoIV Z2 mem2 */
212 {2167, 23, 0}, /* PicassoIV Z2 regs */ 214 {2167, 23, 0}, /* PicassoIV Z2 regs */
213 {2167, 24, 0}, /* PicassoIV Z3 */ 215 {2167, 24, 0}, /* PicassoIV Z3 */
214 {2193, 2, 0}, /* Spectrum mem */ 216 {2193, 2, 0}, /* Spectrum mem */
215 {2193, 1, 0}, /* Spectrum regs */ 217 {2193, 1, 0}, /* Spectrum regs */
216 {2195, 5, 0}, /* Piccolo mem */ 218 {2195, 5, 0}, /* Piccolo mem */
217 {2195, 6, 0}, /* Piccolo regs */ 219 {2195, 6, 0}, /* Piccolo regs */
218 {2195, 10, 0}, /* Piccolo SD64 mem */ 220 {2195, 10, 0}, /* Piccolo SD64 mem */
219 {2195, 11, 0}, /* Piccolo SD64 regs */ 221 {2195, 11, 0}, /* Piccolo SD64 regs */
220 {1030, 0, 0}, /* Ulwl board */ /* grf4 */ 222 {1030, 0, 0}, /* Ulwl board */ /* grf4 */
221 {8512, 34, 0}, /* Cybervison 64 */ /* grf5 */ 223 {8512, 34, 0}, /* Cybervison 64 */ /* grf5 */
222 {2117, 3, 0}, /* Merlin mem */ /* grf6 */ 224 {2117, 3, 0}, /* Merlin mem */ /* grf6 */
223 {2117, 4, 0}, /* Merlin regs */ 225 {2117, 4, 0}, /* Merlin regs */
224 {2167, 1, 0}, /* Domino mem */ 226 {2167, 1, 0}, /* Domino mem */
225 {2167, 2, 0}, /* Domino regs */ 227 {2167, 2, 0}, /* Domino regs */
226 {2167, 3, 0}, /* Domino regs (proto 16M) */ 228 {2167, 3, 0}, /* Domino regs (proto 16M) */
227 {2181, 0, 0}, /* oMniBus mem or regs */ 229 {2181, 0, 0}, /* oMniBus mem or regs */
228 {8512, 67, 0} /* Cybervison 64/3D */ /* grf7 */ 230 {8512, 67, 0} /* Cybervison 64/3D */ /* grf7 */
 231/* {28014, 1, 0} // MNTMN VA2000 */
229}; 232};
230static int npreconfent = sizeof(preconftab) / sizeof(struct preconfdata); 233static int npreconfent = sizeof(preconftab) / sizeof(struct preconfdata);
231 234
232/* 235/*
233 * Quirks table. 236 * Quirks table.
234 */ 237 */
235#define ZORRO_QUIRK_NO_ZBUSMAP 1 /* Don't map VA=PA in zbusattach. */ 238#define ZORRO_QUIRK_NO_ZBUSMAP 1 /* Don't map VA=PA in zbusattach. */
236static struct quirksdata quirkstab[] = { 239static struct quirksdata quirkstab[] = {
237 {8512, 101, ZORRO_QUIRK_NO_ZBUSMAP} 240 {8512, 101, ZORRO_QUIRK_NO_ZBUSMAP}
238}; 241};
239static int nquirksent = sizeof(quirkstab) / sizeof(struct quirksdata); 242static int nquirksent = sizeof(quirkstab) / sizeof(struct quirksdata);
240 243
241void zbusattach(device_t, device_t, void *); 244void zbusattach(device_t, device_t, void *);
242int zbusprint(void *, const char *); 245int zbusprint(void *, const char *);
243int zbusmatch(device_t, cfdata_t, void *); 246int zbusmatch(device_t, cfdata_t, void *);
244static const char *aconflookup(int, int); 247static const char *aconflookup(int, int);
245 248
246/* 249/*
247 * given a manufacturer id and product id, find quirks 250 * given a manufacturer id and product id, find quirks
248 * for this board. 251 * for this board.
249 */ 252 */
250 253
251static uint8_t 254static uint8_t
252quirkslookup(int mid, int pid) 255quirkslookup(int mid, int pid)
253{ 256{
254 const struct quirksdata *qdp, *eqdp; 257 const struct quirksdata *qdp, *eqdp;
255 258
256 eqdp = &quirkstab[nquirksent]; 259 eqdp = &quirkstab[nquirksent];
257 for (qdp = quirkstab; qdp < eqdp; qdp++) 260 for (qdp = quirkstab; qdp < eqdp; qdp++)
258 if (qdp->manid == mid && qdp->prodid == pid)  261 if (qdp->manid == mid && qdp->prodid == pid)
259 return(qdp->quirks); 262 return(qdp->quirks);
260 return(0); 263 return(0);
261} 264}
262 265
263/* 266/*
264 * given a manufacturer id and product id, find the name 267 * given a manufacturer id and product id, find the name
265 * that describes this board. 268 * that describes this board.
266 */ 269 */
267static const char * 270static const char *
268aconflookup(int mid, int pid) 271aconflookup(int mid, int pid)
269{ 272{
270 const struct aconfdata *adp, *eadp; 273 const struct aconfdata *adp, *eadp;
271 274
272 eadp = &aconftab[naconfent]; 275 eadp = &aconftab[naconfent];
273 for (adp = aconftab; adp < eadp; adp++) 276 for (adp = aconftab; adp < eadp; adp++)
274 if (adp->manid == mid && adp->prodid == pid) 277 if (adp->manid == mid && adp->prodid == pid)
275 return(adp->name); 278 return(adp->name);
276 return("board"); 279 return("board");
277} 280}
278 281
279/* 282/*
280 * mainbus driver 283 * mainbus driver
281 */ 284 */
282 285
283CFATTACH_DECL_NEW(zbus, 0, 286CFATTACH_DECL_NEW(zbus, 0,
284 zbusmatch, zbusattach, NULL, NULL); 287 zbusmatch, zbusattach, NULL, NULL);
285 288
286static cfdata_t early_cfdata; 289static cfdata_t early_cfdata;
287 290
288/*ARGSUSED*/ 291/*ARGSUSED*/
289int 292int
290zbusmatch(device_t parent, cfdata_t cf, void *aux) 293zbusmatch(device_t parent, cfdata_t cf, void *aux)
291{ 294{
292 295
293 if (matchname(aux, "zbus") == 0) 296 if (matchname(aux, "zbus") == 0)
294 return(0); 297 return(0);
295 if (amiga_realconfig == 0) 298 if (amiga_realconfig == 0)
296 early_cfdata = cf; 299 early_cfdata = cf;
297 return(1); 300 return(1);
298} 301}
299 302
300/* 303/*
301 * called to attach bus, we probe, i.e., scan configdev structs passed 304 * called to attach bus, we probe, i.e., scan configdev structs passed
302 * in, for each found name call config_found() which will do this again 305 * in, for each found name call config_found() which will do this again
303 * with that driver if matched else print a diag. 306 * with that driver if matched else print a diag.
304 */ 307 */
305void 308void
306zbusattach(device_t parent, device_t self, void *aux) 309zbusattach(device_t parent, device_t self, void *aux)
307{ 310{
308 struct zbus_args za; 311 struct zbus_args za;
309 struct preconfdata *pcp, *epcp; 312 struct preconfdata *pcp, *epcp;
310 struct cfdev *cdp, *ecdp; 313 struct cfdev *cdp, *ecdp;
311 314
312 epcp = &preconftab[npreconfent]; 315 epcp = &preconftab[npreconfent];
313 ecdp = &cfdev[ncfdev]; 316 ecdp = &cfdev[ncfdev];
314 if (amiga_realconfig) { 317 if (amiga_realconfig) {
315 if (ZTWOMEMADDR) 318 if (ZTWOMEMADDR)
316 printf(": mem 0x%08lx-0x%08lx", 319 printf(": mem 0x%08lx-0x%08lx",
317 ZTWOMEMADDR, 320 ZTWOMEMADDR,
318 ZTWOMEMADDR + PAGE_SIZE * NZTWOMEMPG - 1); 321 ZTWOMEMADDR + PAGE_SIZE * NZTWOMEMPG - 1);
319 if (ZBUSAVAIL) 322 if (ZBUSAVAIL)
320 printf (": i/o size 0x%08x", ZBUSAVAIL); 323 printf (": i/o size 0x%08x", ZBUSAVAIL);
321 printf("\n"); 324 printf("\n");
322 } 325 }
323 for (cdp = cfdev; cdp < ecdp; cdp++) { 326 for (cdp = cfdev; cdp < ecdp; cdp++) {
324 for (pcp = preconftab; pcp < epcp; pcp++) { 327 for (pcp = preconftab; pcp < epcp; pcp++) {
325 if (pcp->manid == cdp->rom.manid && 328 if (pcp->manid == cdp->rom.manid &&
326 pcp->prodid == cdp->rom.prodid) 329 pcp->prodid == cdp->rom.prodid)
327 break; 330 break;
328 } 331 }
329 if (amiga_realconfig == 0 && pcp >= epcp) 332 if (amiga_realconfig == 0 && pcp >= epcp)
330 continue; 333 continue;
331 334
332#if NZ3RAMBD > 0 335#if NZ3RAMBD > 0
333 if (z3rambd_match_id(cdp->rom.manid, cdp->rom.prodid) > 0) 336 if (z3rambd_match_id(cdp->rom.manid, cdp->rom.prodid) > 0)
334 { } 337 { }
335 else  338 else
336#endif /* NZ3RAMBD */ 339#endif /* NZ3RAMBD */
337 /* 340 /*
338 * check if it's a Zorro II or III board and not linked into 341 * check if it's a Zorro II or III board and not linked into
339 * MemList (i.e. not a memory board) 342 * MemList (i.e. not a memory board)
340 */ 343 */
341 switch (cdp->rom.type & (ERT_TYPEMASK | ERTF_MEMLIST)) { 344 switch (cdp->rom.type & (ERT_TYPEMASK | ERTF_MEMLIST)) {
342 case ERT_ZORROII: 345 case ERT_ZORROII:
343 case ERT_ZORROIII: 346 case ERT_ZORROIII:
344 break; 347 break;
345 default: 348 default:
346 continue; 349 continue;
347 } 350 }
348 351
349 za.pa = cdp->addr; 352 za.pa = cdp->addr;
350 za.size = cdp->size; 353 za.size = cdp->size;
351 za.manid = cdp->rom.manid; 354 za.manid = cdp->rom.manid;
352 za.prodid = cdp->rom.prodid; 355 za.prodid = cdp->rom.prodid;
353 za.serno = cdp->rom.serno; 356 za.serno = cdp->rom.serno;
354 za.slot = (((u_long)za.pa >> 16) & 0xF) - 0x9; 357 za.slot = (((u_long)za.pa >> 16) & 0xF) - 0x9;
355 358
356 if (amiga_realconfig && pcp < epcp && pcp->vaddr) 359 if (amiga_realconfig && pcp < epcp && pcp->vaddr)
357 za.va = pcp->vaddr; 360 za.va = pcp->vaddr;
358 else { 361 else {
359 if(quirkslookup(za.manid, za.prodid) !=  362 if(quirkslookup(za.manid, za.prodid) !=
360 ZORRO_QUIRK_NO_ZBUSMAP)  363 ZORRO_QUIRK_NO_ZBUSMAP)
361 za.va = (void *) (isztwopa(za.pa) ?  364 za.va = (void *) (isztwopa(za.pa) ?
362 __UNVOLATILE(ztwomap(za.pa)) : 365 __UNVOLATILE(ztwomap(za.pa)) :
363 zbusmap(za.pa, za.size)); 366 zbusmap(za.pa, za.size));
364 /* 367 /*
365 * save value if early console init 368 * save value if early console init
366 */ 369 */
367 if (amiga_realconfig == 0) 370 if (amiga_realconfig == 0)
368 pcp->vaddr = za.va; 371 pcp->vaddr = za.va;
369 } 372 }
370 amiga_config_found(early_cfdata, self, &za, zbusprint); 373 amiga_config_found(early_cfdata, self, &za, zbusprint);
371 } 374 }
372} 375}
373 376
374/* 377/*
375 * print configuration info. 378 * print configuration info.
376 */ 379 */
377int 380int
378zbusprint(void *aux, const char *pnp) 381zbusprint(void *aux, const char *pnp)
379{ 382{
380 struct zbus_args *zap; 383 struct zbus_args *zap;
381 int rv; 384 int rv;
382 385
383 rv = UNCONF; 386 rv = UNCONF;
384 zap = aux; 387 zap = aux;
385 388
386 if (pnp) { 389 if (pnp) {
387 aprint_normal("%s at %s:", 390 aprint_normal("%s at %s:",
388 aconflookup(zap->manid, zap->prodid), pnp); 391 aconflookup(zap->manid, zap->prodid), pnp);
389 if (zap->manid == -1) 392 if (zap->manid == -1)
390 rv = UNSUPP; 393 rv = UNSUPP;
391 } 394 }
392 aprint_normal(" pa %8p man/pro %d/%d", zap->pa, zap->manid, 395 aprint_normal(" pa %8p man/pro %d/%d", zap->pa, zap->manid,
393 zap->prodid); 396 zap->prodid);
394 return(rv); 397 return(rv);
395} 398}
396 399
397/* 400/*
398 * this function is used to map Zorro physical I/O addresses into kernel 401 * this function is used to map Zorro physical I/O addresses into kernel
399 * virtual addresses. We don't keep track which address we map where, we don't 402 * virtual addresses. We don't keep track which address we map where, we don't
400 * NEED to know this. We made sure in amiga_init.c (by scanning all available 403 * NEED to know this. We made sure in amiga_init.c (by scanning all available
401 * Zorro devices) to have enough kva-space available, so there is no extra 404 * Zorro devices) to have enough kva-space available, so there is no extra
402 * range check done here. 405 * range check done here.
403 */ 406 */
404void * 407void *
405zbusmap(void *pa, u_int size) 408zbusmap(void *pa, u_int size)
406{ 409{
407#if defined(__m68k__) 410#if defined(__m68k__)
408 static vaddr_t nextkva = 0; 411 static vaddr_t nextkva = 0;
409 vaddr_t kva; 412 vaddr_t kva;
410 413
411 if (nextkva == 0) 414 if (nextkva == 0)
412 nextkva = ZBUSADDR; 415 nextkva = ZBUSADDR;
413 416
414 if (nextkva > ZBUSADDR + ZBUSAVAIL) 417 if (nextkva > ZBUSADDR + ZBUSAVAIL)
415 return 0; 418 return 0;
416 419
417 /* size better be an integral multiple of the page size... */ 420 /* size better be an integral multiple of the page size... */
418 kva = nextkva; 421 kva = nextkva;
419 nextkva += size; 422 nextkva += size;
420 if (nextkva > ZBUSADDR + ZBUSAVAIL) 423 if (nextkva > ZBUSADDR + ZBUSAVAIL)
421 panic("allocating too much Zorro I/O address space"); 424 panic("allocating too much Zorro I/O address space");
422 physaccess((void *)kva, (void *)pa, size, PG_RW|PG_CI); 425 physaccess((void *)kva, (void *)pa, size, PG_RW|PG_CI);
423 return((void *)kva); 426 return((void *)kva);
424#else 427#else
425/* 428/*
426 * XXX we use direct constant mapping 429 * XXX we use direct constant mapping
427 */ 430 */
428 return(pa); 431 return(pa);
429#endif 432#endif
430} 433}