diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2002-08-12 10:44:05 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2002-08-12 10:44:05 +0000 |
commit | 15dafe6228319925897f71b6a78bb04ebfb3abc4 (patch) | |
tree | 2bfbe764cfc6f9b1e3c6ca9d29d0881a4283149e /sys/arch/sparc/include | |
parent | a83486fe3ff711d8b3727f8abae7995141bb7562 (diff) |
Convert sparc console code from rcons and pseudo-devices to rasops and wscons.
For most framebuffers it is faster.
Other changes include:
o 24 bit support in tcx(4) for the S24 framebuffer
o accelerated cgsix(4) text console
o new cgtwelve(4) driver for the GS framebuffer
o improved serial driver code
o better keyboard support
The following framebuffers have not been tested but should work: cgfour,
cgeight and cgfourteen
These changes will require XF4 changes, to use Xwsfb instead of Xsun*, to be
commited later today.
Most of the work by me during the LSM and the week after, with code borrowed
from jason@, NetBSD (new serial code), and feedback from mickey@. Work on
pnozz(4) done by millert@
Diffstat (limited to 'sys/arch/sparc/include')
-rw-r--r-- | sys/arch/sparc/include/cgtworeg.h | 267 | ||||
-rw-r--r-- | sys/arch/sparc/include/conf.h | 26 | ||||
-rw-r--r-- | sys/arch/sparc/include/cpu.h | 7 | ||||
-rw-r--r-- | sys/arch/sparc/include/fbio.h | 188 | ||||
-rw-r--r-- | sys/arch/sparc/include/fbvar.h | 77 | ||||
-rw-r--r-- | sys/arch/sparc/include/kbd.h | 169 | ||||
-rw-r--r-- | sys/arch/sparc/include/kbio.h | 114 | ||||
-rw-r--r-- | sys/arch/sparc/include/psl.h | 3 | ||||
-rw-r--r-- | sys/arch/sparc/include/z8530var.h (renamed from sys/arch/sparc/include/vuid_event.h) | 75 |
9 files changed, 73 insertions, 853 deletions
diff --git a/sys/arch/sparc/include/cgtworeg.h b/sys/arch/sparc/include/cgtworeg.h deleted file mode 100644 index 4660ba7f2b6..00000000000 --- a/sys/arch/sparc/include/cgtworeg.h +++ /dev/null @@ -1,267 +0,0 @@ -/* $OpenBSD: cgtworeg.h,v 1.2 1997/08/08 08:26:09 downsj Exp $ */ -/* $NetBSD: cgtworeg.h,v 1.3 1995/10/04 00:21:27 pk Exp $ */ - -/* - * Copyright (c) 1994 Dennis Ferguson - * All rights reserved. - * - * 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. - */ - -/* cgtworeg.h - CG2 colour frame buffer definitions - * - * The mapped memory looks like: - * - * offset contents - * 0x000000 bit plane map - 1st (of 8) plane used by the X server in -mono mode - * 0x100000 pixel map - used by the X server in color mode - * 0x200000 raster op mode memory map - unused by X server - * 0x300000 random control registers (lots of spaces in between) - * 0x310000 shadow colour map - */ - -/* Frame buffer memory size and depth */ -#define CG2_FBSIZE (1024 * 1024) -#define CG2_N_PLANE 8 - -/* Screen dimensions */ -#define CG2_WIDTH 1152 -#define CG2_HEIGHT 900 - -/* Colourmap size */ -#define CG2_CMSIZE 256 - -#define CG2_BITPLANE_OFF 0 -#define CG2_BITPLANE_SIZE 0x100000 -#define CG2_PIXMAP_OFF (CG2_BITPLANE_OFF + CG2_BITPLANE_SIZE) -#define CG2_PIXMAP_SIZE 0x100000 -#define CG2_ROPMEM_OFF (CG2_PIXMAP_OFF + CG2_PIXMAP_SIZE) -#define CG2_ROPMEM_SIZE 0x100000 -#define CG2_CTLREG_OFF (CG2_ROPMEM_OFF + CG2_ROPMEM_SIZE) -#define CG2_CTLREG_SIZE 0x010600 -#define CG2_MAPPED_SIZE (CG2_CTLREG_OFF + CG2_CTLREG_SIZE) - - -/* arrangement of bit plane mode memory */ -union bitplane { - u_short word[CG2_HEIGHT][CG2_WIDTH/(CG2_N_PLANE * sizeof(u_short))]; - u_short plane[CG2_FBSIZE/(CG2_N_PLANE * sizeof(u_short))]; -}; - -/* arrangement of pixel mode memory */ -union byteplane { - u_char pixel[CG2_HEIGHT][CG2_WIDTH]; - u_char frame[CG2_FBSIZE]; -}; - - -/* - * Structure describing the first two megabytes of the frame buffer. - * Normal memory maps in bit plane and pixel modes - */ -struct cg2memfb { - union bitplane memplane[CG2_N_PLANE]; /* bit plane map */ - union byteplane pixplane; /* pixel map */ -}; - - -/* - * Control/status register. The X server only appears to use update_cmap - * and video_enab. - */ -struct cg2statusreg { - u_int reserved : 2; /* not used */ - u_int fastread : 1; /* r/o: has some feature I don't understand */ - u_int id : 1; /* r/o: ext status and ID registers exist */ - u_int resolution : 4; /* screen resolution, 0 means 1152x900 */ - u_int retrace : 1; /* r/o: retrace in progress */ - u_int inpend : 1; /* r/o: interrupt request */ - u_int ropmode : 3; /* ?? */ - u_int inten : 1; /* interrupt enable (for end of retrace) */ - u_int update_cmap : 1; /* copy/use shadow colour map */ - u_int video_enab : 1; /* enable video */ -}; - - -/* - * Extended status register. Unused by X server - */ -struct cg2_extstatus { - u_int gpintreq : 1; /* interrupt request */ - u_int gpintdis : 1; /* interrupt disable */ - u_int reserved : 13; /* unused */ - u_int gpbus : 1; /* bus enabled */ -}; - - -/* - * Double buffer control register. It appears that (some of?) the - * cg2 cards support a pair of memory sets, referred to as `A' and - * `B', which can be swapped to allow atomic screen updates. This - * controls them. - */ -struct dblbufreg { - u_int display_b : 1; /* display memory B (set) or A (reset) */ - u_int read_b : 1; /* accesss memory B (set) or A (reset) */ - u_int nowrite_b : 1; /* when set, writes don't update memory B */ - u_int nowrite_a : 1; /* when set, writes don't update memory A */ - u_int read_ecmap : 1; /* copy from(clear)/to(set) shadow colour map */ - u_int fast_read : 1; /* fast reads, but wrong data */ - u_int wait : 1; /* when set, remains so to end up v. retrace */ - u_int update_ecmap : 1; /* copy/use shadow colour map */ - u_int reserved : 8; -}; - - -/* - * Zoom register, apparently present on Sun-2 colour boards only. See - * the Sun documentation, I don't know anyone who still has a Sun-2. - */ -struct cg2_zoom { - union { - u_int short reg; - u_char reg_pad[4096]; - } wordpan; - union { - struct { - u_int unused : 8; - u_int lineoff : 4; - u_int pixzoom : 4; - } reg; - u_short word; - u_char reg_pad[4096]; - } zoom; - union { - struct { - u_int unused : 8; - u_int lorigin : 4; - u_int pixeloff : 4; - } reg; - u_short word; - u_char reg_pad[4096]; - } pixpan; - union { - u_short reg; - u_char reg_pad[4096]; - } varzoom; -}; - - -/* - * Miscellany. On the Sun-3 these registers exist in place of the above. - */ -struct cg2_nozoom { - union { /* double buffer register (see above) */ - struct dblbufreg reg; - u_short word; - u_char reg_pad[4096]; - } dblbuf; - union { /* start of dma window */ - u_short reg; - u_char reg_pad[4096]; - } dmabase; - union { /* dma window size */ - u_short reg; /* actually 8 bits. reg*16 == size */ - u_char reg_pad[4096]; - } dmawidth; - union { /* frame count */ - u_short reg; /* actually 8 bits only. r/o */ - u_char reg_pad[4096]; - } framecnt; -}; - - -/* - * Raster op control registers. X doesn't use this, but documented here - * for future reference. - */ -struct memropc { - u_short mrc_dest; - u_short mrc_source1; - u_short mrc_source2; - u_short mrc_pattern; - u_short mrc_mask1; - u_short mrc_mask2; - u_short mrc_shift; - u_short mrc_op; - u_short mrc_width; - u_short mrc_opcount; - u_short mrc_decoderout; - u_short mrc_x11; - u_short mrc_x12; - u_short mrc_x13; - u_short mrc_x14; - u_short mrc_x15; -}; - - -/* - * Last chunk of the frame buffer (i.e. from offset 0x200000 and above). - * Exists separately from struct cg2memfb apparently because Sun software - * avoids mapping the latter, though X uses it. - */ -struct cg2fb { - union { /* raster op mode frame memory */ - union bitplane ropplane[CG2_N_PLANE]; - union byteplane roppixel; - } ropio; - union { /* raster op control unit (1 per plane) */ - struct memropc ropregs; - struct { - u_char pad[2048]; - struct memropc ropregs; - } prime; - u_char reg_pad[4096]; - } ropcontrol[9]; - union { /* status register */ - struct cg2statusreg reg; - u_short word; - u_char reg_pad[4096]; - } status; - union { /* per-plane mask register */ - u_short reg; /* 8 bit mask register - set means plane r/w */ - u_char reg_pad[4096]; - } ppmask; - union { /* miscellaneous registers */ - struct cg2_zoom zoom; - struct cg2_nozoom nozoom; - } misc; - union { /* interrupt vector */ - u_short reg; - u_char reg_pad[32]; - } intrptvec; - union { /* board ID */ - u_short reg; - u_char reg_pad[16]; - } id; - union { /* extended status */ - struct cg2_extstatus reg; - u_short word; - u_char reg_pad[16]; - } extstatus; - union { /* auxiliary raster op mode register (?)*/ - u_short reg; - u_char reg_pad[4032]; - } ropmode; - u_short redmap[CG2_CMSIZE]; /* shadow colour maps */ - u_short greenmap[CG2_CMSIZE]; - u_short bluemap[CG2_CMSIZE]; -}; diff --git a/sys/arch/sparc/include/conf.h b/sys/arch/sparc/include/conf.h index eab974b0ba0..bcd92828dce 100644 --- a/sys/arch/sparc/include/conf.h +++ b/sys/arch/sparc/include/conf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.h,v 1.15 2002/07/10 22:08:47 mickey Exp $ */ +/* $OpenBSD: conf.h,v 1.16 2002/08/12 10:44:04 miod Exp $ */ /* $NetBSD: conf.h,v 1.8 1996/12/31 07:12:43 mrg Exp $ */ /* @@ -48,36 +48,12 @@ cdev_decl(zs); bdev_decl(fd); cdev_decl(fd); -cdev_decl(fb); - /* open, close, read, write, ioctl, select */ #define cdev_gen_init(c,n) { \ dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \ dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) nullop, \ 0, dev_init(c,n,select), (dev_type_mmap((*))) enodev } -cdev_decl(ms); - -cdev_decl(kbd); - -cdev_decl(bwtwo); - -cdev_decl(cgtwo); - -cdev_decl(cgthree); - -cdev_decl(cgfour); - -cdev_decl(cgsix); - -cdev_decl(cgeight); - -cdev_decl(tcx); - -cdev_decl(cgfourteen); - -cdev_decl(p9100); - bdev_decl(xd); cdev_decl(xd); diff --git a/sys/arch/sparc/include/cpu.h b/sys/arch/sparc/include/cpu.h index ee501d4cc3f..802036af481 100644 --- a/sys/arch/sparc/include/cpu.h +++ b/sys/arch/sparc/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.16 2002/06/14 04:16:06 art Exp $ */ +/* $OpenBSD: cpu.h,v 1.17 2002/08/12 10:44:04 miod Exp $ */ /* $NetBSD: cpu.h,v 1.24 1997/03/15 22:25:15 pk Exp $ */ /* @@ -213,11 +213,8 @@ void kill_user_windows(struct proc *); int rwindow_save(struct proc *); /* amd7930intr.s */ void amd7930_trap(void); -/* cons.c */ -int cnrom(void); -/* zs.c */ -void zsconsole(struct tty *, int, int, int (**)(struct tty *, int)); #ifdef KGDB +/* zs_kgdb.c */ void zs_kgdb_init(void); #endif /* fb.c */ diff --git a/sys/arch/sparc/include/fbio.h b/sys/arch/sparc/include/fbio.h deleted file mode 100644 index 2ae9149767e..00000000000 --- a/sys/arch/sparc/include/fbio.h +++ /dev/null @@ -1,188 +0,0 @@ -/* $OpenBSD: fbio.h,v 1.4 2001/09/16 00:42:44 millert Exp $ */ -/* $NetBSD: fbio.h,v 1.5 1996/09/30 23:45:11 abrown Exp $ */ - -/* - * Copyright (c) 1992 Regents of the University of California. - * All rights reserved. - * - * This code is derived from software developed by the Computer Systems - * Engineering group at Lawrence Berkeley Laboratory under DARPA - * contract BG 91-66 and contributed to Berkeley. - * - * 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. - * - * @(#)fbio.h 7.2 (Berkeley) 4/1/92 - */ - -/* - * Frame buffer ioctls (from Sprite, trimmed to essentials for X11). - */ - -/* - * Frame buffer type codes. - */ -#define FBTYPE_SUN1BW 0 /* multibus mono */ -#define FBTYPE_SUN1COLOR 1 /* multibus color */ -#define FBTYPE_SUN2BW 2 /* memory mono */ -#define FBTYPE_SUN2COLOR 3 /* color w/rasterop chips */ -#define FBTYPE_SUN2GP 4 /* GP1/GP2 */ -#define FBTYPE_SUN5COLOR 5 /* RoadRunner accelerator */ -#define FBTYPE_SUN3COLOR 6 /* memory color */ -#define FBTYPE_MEMCOLOR 7 /* memory 24-bit */ -#define FBTYPE_SUN4COLOR 8 /* memory color w/overlay */ - -#define FBTYPE_NOTSUN1 9 /* reserved for customer */ -#define FBTYPE_NOTSUN2 10 /* reserved for customer */ -#define FBTYPE_NOTSUN3 11 /* reserved for customer */ - -#define FBTYPE_SUNFAST_COLOR 12 /* accelerated 8bit */ -#define FBTYPE_SUNROP_COLOR 13 /* MEMCOLOR with rop h/w */ -#define FBTYPE_SUNFB_VIDEO 14 /* Simple video mixing */ -#define FBTYPE_RESERVED5 15 /* reserved, do not use */ -#define FBTYPE_RESERVED4 16 /* reserved, do not use */ -#define FBTYPE_RESERVED3 17 /* reserved, do not use */ -#define FBTYPE_SUNGP3 17 /* cg12 running gpsi microcode */ -#define FBTYPE_SUNGT 18 /* gt graphics accelerator */ -#define FBTYPE_SUNLEO 19 /* zx graphics accelerator */ -#define FBTYPE_MDICOLOR 20 /* cgfourteen framebuffer */ - -#define FBTYPE_LASTPLUSONE 21 /* max number of fbs (change as add) */ - -/* - * Frame buffer descriptor as returned by FBIOGTYPE. - */ -struct fbtype { - int fb_type; /* as defined above */ - int fb_height; /* in pixels */ - int fb_width; /* in pixels */ - int fb_depth; /* bits per pixel */ - int fb_cmsize; /* size of color map (entries) */ - int fb_size; /* total size in bytes */ -}; -#define FBIOGTYPE _IOR('F', 0, struct fbtype) - -#ifdef notdef -/* - * General purpose structure for passing info in and out of frame buffers - * (used for gp1) -- unsupported. - */ -struct fbinfo { - int fb_physaddr; /* physical frame buffer address */ - int fb_hwwidth; /* fb board width */ - int fb_hwheight; /* fb board height */ - int fb_addrdelta; /* phys addr diff between boards */ - u_char *fb_ropaddr; /* fb virtual addr */ - int fb_unit; /* minor devnum of fb */ -}; -#define FBIOGINFO _IOR('F', 2, struct fbinfo) -#endif - -/* - * Color map I/O. - */ -struct fbcmap { - u_int index; /* first element (0 origin) */ - u_int count; /* number of elements */ - u_char *red; /* red color map elements */ - u_char *green; /* green color map elements */ - u_char *blue; /* blue color map elements */ -}; -#define FBIOPUTCMAP _IOW('F', 3, struct fbcmap) -#define FBIOGETCMAP _IOW('F', 4, struct fbcmap) - -/* - * Set/get attributes. - */ -#define FB_ATTR_NDEVSPECIFIC 8 /* no. of device specific values */ -#define FB_ATTR_NEMUTYPES 4 /* no. of emulation types */ - -struct fbsattr { - int flags; /* flags; see below */ - int emu_type; /* emulation type (-1 if unused) */ - int dev_specific[FB_ATTR_NDEVSPECIFIC]; /* catchall */ -}; -#define FB_ATTR_AUTOINIT 1 /* emulation auto init flag */ -#define FB_ATTR_DEVSPECIFIC 2 /* dev. specific stuff valid flag */ - -struct fbgattr { - int real_type; /* real device type */ - int owner; /* PID of owner, 0 if myself */ - struct fbtype fbtype; /* fbtype info for real device */ - struct fbsattr sattr; /* see above */ - int emu_types[FB_ATTR_NEMUTYPES]; /* possible emulations */ - /* (-1 if unused) */ -}; -/* FBIOSATTR _IOW('F', 5, struct fbsattr) -- unsupported */ -#define FBIOGATTR _IOR('F', 6, struct fbgattr) - -/* - * Video control. - */ -#define FBVIDEO_OFF 0 -#define FBVIDEO_ON 1 - -#define FBIOSVIDEO _IOW('F', 7, int) -#define FBIOGVIDEO _IOR('F', 8, int) - -/* - * hardware cursor control - */ -struct fbcurpos { - short x; - short y; -}; - -#define FB_CUR_SETCUR 0x01 -#define FB_CUR_SETPOS 0x02 -#define FB_CUR_SETHOT 0x04 -#define FB_CUR_SETCMAP 0x08 -#define FB_CUR_SETSHAPE 0x10 -#define FB_CUR_SETALL 0x1F - -struct fbcursor { - short set; /* what to set */ - short enable; /* enable/disable cursor */ - struct fbcurpos pos; /* cursor's position */ - struct fbcurpos hot; /* cursor's hot spot */ - struct fbcmap cmap; /* color map info */ - struct fbcurpos size; /* cursor's bit map size */ - char *image; /* cursor's image bits */ - char *mask; /* cursor's mask bits */ -}; - -/* set/get cursor attributes/shape */ -#define FBIOSCURSOR _IOW('F', 24, struct fbcursor) -#define FBIOGCURSOR _IOWR('F', 25, struct fbcursor) - -/* set/get cursor position */ -#define FBIOSCURPOS _IOW('F', 26, struct fbcurpos) -#define FBIOGCURPOS _IOW('F', 27, struct fbcurpos) - -/* get max cursor size */ -#define FBIOGCURMAX _IOR('F', 28, struct fbcurpos) diff --git a/sys/arch/sparc/include/fbvar.h b/sys/arch/sparc/include/fbvar.h index 6ddf438f567..f8b9e1028d6 100644 --- a/sys/arch/sparc/include/fbvar.h +++ b/sys/arch/sparc/include/fbvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fbvar.h,v 1.5 2002/03/14 01:26:43 millert Exp $ */ +/* $OpenBSD: fbvar.h,v 1.6 2002/08/12 10:44:04 miod Exp $ */ /* $NetBSD: fbvar.h,v 1.9 1997/07/07 23:31:30 pk Exp $ */ /* @@ -46,60 +46,47 @@ */ /* - * Frame buffer variables. All frame buffer drivers must provide the - * following in order to participate. + * Frame buffer device flags. + * + * XXX add flags to run 24 bit framebuffers in 8 bit mode if possible? */ -#ifdef RASTERCONSOLE -#include <dev/rcons/rcons.h> -#endif - -struct fbdriver { - /* device unblank function (force kernel output to display) */ - void (*fbd_unblank)(struct device *); - int (*fbd_open)(dev_t, int, int, struct proc *); - int (*fbd_close)(dev_t, int, int, struct proc *); - int (*fbd_ioctl)(dev_t, u_long, caddr_t, int, struct proc *); - paddr_t (*fbd_mmap)(dev_t, off_t, int); -#ifdef notyet - void (*fbd_wrrop)(); /* `write region' rasterop */ - void (*fbd_cprop)(); /* `copy region' rasterop */ - void (*fbd_clrop)(); /* `clear region' rasterop */ -#endif -}; +#define FB_PFOUR 0x00010000 /* indicates fb is a pfour fb */ +#define FB_USERMASK (0) /* flags that the user can set */ -struct fbdevice { - int fb_major; /* XXX */ - struct fbtype fb_type; /* what it says */ - caddr_t fb_pixels; /* display RAM */ - int fb_linebytes; /* bytes per display line */ +/* + * Common frame buffer variables. + * All framebuffer softc structures must start with such a structure. + */ +struct sunfb { + struct device sf_dev; /* base device */ - struct fbdriver *fb_driver; /* pointer to driver */ - struct device *fb_device; /* parameter for fbd_unblank */ + int sf_width; + int sf_height; + int sf_depth; + int sf_linebytes; - int fb_flags; /* misc. flags */ -#define FB_FORCE 0x00000001 /* force device into /dev/fb */ -#define FB_PFOUR 0x00010000 /* indicates fb is a pfour fb */ -#define FB_USERMASK (FB_FORCE) /* flags that the user can set */ + int sf_fbsize; /* sf_height * sf_linebytes */ - volatile u_int32_t *fb_pfour; /* pointer to pfour register */ + int sf_flags; + volatile u_int32_t* sf_pfour; /* P4 register when applicable */ -#ifdef RASTERCONSOLE - /* Raster console emulator state */ - struct rconsole fb_rcons; -#endif + struct rasops_info sf_ro; }; -void fb_attach(struct fbdevice *, int); -void fb_setsize(struct fbdevice *, int, int, int, int, int); -#ifdef RASTERCONSOLE -void fbrcons_init(struct fbdevice *); -int fbrcons_rows(void); -int fbrcons_cols(void); -#endif +/* + * Selected framebuffer node on OBP systems if k/d console. + */ +extern int fbnode; + +void fb_setsize(struct sunfb*, int, int, int, int, int); +void fbwscons_init(struct sunfb *, int); +void fbwscons_console_init(struct sunfb *, struct wsscreen_descr *, int, + void (*)(void *, u_int, u_int8_t, u_int8_t, u_int8_t), + void (*)(void *, u_int, u_int)); #if defined(SUN4) int fb_pfour_id(void *); -int fb_pfour_get_video(struct fbdevice *); -void fb_pfour_set_video(struct fbdevice *, int); +int fb_pfour_get_video(struct sunfb *); +void fb_pfour_set_video(struct sunfb *, int); #endif diff --git a/sys/arch/sparc/include/kbd.h b/sys/arch/sparc/include/kbd.h deleted file mode 100644 index 08276c2f5d3..00000000000 --- a/sys/arch/sparc/include/kbd.h +++ /dev/null @@ -1,169 +0,0 @@ -/* $OpenBSD: kbd.h,v 1.9 2002/03/14 03:16:00 millert Exp $ */ -/* $NetBSD: kbd.h,v 1.6 1996/03/31 22:21:35 pk 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. - * - * @(#)kbd.h 8.1 (Berkeley) 6/11/93 - */ - -/* - * Keyboard `registers'. (This should be called kbd_reg.h but we need to - * be compatible.) - */ - -/* - * Control codes sent from type 2, 3, and 4 keyboards. - * - * Note that KBD_RESET is followed by a keyboard ID, while KBD_IDLE is not. - * KBD_IDLE does not take the place of any `up' transitions (it merely occurs - * after them). - */ -#define KBD_RESET 0xff /* keyboard `reset' response */ -#define KBD_IDLE 0x7f /* keyboard `all keys are up' code */ -#define KBD_LAYOUT 0xfe /* keyboard `get layout' response */ - -/* Keyboard IDs */ -#define KB_SUN2 2 /* type 2 keyboard */ -#define KB_SUN3 3 /* type 3 keyboard */ -#define KB_SUN4 4 /* type 4 keyboard */ - -/* Key codes are in 0x00..0x7e; KBD_UP is set if the key goes up */ -#define KBD_KEYMASK 0x7f /* keyboard key mask */ -#define KBD_UP 0x80 /* keyboard `up' transition */ - -/* Keyboard codes needed to recognize the L1-A sequence */ -#define KBD_L1 1 /* keyboard code for `L1' key */ -#define KBD_A 77 /* keyboard code for `A' key */ - -/* Control codes sent to the various keyboards */ -#define KBD_CMD_RESET 1 /* reset keyboard */ -#define KBD_CMD_BELL 2 /* turn bell on */ -#define KBD_CMD_NOBELL 3 /* turn bell off */ -#define KBD_CMD_CLICK 10 /* turn keyclick on */ -#define KBD_CMD_NOCLICK 11 /* turn keyclick off */ -#define KBD_CMD_SETLED 14 /* set LED state (type 4 kbd) */ -#define KBD_CMD_GLAYOUT 15 /* get DIP switch (type 4 kbd) */ - -#define LED_NUM_LOCK 0x1 -#define LED_COMPOSE 0x2 -#define LED_SCROLL_LOCK 0x4 -#define LED_CAPS_LOCK 0x8 - -#define CAPSLOCK 0 -#define SHIFTLOCK 1 -#define LEFTSHIFT 2 -#define RIGHTSHIFT 3 -#define LEFTCTRL 4 -#define RIGHTCTRL 5 -#define ALTGRAPH 9 -#define ALT 10 -#define NUMLOCK 11 - -#define SYSTEMBIT 1 - -#define SHIFTKEYS 0x100 -#define BUCKYBITS 0x200 -#define FUNNY 0x300 -#define NOP 0x300 -#define OOPS 0x301 -/* HOLE 0x302 defined in kbio.h */ -#define RESET 0x306 -#define ERROR 0x307 -#define IDLE 0x308 -#define COMPOSE 0x309 -#define NONL 0x30a - -#define FA_CLASS 0x400 -#define FA_UMLAUT 0x400 -#define FA_CFLEX 0x401 -#define FA_TILDE 0x402 -#define FA_CEDILLA 0x403 -#define FA_ACUTE 0x404 -#define FA_GRAVE 0x405 -#define FA_CLASS_LAST 0x405 - -#define STRING 0x500 -#define KTAB_STRLEN 10 -#define HOMEARROW 0x00 -#define UPARROW 0x01 -#define DOWNARROW 0x02 -#define LEFTARROW 0x03 -#define RIGHTARROR 0x04 - -#define FUNCKEYS 0x600 -#define LEFTFUNC 0x600 -#define RIGHTFUNC 0x610 -#define TOPFUNC 0x620 -#define BOTTOMFUNC 0x630 -#define LF(n) (LEFTFUNC+(n)-1) -#define RF(n) (RIGHTFUNC+(n)-1) -#define TF(n) (TOPFUNC+(n)-1) -#define BF(n) (BOTTOMFUNC+(n)-1) - -#define PADKEYS 0x700 -#define PADEQUAL 0x700 -#define PADSLASH 0x701 -#define PADSTAR 0x702 -#define PADMINUS 0x703 -#define PADSEP 0x704 -#define PAD7 0x705 -#define PAD8 0x706 -#define PAD9 0x707 -#define PADPLUS 0x708 -#define PAD4 0x709 -#define PAD5 0x70A -#define PAD6 0x70B -#define PAD1 0x70C -#define PAD2 0x70D -#define PAD3 0x70E -#define PAD0 0x70F -#define PADDOT 0x710 -#define PADENTER 0x711 - -#ifdef _KERNEL -void kbd_serial(struct tty *, void (*)(struct tty *), void (*)(struct tty *)); -void ms_serial(struct tty *, void (*)(struct tty *), void (*)(struct tty *)); -void kbd_rint(int); -void ms_rint(int); -void kbd_ascii(struct tty *); -int kbd_docmd(int, int); -#endif diff --git a/sys/arch/sparc/include/kbio.h b/sys/arch/sparc/include/kbio.h deleted file mode 100644 index ff54ac3c701..00000000000 --- a/sys/arch/sparc/include/kbio.h +++ /dev/null @@ -1,114 +0,0 @@ -/* $OpenBSD: kbio.h,v 1.4 1997/08/08 08:26:28 downsj Exp $ */ -/* $NetBSD: kbio.h,v 1.4 1995/05/10 16:07:27 pk 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 - */ - -/* - * 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 */ -#define KIOCSDIRECT _IOW('k', 10, int) /* keys to console? */ -#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 diff --git a/sys/arch/sparc/include/psl.h b/sys/arch/sparc/include/psl.h index 6c9f8a3bfb8..2016f5b8ca6 100644 --- a/sys/arch/sparc/include/psl.h +++ b/sys/arch/sparc/include/psl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: psl.h,v 1.14 2002/07/23 14:00:38 art Exp $ */ +/* $OpenBSD: psl.h,v 1.15 2002/08/12 10:44:04 miod Exp $ */ /* $NetBSD: psl.h,v 1.12 1997/03/10 21:49:11 pk Exp $ */ /* @@ -89,6 +89,7 @@ #define IPL_TTY 6 /* tty soft interrupts */ #define IPL_NET 7 /* network hardware at 7 or below */ #define IPL_VM 7 /* max(BIO, NET, TTY) */ +#define IPL_FB 9 /* framebuffer interrupts */ #define IPL_CLOCK 10 /* hardclock() */ #define IPL_FD 11 /* hard floppy interrupts. */ #define IPL_ZS 12 /* zs interrupts */ diff --git a/sys/arch/sparc/include/vuid_event.h b/sys/arch/sparc/include/z8530var.h index 7a3a5c14bab..9969389c57a 100644 --- a/sys/arch/sparc/include/vuid_event.h +++ b/sys/arch/sparc/include/z8530var.h @@ -1,5 +1,5 @@ -/* $OpenBSD: vuid_event.h,v 1.2 1997/08/08 08:26:55 downsj Exp $ */ -/* $NetBSD: vuid_event.h,v 1.2 1994/11/20 20:53:39 deraadt Exp $ */ +/* $OpenBSD: z8530var.h,v 1.1 2002/08/12 10:44:04 miod Exp $ */ +/* $NetBSD: z8530var.h,v 1.1 1997/10/18 00:01:30 gwr Exp $ */ /* * Copyright (c) 1992, 1993 @@ -42,47 +42,44 @@ * 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 + * @(#)zsvar.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; +#include <sparc/dev/z8530sc.h> -/* - * 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 */ +struct zsc_softc { + struct device zsc_dev; /* required first: base device */ + struct zs_chanstate zsc_cs[2]; /* channel A and B soft state */ + /* Machine-dependent part follows... */ + struct evcnt zsc_intrcnt; /* count interrupts */ +}; /* - * 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). + * Functions to read and write individual registers in a channel. + * The ZS chip requires a 1.6 uSec. recovery time between accesses. + * On the SparcStation the recovery time is handled in hardware. + * On the older Sun4 machine it isn't, and software must do it. + * + * However, it *is* a problem on some Sun4m's (i.e. the SS20) (XXX: why?). + * Thus we leave in the delay (done in the functions below). + * XXX: (ABB) Think about this more. + * + * The functions below could be macros instead if we are concerned + * about the function call overhead where ZS_DELAY does nothing. */ -#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 */ +u_char zs_read_reg(struct zs_chanstate *cs, u_char reg); +u_char zs_read_csr(struct zs_chanstate *cs); +u_char zs_read_data(struct zs_chanstate *cs); + +void zs_write_reg(struct zs_chanstate *cs, u_char reg, u_char val); +void zs_write_csr(struct zs_chanstate *cs, u_char val); +void zs_write_data(struct zs_chanstate *cs, u_char val); + +/* The sparc has splzs() in psl.h */ + +/* We want to call it "zs" instead of "zsc" (sigh). */ +#ifndef ZSCCF_CHANNEL +#define ZSCCF_CHANNEL 0 +#define ZSCCF_CHANNEL_DEFAULT -1 +#endif |