Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hpcmips Wsdisplay and wskbd are supported as a cons...



details:   https://anonhg.NetBSD.org/src/rev/c3584afe7293
branches:  trunk
changeset: 477602:c3584afe7293
user:      takemura <takemura%NetBSD.org@localhost>
date:      Sun Oct 24 08:37:28 1999 +0000

description:
Wsdisplay and wskbd are supported as a console device.

diffstat:

 sys/arch/hpcmips/conf/GENERIC       |    4 +-
 sys/arch/hpcmips/conf/files.hpcmips |    7 +-
 sys/arch/hpcmips/dev/fb.c           |   75 +++-
 sys/arch/hpcmips/dev/fbvar.h        |    5 +-
 sys/arch/hpcmips/vr/vr.c            |   38 ++-
 sys/arch/hpcmips/vr/vrkiu.c         |  611 +++++++++++++++++++----------------
 sys/arch/hpcmips/vr/vrkiuvar.h      |   22 +-
 7 files changed, 449 insertions(+), 313 deletions(-)

diffs (truncated from 1032 to 300 lines):

diff -r 8e4acbeb5684 -r c3584afe7293 sys/arch/hpcmips/conf/GENERIC
--- a/sys/arch/hpcmips/conf/GENERIC     Sun Oct 24 04:04:13 1999 +0000
+++ b/sys/arch/hpcmips/conf/GENERIC     Sun Oct 24 08:37:28 1999 +0000
@@ -2,7 +2,7 @@
 # Distribution kernel (any  model) kernel config file
 
 #
-#      $NetBSD: GENERIC,v 1.3 1999/10/18 09:42:12 enami Exp $
+#      $NetBSD: GENERIC,v 1.4 1999/10/24 08:37:28 takemura Exp $
 #
 include                "arch/hpcmips/conf/std.hpcmips"
 
@@ -86,7 +86,7 @@
 # Workstation Console attachments
 fb*    at mainbus0
 wsdisplay*     at      fb?
-#wskbd*                at      pckbd? mux 1
+wskbd*         at      vrkiu? mux 1
 #wsmouse*      at      pms? mux 0
 
 
diff -r 8e4acbeb5684 -r c3584afe7293 sys/arch/hpcmips/conf/files.hpcmips
--- a/sys/arch/hpcmips/conf/files.hpcmips       Sun Oct 24 04:04:13 1999 +0000
+++ b/sys/arch/hpcmips/conf/files.hpcmips       Sun Oct 24 08:37:28 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.hpcmips,v 1.1.1.1 1999/09/16 12:23:19 takemura Exp $
+#      $NetBSD: files.hpcmips,v 1.2 1999/10/24 08:37:28 takemura Exp $
 
 # maxpartitions must be first item in files.${ARCH}.
 maxpartitions 8
@@ -103,9 +103,10 @@
 attach vrbcu at vrip
 file arch/hpcmips/vr/bcu_vrip.c                        vrbcu
 
-device vrkiu
+device vrkiu: wskbddev
 attach vrkiu at vrip
-file arch/hpcmips/vr/vrkiu.c                   vrkiu
+file arch/hpcmips/vr/vrkiu.c                   vrkiu needs-flag
+file dev/pckbc/wskbdmap_mfii.c                 vrkiu
 
 device vrpmu
 attach vrpmu at vrip
diff -r 8e4acbeb5684 -r c3584afe7293 sys/arch/hpcmips/dev/fb.c
--- a/sys/arch/hpcmips/dev/fb.c Sun Oct 24 04:04:13 1999 +0000
+++ b/sys/arch/hpcmips/dev/fb.c Sun Oct 24 08:37:28 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fb.c,v 1.2 1999/09/26 10:22:10 takemura Exp $  */
+/*     $NetBSD: fb.c,v 1.3 1999/10/24 08:37:29 takemura Exp $  */
 
 /*-
  * Copyright (c) 1999
@@ -63,7 +63,7 @@
 static const char _copyright[] __attribute__ ((unused)) =
     "Copyright (c) 19999 Shin Takemura.  All rights reserved.";
 static const char _rcsid[] __attribute__ ((unused)) =
-    "$Id: fb.c,v 1.2 1999/09/26 10:22:10 takemura Exp $";
+    "$Id: fb.c,v 1.3 1999/10/24 08:37:29 takemura Exp $";
 
 
 #include <sys/param.h>
@@ -81,13 +81,13 @@
 #include <machine/autoconf.h>
 #include <machine/bootinfo.h>
 
-#include <arch/hpcmips/dev/fbvar.h>
-
 #include <dev/rcons/raster.h>
 #include <dev/wscons/wsconsio.h>
 #include <dev/wscons/wscons_raster.h>
 #include <dev/wscons/wsdisplayvar.h>
 
+#include <arch/hpcmips/dev/fbvar.h>
+
 #define FBDEBUG
 #ifdef FBDEBUG
 int    fb_debug = 1;
@@ -157,7 +157,9 @@
        0 /* load_font */
 };
 
