Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/alpha Add MX (PMAG-A), CX (PMAG-B), TX (PMAG-RO/PMA...
details: https://anonhg.NetBSD.org/src/rev/db1292d62097
branches: trunk
changeset: 514107:db1292d62097
user: nisimura <nisimura%NetBSD.org@localhost>
date: Thu Aug 23 01:16:52 2001 +0000
description:
Add MX (PMAG-A), CX (PMAG-B), TX (PMAG-RO/PMAG[B]-J) TC framebuffer
supports. None of them has any acceleration capability.
diffstat:
sys/arch/alpha/conf/files.alpha | 14 +-
sys/arch/alpha/tc/cfb.c | 386 ----------------------------------------
sys/arch/alpha/tc/cfbvar.h | 65 ------
sys/arch/alpha/tc/tcasic.c | 22 +-
4 files changed, 28 insertions(+), 459 deletions(-)
diffs (truncated from 553 to 300 lines):
diff -r 962a03d1e57d -r db1292d62097 sys/arch/alpha/conf/files.alpha
--- a/sys/arch/alpha/conf/files.alpha Thu Aug 23 00:56:03 2001 +0000
+++ b/sys/arch/alpha/conf/files.alpha Thu Aug 23 01:16:52 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.alpha,v 1.141 2001/08/12 08:35:32 jdolecek Exp $
+# $NetBSD: files.alpha,v 1.142 2001/08/23 01:16:52 nisimura Exp $
#
# alpha-specific configuration info
@@ -169,13 +169,23 @@
# PMAG-B CX
device cfb: wsemuldisplaydev, wsrasteremulops
attach cfb at tc
-file arch/alpha/tc/cfb.c cfb needs-flag
+file dev/tc/cfb.c cfb needs-flag
# PMAGB-B HX or CXT
device sfb: wsemuldisplaydev, rasops8
attach sfb at tc
file dev/tc/sfb.c sfb needs-flag
+# PMAG-A MX
+device mfb: wsemuldisplaydev, wsrasteremulops
+attach mfb at tc
+file dev/tc/mfb.c mfb needs-flag
+
+# PMAG-RO/JA TX
+device tfb: wsemuldisplaydev, wsrasteremulops
+attach tfb at tc
+file dev/tc/tfb.c tfb needs-flag
+
# PMAGD HX+
device sfbp: wsemuldisplaydev, rasops32
attach sfbp at tc
diff -r 962a03d1e57d -r db1292d62097 sys/arch/alpha/tc/cfb.c
--- a/sys/arch/alpha/tc/cfb.c Thu Aug 23 00:56:03 2001 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,386 +0,0 @@
-/* $NetBSD: cfb.c,v 1.25 2000/06/26 04:55:22 simonb 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@localhost
- * 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/cdefs.h> /* RCS ID & Copyright macro defns */
-
-__KERNEL_RCSID(0, "$NetBSD: cfb.c,v 1.25 2000/06/26 04:55:22 simonb Exp $");
-
-#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/ioctl.h>
-
-#include <machine/bus.h>
-#include <machine/intr.h>
-#include <machine/conf.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 __P((struct device *, struct cfdata *, void *));
-void cfbattach __P((struct device *, struct device *, void *));
-
-struct cfattach cfb_ca = {
- sizeof(struct cfb_softc), cfbmatch, cfbattach,
-};
-
-void cfb_getdevconfig __P((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 __P((void *, u_long, caddr_t, int, struct proc *));
-paddr_t cfbmmap __P((void *, off_t, int));
-
-int cfbintr __P((void *));
-static int cfb_alloc_screen __P((void *, const struct wsscreen_descr *,
- void **, int *, int *, long *));
-static void cfb_free_screen __P((void *, void *));
-static int cfb_show_screen __P((void *, void *, int,
- void (*) (void *, int, int), void *));
-
-struct wsdisplay_accessops cfb_accessops = {
- cfbioctl,
- cfbmmap,
- cfb_alloc_screen,
- cfb_free_screen,
- cfb_show_screen,
- 0 /* load_font */
-};
-
-int
-cfbmatch(parent, match, aux)
- struct device *parent;
- struct cfdata *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(": couldn't map memory space; punt!\n");
- return;
- }
- printf(": %d x %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, TC_IPL_TTY, cfbintr, sc);
- *(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;
-
- 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
-
Home |
Main Index |
Thread Index |
Old Index