diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2012-04-18 11:01:56 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2012-04-18 11:01:56 +0000 |
commit | 2067120148d5a7d101eb7bbec31e895ac1e3a37c (patch) | |
tree | 8e0525af818e347f1404a22961dbb33ae266ba9b | |
parent | 038246e8d74f54f39972c767e09510c300b45e2c (diff) |
Driver for the GR2 family of frame buffers (Elan, XZ...). Based upon the
NetBSD driver, with the infinite loops removed, the negative heights fixed,
and the explicit delay() calls removed. And support for fonts wider than
8 pixels.
-rw-r--r-- | sys/arch/sgi/conf/GENERIC-IP22 | 6 | ||||
-rw-r--r-- | sys/arch/sgi/conf/RAMDISK-IP22 | 6 | ||||
-rw-r--r-- | sys/arch/sgi/gio/grtwo.c | 852 | ||||
-rw-r--r-- | sys/arch/sgi/gio/grtworeg.h | 213 | ||||
-rw-r--r-- | sys/arch/sgi/gio/grtwovar.h | 34 | ||||
-rw-r--r-- | sys/arch/sgi/localbus/int.c | 15 | ||||
-rw-r--r-- | sys/arch/sgi/localbus/intvar.h | 4 |
7 files changed, 1107 insertions, 23 deletions
diff --git a/sys/arch/sgi/conf/GENERIC-IP22 b/sys/arch/sgi/conf/GENERIC-IP22 index e277f1cf84b..ee76fc83c49 100644 --- a/sys/arch/sgi/conf/GENERIC-IP22 +++ b/sys/arch/sgi/conf/GENERIC-IP22 @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC-IP22,v 1.9 2012/04/17 22:06:33 miod Exp $ +# $OpenBSD: GENERIC-IP22,v 1.10 2012/04/18 11:01:55 miod Exp $ # # THIS KERNEL IS FOR INDIGO (IP20), INDY (IP22) AND INDIGO2 (IP24) SYSTEMS ONLY. # @@ -74,8 +74,8 @@ wskbd* at pckbd? mux 1 pms* at pckbc? wsmouse* at pms? mux 0 -#grtwo* at gio? # Express (GR2) graphics -#wsdisplay* at grtwo? +grtwo* at gio? # Express (GR2) graphics +wsdisplay* at grtwo? light* at gio? # Light/Starter/Entry (LG1/LG2) graphics wsdisplay* at light? newport* at gio? # Indy Newport and Indigo2 XL graphics diff --git a/sys/arch/sgi/conf/RAMDISK-IP22 b/sys/arch/sgi/conf/RAMDISK-IP22 index 99b29b2d2c4..1ebd7cfd542 100644 --- a/sys/arch/sgi/conf/RAMDISK-IP22 +++ b/sys/arch/sgi/conf/RAMDISK-IP22 @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISK-IP22,v 1.6 2012/04/17 22:06:33 miod Exp $ +# $OpenBSD: RAMDISK-IP22,v 1.7 2012/04/18 11:01:55 miod Exp $ # # THIS KERNEL IS FOR INDIGO (IP20), INDY (IP22) AND INDIGO2 (IP24) SYSTEMS ONLY. @@ -81,8 +81,8 @@ wskbd* at pckbd? mux 1 #pms* at pckbc? #wsmouse* at pms? mux 0 -#grtwo* at gio? # Express (GR2) graphics -#wsdisplay* at grtwo? +grtwo* at gio? # Express (GR2) graphics +wsdisplay* at grtwo? light* at gio? # Light/Starter/Entry (LG1/LG2) graphics wsdisplay* at light? newport* at gio? # Indy Newport and Indigo2 XL graphics diff --git a/sys/arch/sgi/gio/grtwo.c b/sys/arch/sgi/gio/grtwo.c new file mode 100644 index 00000000000..6d77160f312 --- /dev/null +++ b/sys/arch/sgi/gio/grtwo.c @@ -0,0 +1,852 @@ +/* $OpenBSD: grtwo.c,v 1.1 2012/04/18 11:01:55 miod Exp $ */ +/* $NetBSD: grtwo.c,v 1.11 2009/11/22 19:09:15 mbalmer Exp $ */ + +/* + * Copyright (c) 2012 Miodrag Vallat. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +/* + * Copyright (c) 2004 Christopher SEKIYA + * 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. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * 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. + * + * <<Id: LICENSE_GC,v 1.1 2001/10/01 23:24:05 cgd Exp>> + */ + +/* wscons driver for SGI GR2 family of framebuffers + * + * Heavily based on the newport wscons driver. + */ + +/* + * GR2 coordinates start from (0,0) in the lower left corner, to (1279,1023) + * in the upper right. The low-level drawing routines will take care of + * converting the traditional ``y goes down'' coordinates to those expected + * by the hardware. + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/device.h> +#include <sys/malloc.h> + +#include <machine/autoconf.h> + +#include <dev/wscons/wsconsio.h> +#include <dev/wscons/wsdisplayvar.h> +#include <dev/rasops/rasops.h> + +#include <sgi/dev/gl.h> +#include <sgi/gio/gioreg.h> +#include <sgi/gio/giovar.h> +#include <sgi/gio/grtworeg.h> +#include <sgi/gio/grtwovar.h> +#include <sgi/localbus/intreg.h> +#include <sgi/localbus/intvar.h> + +#define GRTWO_WIDTH 1280 +#define GRTWO_HEIGHT 1024 + +struct grtwo_softc { + struct device sc_dev; + + struct grtwo_devconfig *sc_dc; + + int sc_nscreens; + struct wsscreen_list sc_wsl; + const struct wsscreen_descr *sc_scrlist[1]; +}; + +struct grtwo_devconfig { + struct rasops_info dc_ri; + long dc_defattr; + struct wsdisplay_charcell *dc_bs; + + uint32_t dc_addr; + bus_space_tag_t iot; + bus_space_handle_t ioh; + + uint8_t boardrev; + uint8_t backendrev; + int hq2rev; + int ge7rev; + int vc1rev; + int zbuffer; + int depth; + int monitor; + + struct grtwo_softc *dc_sc; + struct wsscreen_descr dc_wsd; +}; + +int grtwo_match(struct device *, void *, void *); +void grtwo_attach(struct device *, struct device *, void *); + +struct cfdriver grtwo_cd = { + NULL, "grtwo", DV_DULL +}; + +const struct cfattach grtwo_ca = { + sizeof(struct grtwo_softc), grtwo_match, grtwo_attach +}; + +/* accessops */ +int grtwo_ioctl(void *, u_long, caddr_t, int, struct proc *); +paddr_t grtwo_mmap(void *, off_t, int); +int grtwo_alloc_screen(void *, const struct wsscreen_descr *, void **, + int *, int *, long *); +void grtwo_free_screen(void *, void *); +int grtwo_show_screen(void *, void *, int, void (*)(void *, int, int), + void *); + +static struct wsdisplay_accessops grtwo_accessops = { + .ioctl = grtwo_ioctl, + .mmap = grtwo_mmap, + .alloc_screen = grtwo_alloc_screen, + .free_screen = grtwo_free_screen, + .show_screen = grtwo_show_screen, +}; + +int grtwo_cursor(void *, int, int, int); +int grtwo_putchar(void *, int, int, u_int, long); +int grtwo_copycols(void *, int, int, int, int); +int grtwo_erasecols(void *, int, int, int, long); +int grtwo_copyrows(void *, int, int, int); +int grtwo_eraserows(void *, int, int, long); + +void grtwo_wait_gfifo(struct grtwo_devconfig *); +static __inline__ +void grtwo_set_color(bus_space_tag_t, bus_space_handle_t, int); +void grtwo_fillrect(struct grtwo_devconfig *, int, int, int, int, int); +void grtwo_copyrect(struct grtwo_devconfig *, int, int, int, int, int, int); +void grtwo_cmap_setrgb(struct grtwo_devconfig *, int, uint, uint, uint); +int grtwo_setup_hw(struct grtwo_devconfig *); +static __inline__ +int grtwo_attach_common(struct grtwo_devconfig *, struct gio_attach_args *); +int grtwo_init_screen(struct grtwo_devconfig *, int); +int grtwo_putchar_internal(struct rasops_info *, int, int, u_int, int, int, + int); + +static struct grtwo_devconfig grtwo_console_dc; +/* console backing store, worst cast font selection */ +static struct wsdisplay_charcell + grtwo_console_bs[(GRTWO_WIDTH / 8) * (GRTWO_HEIGHT / 16)]; +static int grtwo_is_console = 0; + +void +grtwo_wait_gfifo(struct grtwo_devconfig *dc) +{ + int i; + + /* + * This loop is for paranoia. Of course there is currently no + * known way to whack the FIFO (or reset the board) in case it + * gets stuck... but this code is careful to avoid this situation + * and it should never happen (famous last words) + */ + for (i = 100000; i != 0; i--) { + if (!int2_is_intr_pending(INT2_L0_FIFO)) + break; + delay(1); + } +#ifdef DIAGNOSTIC + if (i == 0) { + if (dc != &grtwo_console_dc && dc->dc_sc != NULL) + printf("%s: FIFO is stuck\n", + dc->dc_sc->sc_dev.dv_xname); + } +#endif +} + +static __inline__ void +grtwo_set_color(bus_space_tag_t iot, bus_space_handle_t ioh, int color) +{ + bus_space_write_4(iot, ioh, GR2_FIFO_COLOR, color); +} + +/* + * Rectangle fill with the given background. + */ +void +grtwo_fillrect(struct grtwo_devconfig *dc, int x1, int y1, int x2, + int y2, int bg) +{ + struct rasops_info *ri = &dc->dc_ri; + + grtwo_wait_gfifo(dc); + grtwo_set_color(dc->iot, dc->ioh, ri->ri_devcmap[bg] & 0xff); + + grtwo_wait_gfifo(dc); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_RECTI2D, x1); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, + GRTWO_HEIGHT - 1 - y1); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, x2); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, + GRTWO_HEIGHT - 1 - y2); +} + +/* + * Rectangle copy. + * Does not handle overlapping copies; this is handled at the wsdisplay + * emulops level by splitting overlapping copies in smaller, non-overlapping, + * operations. + */ +void +grtwo_copyrect(struct grtwo_devconfig *dc, int x1, int y1, int x2, + int y2, int width, int height) +{ + int length = (width + 3) >> 2; + int lines = 4864 / length; + int step; + + y1 += height; y2 += height; + while (height != 0) { + step = imin(height, lines); + y1 -= step; y2 -= step; + + grtwo_wait_gfifo(dc); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_RECTCOPY, length); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, lines); + /* source */ + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, x1); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, y1); + /* span */ + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, width); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, step); + /* dest */ + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, x2); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, y2); + + height -= step; + } +} + +void +grtwo_cmap_setrgb(struct grtwo_devconfig *dc, int index, uint r, + uint g, uint b) +{ + grtwo_wait_gfifo(dc); + bus_space_write_1(dc->iot, dc->ioh, XMAPALL_ADDRHI, + ((index & 0x1f00) >> 8)); + bus_space_write_1(dc->iot, dc->ioh, XMAPALL_ADDRLO, + (index & 0xff)); + bus_space_write_1(dc->iot, dc->ioh, XMAPALL_CLUT, r); + bus_space_write_1(dc->iot, dc->ioh, XMAPALL_CLUT, g); + bus_space_write_1(dc->iot, dc->ioh, XMAPALL_CLUT, b); +} + +int +grtwo_setup_hw(struct grtwo_devconfig *dc) +{ + int i = 0; + uint32_t rd0, rd1, rd2, rd3, vc1; + + rd0 = bus_space_read_4(dc->iot, dc->ioh, GR2_REVISION_RD0); + rd1 = bus_space_read_4(dc->iot, dc->ioh, GR2_REVISION_RD1); + rd2 = bus_space_read_4(dc->iot, dc->ioh, GR2_REVISION_RD2); + rd3 = bus_space_read_4(dc->iot, dc->ioh, GR2_REVISION_RD3); + + /* Get various revisions */ + dc->boardrev = ~rd0 & GR2_REVISION_RD0_VERSION_MASK; + + /* + * Boards prior to rev 4 have a pretty whacky config scheme. + * What is doubly weird is that i have a rev 2 board, but the rev 4 + * probe routines work just fine. + * We'll trust SGI, though, and separate things a bit. It's only + * critical for the display depth calculation. + */ + + if (dc->boardrev < 4) { + dc->backendrev = ~(rd2 & GR2_REVISION_RD2_BACKEND_REV) >> + GR2_REVISION_RD2_BACKEND_SHIFT; + if (dc->backendrev == 0) + return ENXIO; + dc->zbuffer = ~rd1 & GR2_REVISION_RD1_ZBUFFER; + if ((rd3 & GR2_REVISION_RD3_VMA) != GR2_REVISION_RD3_VMA) + i++; + if ((rd3 & GR2_REVISION_RD3_VMB) != GR2_REVISION_RD3_VMB) + i++; + if ((rd3 & GR2_REVISION_RD3_VMC) != GR2_REVISION_RD3_VMC) + i++; + dc->depth = 8 * i; + dc->monitor = ((rd2 & 0x03) << 1) | (rd1 & 0x01); + } else { + dc->backendrev = ~rd1 & GR2_REVISION4_RD1_BACKEND; + if (dc->backendrev == 0) + return ENXIO; + dc->zbuffer = rd1 & GR2_REVISION4_RD1_ZBUFFER; + dc->depth = (rd1 & GR2_REVISION4_RD1_24BPP) ? 24 : 8; + dc->monitor = (rd0 & GR2_REVISION4_RD0_MONITOR_MASK) >> + GR2_REVISION4_RD0_MONITOR_SHIFT; + } + + dc->hq2rev = (bus_space_read_4(dc->iot, dc->ioh, HQ2_VERSION) & + HQ2_VERSION_MASK) >> HQ2_VERSION_SHIFT; + dc->ge7rev = (bus_space_read_4(dc->iot, dc->ioh, GE7_REVISION) & + GE7_REVISION_MASK) >> GE7_REVISION_SHIFT; + /* dc->vc1rev = vc1_read_ireg(dc, 5) & 0x07; */ + + vc1 = bus_space_read_4(dc->iot, dc->ioh, VC1_SYSCTL); + if (vc1 == -1) + return ENXIO; /* XXX would need a reset */ + + /* Turn on display, DID, disable cursor display */ + bus_space_write_4(dc->iot, dc->ioh, VC1_SYSCTL, + VC1_SYSCTL_VC1 | VC1_SYSCTL_DID); + + /* Setup CMAP */ + for (i = 0; i < 8 /* 256 */; i++) + grtwo_cmap_setrgb(dc, i, rasops_cmap[i * 3], + rasops_cmap[i * 3 + 1], rasops_cmap[i * 3 + 2]); + + return 0; +} + +/* Attach routines */ +int +grtwo_match(struct device *parent, void *vcf, void *aux) +{ + struct gio_attach_args *ga = aux; + uint32_t mystery; + + /* not looking for a frame buffer */ + if (ga->ga_slot != -1) + return 0; + + if (ga->ga_addr != GIO_ADDR_GFX && ga->ga_addr != GIO_ADDR_EXP0 && + ga->ga_addr != GIO_ADDR_EXP1) + return 0; + + /* + * GR2 doesn't have anything that even vaguely resembles a product + * ID. Instead, we determine presence by looking at the HQ2 "mystery" + * register, which contains a magic number. + */ + + if (guarded_read_4(ga->ga_ioh + HQ2_MYSTERY, &mystery) != 0) + return 0; + + if (mystery != HQ2_MYSTERY_VALUE) + return 0; + + return 1; +} + +void +grtwo_attach(struct device *parent, struct device *self, void *aux) +{ + struct grtwo_softc *sc = (struct grtwo_softc *)self; + struct gio_attach_args *ga = aux; + struct grtwo_devconfig *dc; + struct wsemuldisplaydev_attach_args waa; + const char *descr; + + descr = ga->ga_descr; + if (descr == NULL || *descr == '\0') + descr = "GR2"; + printf(": %s", descr); + + if (grtwo_is_console && ga->ga_addr == grtwo_console_dc.dc_addr) { + waa.console = 1; + dc = &grtwo_console_dc; + sc->sc_nscreens = 1; + } else { + waa.console = 0; + dc = malloc(sizeof(struct grtwo_devconfig), + M_DEVBUF, M_WAITOK | M_CANFAIL | M_ZERO); + if (dc == NULL) + goto out; + if (grtwo_attach_common(dc, ga) != 0) { + printf("\n%s: not responding\n", self->dv_xname); + free(dc, M_DEVBUF); + return; + } + if (grtwo_init_screen(dc, M_WAITOK | M_CANFAIL) != 0) { + free(dc, M_DEVBUF); + goto out; + } + } + sc->sc_dc = dc; + dc->dc_sc = sc; + + printf(", revision %d, monitor sense %d\n", dc->boardrev, dc->monitor); + printf("%s: %dx%d %d-bit frame buffer\n", + self->dv_xname, GRTWO_WIDTH, GRTWO_HEIGHT, dc->depth); + + sc->sc_scrlist[0] = &dc->dc_wsd; + sc->sc_wsl.nscreens = 1; + sc->sc_wsl.screens = sc->sc_scrlist; + + waa.scrdata = &sc->sc_wsl; + waa.accessops = &grtwo_accessops; + waa.accesscookie = dc; + waa.defaultscreens = 0; + + config_found(self, &waa, wsemuldisplaydevprint); + return; + +out: + printf("\n%s: failed to allocate memory\n", self->dv_xname); + return; +} + +int +grtwo_cnprobe(struct gio_attach_args *ga) +{ + return grtwo_match(NULL, NULL, ga); +} + +int +grtwo_cnattach(struct gio_attach_args *ga) +{ + struct rasops_info *ri = &grtwo_console_dc.dc_ri; + struct wsdisplay_charcell *cell; + long defattr; + int rc; + int i; + + rc = grtwo_attach_common(&grtwo_console_dc, ga); + if (rc != 0) + return rc; + grtwo_console_dc.dc_bs = grtwo_console_bs; + rc = grtwo_init_screen(&grtwo_console_dc, M_NOWAIT); + if (rc != 0) + return rc; + + ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); + cell = grtwo_console_bs; + for (i = ri->ri_cols * ri->ri_rows; i != 0; i--, cell++) + cell->attr = defattr; + + wsdisplay_cnattach(&grtwo_console_dc.dc_wsd, ri, 0, 0, defattr); + grtwo_is_console = 1; + + return 0; +} + +static __inline__ int +grtwo_attach_common(struct grtwo_devconfig *dc, struct gio_attach_args * ga) +{ + dc->dc_addr = ga->ga_addr; + dc->iot = ga->ga_iot; + dc->ioh = ga->ga_ioh; + + return grtwo_setup_hw(dc); +} + +int +grtwo_init_screen(struct grtwo_devconfig *dc, int malloc_flags) +{ + struct rasops_info *ri = &dc->dc_ri; + + memset(ri, 0, sizeof(struct rasops_info)); + ri->ri_hw = dc; + ri->ri_flg = RI_CENTER | RI_FULLCLEAR; + /* for the proper operation of rasops computations, pretend 8bpp */ + ri->ri_depth = 8; + ri->ri_stride = GRTWO_WIDTH; + ri->ri_width = GRTWO_WIDTH; + ri->ri_height = GRTWO_HEIGHT; + + rasops_init(ri, 160, 160); + /* we can only use 8 colors so far */ + ri->ri_caps &= ~WSSCREEN_HILIT; + + /* + * Allocate backing store to remember character cells, to + * be able to paint an inverted cursor. + */ + if (dc->dc_bs == NULL) { + dc->dc_bs = malloc(ri->ri_rows * ri->ri_cols * + sizeof(struct wsdisplay_charcell), M_DEVBUF, + malloc_flags | M_ZERO); + if (dc->dc_bs == NULL) + return ENOMEM; + } + + ri->ri_ops.cursor = grtwo_cursor; + ri->ri_ops.copyrows = grtwo_copyrows; + ri->ri_ops.eraserows = grtwo_eraserows; + ri->ri_ops.copycols = grtwo_copycols; + ri->ri_ops.erasecols = grtwo_erasecols; + ri->ri_ops.putchar = grtwo_putchar; + + strlcpy(dc->dc_wsd.name, "std", sizeof(dc->dc_wsd.name)); + dc->dc_wsd.ncols = ri->ri_cols; + dc->dc_wsd.nrows = ri->ri_rows; + dc->dc_wsd.textops = &ri->ri_ops; + dc->dc_wsd.fontwidth = ri->ri_font->fontwidth; + dc->dc_wsd.fontheight = ri->ri_font->fontheight; + dc->dc_wsd.capabilities = ri->ri_caps; + + grtwo_fillrect(dc, 0, 0, GRTWO_WIDTH - 1, GRTWO_HEIGHT - 1, + WSCOL_BLACK); + + return 0; +} + +/* wsdisplay textops */ + +int +grtwo_cursor(void *c, int on, int row, int col) +{ + struct rasops_info *ri = c; + struct grtwo_devconfig *dc = ri->ri_hw; + struct wsdisplay_charcell *cell; + int bg, fg, ul; + + cell = dc->dc_bs + row * ri->ri_cols + col; + ri->ri_ops.unpack_attr(ri, cell->attr, &fg, &bg, &ul); + + if (on) { + /* redraw the existing character with inverted colors */ + return grtwo_putchar_internal(ri, row, col, cell->uc, + bg, fg, ul); + } else { + /* redraw the existing character with correct colors */ + return grtwo_putchar_internal(ri, row, col, cell->uc, + fg, bg, ul); + } +} + +int +grtwo_putchar(void *c, int row, int col, u_int ch, long attr) +{ + struct rasops_info *ri = c; + struct grtwo_devconfig *dc = ri->ri_hw; + struct wsdisplay_charcell *cell; + int bg, fg, ul; + + /* Update backing store. */ + cell = dc->dc_bs + row * ri->ri_cols + col; + cell->uc = ch; + cell->attr = attr; + + ri->ri_ops.unpack_attr(ri, attr, &fg, &bg, &ul); + return grtwo_putchar_internal(ri, row, col, ch, fg, bg, ul); +} + +int +grtwo_putchar_internal(struct rasops_info *ri, int row, int col, u_int ch, + int fg, int bg, int ul) +{ + struct grtwo_devconfig *dc = ri->ri_hw; + struct wsdisplay_font *font = ri->ri_font; + uint8_t *bitmap; + uint32_t pattern; + int x, y; + int h = font->fontheight; + int w = font->fontwidth; + int i; + + /* + * The `draw char' operation below writes on top of the existing + * background. We need to paint the background first. + */ + x = ri->ri_xorigin + col * w; + y = ri->ri_yorigin + row * h; + grtwo_fillrect(dc, x, y, x + w - 1, y + h - 1, bg); + + if ((ch == ' ' || ch == 0) && ul == 0) + return 0; + + /* Set the drawing color */ + grtwo_wait_gfifo(dc); + grtwo_set_color(dc->iot, dc->ioh, ri->ri_devcmap[fg] & 0xff); + + /* + * This character drawing operation apparently expects a 18 pixel + * character cell height. We will perform as many cell fillings as + * necessary to draw a complete glyph. + */ + bitmap = (uint8_t *)font->data + + (ch - font->firstchar + 1) * ri->ri_fontscale; + y = ri->ri_height - h - y; + while (h != 0) { + /* Set drawing coordinates */ + grtwo_wait_gfifo(dc); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_CMOV2I, x); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, y); + + grtwo_wait_gfifo(dc); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DRAWCHAR, w); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, + h > GR2_DRAWCHAR_HEIGHT ? GR2_DRAWCHAR_HEIGHT : h); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, 2); + /* (x,y) offset */ + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, 0); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, 0); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, 0); + bus_space_write_4(dc->iot, dc->ioh, GR2_FIFO_DATA, 0); + + grtwo_wait_gfifo(dc); + if (w <= 8) { + for (i = 0; i < GR2_DRAWCHAR_HEIGHT; i++) { + if (h != 0) { + bitmap -= font->stride; + if (ul && h == font->fontheight - 1) + pattern = 0xff00; + else + pattern = *bitmap << 8; + h--; + } else + pattern = 0; + + bus_space_write_4(dc->iot, dc->ioh, + GR2_FIFO_DATA, pattern); + } + } else { + for (i = 0; i < GR2_DRAWCHAR_HEIGHT; i++) { + if (h != 0) { + bitmap -= font->stride; + if (ul && h == font->fontheight - 1) + pattern = 0xffff; + else + pattern = *(uint16_t *)bitmap; + h--; + } else + pattern = 0; + + bus_space_write_4(dc->iot, dc->ioh, + GR2_FIFO_DATA, pattern); + } + } + + y += GR2_DRAWCHAR_HEIGHT; + } + + return 0; +} + +int +grtwo_copycols(void *c, int row, int src, int dst, int ncol) +{ + struct rasops_info *ri = c; + struct grtwo_devconfig *dc = ri->ri_hw; + struct wsdisplay_font *font = ri->ri_font; + struct wsdisplay_charcell *cell; + int y = ri->ri_yorigin + row * font->fontheight; + int i; + + /* Copy columns in backing store. */ + cell = dc->dc_bs + row * ri->ri_cols; + ovbcopy(cell + src, cell + dst, ncol * sizeof(*cell)); + + if (src > dst) { + /* may overlap, copy cell by cell */ + for (i = 0; i < ncol; i++) + grtwo_copyrect(dc, + ri->ri_xorigin + (src + i) * font->fontwidth, y, + ri->ri_xorigin + (dst + i) * font->fontwidth, y, + font->fontwidth, font->fontheight); + } else { + grtwo_copyrect(dc, + ri->ri_xorigin + src * font->fontwidth, y, + ri->ri_xorigin + dst * font->fontwidth, y, + ncol * font->fontwidth, font->fontheight); + } + + return 0; +} + +int +grtwo_erasecols(void *c, int row, int startcol, int ncol, long attr) +{ + struct rasops_info *ri = c; + struct grtwo_devconfig *dc = ri->ri_hw; + struct wsdisplay_font *font = ri->ri_font; + struct wsdisplay_charcell *cell; + int y = ri->ri_yorigin + row * font->fontheight; + int i, bg, fg; + + /* Erase columns in backing store. */ + cell = dc->dc_bs + row * ri->ri_cols + startcol; + for (i = ncol; i != 0; i--, cell++) { + cell->uc = 0; + cell->attr = attr; + } + + ri->ri_ops.unpack_attr(ri, attr, &fg, &bg, NULL); + + grtwo_fillrect(dc, ri->ri_xorigin + startcol * font->fontwidth, y, + ri->ri_xorigin + (startcol + ncol) * font->fontwidth - 1, + y + font->fontheight - 1, bg); + + return 0; +} + +int +grtwo_copyrows(void *c, int src, int dst, int nrow) +{ + struct rasops_info *ri = c; + struct grtwo_devconfig *dc = ri->ri_hw; + struct wsdisplay_font *font = ri->ri_font; + struct wsdisplay_charcell *cell; + int i; + + /* Copy rows in backing store. */ + cell = dc->dc_bs + dst * ri->ri_cols; + ovbcopy(dc->dc_bs + src * ri->ri_cols, cell, + nrow * ri->ri_cols * sizeof(*cell)); + + if (src > dst) { + /* may overlap, copy row by row */ + for (i = 0; i < nrow; i++) + grtwo_copyrect(dc, ri->ri_xorigin, + ri->ri_yorigin + (src + i) * font->fontheight, + ri->ri_xorigin, + ri->ri_yorigin + (dst + i) * font->fontheight, + ri->ri_emuwidth, font->fontheight); + } else { + grtwo_copyrect(dc, ri->ri_xorigin, + ri->ri_yorigin + src * font->fontheight, ri->ri_xorigin, + ri->ri_yorigin + dst * font->fontheight, ri->ri_emuwidth, + nrow * font->fontheight); + } + + return 0; +} + +int +grtwo_eraserows(void *c, int startrow, int nrow, long attr) +{ + struct rasops_info *ri = c; + struct grtwo_devconfig *dc = ri->ri_hw; + struct wsdisplay_font *font = ri->ri_font; + struct wsdisplay_charcell *cell; + int i, bg, fg; + + /* Erase rows in backing store. */ + cell = dc->dc_bs + startrow * ri->ri_cols; + for (i = ri->ri_cols; i != 0; i--, cell++) { + cell->uc = 0; + cell->attr = attr; + } + for (i = 1; i < nrow; i++) + ovbcopy(dc->dc_bs + startrow * ri->ri_cols, + dc->dc_bs + (startrow + i) * ri->ri_cols, + ri->ri_cols * sizeof(*cell)); + + ri->ri_ops.unpack_attr(ri, attr, &fg, &bg, NULL); + + if (nrow == ri->ri_rows && (ri->ri_flg & RI_FULLCLEAR)) { + grtwo_fillrect(dc, 0, 0, GRTWO_WIDTH - 1, + GRTWO_HEIGHT - 1, bg); + return 0; + } + + grtwo_fillrect(dc, ri->ri_xorigin, + ri->ri_yorigin + startrow * font->fontheight, + ri->ri_xorigin + ri->ri_emuwidth - 1, + ri->ri_yorigin + (startrow + nrow) * font->fontheight - 1, bg); + + return 0; +} + +/* wsdisplay accessops */ + +int +grtwo_alloc_screen(void *v, const struct wsscreen_descr * type, void **cookiep, + int *curxp, int *curyp, long *attrp) +{ + struct grtwo_devconfig *dc = v; + struct rasops_info *ri = &dc->dc_ri; + struct grtwo_softc *sc = dc->dc_sc; + struct wsdisplay_charcell *cell; + int i; + + if (sc->sc_nscreens > 0) + return ENOMEM; + + sc->sc_nscreens++; + + *cookiep = ri; + *curxp = *curyp = 0; + ri->ri_ops.alloc_attr(ri, 0, 0, 0, &dc->dc_defattr); + *attrp = dc->dc_defattr; + + cell = dc->dc_bs; + for (i = ri->ri_cols * ri->ri_rows; i != 0; i--, cell++) + cell->attr = dc->dc_defattr; + + return 0; +} + +void +grtwo_free_screen(void *v, void *cookie) +{ +} + +int +grtwo_show_screen(void *v, void *cookie, int waitok, + void (*cb) (void *, int, int), void *cbarg) +{ + return 0; +} + +int +grtwo_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) +{ + struct grtwo_devconfig *dc = v; + struct rasops_info *ri = &dc->dc_ri; + struct wsdisplay_fbinfo *fb; + + switch (cmd) { + case WSDISPLAYIO_GTYPE: + *(u_int *) data = WSDISPLAY_TYPE_GRTWO; + break; + case WSDISPLAYIO_GINFO: + fb = (struct wsdisplay_fbinfo *)data; + fb->width = ri->ri_width; + fb->height = ri->ri_height; + fb->depth = dc->depth; /* real depth */ + if (dc->depth > 8) + fb->cmsize = 0; + else + fb->cmsize = 1 << dc->depth; + break; + default: + return -1; + } + + return 0; +} + +paddr_t +grtwo_mmap(void *v, off_t offset, int prot) +{ + return -1; +} diff --git a/sys/arch/sgi/gio/grtworeg.h b/sys/arch/sgi/gio/grtworeg.h new file mode 100644 index 00000000000..ab994568441 --- /dev/null +++ b/sys/arch/sgi/gio/grtworeg.h @@ -0,0 +1,213 @@ +/* $OpenBSD: grtworeg.h,v 1.1 2012/04/18 11:01:55 miod Exp $ */ +/* $NetBSD: grtworeg.h,v 1.2 2005/12/11 12:18:53 christos Exp $ */ + +/* + * Copyright (c) 2004 Christopher SEKIYA + * 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. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * 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. + * + * <<Id: LICENSE_GC,v 1.1 2001/10/01 23:24:05 cgd Exp>> + */ + +/* + * Memory map: + * + * 0x1f000000 - 0x1f01ffff Shared data RAM + * 0x1f020000 - 0x1f03ffff (unused) + * 0x1f040000 - 0x1f05ffff FIFO + * 0x1f060000 - 0x1f068000 HQ2 ucode + * 0x1f068000 - 0x1f069fff GE7 (eight of them) + * 0x1f06a000 - 0x1f06b004 HQ2 + * 0x1f06c000 Board revision register + * 0x1f06c020 clock + * 0x1f06c040 VC1 + * 0x1f06c060 BT479 Triple-DAC (read) + * 0x1f06c080 BT479 Triple-DAC (write) + * 0x1f06c0a0 BT457 DAC (red) + * 0x1f06c0c0 BT457 DAC (green) + * 0x1f06c0e0 BT457 DAC (blue) + * 0x1f06c100 XMAP5 (five of them) + * 0x1f06c1a0 XMAP5 ("xmap all") + * 0x1f06c1c0 Kaleidoscope (AB1) + * 0x1f06c1e0 Kaleidoscope (CC1) + * 0x1f06c200 RE3 (27-bit registers) + * 0x1f06c280 RE3 (24-bit registers) + * 0x1f06c600 RE3 (32-bit registers) + */ + +#define GR2_FIFO 0x40000 +#define GR2_FIFO_INIT (GR2_FIFO + 0x644) +#define GR2_FIFO_COLOR (GR2_FIFO + 0x648) +#define GR2_FIFO_FINISH (GR2_FIFO + 0x64c) +#define GR2_FIFO_PNT2I (GR2_FIFO + 0x650) +#define GR2_FIFO_RECTI2D (GR2_FIFO + 0x654) +#define GR2_FIFO_CMOV2I (GR2_FIFO + 0x658) +#define GR2_FIFO_LINE2I (GR2_FIFO + 0x65c) +#define GR2_FIFO_DRAWCHAR (GR2_FIFO + 0x660) +#define GR2_FIFO_RECTCOPY (GR2_FIFO + 0x664) +#define GR2_FIFO_DATA (GR2_FIFO + 0x77c) + +/* HQ2 */ + +#define HQ2_BASE 0x6a000 +#define HQ2_ATTRJUMP (HQ2_BASE + 0x00) +#define HQ2_VERSION (HQ2_BASE + 0x40) +#define HQ2_VERSION_MASK 0xff000000 +#define HQ2_VERSION_SHIFT 23 + +#define HQ2_NUMGE (HQ2_BASE + 0x44) +#define HQ2_FIN1 (HQ2_BASE + 0x48) +#define HQ2_FIN2 (HQ2_BASE + 0x4c) +#define HQ2_DMASYNC (HQ2_BASE + 0x50) +#define HQ2_FIFO_FULL_TIMEOUT (HQ2_BASE + 0x54) +#define HQ2_FIFO_EMPTY_TIMEOUT (HQ2_BASE + 0x58) +#define HQ2_FIFO_FULL (HQ2_BASE + 0x5c) +#define HQ2_FIFO_EMPTY (HQ2_BASE + 0x60) +#define HQ2_GE7_LOAD_UCODE (HQ2_BASE + 0x64) +#define HQ2_GEDMA (HQ2_BASE + 0x68) +#define HQ2_HQ_GEPC (HQ2_BASE + 0x6c) +#define HQ2_GEPC (HQ2_BASE + 0x70) +#define HQ2_INTR (HQ2_BASE + 0x74) +#define HQ2_UNSTALL (HQ2_BASE + 0x78) +#define HQ2_MYSTERY (HQ2_BASE + 0x7c) +#define HQ2_MYSTERY_VALUE 0xdeadbeef +#define HQ2_REFRESH (HQ2_BASE + 0x80) +#define HQ2_FIN3 (HQ2_BASE + 0x1000) + +/* GE7 */ + +#define GE7_REVISION 0x680fc +#define GE7_REVISION_MASK 0xe0 +#define GE7_REVISION_SHIFT 5 + +/* VC1 */ + +#define VC1_BASE 0x6c040 +#define VC1_COMMAND (VC1_BASE + 0x00) +#define VC1_XMAPMODE (VC1_BASE + 0x04) +#define VC1_SRAM (VC1_BASE + 0x08) +#define VC1_TESTREG (VC1_BASE + 0x0c) +#define VC1_ADDRLO (VC1_BASE + 0x10) +#define VC1_ADDRHI (VC1_BASE + 0x14) +#define VC1_SYSCTL (VC1_BASE + 0x18) + +/* VC1 System Control Register */ +#define VC1_SYSCTL_INTERRUPT 0x01 /* active low */ +#define VC1_SYSCTL_VTG 0x02 /* active low */ +#define VC1_SYSCTL_VC1 0x04 +#define VC1_SYSCTL_DID 0x08 +#define VC1_SYSCTL_CURSOR 0x10 +#define VC1_SYSCTL_CURSOR_DISPLAY 0x20 +#define VC1_SYSCTL_GENSYNC 0x40 +#define VC1_SYSCTL_VIDEO 0x80 + +/* VC1 SRAM memory map */ +#define VC1_SRAM_VIDTIM_LST_BASE 0x0000 +#define VC1_SRAM_VIDTIM_CURSLST_BASE 0x0400 +#define VC1_SRAM_VIDTIM_FRMT_BASE 0x0800 +#define VC1_SRAM_VIDTIM_CURSFRMT_BASE 0x0900 +#define VC1_SRAM_INTERLACED 0x09f0 +#define VC1_SRAM_SCREENWIDTH 0x09f2 +#define VC1_SRAM_NEXTDID_ADDR 0x09f4 +#define VC1_SRAM_CURSOR0_BASE 0x0a00 /* 32x32 */ +#define VC1_SRAM_DID_FRMT_BASE 0x0b00 +#define VC1_SRAM_DID_MAX_FMTSIZE 0x0900 +#define VC1_SRAM_DID_LST_END 0x8000 + +/* VC1 registers */ +#define VC1_VIDEO_EP 0x00 +#define VC1_VIDEO_LC 0x02 +#define VC1_VIDEO_SC 0x04 +#define VC1_VIDEO_TSA 0x06 +#define VC1_VIDEO_TSB 0x07 +#define VC1_VIDEO_TSC 0x08 +#define VC1_VIDEO_LP 0x09 +#define VC1_VIDEO_LS_EP 0x0b +#define VC1_VIDEO_LR 0x0d +#define VC1_VIDEO_FC 0x10 +#define VC1_VIDEO_ENABLE 0x14 + +/* Cursor Generator */ +#define VC1_CURSOR_EP 0x20 +#define VC1_CURSOR_XL 0x22 +#define VC1_CURSOR_YL 0x24 +#define VC1_CURSOR_MODE 0x26 +#define VC1_CURSOR_BX 0x27 +#define VC1_CURSOR_LY 0x28 +#define VC1_CURSOR_YC 0x2a +#define VC1_CURSOR_CC 0x2e +#define VC1_CURSOR_RC 0x30 + +/* Board revision register */ + +#define GR2_REVISION 0x6c000 +#define GR2_REVISION_RD0 0x6c000 +#define GR2_REVISION_RD0_VERSION_MASK 0x0f +#define GR2_REVISION4_RD0_MONITOR_MASK 0xf0 +#define GR2_REVISION4_RD0_MONITOR_SHIFT 4 + +#define GR2_REVISION_RD1 0x6c004 +#define GR2_REVISION_RD1_BACKEND_REV 0x03 +#define GR2_REVISION_RD1_ZBUFFER 0x0c + +#define GR2_REVISION4_RD1_BACKEND 0x03 +#define GR2_REVISION4_RD1_24BPP 0x10 +#define GR2_REVISION4_RD1_ZBUFFER 0x20 + +#define GR2_REVISION_RD2 0x6c008 +#define GR2_REVISION_RD2_BACKEND_REV 0x000c +#define GR2_REVISION_RD2_BACKEND_SHIFT 2 + +/* one slot = 8bpp, two slots = 16bpp, three slots = 24bpp, br < 4 only */ +#define GR2_REVISION_RD3 0x6c00c +#define GR2_REVISION_RD3_VMA 0x03 /* both bits set == empty + * slot */ +#define GR2_REVISION_RD3_VMB 0x0c +#define GR2_REVISION_RD3_VMC 0x30 + +/* XMAP5 -- five of them, 0x1f06c100 - 0x1f06c1a0 */ + +#define XMAP5_MISC 0x00 +#define XMAP5_MODE 0x04 +#define XMAP5_CLUT 0x08 +#define XMAP5_CRC 0x0c +#define XMAP5_ADDRLO 0x10 +#define XMAP5_ADRHI 0x14 +#define XMAP5_BYTECOUNT 0x18 +#define XMAP5_FIFOSTATUS 0x1c + +#define XMAPALL_MISC 0x6c1a0 +#define XMAPALL_MODE 0x6c1a4 +#define XMAPALL_CLUT 0x6c1a8 +#define XMAPALL_CRC 0x6c1ac +#define XMAPALL_ADDRLO 0x6c190 +#define XMAPALL_ADDRHI 0x6c194 +#define XMAPALL_BYTECOUNT 0x6c198 +#define XMAPALL_FIFOSTATUS 0x6c19c + +/* + * FIFO operation constraints. + */ + +#define GR2_DRAWCHAR_HEIGHT 18 diff --git a/sys/arch/sgi/gio/grtwovar.h b/sys/arch/sgi/gio/grtwovar.h new file mode 100644 index 00000000000..0adddb44bb6 --- /dev/null +++ b/sys/arch/sgi/gio/grtwovar.h @@ -0,0 +1,34 @@ +/* $OpenBSD: grtwovar.h,v 1.1 2012/04/18 11:01:55 miod Exp $ */ +/* $NetBSD: grtwovar.h,v 1.3 2011/07/01 18:53:46 dyoung Exp $ */ + +/* + * Copyright (c) 2004 Christopher SEKIYA + * 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. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * 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. + * + * <<Id: LICENSE_GC,v 1.1 2001/10/01 23:24:05 cgd Exp>> + */ + +int grtwo_cnattach(struct gio_attach_args *); +int grtwo_cnprobe(struct gio_attach_args *); diff --git a/sys/arch/sgi/localbus/int.c b/sys/arch/sgi/localbus/int.c index ad141ed2a3c..c97be27e52c 100644 --- a/sys/arch/sgi/localbus/int.c +++ b/sys/arch/sgi/localbus/int.c @@ -1,4 +1,4 @@ -/* $OpenBSD: int.c,v 1.3 2012/04/17 15:22:04 miod Exp $ */ +/* $OpenBSD: int.c,v 1.4 2012/04/18 11:01:55 miod Exp $ */ /* $NetBSD: int.c,v 1.24 2011/07/01 18:53:46 dyoung Exp $ */ /* @@ -460,16 +460,3 @@ int2_intr_enable(void *v) } splx(s); } - -/* - * Wait for the FIFO Full interrupt condition (Local 0 bit 0) to clear. - */ -void -int2_wait_fifo(uint32_t flag) -{ - if (int2_base == 0) - int2_base = int2_get_base(); - - while (int2_read(INT2_LOCAL0_STATUS) & flag) - ; -} diff --git a/sys/arch/sgi/localbus/intvar.h b/sys/arch/sgi/localbus/intvar.h index 4bebab52526..b9deb77d107 100644 --- a/sys/arch/sgi/localbus/intvar.h +++ b/sys/arch/sgi/localbus/intvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intvar.h,v 1.2 2012/04/17 15:22:04 miod Exp $ */ +/* $OpenBSD: intvar.h,v 1.3 2012/04/18 11:01:55 miod Exp $ */ /* $NetBSD: int2var.h,v 1.3 2008/08/23 17:25:54 tsutsui Exp $ */ /* @@ -33,5 +33,3 @@ void *int2_intr_establish(int, int, int (*)(void *), int int2_is_intr_pending(int); void int2_intr_disable(void *); void int2_intr_enable(void *); - -void int2_wait_fifo(uint32_t); |