1*5b509902Stsutsui /* $NetBSD: bmc.c,v 1.6 2015/02/14 05:58:02 tsutsui Exp $ */
2df6945b8Stsutsui
3df6945b8Stsutsui /*
4df6945b8Stsutsui * Copyright (c) 1992 OMRON Corporation.
5df6945b8Stsutsui *
6df6945b8Stsutsui * This code is derived from software contributed to Berkeley by
7df6945b8Stsutsui * OMRON Corporation.
8df6945b8Stsutsui *
9df6945b8Stsutsui * Redistribution and use in source and binary forms, with or without
10df6945b8Stsutsui * modification, are permitted provided that the following conditions
11df6945b8Stsutsui * are met:
12df6945b8Stsutsui * 1. Redistributions of source code must retain the above copyright
13df6945b8Stsutsui * notice, this list of conditions and the following disclaimer.
14df6945b8Stsutsui * 2. Redistributions in binary form must reproduce the above copyright
15df6945b8Stsutsui * notice, this list of conditions and the following disclaimer in the
16df6945b8Stsutsui * documentation and/or other materials provided with the distribution.
17df6945b8Stsutsui * 3. All advertising materials mentioning features or use of this software
18df6945b8Stsutsui * must display the following acknowledgement:
19df6945b8Stsutsui * This product includes software developed by the University of
20df6945b8Stsutsui * California, Berkeley and its contributors.
21df6945b8Stsutsui * 4. Neither the name of the University nor the names of its contributors
22df6945b8Stsutsui * may be used to endorse or promote products derived from this software
23df6945b8Stsutsui * without specific prior written permission.
24df6945b8Stsutsui *
25df6945b8Stsutsui * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26df6945b8Stsutsui * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27df6945b8Stsutsui * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28df6945b8Stsutsui * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29df6945b8Stsutsui * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30df6945b8Stsutsui * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31df6945b8Stsutsui * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32df6945b8Stsutsui * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33df6945b8Stsutsui * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34df6945b8Stsutsui * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35df6945b8Stsutsui * SUCH DAMAGE.
36df6945b8Stsutsui *
37df6945b8Stsutsui * @(#)bmc.c 8.1 (Berkeley) 6/10/93
38df6945b8Stsutsui */
39df6945b8Stsutsui /*
40df6945b8Stsutsui * Copyright (c) 1992, 1993
41df6945b8Stsutsui * The Regents of the University of California. All rights reserved.
42df6945b8Stsutsui *
43df6945b8Stsutsui * This code is derived from software contributed to Berkeley by
44df6945b8Stsutsui * OMRON Corporation.
45df6945b8Stsutsui *
46df6945b8Stsutsui * Redistribution and use in source and binary forms, with or without
47df6945b8Stsutsui * modification, are permitted provided that the following conditions
48df6945b8Stsutsui * are met:
49df6945b8Stsutsui * 1. Redistributions of source code must retain the above copyright
50df6945b8Stsutsui * notice, this list of conditions and the following disclaimer.
51df6945b8Stsutsui * 2. Redistributions in binary form must reproduce the above copyright
52df6945b8Stsutsui * notice, this list of conditions and the following disclaimer in the
53df6945b8Stsutsui * documentation and/or other materials provided with the distribution.
54df6945b8Stsutsui * 3. Neither the name of the University nor the names of its contributors
55df6945b8Stsutsui * may be used to endorse or promote products derived from this software
56df6945b8Stsutsui * without specific prior written permission.
57df6945b8Stsutsui *
58df6945b8Stsutsui * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
59df6945b8Stsutsui * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
60df6945b8Stsutsui * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
61df6945b8Stsutsui * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
62df6945b8Stsutsui * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
63df6945b8Stsutsui * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
64df6945b8Stsutsui * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
65df6945b8Stsutsui * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
66df6945b8Stsutsui * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
67df6945b8Stsutsui * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
68df6945b8Stsutsui * SUCH DAMAGE.
69df6945b8Stsutsui *
70df6945b8Stsutsui * @(#)bmc.c 8.1 (Berkeley) 6/10/93
71df6945b8Stsutsui */
72df6945b8Stsutsui
73df6945b8Stsutsui /*
74df6945b8Stsutsui * bmc.c -- bitmap console driver
75df6945b8Stsutsui * by A.Fujita, JUL-06-1992
76df6945b8Stsutsui */
77df6945b8Stsutsui
78df6945b8Stsutsui #include <sys/param.h>
79df6945b8Stsutsui #include <luna68k/stand/boot/samachdep.h>
80df6945b8Stsutsui #include <luna68k/stand/boot/rcvbuf.h>
81df6945b8Stsutsui #include <luna68k/stand/boot/preset.h>
82df6945b8Stsutsui
83df6945b8Stsutsui /*
84df6945b8Stsutsui * Following are all routines needed for SIO to act as console
85df6945b8Stsutsui */
86df6945b8Stsutsui #include <dev/cons.h>
87df6945b8Stsutsui
88df6945b8Stsutsui void
bmccnprobe(struct consdev * cp)89df6945b8Stsutsui bmccnprobe(struct consdev *cp)
90df6945b8Stsutsui {
910dfe4134Stsutsui
92df6945b8Stsutsui if ((dipsw1 & PS_BMC_CONS) == 0) {
93df6945b8Stsutsui cp->cn_pri = CN_DEAD;
94df6945b8Stsutsui return;
95df6945b8Stsutsui }
96df6945b8Stsutsui
97df6945b8Stsutsui if (nplane == 0) {
98df6945b8Stsutsui cp->cn_pri = CN_DEAD;
99df6945b8Stsutsui return;
100df6945b8Stsutsui }
101df6945b8Stsutsui
102df6945b8Stsutsui /* initialize required fields */
103df6945b8Stsutsui cp->cn_dev = 1;
104df6945b8Stsutsui cp->cn_pri = CN_NORMAL;
105df6945b8Stsutsui }
106df6945b8Stsutsui
107df6945b8Stsutsui void
bmccninit(struct consdev * cp)108df6945b8Stsutsui bmccninit(struct consdev *cp)
109df6945b8Stsutsui {
1100dfe4134Stsutsui
111df6945b8Stsutsui sioinit();
112df6945b8Stsutsui bmdinit();
113df6945b8Stsutsui }
114df6945b8Stsutsui
115df6945b8Stsutsui int
bmccngetc(dev_t dev)116df6945b8Stsutsui bmccngetc(dev_t dev)
117df6945b8Stsutsui {
118df6945b8Stsutsui int c;
119df6945b8Stsutsui int unit = 1;
120df6945b8Stsutsui
121bd88a8a6Stsutsui if (RBUF_EMPTY(unit))
122bd88a8a6Stsutsui return 0;
123df6945b8Stsutsui
124df6945b8Stsutsui POP_RBUF(unit, c);
125df6945b8Stsutsui
1260dfe4134Stsutsui #if 1
1270dfe4134Stsutsui return c;
1280dfe4134Stsutsui #else
1290dfe4134Stsutsui return siocngetc(dev);
1300dfe4134Stsutsui #endif
131df6945b8Stsutsui }
132df6945b8Stsutsui
133df6945b8Stsutsui void
bmccnputc(dev_t dev,int c)134df6945b8Stsutsui bmccnputc(dev_t dev, int c)
135df6945b8Stsutsui {
1360dfe4134Stsutsui
137df6945b8Stsutsui bmdputc(c);
138df6945b8Stsutsui }
139