Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm Support a wsdisplay(4) attachment on a tslcd



details:   https://anonhg.NetBSD.org/src/rev/98d6723d639d
branches:  trunk
changeset: 573655:98d6723d639d
user:      joff <joff%NetBSD.org@localhost>
date:      Fri Feb 04 06:02:36 2005 +0000

description:
Support a wsdisplay(4) attachment on a tslcd

diffstat:

 sys/arch/evbarm/conf/TS7200      |  50 ++++++++++++++++++++++++++++++-
 sys/arch/evbarm/conf/files.tsarm |   4 +-
 sys/arch/evbarm/tsarm/tslcd.c    |  61 +++++++++++++++++++++++++++++----------
 3 files changed, 94 insertions(+), 21 deletions(-)

diffs (246 lines):

diff -r 06c1d5282048 -r 98d6723d639d sys/arch/evbarm/conf/TS7200
--- a/sys/arch/evbarm/conf/TS7200       Fri Feb 04 05:59:51 2005 +0000
+++ b/sys/arch/evbarm/conf/TS7200       Fri Feb 04 06:02:36 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: TS7200,v 1.10 2005/01/31 16:54:33 hannken Exp $
+#      $NetBSD: TS7200,v 1.11 2005/02/04 06:02:36 joff Exp $
 #
 #      GENERIC -- Generic kernel
 #
@@ -169,6 +169,7 @@
 tsrtc*         at tspld?
 # HD44780 LCD on LCD header
 tslcd*         at tspld?
+wsdisplay*     at tslcd? console ?
 # 4x4 Matrix Keypad on DIO header
 tskp*          at tspld?
 wskbd* at tskp? console ? mux 1
@@ -272,8 +273,8 @@
 # wsmouse* at uep? mux 0
 
 # USB Keyboards
-#ukbd* at uhidev? reportid ?
-# wskbd*       at ukbd? console ? mux 1
+ukbd*  at uhidev? reportid ?
+wskbd* at ukbd? console ? mux 1
 
 # USB Generic HID devices
 uhid*  at uhidev? reportid ?
@@ -425,6 +426,49 @@
 #pseudo-device swdmover                # softare dmover(9) back-end
 #pseudo-device dmoverio                # /dev/dmover dmover(9) interface
 
+#
+# wscons options
+#
+# builtin terminal emulations
+#options       WSEMUL_SUN              # sun terminal emulation
+options        WSEMUL_VT100            # VT100 / VT220 emulation
+# customization of console and kernel output - see dev/wscons/wsdisplayvar.h
+#options       WSDISPLAY_CUSTOM_OUTPUT # color customization from wsconsctl(8)
+#options       WS_DEFAULT_FG=WSCOL_WHITE
+#options       WS_DEFAULT_BG=WSCOL_BLACK
+#options       WS_DEFAULT_COLATTR="(0)"
+#options       WS_DEFAULT_MONOATTR="(0)"
+#options       WS_KERNEL_FG=WSCOL_GREEN
+#options       WS_KERNEL_BG=WSCOL_BLACK
+#options       WS_KERNEL_COLATTR=""
+#options       WS_KERNEL_MONOATTR=""
+# customization of console border color
+#options       WSDISPLAY_CUSTOM_BORDER # border customization from wsconsctl(8)
+#options       WSDISPLAY_BORDER_COLOR=WSCOL_BLUE       # default color
+# compatibility to other console drivers
+#options       WSDISPLAY_COMPAT_PCVT           # emulate some ioctls
+#options       WSDISPLAY_COMPAT_SYSCONS        # emulate some ioctls
+#options       WSDISPLAY_COMPAT_USL            # VT handling
+#options       WSDISPLAY_COMPAT_RAWKBD         # can get raw scancodes
+# see dev/pckbc/wskbdmap_mfii.c for implemented layouts
+#options       PCKBD_LAYOUT="(KB_DE | KB_NODEAD)"
+# allocate a number of virtual screens at autoconfiguration time
+#options       WSDISPLAY_DEFAULTSCREENS=4
+# use a large software cursor that doesn't blink
+#options       PCDISPLAY_SOFTCURSOR
+# modify the screen type of the console; defaults to "80x25"
+#options       VGA_CONSOLE_SCREENTYPE="\"80x24\""
+# work around a hardware bug that loaded fonts don't work; found on ATI cards
+#options       VGA_CONSOLE_ATI_BROKEN_FONTSEL
+# the following enables some functions to get mouse console support.
+# if you want a really secure system, it may be better not to enable them,
+# see wsmoused(8), section SECURITY CONSIDERATIONS for more info.
+#options       WSDISPLAY_CHARFUNCS             # mouse console support
+# console scrolling support.
+#options       WSDISPLAY_SCROLLSUPPORT
+# enable VGA raster mode capable of displaying multilingual text on console
+#options       VGA_RASTERCONSOLE
+
 # wscons pseudo-devices
 pseudo-device  wsmux                   # mouse & keyboard multiplexor
 #pseudo-device wsfont
