summaryrefslogtreecommitdiff
path: root/sys/arch/alpha
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/alpha')
-rw-r--r--sys/arch/alpha/conf/GENERIC4
-rw-r--r--sys/arch/alpha/conf/RAMDISKBIG4
-rw-r--r--sys/arch/alpha/tc/cfb.c392
-rw-r--r--sys/arch/alpha/tc/cfbvar.h68
-rw-r--r--sys/arch/alpha/tc/sfb.c456
-rw-r--r--sys/arch/alpha/tc/sfbvar.h68
6 files changed, 2 insertions, 990 deletions
diff --git a/sys/arch/alpha/conf/GENERIC b/sys/arch/alpha/conf/GENERIC
index 2309131cafd..42bd72235ec 100644
--- a/sys/arch/alpha/conf/GENERIC
+++ b/sys/arch/alpha/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.264 2019/12/17 13:08:54 reyk Exp $
+# $OpenBSD: GENERIC,v 1.265 2020/05/23 06:17:08 jsg Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -167,8 +167,6 @@ zstty* at zs? channel 1
tcds* at tc?
asc* at tcds?
asc* at tc?
-#cfb* at tc?
-#sfb* at tc?
le* at tc?
# PCI host bus adapter support
diff --git a/sys/arch/alpha/conf/RAMDISKBIG b/sys/arch/alpha/conf/RAMDISKBIG
index 43de32ab660..5ef9908e907 100644
--- a/sys/arch/alpha/conf/RAMDISKBIG
+++ b/sys/arch/alpha/conf/RAMDISKBIG
@@ -1,4 +1,4 @@
-# $OpenBSD: RAMDISKBIG,v 1.102 2019/09/04 14:29:41 cheloha Exp $
+# $OpenBSD: RAMDISKBIG,v 1.103 2020/05/23 06:17:08 jsg Exp $
machine alpha
maxusers 4
@@ -81,8 +81,6 @@ zstty* at zs? channel 1
tcds* at tc?
asc* at tcds?
asc* at tc?
-#cfb* at tc?
-#sfb* at tc?
le* at tc?
apecs* at mainbus?
diff --git a/sys/arch/alpha/tc/cfb.c b/sys/arch/alpha/tc/cfb.c
deleted file mode 100644
index e2b9e7bff7a..00000000000
--- a/sys/arch/alpha/tc/cfb.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/* $OpenBSD: cfb.c,v 1.24 2017/01/15 20:22:33 fcambus Exp $ */
-/* $NetBSD: cfb.c,v 1.7 1996/12/05 01:39:39 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.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/device.h>
-#include <sys/malloc.h>
-#include <sys/buf.h>
-#include <sys/conf.h>
-#include <sys/ioctl.h>
-
-#include <uvm/uvm_extern.h>
-
-#include <machine/bus.h>
-#include <machine/intr.h>
-
-#include <dev/tc/tcvar.h>
-#include <machine/cfbreg.h>
-#include <alpha/tc/cfbvar.h>
-
-#include <dev/rcons/raster.h>
-#include <dev/wscons/wscons_raster.h>
-#include <dev/wscons/wsdisplayvar.h>
-#include <machine/fbio.h>
-
-#include <machine/autoconf.h>
-#include <machine/pte.h>
-
-int cfbmatch(struct device *, void *, void *);
-void cfbattach(struct device *, struct device *, void *);
-
-struct cfattach cfb_ca = {
- sizeof(struct cfb_softc), cfbmatch, cfbattach,
-};
-
-struct cfdriver cfb_cd = {
- NULL, "cfb", DV_DULL,
-};
-
-void cfb_getdevconfig(tc_addr_t dense_addr, struct cfb_devconfig *dc);
-struct cfb_devconfig cfb_console_dc;
-tc_addr_t cfb_consaddr;
-
-struct wsdisplay_emulops cfb_emulfuncs = {
- rcons_cursor, /* could use hardware cursor; punt */
- rcons_mapchar,
- rcons_putchar,
- rcons_copycols,
- rcons_erasecols,
- rcons_copyrows,
- rcons_eraserows,
- rcons_alloc_attr
-};
-
-struct wsscreen_descr cfb_stdscreen = {
- "std",
- 0, 0, /* will be filled in -- XXX shouldn't, it's global */
- &cfb_emulfuncs,
- 0, 0
-};
-
-const struct wsscreen_descr *_cfb_scrlist[] = {
- &cfb_stdscreen,
- /* XXX other formats, graphics screen? */
-};
-
-struct wsscreen_list cfb_screenlist = {
- sizeof(_cfb_scrlist) / sizeof(struct wsscreen_descr *), _cfb_scrlist
-};
-
-int cfbioctl(void *, u_long, caddr_t, int, struct proc *);
-paddr_t cfbmmap(void *, off_t, int);
-
-int cfbintr(void *);
-static int cfb_alloc_screen(void *, const struct wsscreen_descr *,
- void **, int *, int *, long *);
-static void cfb_free_screen(void *, void *);
-static int cfb_show_screen(void *, void *, int,
- void (*) (void *, int, int), void *);
-
-struct wsdisplay_accessops cfb_accessops = {
- .ioctl = cfbioctl,
- .mmap = cfbmmap,
- .alloc_screen = cfb_alloc_screen,
- .free_screen = cfb_free_screen,
- .show_screen = cfb_show_screen
-};
-
-int
-cfbmatch(parent, match, aux)
- struct device *parent;
- void *match;
- void *aux;
-{
- struct tc_attach_args *ta = aux;
-
- if (strncmp("PMAG-BA ", ta->ta_modname, TC_ROM_LLEN) != 0)
- return (0);
-
- return (10);
-}
-
-void
-cfb_getdevconfig(dense_addr, dc)
- tc_addr_t dense_addr;
- struct cfb_devconfig *dc;
-{
- struct raster *rap;
- struct rcons *rcp;
- char *ramdacregp;
- int i;
-
- dc->dc_vaddr = dense_addr;
- dc->dc_paddr = ALPHA_K0SEG_TO_PHYS(dc->dc_vaddr); /* XXX */
- dc->dc_size = CFB_SIZE;
-
- ramdacregp = (char *)dc->dc_vaddr + CFB_RAMDAC_OFFSET;
-
- dc->dc_wid = 1024;
- dc->dc_ht = 864;
- dc->dc_depth = 8; /* 8 plane */
- dc->dc_rowbytes = dc->dc_wid * (dc->dc_depth / 8);
-
- dc->dc_videobase = dc->dc_vaddr + CFB_FB_OFFSET;
-
- /* Initialize the RAMDAC/colormap */
- /* start XXX XXX XXX */
- (*(volatile u_int32_t *)(ramdacregp + CFB_RAMDAC_ADDRLOW)) = 0;
- (*(volatile u_int32_t *)(ramdacregp + CFB_RAMDAC_ADDRHIGH)) = 0;
- tc_wmb();
- for (i = 0; i < 256; i++) {
- (*(volatile u_int32_t *)(ramdacregp + CFB_RAMDAC_CMAPDATA)) =
- i ? 0xff : 0;
- tc_wmb();
- (*(volatile u_int32_t *)(ramdacregp + CFB_RAMDAC_CMAPDATA)) =
- i ? 0xff : 0;
- tc_wmb();
- (*(volatile u_int32_t *)(ramdacregp + CFB_RAMDAC_CMAPDATA)) =
- i ? 0xff : 0;
- tc_wmb();
- }
- /* end XXX XXX XXX */
-
- /* clear the screen */
- for (i = 0; i < dc->dc_ht * dc->dc_rowbytes; i += sizeof(u_int32_t))
- *(u_int32_t *)(dc->dc_videobase + i) = 0x00000000;
-
- rap = &dc->dc_raster;
- rap->width = dc->dc_wid;
- rap->height = dc->dc_ht;
- rap->depth = 8;
- rap->linelongs = dc->dc_rowbytes / sizeof(u_int32_t);
- rap->pixels = (u_int32_t *)dc->dc_videobase;
-
- /* initialize the raster console blitter */
- rcp = &dc->dc_rcons;
- rcp->rc_sp = rap;
- rcp->rc_crow = rcp->rc_ccol = -1;
- rcp->rc_crowp = &rcp->rc_crow;
- rcp->rc_ccolp = &rcp->rc_ccol;
- rcons_init(rcp, 34, 80);
-
- cfb_stdscreen.nrows = dc->dc_rcons.rc_maxrow;
- cfb_stdscreen.ncols = dc->dc_rcons.rc_maxcol;
-}
-
-void
-cfbattach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct cfb_softc *sc = (struct cfb_softc *)self;
- struct tc_attach_args *ta = aux;
- struct wsemuldisplaydev_attach_args waa;
- int console;
-
- console = (ta->ta_addr == cfb_consaddr);
- if (console) {
- sc->sc_dc = &cfb_console_dc;
- sc->nscreens = 1;
- } else {
- sc->sc_dc = (struct cfb_devconfig *)
- malloc(sizeof(struct cfb_devconfig), M_DEVBUF, M_WAITOK);
- cfb_getdevconfig(ta->ta_addr, sc->sc_dc);
- }
- if (sc->sc_dc->dc_vaddr == NULL) {
- printf(": can't map mem space\n");
- return;
- }
- printf(": %dx%d, %dbpp\n", sc->sc_dc->dc_wid, sc->sc_dc->dc_ht,
- sc->sc_dc->dc_depth);
-
- /* Establish an interrupt handler, and clear any pending interrupts */
- tc_intr_establish(parent, ta->ta_cookie, IPL_TTY, cfbintr, sc,
- self->dv_xname);
- *(volatile u_int32_t *)(sc->sc_dc->dc_vaddr + CFB_IREQCTRL_OFFSET) = 0;
-
- /* initialize the raster */
- waa.console = console;
- waa.scrdata = &cfb_screenlist;
- waa.accessops = &cfb_accessops;
- waa.accesscookie = sc;
- waa.defaultscreens = 0;
-
- config_found(self, &waa, wsemuldisplaydevprint);
-}
-
-int
-cfbioctl(v, cmd, data, flag, p)
- void *v;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-{
- struct cfb_softc *sc = v;
- struct cfb_devconfig *dc = sc->sc_dc;
-
- switch (cmd) {
- case FBIOGTYPE:
-#define fbt ((struct fbtype *)data)
- fbt->fb_type = FBTYPE_CFB;
- fbt->fb_height = sc->sc_dc->dc_ht;
- fbt->fb_width = sc->sc_dc->dc_wid;
- fbt->fb_depth = sc->sc_dc->dc_depth;
- fbt->fb_cmsize = 256; /* XXX ??? */
- fbt->fb_size = sc->sc_dc->dc_size;
-#undef fbt
- return (0);
-
-#if 0
- case FBIOPUTCMAP:
- return (*tgar->tgar_set_cmap)(dc, (struct fbcmap *)data);
-
- case FBIOGETCMAP:
- return (*tgar->tgar_get_cmap)(dc, (struct fbcmap *)data);
-#endif
-
- case FBIOGATTR:
- return (ENOTTY); /* XXX ? */
-
-#if 0
- case FBIOSVIDEO:
- if (*(int *)data == FBVIDEO_OFF)
- cfb_blank(sc->sc_dc);
- else
- cfb_unblank(sc->sc_dc);
- return (0);
-#endif
-
- case FBIOGVIDEO:
- *(int *)data = dc->dc_blanked ? FBVIDEO_OFF : FBVIDEO_ON;
- return (0);
-
-#if 0
- case FBIOSCURSOR:
- return (*tgar->tgar_set_cursor)(dc, (struct fbcursor *)data);
-
- case FBIOGCURSOR:
- return (*tgar->tgar_get_cursor)(dc, (struct fbcursor *)data);
-
- case FBIOSCURPOS:
- return (*tgar->tgar_set_curpos)(dc, (struct fbcurpos *)data);
-
- case FBIOGCURPOS:
- return (*tgar->tgar_get_curpos)(dc, (struct fbcurpos *)data);
-
- case FBIOGCURMAX:
- return (*tgar->tgar_get_curmax)(dc, (struct fbcurpos *)data);
-#endif
- }
- return (-1);
-}
-
-paddr_t
-cfbmmap(v, offset, prot)
- void *v;
- off_t offset;
- int prot;
-{
- struct cfb_softc *sc = v;
-
- if (offset > CFB_SIZE)
- return (-1);
- return sc->sc_dc->dc_paddr + offset;
-}
-
-int
-cfbintr(v)
- void *v;
-{
- struct cfb_softc *sc = v;
-
- *(volatile u_int32_t *)(sc->sc_dc->dc_vaddr + CFB_IREQCTRL_OFFSET) = 0;
-
- return (1);
-}
-
-int
-cfb_alloc_screen(v, type, cookiep, curxp, curyp, attrp)
- void *v;
- const struct wsscreen_descr *type;
- void **cookiep;
- int *curxp, *curyp;
- long *attrp;
-{
- struct cfb_softc *sc = v;
- long defattr;
-
- if (sc->nscreens > 0)
- return (ENOMEM);
-
- *cookiep = &sc->sc_dc->dc_rcons; /* one and only for now */
- *curxp = 0;
- *curyp = 0;
- rcons_alloc_attr(&sc->sc_dc->dc_rcons, 0, 0, 0, &defattr);
- *attrp = defattr;
- sc->nscreens++;
- return(0);
-}
-
-void
-cfb_free_screen(v, cookie)
- void *v;
- void *cookie;
-{
- struct cfb_softc *sc = v;
-
- if (sc->sc_dc == &cfb_console_dc)
- panic("cfb_free_screen: console");
-
- sc->nscreens--;
-}
-
-int
-cfb_show_screen(v, cookie, waitok, cb, cbarg)
- void *v;
- void *cookie;
- int waitok;
- void (*cb)(void *, int, int);
- void *cbarg;
-{
- return (0);
-}
-
-#if 0
-int
-cfb_cnattach(addr)
- tc_addr_t addr;
-{
- struct cfb_devconfig *dc = &cfb_console_dc;
- long defattr;
-
- cfb_getdevconfig(addr, dcp);
-
- rcons_alloc_attr(&dcp->dc_rcons, 0, 0, 0, &defattr);
-
- wsdisplay_cnattach(&cfb_stdscreen, &dcp->dc_rcons,
- 0,0, defattr;);
-
- cfb_consaddr = addr;
- return (0);
-}
-#endif
diff --git a/sys/arch/alpha/tc/cfbvar.h b/sys/arch/alpha/tc/cfbvar.h
deleted file mode 100644
index 567df97081b..00000000000
--- a/sys/arch/alpha/tc/cfbvar.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* $OpenBSD: cfbvar.h,v 1.7 2005/12/17 07:31:25 miod Exp $ */
-/* $NetBSD: cfbvar.h,v 1.1 1996/05/01 23:25:04 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.
- */
-
-#include <machine/cfbreg.h>
-#include <dev/rcons/raster.h>
-#include <dev/wscons/wscons_raster.h>
-
-struct cfb_devconfig;
-struct fbcmap;
-struct fbcursor;
-struct fbcurpos;
-
-struct cfb_devconfig {
- vaddr_t dc_vaddr; /* memory space virtual base address */
- paddr_t dc_paddr; /* memory space physical base address */
- vsize_t dc_size; /* size of slot memory */
-
- int dc_wid; /* width of frame buffer */
- int dc_ht; /* height of frame buffer */
- int dc_depth; /* depth, bits per pixel */
- int dc_rowbytes; /* bytes in a FB scan line */
-
- vaddr_t dc_videobase; /* base of flat frame buffer */
-
- struct raster dc_raster; /* raster description */
- struct rcons dc_rcons; /* raster blitter control info */
-
- int dc_blanked; /* currently has video disabled */
-};
-
-struct cfb_softc {
- struct device sc_dev;
-
- struct cfb_devconfig *sc_dc; /* device configuration */
-
- int nscreens;
-};
-
-#if 0
-int cfb_cnattach(tc_addr_t);
-#endif
diff --git a/sys/arch/alpha/tc/sfb.c b/sys/arch/alpha/tc/sfb.c
deleted file mode 100644
index 81b80e09ee8..00000000000
--- a/sys/arch/alpha/tc/sfb.c
+++ /dev/null
@@ -1,456 +0,0 @@
-/* $OpenBSD: sfb.c,v 1.22 2017/01/15 20:22:33 fcambus Exp $ */
-/* $NetBSD: sfb.c,v 1.7 1996/12/05 01:39:44 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.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/device.h>
-#include <sys/malloc.h>
-#include <sys/buf.h>
-#include <sys/conf.h>
-#include <sys/ioctl.h>
-
-#include <uvm/uvm_extern.h>
-
-#include <machine/bus.h>
-#include <machine/intr.h>
-
-#include <dev/tc/tcvar.h>
-#include <machine/sfbreg.h>
-#include <alpha/tc/sfbvar.h>
-
-#include <dev/rcons/raster.h>
-#include <dev/wscons/wscons_raster.h>
-#include <dev/wscons/wsdisplayvar.h>
-#include <machine/fbio.h>
-
-#include <machine/autoconf.h>
-#include <machine/pte.h>
-
-int sfbmatch(struct device *, void *, void *);
-void sfbattach(struct device *, struct device *, void *);
-
-struct cfattach sfb_ca = {
- sizeof(struct sfb_softc), sfbmatch, sfbattach,
-};
-
-struct cfdriver sfb_cd = {
- NULL, "sfb", DV_DULL,
-};
-
-void sfb_getdevconfig(tc_addr_t dense_addr, struct sfb_devconfig *dc);
-struct sfb_devconfig sfb_console_dc;
-tc_addr_t sfb_consaddr;
-
-struct wsdisplay_emulops sfb_emulfuncs = {
- rcons_cursor, /* could use hardware cursor; punt */
- rcons_mapchar,
- rcons_putchar,
- rcons_copycols,
- rcons_erasecols,
- rcons_copyrows,
- rcons_eraserows,
- rcons_alloc_attr
-};
-
-struct wsscreen_descr sfb_stdscreen = {
- "std",
- 0, 0, /* will be filled in -- XXX shouldn't, it's global */
- &sfb_emulfuncs,
- 0, 0
-};
-const struct wsscreen_descr *_sfb_scrlist[] = {
- &sfb_stdscreen,
- /* XXX other formats, graphics screen? */
-};
-
-struct wsscreen_list sfb_screenlist = {
- sizeof(_sfb_scrlist) / sizeof(struct wsscreen_descr *), _sfb_scrlist
-};
-
-int sfbioctl(void *, u_long, caddr_t, int, struct proc *);
-paddr_t sfbmmap(void *, off_t, int);
-
-static int sfb_alloc_screen(void *, const struct wsscreen_descr *,
- void **, int *, int *, long *);
-static void sfb_free_screen(void *, void *);
-static int sfb_show_screen(void *, void *, int,
- void (*) (void *, int, int), void *);
-
-#if 0
-void sfb_blank(struct sfb_devconfig *);
-void sfb_unblank(struct sfb_devconfig *);
-#endif
-
-struct wsdisplay_accessops sfb_accessops = {
- .ioctl = sfbioctl,
- .mmap = sfbmmap,
- .alloc_screen = sfb_alloc_screen,
- .free_screen = sfb_free_screen,
- .show_screen = sfb_show_screen
-};
-
-int
-sfbmatch(parent, match, aux)
- struct device *parent;
- void *match;
- void *aux;
-{
- struct tc_attach_args *ta = aux;
-
- if (strncmp("PMAGB-BA", ta->ta_modname, TC_ROM_LLEN) != 0)
- return (0);
-
- return (10);
-}
-
-void
-sfb_getdevconfig(dense_addr, dc)
- tc_addr_t dense_addr;
- struct sfb_devconfig *dc;
-{
- struct raster *rap;
- struct rcons *rcp;
- char *regp, *ramdacregp;
- int i;
-
- dc->dc_vaddr = dense_addr;
- dc->dc_paddr = ALPHA_K0SEG_TO_PHYS(dc->dc_vaddr); /* XXX */
- dc->dc_size = SFB_SIZE;
-
- regp = (char *)dc->dc_vaddr + SFB_ASIC_OFFSET;
- ramdacregp = (char *)dc->dc_vaddr + SFB_RAMDAC_OFFSET;
-
- dc->dc_wid =
- (*(volatile u_int32_t *)(regp + SFB_ASIC_VIDEO_HSETUP) & 0x1ff) * 4;
- dc->dc_ht =
- (*(volatile u_int32_t *)(regp + SFB_ASIC_VIDEO_VSETUP) & 0x7ff);
-
- switch (*(volatile u_int32_t *)(regp + SFB_ASIC_DEEP)) {
- case 0:
- case 1: /* XXX by the book; wrong? */
- dc->dc_depth = 8; /* 8 plane */
- break;
- case 2:
- dc->dc_depth = 16; /* 16 plane */
- break;
- case 4:
- dc->dc_depth = 32; /* 32 plane */
- break;
- default:
- dc->dc_depth = 8; /* XXX can't happen? */
- break;
- }
-
- dc->dc_rowbytes = dc->dc_wid * (dc->dc_depth / 8);
-
- dc->dc_videobase = dc->dc_vaddr + SFB_FB_OFFSET +
- ((*(volatile u_int32_t *)(regp + SFB_ASIC_VIDEO_BASE)) *
- 4096 * (dc->dc_depth / 8));
-
- (*(volatile u_int32_t *)(regp + SFB_ASIC_MODE)) = 0;
- tc_wmb();
- (*(volatile u_int32_t *)(regp + SFB_ASIC_VIDEO_VALID)) = 1;
- tc_wmb();
-
- /*
- * Set all bits in the pixel mask, to enable writes to all pixels.
- * It seems that the console firmware clears some of them
- * under some circumstances, which causes cute vertical stripes.
- */
- (*(volatile u_int32_t *)(regp + SFB_ASIC_PIXELMASK)) = 0xffffffff;
- tc_wmb();
- (*(volatile u_int32_t *)(regp + SFB_ASIC_PLANEMASK)) = 0xffffffff;
- tc_wmb();
-
- /* Initialize the RAMDAC/colormap */
- /* start XXX XXX XXX */
- (*(volatile u_int32_t *)(ramdacregp + SFB_RAMDAC_ADDRLOW)) = 0;
- (*(volatile u_int32_t *)(ramdacregp + SFB_RAMDAC_ADDRHIGH)) = 0;
- tc_wmb();
- for (i = 0; i < 256; i++) {
- (*(volatile u_int32_t *)(ramdacregp + SFB_RAMDAC_CMAPDATA)) =
- i ? 0xff : 0;
- tc_wmb();
- (*(volatile u_int32_t *)(ramdacregp + SFB_RAMDAC_CMAPDATA)) =
- i ? 0xff : 0;
- tc_wmb();
- (*(volatile u_int32_t *)(ramdacregp + SFB_RAMDAC_CMAPDATA)) =
- i ? 0xff : 0;
- tc_wmb();
- }
- /* end XXX XXX XXX */
-
- /* clear the screen */
- for (i = 0; i < dc->dc_ht * dc->dc_rowbytes; i += sizeof(u_int32_t))
- *(u_int32_t *)(dc->dc_videobase + i) = 0x00000000;
-
- /* initialize the raster */
- rap = &dc->dc_raster;
- rap->width = dc->dc_wid;
- rap->height = dc->dc_ht;
- rap->depth = 8;
- rap->linelongs = dc->dc_rowbytes / sizeof(u_int32_t);
- rap->pixels = (u_int32_t *)dc->dc_videobase;
-
- /* initialize the raster console blitter */
- rcp = &dc->dc_rcons;
- rcp->rc_sp = rap;
- rcp->rc_crow = rcp->rc_ccol = -1;
- rcp->rc_crowp = &rcp->rc_crow;
- rcp->rc_ccolp = &rcp->rc_ccol;
- rcons_init(rcp, 34, 80);
-
- sfb_stdscreen.nrows = dc->dc_rcons.rc_maxrow;
- sfb_stdscreen.ncols = dc->dc_rcons.rc_maxcol;
-}
-
-void
-sfbattach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct sfb_softc *sc = (struct sfb_softc *)self;
- struct tc_attach_args *ta = aux;
- struct wsemuldisplaydev_attach_args waa;
- int console;
-
- console = (ta->ta_addr == sfb_consaddr);
- if (console) {
- sc->sc_dc = &sfb_console_dc;
- sc->nscreens = 1;
- } else {
- sc->sc_dc = (struct sfb_devconfig *)
- malloc(sizeof(struct sfb_devconfig), M_DEVBUF, M_WAITOK);
- sfb_getdevconfig(ta->ta_addr, sc->sc_dc);
- }
- if (sc->sc_dc->dc_vaddr == NULL) {
- printf(": can't map mem space\n");
- return;
- }
- printf(": %dx%d, %dbpp\n", sc->sc_dc->dc_wid, sc->sc_dc->dc_ht,
- sc->sc_dc->dc_depth);
-
-#if 0
- x = (char *)ta->ta_addr + SFB_ASIC_OFFSET;
- printf("%s: Video Base Address = 0x%x\n", self->dv_xname,
- *(u_int32_t *)(x + SFB_ASIC_VIDEO_BASE));
- printf("%s: Horizontal Setup = 0x%x\n", self->dv_xname,
- *(u_int32_t *)(x + SFB_ASIC_VIDEO_HSETUP));
- printf("%s: Vertical Setup = 0x%x\n", self->dv_xname,
- *(u_int32_t *)(x + SFB_ASIC_VIDEO_VSETUP));
-#endif
-
- waa.console = console;
- waa.scrdata = &sfb_screenlist;
- waa.accessops = &sfb_accessops;
- waa.accesscookie = sc;
- waa.defaultscreens = 0;
-
- config_found(self, &waa, wsemuldisplaydevprint);
-}
-
-int
-sfbioctl(v, cmd, data, flag, p)
- void *v;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-{
- struct sfb_softc *sc = v;
- struct sfb_devconfig *dc = sc->sc_dc;
-
- switch (cmd) {
- case FBIOGTYPE:
-#define fbt ((struct fbtype *)data)
- fbt->fb_type = FBTYPE_SFB;
- fbt->fb_height = sc->sc_dc->dc_ht;
- fbt->fb_width = sc->sc_dc->dc_wid;
- fbt->fb_depth = sc->sc_dc->dc_depth;
- fbt->fb_cmsize = 256; /* XXX ??? */
- fbt->fb_size = sc->sc_dc->dc_size;
-#undef fbt
- return (0);
-
-#if 0
- case FBIOPUTCMAP:
- return (*tgar->tgar_set_cmap)(dc, (struct fbcmap *)data);
-
- case FBIOGETCMAP:
- return (*tgar->tgar_get_cmap)(dc, (struct fbcmap *)data);
-#endif
-
- case FBIOGATTR:
- return (ENOTTY); /* XXX ? */
-
-#if 0
- case FBIOSVIDEO:
- if (*(int *)data == FBVIDEO_OFF)
- sfb_blank(sc->sc_dc);
- else
- sfb_unblank(sc->sc_dc);
- return (0);
-#endif
-
- case FBIOGVIDEO:
- *(int *)data = dc->dc_blanked ? FBVIDEO_OFF : FBVIDEO_ON;
- return (0);
-
-#if 0
- case FBIOSCURSOR:
- return (*tgar->tgar_set_cursor)(dc, (struct fbcursor *)data);
-
- case FBIOGCURSOR:
- return (*tgar->tgar_get_cursor)(dc, (struct fbcursor *)data);
-
- case FBIOSCURPOS:
- return (*tgar->tgar_set_curpos)(dc, (struct fbcurpos *)data);
-
- case FBIOGCURPOS:
- return (*tgar->tgar_get_curpos)(dc, (struct fbcurpos *)data);
-
- case FBIOGCURMAX:
- return (*tgar->tgar_get_curmax)(dc, (struct fbcurpos *)data);
-#endif
- }
- return (-1);
-}
-
-paddr_t
-sfbmmap(v, offset, prot)
- void *v;
- off_t offset;
- int prot;
-{
- struct sfb_softc *sc = v;
-
- if (offset >= SFB_SIZE || offset < 0)
- return (-1);
- return sc->sc_dc->dc_paddr + offset;
-}
-
-int
-sfb_alloc_screen(v, type, cookiep, curxp, curyp, attrp)
- void *v;
- const struct wsscreen_descr *type;
- void **cookiep;
- int *curxp, *curyp;
- long *attrp;
-{
- struct sfb_softc *sc = v;
- long defattr;
-
- if (sc->nscreens > 0)
- return (ENOMEM);
-
- *cookiep = &sc->sc_dc->dc_rcons; /* one and only for now */
- *curxp = 0;
- *curyp = 0;
- rcons_alloc_attr(&sc->sc_dc->dc_rcons, 0, 0, 0, &defattr);
- *attrp = defattr;
- sc->nscreens++;
- return (0);
-}
-
-void
-sfb_free_screen(v, cookie)
- void *v;
- void *cookie;
-{
- struct sfb_softc *sc = v;
-
- if (sc->sc_dc == &sfb_console_dc)
- panic("sfb_free_screen: console");
-
- sc->nscreens--;
-}
-
-int
-sfb_show_screen(v, cookie, waitok, cb, cbarg)
- void *v;
- void *cookie;
- int waitok;
- void (*cb)(void *, int, int);
- void *cbarg;
-{
-
- return (0);
-}
-
-#if 0
-int
-sfb_cnattach(addr)
- tc_addr_t addr;
-{
- struct sfb_devconfig *dcp = &sfb_console_dc;
- long defattr;
-
- sfb_getdevconfig(addr, dcp);
-
- rcons_alloc_attr(&dcp->dc_rcons, 0, 0, 0, &defattr);
-
- wsdisplay_cnattach(&sfb_stdscreen, &dcp->dc_rcons,
- 0, 0, defattr);
- sfb_consaddr = addr;
- return(0);
-}
-#endif
-
-#if 0
-/*
- * Functions to blank and unblank the display.
- */
-void
-sfb_blank(dc)
- struct sfb_devconfig *dc;
-{
- char *regp = (char *)dc->dc_vaddr + SFB_ASIC_OFFSET;
-
- if (!dc->dc_blanked) {
- dc->dc_blanked = 1;
- *(volatile u_int32_t *)(regp + SFB_ASIC_VIDEO_VALID) = 0;
- tc_wmb();
- }
-}
-
-void
-sfb_unblank(dc)
- struct sfb_devconfig *dc;
-{
- char *regp = (char *)dc->dc_vaddr + SFB_ASIC_OFFSET;
-
- if (dc->dc_blanked) {
- dc->dc_blanked = 0;
- *(volatile u_int32_t *)(regp + SFB_ASIC_VIDEO_VALID) = 1;
- tc_wmb();
- }
-}
-#endif
diff --git a/sys/arch/alpha/tc/sfbvar.h b/sys/arch/alpha/tc/sfbvar.h
deleted file mode 100644
index 6674c2cfcf1..00000000000
--- a/sys/arch/alpha/tc/sfbvar.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* $OpenBSD: sfbvar.h,v 1.7 2005/12/17 07:31:25 miod Exp $ */
-/* $NetBSD: sfbvar.h,v 1.1 1996/05/01 21:15:51 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.
- */
-
-#include <machine/sfbreg.h>
-#include <dev/rcons/raster.h>
-#include <dev/wscons/wscons_raster.h>
-
-struct sfb_devconfig;
-struct fbcmap;
-struct fbcursor;
-struct fbcurpos;
-
-struct sfb_devconfig {
- vaddr_t dc_vaddr; /* memory space virtual base address */
- paddr_t dc_paddr; /* memory space physical base address */
- vsize_t dc_size; /* size of slot memory */
-
- int dc_wid; /* width of frame buffer */
- int dc_ht; /* height of frame buffer */
- int dc_depth; /* depth, bits per pixel */
- int dc_rowbytes; /* bytes in a FB scan line */
-
- vaddr_t dc_videobase; /* base of flat frame buffer */
-
- struct raster dc_raster; /* raster description */
- struct rcons dc_rcons; /* raster blitter control info */
-
- int dc_blanked; /* currently has video disabled */
-};
-
-struct sfb_softc {
- struct device sc_dev;
-
- struct sfb_devconfig *sc_dc; /* device configuration */
-
- int nscreens;
-};
-
-#if 0
-int sfb_cnattach(tc_addr_t);
-#endif