Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hpcmips add platform dependent TX39 UART module hook.



details:   https://anonhg.NetBSD.org/src/rev/0ebd23bc9686
branches:  trunk
changeset: 480617:0ebd23bc9686
user:      uch <uch%NetBSD.org@localhost>
date:      Sun Jan 16 21:47:00 2000 +0000

description:
add platform dependent TX39 UART module hook.
remove delay from tc5165buf interrupt handler.
backlight config_hook.

diffstat:

 sys/arch/hpcmips/conf/TX3912        |   17 +-
 sys/arch/hpcmips/conf/TX3922        |   26 ++-
 sys/arch/hpcmips/conf/files.hpcmips |   12 +-
 sys/arch/hpcmips/dev/skbd.c         |   23 ++-
 sys/arch/hpcmips/dev/skbdkeymap.h   |   48 ++++-
 sys/arch/hpcmips/dev/tc5165buf.c    |   68 +++++--
 sys/arch/hpcmips/dev/ucbsnd.c       |   28 ++-
 sys/arch/hpcmips/dev/ucbtp.c        |    7 +-
 sys/arch/hpcmips/tx/tx39.c          |   18 +-
 sys/arch/hpcmips/tx/tx39icu.c       |  104 +++++++----
 sys/arch/hpcmips/tx/tx39io.c        |  189 +++++++++++++++------
 sys/arch/hpcmips/tx/tx39ioreg.h     |    9 +-
 sys/arch/hpcmips/tx/tx39iovar.h     |   37 ++++
 sys/arch/hpcmips/tx/tx39power.c     |   12 +-
 sys/arch/hpcmips/tx/tx39sib.c       |    4 +-
 sys/arch/hpcmips/tx/tx39uart.c      |    8 +-
 sys/arch/hpcmips/tx/tx39var.h       |   15 +-
 sys/arch/hpcmips/tx/txcom.c         |  268 +++++++++++++++++++++++++----
 sys/arch/hpcmips/tx/txioman.c       |  318 ++++++++++++++++++++++++++++++++++++
 sys/arch/hpcmips/tx/txiomanvar.h    |   60 ++++++
 sys/arch/hpcmips/tx/txsnd.c         |   13 +-
 sys/arch/hpcmips/tx/txsnd.h         |   10 +-
 22 files changed, 1069 insertions(+), 225 deletions(-)

diffs (truncated from 2265 to 300 lines):

diff -r 84e377c6092a -r 0ebd23bc9686 sys/arch/hpcmips/conf/TX3912
--- a/sys/arch/hpcmips/conf/TX3912      Sun Jan 16 21:39:36 2000 +0000
+++ b/sys/arch/hpcmips/conf/TX3912      Sun Jan 16 21:47:00 2000 +0000
@@ -2,7 +2,7 @@
 # Distribution kernel (TX3912 based model) kernel config file
 
 #
-#      $NetBSD: TX3912,v 1.8 2000/01/13 17:53:40 uch Exp $
+#      $NetBSD: TX3912,v 1.9 2000/01/16 21:47:00 uch Exp $
 #
 include                "arch/hpcmips/conf/std.hpcmips"
 
@@ -31,9 +31,11 @@
 options                SERIALCONSSLOT=0        # UARTA 0, UARTB 1
 
 options                DDB                     # in-kernel debugger
+#options       DDB_ONPANIC=0           # don't enter debugger on panic
 options                DIAGNOSTIC              # extra kernel debugging checks
 options                DEBUG                   # extra kernel debugging support
 options                KTRACE                  # system call tracing support
+#options       SYSCALL_DEBUG           # for debug
 options                NKMEMCLUSTERS=1024      # 4K pages in kernel malloc pool
 #options        MINIROOTSIZE=10000
 
@@ -58,6 +60,7 @@
 config         netbsd          root on ? type ?
 
 txsim* at      mainbus0
+
 #
 # System Internal Modules
 #
@@ -66,7 +69,6 @@
 tx39clock*     at      txsim?
 tx39power*     at      txsim?
 tx3912video*   at      txsim?
