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