summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc/include
diff options
context:
space:
mode:
authorDale S. Rahn <rahnds@cvs.openbsd.org>1998-09-27 03:56:01 +0000
committerDale S. Rahn <rahnds@cvs.openbsd.org>1998-09-27 03:56:01 +0000
commite3799eda2b35d8e52c1c33dde47c2664a22c23f9 (patch)
tree3160d2ae2c991b41feeabc8e0b5e1516442a9902 /sys/arch/powerpc/include
parent757fb5ee59b0ab06de192f2cc51dc8d7a7744bbd (diff)
add wscons support to powerpc port.
This contains several pieces of the port MI: vgafb, on powerpc under openfirmware the vga card comes up in gfx mode. instead of resetting it to text mode, vgafb treats this as a raster display. The mechanism used may not have been the best, it's interface to wscons is as a text display, and it does the character plotting itself. font_8x16.c was stolen from the atari port for use. MD: ppcppi support stolen from alpha pms.c, pckbd.c and the rest of the support files were used nearly directly. powerpc conf.c to support wscon, vga/kbd machdep.c hack to get around a bus_space_set_region,bus_space_copy error. ofw_machdep.c some hack code on the road to supporting wscons as console.
Diffstat (limited to 'sys/arch/powerpc/include')
-rw-r--r--sys/arch/powerpc/include/kbio.h118
-rw-r--r--sys/arch/powerpc/include/vuid_event.h88
-rw-r--r--sys/arch/powerpc/include/wsconsio.h62
3 files changed, 268 insertions, 0 deletions
diff --git a/sys/arch/powerpc/include/kbio.h b/sys/arch/powerpc/include/kbio.h
new file mode 100644
index 00000000000..d6a3e38edf2
--- /dev/null
+++ b/sys/arch/powerpc/include/kbio.h
@@ -0,0 +1,118 @@
+/* $OpenBSD: kbio.h,v 1.1 1998/09/27 03:55:57 rahnds Exp $ */
+/* $NetBSD: kbio.h,v 1.1 1996/04/12 01:45:45 cgd Exp $ */
+
+/*
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
+ * contributed to Berkeley.
+ *
+ * All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Lawrence Berkeley Laboratory.
+ *
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ * @(#)kbio.h 8.1 (Berkeley) 6/11/93
+ */
+
+#if 0 /* XXX */
+/*
+ * The following is a minimal emulation of Sun's `kio' structures
+ * and related operations necessary to make X11 happy (i.e., make it
+ * compile, and make old X11 binaries run).
+ */
+
+/*
+ * The kiockey structure apparently gets and/or sets keyboard mappings.
+ * It seems to be kind of useless, but X11 uses it (according to the
+ * comments) to figure out when a Sun 386i has a type-4 keyboard but
+ * claims to have a type-3 keyboard. We need just enough to cause the
+ * appropriate ioctl to return the appropriate magic value.
+ *
+ * KIOCGETKEY fills in kio_entry from kio_station. Not sure what tablemask
+ * is for; X sets it before the call, so it is not an output, but we do not
+ * care anyway. KIOCSDIRECT is supposed to tell the kernel whether to send
+ * keys to the console or to X; we just send them to X whenever the keyboard
+ * is open at all. (XXX may need to change this later)
+ *
+ * Keyboard commands and types are defined in kbd.h as they are actually
+ * real hardware commands and type numbers.
+ */
+struct okiockey { /* Out-dated key translation structure */
+ int kio_tablemask; /* whatever */
+ u_char kio_station; /* key number */
+ u_char kio_entry; /* HOLE if not present */
+ char kio_text[10]; /* the silly escape sequences (unsupported) */
+};
+
+struct kiockey {
+ int kio_tablemask; /* whatever */
+ u_char kio_station; /* key number */
+ u_short kio_entry; /* HOLE if not present */
+ char kio_text[10]; /* the silly escape sequences (unsupported) */
+};
+
+/*
+ * Values for kio_tablemask. These determine which table to read/modify
+ * in KIOC[SG]KEY ioctls. Currently, we only have "non-shift" and "shift"
+ * tables.
+ */
+#define KIOC_NOMASK 0x0
+#define KIOC_CAPSMASK 0x1
+#define KIOC_SHIFTMASK 0xe
+#define KIOC_CTRLMASK 0x30
+#define KIOC_ALTGMASK 0x200
+#define KIOC_NUMLMASK 0x800
+
+#define HOLE 0x302 /* value for kio_entry to say `really type 3' */
+
+#define KIOCTRANS _IOW('k', 0, int) /* set translation mode */
+ /* (we only accept TR_UNTRANS_EVENT) */
+#define KIOCGETKEY _IOWR('k', 2, struct okiockey) /* fill in kio_entry */
+#define KIOCGTRANS _IOR('k', 5, int) /* get translation mode */
+#define KIOCCMD _IOW('k', 8, int) /* X uses this to ring bell */
+#define KIOCTYPE _IOR('k', 9, int) /* get keyboard type */
+#endif /* 0 XXX */
+#define KIOCSDIRECT _IOW('k', 10, int) /* keys to console? */
+#if 0 /* XXX */
+#define KIOCSKEY _IOW('k', 12, struct kiockey) /* set xlat mode */
+#define KIOCGKEY _IOWR('k', 13, struct kiockey) /* get xlat mode */
+#define KIOCLAYOUT _IOR('k', 20, int) /* get keyboard layout */
+#define KIOCSLED _IOW('k', 14, char) /* set LED state */
+#define KIOCGLED _IOR('k', 15, char) /* get LED state */
+
+#define TR_NONE 0 /* X compat, unsupported */
+#define TR_ASCII 1 /* X compat, unsupported */
+#define TR_EVENT 2 /* X compat, unsupported */
+#define TR_UNTRANS_EVENT 3
+#endif /* 0 XXX */
diff --git a/sys/arch/powerpc/include/vuid_event.h b/sys/arch/powerpc/include/vuid_event.h
new file mode 100644
index 00000000000..21576cf8e26
--- /dev/null
+++ b/sys/arch/powerpc/include/vuid_event.h
@@ -0,0 +1,88 @@
+/* $OpenBSD: vuid_event.h,v 1.1 1998/09/27 03:55:57 rahnds Exp $ */
+/* $NetBSD: vuid_event.h,v 1.1 1996/04/12 01:45:47 cgd Exp $ */
+
+/*
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
+ * contributed to Berkeley.
+ *
+ * All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Lawrence Berkeley Laboratory.
+ *
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ * @(#)vuid_event.h 8.1 (Berkeley) 6/11/93
+ */
+
+/*
+ * The following is a minimal emulation of Sun's `Firm_event' structures
+ * and related operations necessary to make X11 happy (i.e., make it
+ * compile, and make old X11 binaries run).
+ */
+typedef struct firm_event {
+ u_short id; /* key or MS_* or LOC_[XY]_DELTA */
+ u_short pad; /* unused, at least by X11 */
+ int value; /* VKEY_{UP,DOWN} or locator delta */
+ struct timeval time;
+} Firm_event;
+
+/*
+ * Special `id' fields. These weird numbers simply match the old binaries.
+ * Others are in 0..0x7f and are keyboard key numbers (keyboard dependent!).
+ */
+#define MS_LEFT 0x7f20 /* left mouse button */
+#define MS_MIDDLE 0x7f21 /* middle mouse button */
+#define MS_RIGHT 0x7f22 /* right mouse button */
+#define LOC_X_DELTA 0x7f80 /* mouse delta-X */
+#define LOC_Y_DELTA 0x7f81 /* mouse delta-Y */
+#define LOC_X_ABSOLUTE 0x7f82 /* X compat, unsupported */
+#define LOC_Y_ABSOLUTE 0x7f83 /* X compat, unsupported */
+
+/*
+ * Special `value' fields. These apply to keys and mouse buttons. The
+ * value of a mouse delta is the delta. Note that positive deltas are
+ * left and up (not left and down as you might expect).
+ */
+#define VKEY_UP 0 /* key or button went up */
+#define VKEY_DOWN 1 /* key or button went down */
+
+/*
+ * The following ioctls are clearly intended to take things in and out
+ * of `firm event' mode. Since we always run in this mode (as far as
+ * /dev/kbd and /dev/mouse are concerned, anyway), we always claim to
+ * be in this mode and reject anything else.
+ */
+#define VUIDSFORMAT _IOW('v', 1, int)
+#define VUIDGFORMAT _IOR('v', 2, int)
+#define VUID_FIRM_EVENT 1 /* the only format we support */
diff --git a/sys/arch/powerpc/include/wsconsio.h b/sys/arch/powerpc/include/wsconsio.h
new file mode 100644
index 00000000000..9fe9ba4c58d
--- /dev/null
+++ b/sys/arch/powerpc/include/wsconsio.h
@@ -0,0 +1,62 @@
+/* $OpenBSD: wsconsio.h,v 1.1 1998/09/27 03:55:57 rahnds Exp $ */
+/* $NetBSD: wsconsio.h,v 1.1 1996/04/12 01:43:06 cgd Exp $ */
+
+/*
+ * Copyright (c) 1995, 1996 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+/*
+ * Get keyboard type. Keyboard type definitions are below.
+ */
+#define WSCONSIO_KBD_GTYPE _IOR('W',100,int)
+#define KBD_TYPE_LK201 0 /* lk-201 */
+#define KBD_TYPE_LK401 1 /* lk-401 */
+#define KBD_TYPE_PC 2 /* pc-like */
+
+/*
+ * If arg is one, don't process scancodes into characters
+ */
+#define WSCONSIO_KBD_SCANCODES _IO('W',101,int)
+
+/*
+ * Bell ioctls.
+ */
+
+struct wsconsio_bell_data {
+ int wbd_flags;
+ int wbd_pitch; /* pitch, in Hz. */
+ int wbd_period; /* period, in milliseconds. */
+ int wbd_volume; /* percentage of maximum volume. */
+};
+
+#define WSCONSIO_BELLDATA_PITCH 0x01 /* pitch data present */
+#define WSCONSIO_BELLDATA_PERIOD 0x02 /* period data present */
+#define WSCONSIO_BELLDATA_VOLUME 0x04 /* volume data present */
+
+#define WSCONSIO_BELL _IO('W',102)
+#define WSCONSIO_COMPLEXBELL _IOW('W',103,struct wsconsio_bell_data)
+#define WSCONSIO_SETBELL _IOW('W',104,struct wsconsio_bell_data)
+#define WSCONSIO_GETBELL _IOR('W',105,struct wsconsio_bell_data)