-#options COMPAQ_LOCAL_INTR
 tx39io*                at      txsim?
 tx39sib*       at      txsim?
 tx39uart*      at      txsim?
@@ -77,15 +79,21 @@
 #
 # TX39 external modules. (Platform dependent)
 #
-options USE_POLL       # keyboard device requires this
+options USE_POLL       # keyboard / touchpanel device  requires this
 
+# IO module manager (Don't delete)
+txioman3       at      tx39io? platform COMPAQ_C
+txioman4       at      tx39io? platform PHILIPS_NINO
+txioman5       at      tx39io? platform SHARP_MOBILON
+txioman*       at      tx39io? # misc unknown.
+
+# Chip select manager
 txcsbus3       at      tx39biu? platform COMPAQ_C
 txcsbus4       at      tx39biu? platform PHILIPS_NINO
 txcsbus5       at      tx39biu? platform SHARP_MOBILON
 txcsbus*       at      tx39biu?        # misc unknown.
 
 # PHILIPS 74ALVC*1624? / TOSHIBA TC5165BFTS buffer chip (keyboard)
-#
 tc5165buf*     at      txcsbus3 iocs 3 iocsbase 0 iocssize 0x100 iocswidth 16
 tc5165buf*     at      txcsbus5 iocs 4 iocsbase 0 iocssize 0x100 iocswidth 16
 skbd*          at      tc5165buf?
@@ -150,3 +158,4 @@
 
 # mouse & keyboard multiplexor pseudo-devices
 pseudo-device  wsmux           2
+pseudo-device  btnmgr          1       # button event handler
diff -r 84e377c6092a -r 0ebd23bc9686 sys/arch/hpcmips/conf/TX3922
--- a/sys/arch/hpcmips/conf/TX3922      Sun Jan 16 21:39:36 2000 +0000
+++ b/sys/arch/hpcmips/conf/TX3922      Sun Jan 16 21:47:00 2000 +0000
@@ -2,7 +2,7 @@
 # Distribution kernel (TX3922 based model) kernel config file
 
 #
-#      $NetBSD: TX3922,v 1.4 2000/01/09 07:57:43 shin Exp $
+#      $NetBSD: TX3922,v 1.5 2000/01/16 21:47:00 uch Exp $
 #
 include                "arch/hpcmips/conf/std.hpcmips"
 
@@ -21,10 +21,10 @@
 options                TX39_DEBUG
 #options       TX39_WATCHDOGTIMER
 #options       WINCE_DEFAULT_SETTING   # Debugging use
-options                TX39ICUDEBUG
-options                TX39BIUDEBUG
-options                TX39IODEBUG
-options                TX39POWERDEBUG
+#options               TX39ICUDEBUG
+#options               TX39BIUDEBUG
+#options               TX39IODEBUG
+#options               TX39POWERDEBUG
 #options               TX39UARTDEBUG
 
 options                DDB                     # in-kernel debugger
@@ -43,6 +43,11 @@
 options        USBVERBOSE      # verbose USB device autoconfig messages
 
 file-system    FFS             # fast filesystem with user and group quotas
+file-system    MFS             # memory-based filesystem
+file-system    KERNFS          # /kern (kernel informational filesystem)
+file-system    PROCFS          # /proc
+file-system    UNION
+
 config         netbsd          root on ? type ?
 
 # Networking options
@@ -57,19 +62,27 @@
 tx39clock*     at      txsim?
 tx39power*     at      txsim?
 tx39io*                at      txsim?
+tx39sib*       at      txsim?
 tx39uart*      at      txsim?
 txcom0         at      tx39uart? slot 0
 txcom1         at      tx39uart? slot 1
 
+# IO module manager (Don't delete)
+txioman*       at      tx39io? # misc unknown.
+
 txcsbus1       at      tx39biu? platform SHARP_TELIOS
 txcsbus2       at      tx39biu? platform VICTOR_INTERLINK
 
 options USE_POLL       # m38813,tc5165 requires this
 