diff -r 06c1d5282048 -r 98d6723d639d sys/arch/evbarm/conf/files.tsarm
--- a/sys/arch/evbarm/conf/files.tsarm  Fri Feb 04 05:59:51 2005 +0000
+++ b/sys/arch/evbarm/conf/files.tsarm  Fri Feb 04 06:02:36 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.tsarm,v 1.6 2005/01/31 06:12:35 joff Exp $
+#      $NetBSD: files.tsarm,v 1.7 2005/02/04 06:02:36 joff Exp $
 #
 # First try for arm-specific configuration info
 #
@@ -31,7 +31,7 @@
 attach tsrtc at tspldbus
 file   arch/evbarm/tsarm/tsrtc.c               tsrtc
 
-device tslcd: hd44780
+device tslcd: hd44780, wsemuldisplaydev
 attach tslcd at tspldbus
 file   arch/evbarm/tsarm/tslcd.c               tslcd
 
diff -r 06c1d5282048 -r 98d6723d639d sys/arch/evbarm/tsarm/tslcd.c
--- a/sys/arch/evbarm/tsarm/tslcd.c     Fri Feb 04 05:59:51 2005 +0000
+++ b/sys/arch/evbarm/tsarm/tslcd.c     Fri Feb 04 06:02:36 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tslcd.c,v 1.3 2005/01/11 00:59:06 joff Exp $ */
+/* $NetBSD: tslcd.c,v 1.4 2005/02/04 06:02:36 joff Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tslcd.c,v 1.3 2005/01/11 00:59:06 joff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tslcd.c,v 1.4 2005/02/04 06:02:36 joff Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -54,6 +54,10 @@
 #include <machine/bus.h>
 #include <machine/autoconf.h>
 
+#include <dev/wscons/wsdisplayvar.h>
+#include <dev/wscons/wsconsio.h>
+#include <dev/wscons/wscons_callbacks.h>
+
 #include <arm/ep93xx/ep93xxreg.h>
 #include <dev/ic/hd44780reg.h>
 #include <dev/ic/hd44780var.h>
@@ -62,7 +66,7 @@
 
 struct tslcd_softc {
        struct device sc_dev;
-       struct hd44780_chip sc_lcd;
+       struct hd44780_chip sc_hlcd;
        bus_space_tag_t sc_iot;
        bus_space_handle_t sc_gpioh;
 };
@@ -85,11 +89,29 @@
        nostop, notty, tslcdpoll, nommap,
 };
 
+extern const struct wsdisplay_emulops hlcd_emulops;
+extern const struct wsdisplay_accessops hlcd_accessops;
 extern struct cfdriver tslcd_cd;
 
 CFATTACH_DECL(tslcd, sizeof(struct tslcd_softc),
     tslcd_match, tslcd_attach, NULL, NULL);
 
+static const struct wsscreen_descr tslcd_stdscreen = {
+       "std_tslcd", 24, 2,
+       &hlcd_emulops,
+       5, 7,
+       0,
+};
+
+static const struct wsscreen_descr *_tslcd_scrlist[] = {
+       &tslcd_stdscreen,
+};
+
+static const struct wsscreen_list tslcd_screenlist = {
+       sizeof(_tslcd_scrlist) / sizeof(struct wsscreen_descr *),
+       _tslcd_scrlist,
+};
+
 static int
 tslcd_match(parent, match, aux)
        struct device *parent;
@@ -119,20 +141,21 @@
 {
        struct tslcd_softc *sc = (void *)self;
        struct tspld_attach_args *taa = aux;
+       struct wsemuldisplaydev_attach_args waa;
 
        sc->sc_iot = taa->ta_iot;
        if (bus_space_map(sc->sc_iot, EP93XX_APB_HWBASE + EP93XX_APB_GPIO,
                EP93XX_APB_GPIO_SIZE, 0, &sc->sc_gpioh))
                panic("tslcd_attach: couldn't map GPIO registers");
 
-       sc->sc_lcd.sc_dev_ok = 1;
-       sc->sc_lcd.sc_rows = 24;
-       sc->sc_lcd.sc_vrows = 40;
-       sc->sc_lcd.sc_flags = HD_8BIT | HD_MULTILINE;
-       sc->sc_lcd.sc_dev = self;
+       sc->sc_hlcd.sc_dev_ok = 1;
+       sc->sc_hlcd.sc_cols = 24;
+       sc->sc_hlcd.sc_vcols = 40;
+       sc->sc_hlcd.sc_flags = HD_8BIT | HD_MULTILINE;
+       sc->sc_hlcd.sc_dev = self;
 
-       sc->sc_lcd.sc_writereg = tslcd_writereg;
-       sc->sc_lcd.sc_readreg = tslcd_readreg;
+       sc->sc_hlcd.sc_writereg = tslcd_writereg;
+       sc->sc_hlcd.sc_readreg = tslcd_readreg;
        
        GPIO_SET(PADDR, 0);             /* Port A to inputs */
        GPIO_SETBITS(PHDDR, 0x38);      /* Bits 3:5 of Port H to outputs */
