Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/sys/arch/luna68k Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/697c4f2bf0c0
branches:  netbsd-6
changeset: 774363:697c4f2bf0c0
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Jul 25 21:30:34 2012 +0000

description:
Pull up following revision(s) (requested by tsutsui in ticket #444):
        sys/arch/luna68k/conf/GENERIC: revision 1.99
        sys/arch/luna68k/dev/lunafb.c: revision 1.26
        sys/arch/luna68k/luna68k/locore.s: revision 1.48
        sys/arch/luna68k/dev/lunaws.c: revision 1.24
        sys/arch/luna68k/dev/omron_rfont.h: file removal
        sys/arch/luna68k/dev/omrasopsvar.h: revision 1.1
        sys/arch/luna68k/dev/omrasops.c: revision 1.12
        sys/arch/luna68k/dev/omrasops.c: revision 1.13
        sys/arch/luna68k/conf/INSTALL: revision 1.6
Use & not && to mask bits.  From OpenBSD/luna88k
Fix typo in comment.  From OpenBSD/luna88k.
Switch luna68k wscons framebuffer driver to using rasops(9) APIs instead of
deprecated rcons(4).  This allows "options FONT_foo" in kernel config files.
Mostly taken from OpenBSD/luna88k, but unnecessary MI rasops(9) stuff is
omitted since omrasops.c has own raster wsdisplay_emulops functions.
Tested on LUNA with 4bpp fb and LUNA-II with 1bpp fb.
Make reboot(2) actually work (don't access %sp after MMU is turned off).
Also cleanup spaces and #if 0'ed code.  Tested on both LUNA and LUNA-II.
Should be pulled up to netbsd-6.

diffstat:

 sys/arch/luna68k/conf/GENERIC      |     5 +-
 sys/arch/luna68k/conf/INSTALL      |     3 +-
 sys/arch/luna68k/dev/lunafb.c      |    71 +-
 sys/arch/luna68k/dev/lunaws.c      |     6 +-
 sys/arch/luna68k/dev/omrasops.c    |   304 +++++----
 sys/arch/luna68k/dev/omrasopsvar.h |    29 +
 sys/arch/luna68k/dev/omron_rfont.h |  1039 ------------------------------------
 sys/arch/luna68k/luna68k/locore.s  |    15 +-
 8 files changed, 247 insertions(+), 1225 deletions(-)

diffs (truncated from 1839 to 300 lines):

diff -r 5ad1cfabefcb -r 697c4f2bf0c0 sys/arch/luna68k/conf/GENERIC
--- a/sys/arch/luna68k/conf/GENERIC     Wed Jul 25 20:55:36 2012 +0000
+++ b/sys/arch/luna68k/conf/GENERIC     Wed Jul 25 21:30:34 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.97 2011/12/18 05:49:29 dholland Exp $
+# $NetBSD: GENERIC,v 1.97.2.1 2012/07/25 21:30:34 martin Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.97 $"
+#ident                 "GENERIC-$Revision: 1.97.2.1 $"
 
 maxusers       8
 
@@ -138,6 +138,7 @@
 
 # WS console uses SUN or VT100 terminal emulation
 options        WSEMUL_VT100
+options        FONT_OMRON12x20
 
 config         netbsd root on ? type ?
 
diff -r 5ad1cfabefcb -r 697c4f2bf0c0 sys/arch/luna68k/conf/INSTALL
--- a/sys/arch/luna68k/conf/INSTALL     Wed Jul 25 20:55:36 2012 +0000
+++ b/sys/arch/luna68k/conf/INSTALL     Wed Jul 25 21:30:34 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.4 2011/12/18 05:49:29 dholland Exp $
+# $NetBSD: INSTALL,v 1.4.2.1 2012/07/25 21:30:34 martin Exp $
 #
 # config for installation ramdisk kernel
 # 
@@ -124,6 +124,7 @@
 
 # WS console uses SUN or VT100 terminal emulation
 options        WSEMUL_VT100
+options        FONT_OMRON12x20
 
 config         netbsd root on ? type ?
 
diff -r 5ad1cfabefcb -r 697c4f2bf0c0 sys/arch/luna68k/dev/lunafb.c
--- a/sys/arch/luna68k/dev/lunafb.c     Wed Jul 25 20:55:36 2012 +0000
+++ b/sys/arch/luna68k/dev/lunafb.c     Wed Jul 25 21:30:34 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lunafb.c,v 1.25 2011/07/27 14:17:54 tsutsui Exp $ */
+/* $NetBSD: lunafb.c,v 1.25.8.1 2012/07/25 21:30:35 martin Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lunafb.c,v 1.25 2011/07/27 14:17:54 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lunafb.c,v 1.25.8.1 2012/07/25 21:30:35 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -47,14 +47,15 @@
 
 #include <uvm/uvm_extern.h>
 
-#include <dev/rcons/raster.h>
 #include <dev/wscons/wsconsio.h>
-#include <dev/wscons/wscons_raster.h>
 #include <dev/wscons/wsdisplayvar.h>
+#include <dev/rasops/rasops.h>
 
 #include <machine/cpu.h>
 #include <machine/autoconf.h>
 
+#include <arch/luna68k/dev/omrasopsvar.h>
+
 #include "ioconf.h"
 
 struct bt454 {
@@ -88,8 +89,7 @@
        int     dc_rowbytes;            /* bytes in a FB scan line */
        int     dc_cmsize;              /* colormap size */
        vaddr_t dc_videobase;           /* base of flat frame buffer */
-       struct raster   dc_raster;      /* raster description */
-       struct rcons    dc_rcons;       /* raster blitter control info */
+       struct rasops_info dc_ri;       /* raster blitter variables */
 };
 
 struct hwcmap {
@@ -112,13 +112,8 @@
 static struct om_hwdevconfig omfb_console_dc;
 static void omfb_getdevconfig(paddr_t, struct om_hwdevconfig *);
 
-extern struct wsdisplay_emulops omfb_emulops;
-
 static struct wsscreen_descr omfb_stdscreen = {
-       "std", 0, 0,
-       &omfb_emulops,
-       0, 0,
-       0
+       .name = "std"
 };
 
 static const struct wsscreen_descr *_omfb_scrlist[] = {
@@ -187,7 +182,7 @@
                sc->nscreens = 1;
        } else {
                sc->sc_dc = malloc(sizeof(struct om_hwdevconfig),
-                   M_DEVBUF, M_WAITOK);
+                   M_DEVBUF, M_WAITOK | M_ZERO);
                omfb_getdevconfig(OMFB_FB_WADDR, sc->sc_dc);
        }
        aprint_normal(": %d x %d, %dbpp\n", sc->sc_dc->dc_wid, sc->sc_dc->dc_ht,
@@ -209,11 +204,12 @@
 omfb_cnattach(void)
 {
        struct om_hwdevconfig *dc = &omfb_console_dc;
+       struct rasops_info *ri = &dc->dc_ri;
        long defattr;
 
        omfb_getdevconfig(OMFB_FB_WADDR, dc);
-       (*omfb_emulops.allocattr)(&dc->dc_rcons, 0, 0, 0, &defattr);
-       wsdisplay_cnattach(&omfb_stdscreen, &dc->dc_rcons, 0, 0, defattr);
+       (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
+       wsdisplay_cnattach(&omfb_stdscreen, ri, 0, 0, defattr);
        omfb_console = 1;
        return 0;
 }
@@ -350,8 +346,7 @@
 omfb_getdevconfig(paddr_t paddr, struct om_hwdevconfig *dc)
 {
        int bpp, i;
-       struct raster *rap;
-       struct rcons *rcp;
+       struct rasops_info *ri;
        union {
                struct { short h, v; } p;
                uint32_t u;
@@ -415,7 +410,7 @@
                }
        }
 
-       /* adjust h/v orgin on screen */
+       /* adjust h/v origin on screen */
        rfcnt.p.h = 7;
        rfcnt.p.v = -27;
        /* single write of 0x007ffe6 */
@@ -424,28 +419,29 @@
        /* clear the screen */
        *(volatile uint32_t *)OMFB_PLANEMASK = 0xff;
        ((volatile uint32_t *)OMFB_ROPFUNC)[5] = ~0;    /* ROP copy */
-       for (i = 0; i < dc->dc_ht * dc->dc_rowbytes/sizeof(uint32_t); i++)
+       for (i = 0; i < dc->dc_ht * dc->dc_rowbytes / sizeof(uint32_t); i++)
                *((volatile uint32_t *)dc->dc_videobase + i) = 0;
        *(volatile uint32_t *)OMFB_PLANEMASK = 0x01;
 
        /* initialize the raster */
-       rap = &dc->dc_raster;
-       rap->width = dc->dc_wid;
-       rap->height = dc->dc_ht;
-       rap->depth = dc->dc_depth;
-       rap->linelongs = dc->dc_rowbytes / sizeof(uint32_t);
-       rap->pixels = (uint32_t *)dc->dc_videobase;
+       ri = &dc->dc_ri;
+       ri->ri_width = dc->dc_wid;
+       ri->ri_height = dc->dc_ht;
+       ri->ri_depth = 1;       /* since planes are independently addressed */
+       ri->ri_stride = dc->dc_rowbytes;
+       ri->ri_bits = (void *)dc->dc_videobase;
+       ri->ri_flg = RI_CENTER;
+       if (dc == &omfb_console_dc)
+               ri->ri_flg |= RI_NO_AUTO;
+       ri->ri_hw = dc;
 
-       /* 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);
+       omrasops_init(ri, 34, 80);
 
-       omfb_stdscreen.nrows = dc->dc_rcons.rc_maxrow;
-       omfb_stdscreen.ncols = dc->dc_rcons.rc_maxcol;
+       omfb_stdscreen.nrows = ri->ri_rows;
+       omfb_stdscreen.ncols = ri->ri_cols;
+       omfb_stdscreen.textops = &ri->ri_ops;
+       omfb_stdscreen.fontwidth = ri->ri_font->fontwidth;
+       omfb_stdscreen.fontheight = ri->ri_font->fontheight;
 }
 
 static int
@@ -453,16 +449,15 @@
     int *curxp, int *curyp, long *attrp)
 {
        struct omfb_softc *sc = v;
-       long defattr;
+       struct rasops_info *ri = &sc->sc_dc->dc_ri;
 
        if (sc->nscreens > 0)
                return ENOMEM;
 
-       *cookiep = &sc->sc_dc->dc_rcons; /* one and only for now */
+       *cookiep = ri;
        *curxp = 0;
        *curyp = 0;
-       (*omfb_emulops.allocattr)(&sc->sc_dc->dc_rcons, 0, 0, 0, &defattr);
-       *attrp = defattr;
+       (*ri->ri_ops.allocattr)(ri, 0, 0, 0, attrp);
        sc->nscreens++;
        return 0;
 }
diff -r 5ad1cfabefcb -r 697c4f2bf0c0 sys/arch/luna68k/dev/lunaws.c
--- a/sys/arch/luna68k/dev/lunaws.c     Wed Jul 25 20:55:36 2012 +0000
+++ b/sys/arch/luna68k/dev/lunaws.c     Wed Jul 25 21:30:34 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lunaws.c,v 1.23 2011/07/27 14:17:54 tsutsui Exp $ */
+/* $NetBSD: lunaws.c,v 1.23.8.1 2012/07/25 21:30:35 martin Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lunaws.c,v 1.23 2011/07/27 14:17:54 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lunaws.c,v 1.23.8.1 2012/07/25 21:30:35 martin Exp $");
 
 #include "wsmouse.h"
 
@@ -228,7 +228,7 @@
 #endif
                } while ((rr = getsiocsr(sio)) & RR_RXRDY);
        }
-       if (rr && RR_TXRDY)
+       if (rr & RR_TXRDY)
                sio->sio_cmd = WR0_RSTPEND;
        /* not capable of transmit, yet */
 }
diff -r 5ad1cfabefcb -r 697c4f2bf0c0 sys/arch/luna68k/dev/omrasops.c
--- a/sys/arch/luna68k/dev/omrasops.c   Wed Jul 25 20:55:36 2012 +0000
+++ b/sys/arch/luna68k/dev/omrasops.c   Wed Jul 25 21:30:34 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omrasops.c,v 1.11 2011/07/27 14:17:54 tsutsui Exp $ */
+/* $NetBSD: omrasops.c,v 1.11.8.1 2012/07/25 21:30:35 martin Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,33 +31,26 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: omrasops.c,v 1.11 2011/07/27 14:17:54 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omrasops.c,v 1.11.8.1 2012/07/25 21:30:35 martin Exp $");
 
 /*
  * Designed speficically for 'm68k bitorder';
  *     - most significant byte is stored at lower address,
  *     - most significant bit is displayed at left most on screen.
- * Implementation relys on;
+ * Implementation relies on;
  *     - every memory references is done in aligned 32bit chunk,
  *     - font glyphs are stored in 32bit padded.
  */
 
-#define USE_OMRONFONT
-
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
 
-#include <dev/rcons/raster.h>
-#include <dev/wscons/wscons_raster.h>
-#ifndef USE_OMRONFONT
-#include <dev/wscons/wscons_rfont.h>
-#else
-#include <arch/luna68k/dev/omron_rfont.h>
-#endif
+#include <dev/wscons/wsconsio.h>
 #include <dev/wscons/wsdisplayvar.h>
+#include <dev/rasops/rasops.h>
 
-void rcons_init(struct rcons *, int, int);
+#include <arch/luna68k/dev/omrasopsvar.h>
 
 /* wscons emulator operations */
 static void    om_cursor(void *, int, int, int);
@@ -69,17 +62,6 @@
 static void    om_eraserows(void *, int, int, long);
 static int     om_allocattr(void *, int, int, int, long *);
 
-struct wsdisplay_emulops omfb_emulops = {
-       om_cursor,
-       om_mapchar,
-       om_putchar,
-       om_copycols,
-       om_erasecols,
-       om_copyrows,
-       om_eraserows,



Home | Main Index | Thread Index | Old Index