+# PHILIPS UCB1200 / TOSHIBA TC35413F modem/audio analog front-end
+ucb*           at      tx39sib? slot 0
+ucbsnd*                at      ucb?
+
 #
 # SHARP Telios keyboard driver 
 # chip select: CS1, IRQ: 3:12/4:12
-tc5165buf*     at      txcsbus1 iocs 1 iocsbase 0 iocssize 0x100 iocswidth 16 irq1 108
+tc5165buf*     at      txcsbus1 iocs 1 iocsbase 0 iocssize 0x100 iocswidth 16
 skbd*          at      tc5165buf?
 
 #
@@ -155,3 +168,4 @@
 
 pseudo-device  loop            1       # network loopback
 pseudo-device  pty             64      # pseudo ptys
+pseudo-device  btnmgr          1       # button event handler
diff -r 84e377c6092a -r 0ebd23bc9686 sys/arch/hpcmips/conf/files.hpcmips
--- a/sys/arch/hpcmips/conf/files.hpcmips       Sun Jan 16 21:39:36 2000 +0000
+++ b/sys/arch/hpcmips/conf/files.hpcmips       Sun Jan 16 21:47:00 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.hpcmips,v 1.18 2000/01/13 17:53:39 uch Exp $
+#      $NetBSD: files.hpcmips,v 1.19 2000/01/16 21:47:00 uch Exp $
 
 # maxpartitions must be first item in files.${ARCH}.
 maxpartitions 8
@@ -175,6 +175,7 @@
 device txsibif {[slot = -1]}
 device ucbif { }
 device irif { }
+device txiomanif {[platform = -1]}
 
 attach txsim at mainbus
 file arch/hpcmips/tx/txsim.c           txsim
@@ -204,10 +205,14 @@
 attach tx3912video at txsim
 file arch/hpcmips/tx/tx3912video.c     tx3912video
 
-device tx39io
+device tx39io: txiomanif
 attach tx39io at txsim
 file arch/hpcmips/tx/tx39io.c          tx39io
 
+device txioman
+attach txioman at txiomanif
+file arch/hpcmips/tx/txioman.c         txioman
+
 device tx39sib: txsibif
 attach tx39sib at txsim
 file arch/hpcmips/tx/tx39sib.c         tx39sib
@@ -249,8 +254,7 @@
 attach m38813c at txcsbus
 file arch/hpcmips/dev/m38813c.c                m38813c         needs-flag
 
-#      TOSHIBA TC5165BTFS buffer driver (keyboard)
-#      PHILIPS 74ALVC16241 buffer driver (keyboard)
+#      PHILIPS 74ALVC16241 / TOSHIBA TC5165BTFS buffer driver (keyboard)
 device tc5165buf: skbdif
 attach tc5165buf at txcsbus
 file arch/hpcmips/dev/tc5165buf.c      tc5165buf       needs-flag
diff -r 84e377c6092a -r 0ebd23bc9686 sys/arch/hpcmips/dev/skbd.c
--- a/sys/arch/hpcmips/dev/skbd.c       Sun Jan 16 21:39:36 2000 +0000
+++ b/sys/arch/hpcmips/dev/skbd.c       Sun Jan 16 21:47:00 2000 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: skbd.c,v 1.2 2000/01/12 14:56:22 uch Exp $ */
+/*     $NetBSD: skbd.c,v 1.3 2000/01/16 21:47:01 uch Exp $ */
 
 /*
- * Copyright (c) 1999, by UCHIYAMA Yasushi
+ * Copyright (c) 1999, 2000, by UCHIYAMA Yasushi
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -36,6 +36,7 @@
 #include <machine/bus.h>
 #include <machine/intr.h>
 
+#include <machine/config_hook.h>
 #include <machine/platid.h>
 #include <machine/platid_mask.h>
 
@@ -59,6 +60,7 @@
 struct skbd_chip {
        skbd_tag_t      sk_ic;
        const u_int8_t  *sk_keymap;
+       const int       *sk_special;
        int             sk_polling;
        int             sk_console;
        u_int           sk_type;
@@ -182,6 +184,7 @@
 
                if (platid_match(&platid, &mask)) {
                        sk->sk_keymap = tab->st_keymap;
+                       sk->sk_special = tab->st_special;
                        skbd_keymapdata.layout = tab->st_layout;
 
                        return 0;
@@ -191,6 +194,7 @@
        /* no keymap. use default. */
 
        sk->sk_keymap = default_keymap;