+static int fbconsole, fb_console_type;
 struct fb_devconfig fb_console_dc;
+struct wsscreen_descr fb_console_screen;
 
 /*
  *  function bodies
@@ -194,13 +196,11 @@
        struct fb_softc *sc = (struct fb_softc *)self;
        struct mainbus_attach_args *ma = aux;
        struct wsemuldisplaydev_attach_args wa;
-       int console;
 
        /* avoid warning */
-       console = (int)ma->ma_iot;
+       ma->ma_iot = ma->ma_iot;
 
-       console = 0;
-       if (console) {
+       if (fbconsole) {
                sc->sc_dc = &fb_console_dc;
                sc->nscreens = 1;
        } else {
@@ -221,7 +221,7 @@
 
        printf("\n");
 
-       wa.console = 0;
+       wa.console = fbconsole;
        wa.scrdata = &fb_screenlist;
        wa.accessops = &fb_accessops;
        wa.accesscookie = sc;
@@ -230,6 +230,49 @@
 }
 
 int
+fb_cnattach(iot, memt, type, check)
+       bus_space_tag_t iot, memt;
+       int type, check;
+{
+       long defattr = 0;
+
+       /*
+         We can't probe because we have no real device yet.
+
+       if (check && ! fb_probe(iot, memt))
+               return (ENXIO);
+       */
+
+       bzero(&fb_console_dc, sizeof(struct fb_devconfig));
+       if (fb_getdevconfig(&fb_console_dc) != 0) {
+               return (ENXIO);
+       }
+
+       fb_console_screen = fb_stdscreen;
+       fb_console_screen.nrows = fb_console_dc.dc_rcons.rc_maxrow;
+       fb_console_screen.ncols = fb_console_dc.dc_rcons.rc_maxcol;
+
+       wsdisplay_cnattach(&fb_console_screen, &fb_console_dc.dc_rcons,
+                          0, 0, defattr);
+
+       fbconsole = 1;
+       fb_console_type = type;
+
+       return (0);
+}
+
+void fb_cons_test_xxx(char a);
+
+void
+fb_cons_test_xxx(char a)
+{
+       static int col = 0;
+       fb_console_screen.textops->putchar(&fb_console_dc.dc_rcons,
+                                          0, col++, a, 0);
+
+}
+
+int
 fb_getdevconfig(dc)
        struct fb_devconfig *dc;
 {
@@ -295,9 +338,6 @@
        rcp->rc_ccolp = &rcp->rc_ccol;
        rcons_init(rcp, 34, 80);
 
-       fb_stdscreen.nrows = dc->dc_rcons.rc_maxrow;
-       fb_stdscreen.ncols = dc->dc_rcons.rc_maxcol;
-
        return (0);
 }
 
@@ -309,7 +349,16 @@
        int flag;
        struct proc *p;
 {
-       DPRINTF(("%s(%d): fb_ioctl()\n", __FILE__, __LINE__));
+       switch (cmd) {
+       case WSKBDIO_BELL:
+               return (0);
+               break;
+
+       default:
+               DPRINTF(("%s(%d): fb_ioctl(%ld, %lx)\n",
+                        __FILE__, __LINE__, cmd, (u_long)data));
+               break;
+       }
 
        return (-1);
 }
diff -r 8e4acbeb5684 -r c3584afe7293 sys/arch/hpcmips/dev/fbvar.h
--- a/sys/arch/hpcmips/dev/fbvar.h      Sun Oct 24 04:04:13 1999 +0000
+++ b/sys/arch/hpcmips/dev/fbvar.h      Sun Oct 24 08:37:28 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fbvar.h,v 1.1.1.1 1999/09/16 12:23:19 takemura Exp $   */
+/*     $NetBSD: fbvar.h,v 1.2 1999/10/24 08:37:30 takemura Exp $       */
 
 /*-
  * Copyright (c) 1999
@@ -54,3 +54,6 @@
        struct  fb_devconfig *sc_dc;    /* device configuration */
        int nscreens;
 };