@@ -140,7 +163,13 @@
 
        printf("\n");
 
-       hd44780_attach_subr(&sc->sc_lcd);
+       hd44780_attach_subr(&sc->sc_hlcd);
+
+       waa.console = 0;
+       waa.scrdata = &tslcd_screenlist;
+       waa.accessops = &hlcd_accessops;
+       waa.accesscookie = &sc->sc_hlcd.sc_screen;
+       config_found(self, &waa, wsemuldisplaydevprint);
 }
 
 static void
@@ -242,8 +271,8 @@
 {
        struct tslcd_softc *sc = device_lookup(&tslcd_cd, minor(dev));
 
-       if (sc->sc_lcd.sc_dev_ok == 0)
-               return hd44780_init(&sc->sc_lcd);
+       if (sc->sc_hlcd.sc_dev_ok == 0)
+               return hd44780_init(&sc->sc_hlcd);
        else
                return 0;
 }
@@ -276,7 +305,7 @@
        struct hd44780_io io;
        struct tslcd_softc *sc = device_lookup(&tslcd_cd, minor(dev));
 
-       if (sc->sc_lcd.sc_dev_ok == 0)
+       if (sc->sc_hlcd.sc_dev_ok == 0)
                return EIO;
 
        io.dat = 0;
@@ -287,7 +316,7 @@
        if ((error = uiomove((void*)io.buf, io.len, uio)) != 0)
                return error;
 
-       hd44780_ddram_redraw(&sc->sc_lcd, &io);
+       hd44780_ddram_redraw(&sc->sc_hlcd, &io);
        return 0;
 }
 
@@ -300,7 +329,7 @@
        struct proc *p;
 {
        struct tslcd_softc *sc = device_lookup(&tslcd_cd, minor(dev));
-       return hd44780_ioctl_subr(&sc->sc_lcd, cmd, data);
+       return hd44780_ioctl_subr(&sc->sc_hlcd, cmd, data);
 }
 
 int



Home | Main Index | Thread Index | Old Index