+       sk->sk_special = default_special_keymap;
        skbd_keymapdata.layout = KB_US;
 
        return 1;
@@ -235,6 +239,21 @@
                return 0;
        }
 
+       if (key == SPL) {
+               if (!flag)
+                       return 0;
+               
+               if (scancode == sk->sk_special[KEY_SPECIAL_OFF])
+                       printf("off button\n");
+               else if (scancode == sk->sk_special[KEY_SPECIAL_LIGHT])
+                       config_hook_call(CONFIG_HOOK_BUTTONEVENT,
+                                        CONFIG_HOOK_BUTTONEVENT_LIGHT, 
+                                        0);
+               else 
+                       printf("unknown special key %d\n", scancode);
+               
+               return 0;
+       }
 
        if (sk->sk_polling) {
                sk->sk_type = type;
diff -r 84e377c6092a -r 0ebd23bc9686 sys/arch/hpcmips/dev/skbdkeymap.h
--- a/sys/arch/hpcmips/dev/skbdkeymap.h Sun Jan 16 21:39:36 2000 +0000
+++ b/sys/arch/hpcmips/dev/skbdkeymap.h Sun Jan 16 21:47:00 2000 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: skbdkeymap.h,v 1.4 2000/01/14 18:37:58 uch Exp $ */
+/*     $NetBSD: skbdkeymap.h,v 1.5 2000/01/16 21:47:01 uch Exp $ */
 
 /*
- * Copyright (c) 1999, by UCHIYAMA Yasushi
+ * Copyright (c) 1999, 2000, by UCHIYAMA Yasushi
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,6 +27,10 @@
  */
 #define UNK    255     /* unknown */
 #define IGN    254     /* ignore */
+#define SPL    253     /* special key */
+
+#define KEY_SPECIAL_OFF                0
+#define KEY_SPECIAL_LIGHT      1
 
 const u_int8_t default_keymap[] = {
 /*      0    1    2    3    4    5    6    7 */       
@@ -48,6 +52,11 @@
 /*15 */        UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK
 };
 
+const int default_special_keymap[] = {
+       [KEY_SPECIAL_OFF]       = -1,
+       [KEY_SPECIAL_LIGHT]     = -1
+};
+
 const u_int8_t tc5165_mobilon_keymap[] = {
 /*      0    1    2    3    4    5    6    7 */       
 /* 0 */        37 , 45 , 44 , UNK, 9  , 51 , 23 , UNK,
@@ -55,9 +64,9 @@
 /* 2 */        UNK, UNK, 29 , UNK, UNK, UNK, UNK, UNK,
 /* 3 */        24 , 203, UNK, 38 , 10 , 27 , 13 , UNK,
 /* 4 */        40 , UNK, UNK, 39 , 26 , 53 , 11 , 12 ,
-/* 5 */        UNK, UNK, UNK, 53 , 25 , UNK, UNK, IGN,
+/* 5 */        UNK, UNK, UNK, 53 , 25 , UNK, UNK, SPL, /* Light */
 /* 6 */        208, UNK, UNK, UNK, 52 , UNK, 43 , 14 ,
-/* 7 */        205, 200, UNK, UNK, IGN, UNK, UNK, 28 ,
+/* 7 */        205, 200, UNK, UNK, SPL, UNK, UNK, 28 , /* Off key */
 /* 8 */        UNK, 41 , 59 , 15 , 2  , UNK, UNK, UNK,
 /* 9 */        63 , 64 , 1  , UNK, 65 , 16 , 17 , UNK,
 /*10 */        60 , UNK, 61 , 62 , 3  , UNK, UNK, UNK,



Home | Main Index | Thread Index | Old Index