+
+int    fb_cnattach(bus_space_tag_t iot, bus_space_tag_t memt,
+                   int type, int check);
diff -r 8e4acbeb5684 -r c3584afe7293 sys/arch/hpcmips/vr/vr.c
--- a/sys/arch/hpcmips/vr/vr.c  Sun Oct 24 04:04:13 1999 +0000
+++ b/sys/arch/hpcmips/vr/vr.c  Sun Oct 24 08:37:28 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vr.c,v 1.2 1999/10/16 12:27:55 shin Exp $      */
+/*     $NetBSD: vr.c,v 1.3 1999/10/24 08:37:30 takemura Exp $  */
 
 /*-
  * Copyright (c) 1999
@@ -51,6 +51,7 @@
 #include <mips/mips/mips_mcclock.h>    /* mcclock CPUspeed estimation */
 
 #include <hpcmips/vr/vr.h>
+#include <hpcmips/vr/vripreg.h>
 #include <hpcmips/vr/rtcreg.h>
 #include <hpcmips/hpcmips/machdep.h>   /* XXXjrs replace with vectors */
 #include <machine/bootinfo.h>
@@ -68,6 +69,21 @@
 #endif
 #endif
 
+#include "fb.h"
+#include "vrkiu.h"
+#if NFB > 0 || NVRKIU > 0
+#include <dev/rcons/raster.h>
+#include <dev/wscons/wsdisplayvar.h>
+#endif
+
+#if NFB > 0
+#include <arch/hpcmips/dev/fbvar.h>
+#endif
+
+#if NFB > 0
+#include <arch/hpcmips/vr/vrkiuvar.h>
+#endif
+
 void   vr_init __P((void));
 void   vr_os_init __P((void));
 void   vr_bus_reset __P((void));
@@ -162,7 +178,7 @@
 void
 vr_cons_init()
 {
-#if NCOM > 0
+#if NCOM > 0 || NFB > 0 || NVRKIU > 0
        extern bus_space_tag_t system_bus_iot;
        extern bus_space_tag_t mb_bus_space_init __P((void));
 #endif
@@ -181,6 +197,24 @@
        }
 #endif
 
+#if NFB > 0
+       mb_bus_space_init(); /* At this time, not initialized yet */
+       if(fb_cnattach(system_bus_iot, 0x0c000000, 0, 0)) {
+               printf("%s(%d): can't init fb console", __FILE__, __LINE__);
+       } else {
+               goto find_keyboard;
+       }
+#endif
+
+ find_keyboard:
+#if NVRKIU > 0
+       if (vrkiu_cnattach(system_bus_iot, VRIP_KIU_ADDR)) {
+               printf("%s(%d): can't init vrkiu as console",
+                      __FILE__, __LINE__);
+       } else {
+               return;
+       }
+#endif
 }
 
 void
diff -r 8e4acbeb5684 -r c3584afe7293 sys/arch/hpcmips/vr/vrkiu.c
--- a/sys/arch/hpcmips/vr/vrkiu.c       Sun Oct 24 04:04:13 1999 +0000
+++ b/sys/arch/hpcmips/vr/vrkiu.c       Sun Oct 24 08:37:28 1999 +0000
@@ -1,11 +1,9 @@
-/*     $NetBSD: vrkiu.c,v 1.1.1.1 1999/09/16 12:23:33 takemura Exp $   */
+/*     $NetBSD: vrkiu.c,v 1.2 1999/10/24 08:37:30 takemura Exp $       */
 
 /*-
- * Copyright (c) 1999 SASAKI Takesi
+ * Copyright (c) 1999 SASAKI Takesi All rights reserved.
+ * Copyright (c) 1999 TAKEMRUA, Shin All rights reserved.
  * Copyright (c) 1999 PocketBSD Project. All rights reserved.
- * All rights reserved.
- *
- * This code is a part of the PocketBSD.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -58,6 +56,12 @@
 #include <hpcmips/vr/vrkiureg.h>
 #include <hpcmips/vr/icureg.h>



Home | Main Index | Thread Index | Old Index