Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hpcmips new I/O modules framework for TX based system.



details:   https://anonhg.NetBSD.org/src/rev/8811148ba80c
branches:  trunk
changeset: 498390:8811148ba80c
user:      uch <uch%NetBSD.org@localhost>
date:      Sun Oct 22 10:42:31 2000 +0000

description:
new I/O modules framework for TX based system.

diffstat:

 sys/arch/hpcmips/conf/TX3912           |   43 +-
 sys/arch/hpcmips/conf/TX3922           |   47 +-
 sys/arch/hpcmips/conf/files.hpcmips    |   29 +-
 sys/arch/hpcmips/dev/hpckbd.c          |    9 +-
 sys/arch/hpcmips/dev/ucb1200.c         |   55 +-
 sys/arch/hpcmips/dev/ucb1200var.h      |   53 +-
 sys/arch/hpcmips/dev/ucbio.c           |  215 +++++++---
 sys/arch/hpcmips/dev/ucbioport.c       |  115 -----
 sys/arch/hpcmips/include/config_hook.h |   55 ++-
 sys/arch/hpcmips/tx/tx39.c             |  143 ++----
 sys/arch/hpcmips/tx/tx39biu.c          |    4 +-
 sys/arch/hpcmips/tx/tx39clock.c        |    4 +-
 sys/arch/hpcmips/tx/tx39icu.c          |    4 +-
 sys/arch/hpcmips/tx/tx39io.c           |  651 ++++++++++++++++----------------
 sys/arch/hpcmips/tx/tx39ioreg.h        |  313 +++++++++++----
 sys/arch/hpcmips/tx/tx39iovar.h        |   70 ++-
 sys/arch/hpcmips/tx/tx39power.c        |   70 ++-
 sys/arch/hpcmips/tx/tx39powerreg.h     |    4 +-
 sys/arch/hpcmips/tx/tx39sib.c          |    4 +-
 sys/arch/hpcmips/tx/tx39uart.c         |   81 +--
 sys/arch/hpcmips/tx/tx39var.h          |   90 +++-
 sys/arch/hpcmips/tx/txcom.c            |  404 +++++++++-----------
 sys/arch/hpcmips/tx/txioman.c          |  337 +++-------------
 sys/arch/hpcmips/tx/txioman_in.c       |  155 +++++++
 sys/arch/hpcmips/tx/txioman_out.c      |  106 +++++
 sys/arch/hpcmips/tx/txiomanvar.h       |   91 ++--
 sys/arch/hpcmips/tx/txsim.c            |   87 ++--
 27 files changed, 1767 insertions(+), 1472 deletions(-)

diffs (truncated from 4575 to 300 lines):

diff -r a7069e8129ff -r 8811148ba80c sys/arch/hpcmips/conf/TX3912
--- a/sys/arch/hpcmips/conf/TX3912      Sun Oct 22 10:33:01 2000 +0000
+++ b/sys/arch/hpcmips/conf/TX3912      Sun Oct 22 10:42:31 2000 +0000
@@ -2,7 +2,7 @@
 # Distribution kernel (TOSHIBA TX3912 based model) kernel config file
 
 #
-#      $NetBSD: TX3912,v 1.27 2000/10/04 13:53:54 uch Exp $
+#      $NetBSD: TX3912,v 1.28 2000/10/22 10:42:31 uch Exp $
 #
 include                "arch/hpcmips/conf/std.hpcmips"
 
@@ -23,7 +23,6 @@
 #options       TX39ICUDEBUG
 #options       TX39CLKDEBUG
 #options       TX39BIUDEBUG
-#options       TX39IODEBUG
 #options       TX39POWERDEBUG
 #options       TX39UARTDEBUG
 
@@ -37,6 +36,7 @@
 options        KTRACE                  # system call tracing support
 #options       SYSCALL_DEBUG           # for debug
 #options        MINIROOTSIZE=10000
+options                MSGBUFSIZE=65534        # for dmesg
 
 #options       MEMORY_DISK_HOOKS
 #options       MEMORY_DISK_IS_ROOT     # force root on memory disk
@@ -120,11 +120,39 @@
 #
 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.
+# unified IO module manager
+# group 0 MFIO
+#      1 IO
+#      2 BETTY IO
+#      (3 ITE IO notyet)
+# edge  0 no interrupt.
+# edge  1 positive edge
+# edge  2 negative edge
+# edge  3 both edge
+# initial ... set initial state (on/off)
+txioman3 at txsim? platform COMPAQ_C
+txout* at txioman3 id PWCTL_LED        evtype POWER group 0 port 3 initial 0
+txin*  at txioman3 id BTN_REC          evtype BUTTON group 1 port 6 edge 1
+txin*  at txioman3 id BTN_APP0         evtype BUTTON group 1 port 5 edge 1
+txin*  at txioman3 id PME_AC           evtype EVENT group 0 port 28 edge 1
+txin*  at txioman3 id COM0_DCD         evtype EVENT group 0 port 30 edge 3
+txin*  at txioman3 id COM0_CTS         evtype EVENT group 0 port 5  edge 3
+txout* at txioman3 id COM0_DTR         evtype OUT   group 0 port 31
+txout* at txioman3 id COM0_RTS         evtype OUT   group 0 port 6
+txioman30 at txsim? platform COMPAQ_C_810
+txout* at txioman30 id BTN_LIGHT       evtype BUTTON group 2 port 5
+
+txioman4 at txsim? platform PHILIPS_NINO
+
+txioman5 at txsim? platform SHARP_MOBILON
+txout* at txioman5 id PWCTL_LCDLIGHT   evtype POWER  group 0 port 14
+txin*  at txioman5 id BTN_REC          evtype BUTTON group 1 port 0 edge 1
+txin*  at txioman5 id BTN_APP0         evtype BUTTON group 0 port 31 edge 1
+txin*  at txioman5 id BTN_COVER        evtype BUTTON group 0 port 29 edge 1
+#txin* at txioman5 id COM0_CTS         evtype EVENT  group 1 port 4 edge 3 # DANGER
+#txin* at txioman5 id COM0_DCD         evtype EVENT  group 1 port 6 edge 3 # DANGER
+txout* at txioman5 id COM0_RTS         evtype OUT    group 1 port 5
+txout* at txioman5 id COM0_DTR         evtype OUT    group 0 port 15
 
 # Chip select manager
 txcsbus3       at tx39biu? platform COMPAQ_C
@@ -148,7 +176,6 @@
 ucbtp*         at ucb?
 ucbsnd*                at ucb?
 ucbio*         at ucb?
-ucbioport*     at ucbio? platform COMPAQ_C_810 id BTN_LIGHT port 5
 
 # WS console uses SUN or VT100 terminal emulation
 hpcfb*         at tx3912video?
diff -r a7069e8129ff -r 8811148ba80c sys/arch/hpcmips/conf/TX3922
--- a/sys/arch/hpcmips/conf/TX3922      Sun Oct 22 10:33:01 2000 +0000
+++ b/sys/arch/hpcmips/conf/TX3922      Sun Oct 22 10:42:31 2000 +0000
@@ -1,7 +1,7 @@
 #
 # Distribution kernel (TOSHIBA TX3922 based model) kernel config file
 #
-#      $NetBSD: TX3922,v 1.27 2000/10/04 13:53:54 uch Exp $
+#      $NetBSD: TX3922,v 1.28 2000/10/22 10:42:31 uch Exp $
 #
 include                "arch/hpcmips/conf/std.hpcmips"
 
@@ -22,7 +22,6 @@
 #options       WINCE_DEFAULT_SETTING   # Debugging use
 #options       TX39ICUDEBUG
 #options       TX39BIUDEBUG
-#options       TX39IODEBUG
 #options       TX39POWERDEBUG
 #options       TX39UARTDEBUG
 
@@ -30,6 +29,7 @@
 #options       DIAGNOSTIC              # extra kernel debugging checks
 options        DEBUG                   # extra kernel debugging support
 options        KTRACE                  # system call tracing support
+options                MSGBUFSIZE=65534
 
 options        __NO_SOFT_SERIAL_INTERRUPT
 options        SERIALCONSSLOT=0        # UARTA 0, UARTB 1
@@ -107,21 +107,52 @@
 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
+# unified IO module manager
+# group 0 MFIO
+#      1 IO
+#      2 BETTY IO (
+#      (3) ITE IO notyet
+#      (4) Plum2 IO (EXTPW[0:2]) notyet
+txioman1 at txsim? platform SHARP_TELIOS_HCAJ1
+txin*  at txioman1 id BTN_APP0         group 1 port 7 edge 1 # IE button 
+txin*  at txioman1 id BTN_APP1         group 1 port 8 edge 1 # Mail button 
+txin*  at txioman1 id PME_AC           group 1 port 6 edge 1 # AC-power
+txin*  at txioman1 id COM0_CTS         group 0 port 27 edge 3
+txin*  at txioman1 id COM0_DCD         group 0 port 29 edge 3
+txout* at txioman1 id PWCTL_LED        group 1 port 4  flags 3 #(blink)
+
+txioman2 at txsim? platform SHARP_TELIOS_HCVJ1C_JP
+txin*  at txioman2 id BTN_APP0         evtype BUTTON group 1 port 7 edge 1 # IE button 
+txin*  at txioman2 id BTN_APP1         evtype BUTTON group 1 port 8 edge 1 # Mail button 
+txin*  at txioman2 id BTN_APP2         evtype BUTTON group 1 port 11 edge 1 # Video button
+txin*  at txioman2 id BTN_APP3         evtype BUTTON group 1 port 12 edge 1 # Head phone button
+txin*  at txioman2 id PME_AC           evtype PMEVENT group 1 port 6
+txin*  at txioman2 id COM0_CTS         evtype EVENT  group 0 port 27 edge 3
+txin*  at txioman2 id COM0_DCD         evtype EVENT  group 1 port 13 edge 3
+txout* at txioman2 id PWCTL_COM0       evtype POWER  group 1 port 15
+txout* at txioman2 id PWCTL_LED        evtype POWER  group 1 port 4 flags 3 #(blink)
+
+txioman3 at txsim? platform VICTOR_INTERLINK_MPC101
+txin*  at txioman3 id BTN_COVER        evtype BUTTON group 1 port 4
+txin*  at txioman3 id BTN_REC          evtype BUTTON group 1 port 7
+txin*  at txioman3 id COM0_DCD         evtype EVENT group 0 port 29
+txin*  at txioman3 id COM0_CTS         evtype EVENT group 0 port 30
+# kbd MFIO:7 ?
+
+options USE_POLL
 
 # PHILIPS UCB1200 / TOSHIBA TC35413F modem/audio analog front-end
 ucb*           at tx39sib? slot 0
-#ucbtp*                at ucb?
+ucbtp*         at ucb?
 ucbsnd*                at ucb?
+ucbio*         at ucb?
 
 # PHILIPS 74ALVC*1624? / TOSHIBA TC5165BFTS buffer chip (keyboard)
-# chip select: CS1, IRQ: 3:12/4:12
+# chip select: CS1, IRQ: 3:12/4:12 (irq1 108) 
+# interrupt-mode don't work. use polling mode.
 tc5165buf*     at txcsbus1 iocs 1 iocsbase 0 iocssize 0x100 iocswidth 16
 hpckbd*                at tc5165buf?
 #wsmouse*      at ucbtp? mux 0
diff -r a7069e8129ff -r 8811148ba80c sys/arch/hpcmips/conf/files.hpcmips
--- a/sys/arch/hpcmips/conf/files.hpcmips       Sun Oct 22 10:33:01 2000 +0000
+++ b/sys/arch/hpcmips/conf/files.hpcmips       Sun Oct 22 10:42:31 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.hpcmips,v 1.41 2000/10/17 11:37:23 sato Exp $
+#      $NetBSD: files.hpcmips,v 1.42 2000/10/22 10:42:31 uch Exp $
 
 # maxpartitions must be first item in files.${ARCH}.
 maxpartitions 8
@@ -203,18 +203,17 @@
 defopt TX39ICUDEBUG
 defopt TX39CLKDEBUG
 defopt TX39BIUDEBUG
-defopt TX39IODEBUG
 defopt TX39POWERDEBUG
 defopt TX39UARTDEBUG
 defopt USE_POLL
 
-device txsim { }
+device txsim {[platform = -1]}
 device txcsbusif {[platform = -1]}
 device txcomif {[slot = -1]}
 device txsibif {[slot = -1]}
 device ucbif { }
 device irif { }
-device txiomanif {[platform = -1]}
+device txiomanif {[evtype = -1], [id = -1], [group = -1], [port = -1], [edge = -1], [initial = -1]}
 
 attach txsim at mainbus
 file arch/hpcmips/tx/txsim.c           txsim
@@ -244,14 +243,22 @@
 attach tx3912video at txsim
 file arch/hpcmips/tx/tx3912video.c     tx3912video
 
-device tx39io: txiomanif
+device tx39io
 attach tx39io at txsim
 file arch/hpcmips/tx/tx39io.c          tx39io
 
-device txioman
-attach txioman at txiomanif
+device txioman: txiomanif
+attach txioman at txsim
 file arch/hpcmips/tx/txioman.c         txioman
 
+device txin
+attach txin at txiomanif
+file arch/hpcmips/tx/txioman_in.c      txin
+
+device txout
+attach txout at txiomanif
+file arch/hpcmips/tx/txioman_out.c     txout
+
 device tx39sib: txsibif
 attach tx39sib at txsim
 file arch/hpcmips/tx/tx39sib.c         tx39sib
@@ -269,14 +276,10 @@
 attach ucbsnd at ucbif
 file arch/hpcmips/dev/ucbsnd.c         ucbsnd          needs-flag
 
-device ucbio: newgpbusif
+device ucbio
 attach ucbio at ucbif
 file arch/hpcmips/dev/ucbio.c          ucbio
 
-device ucbioport
-attach ucbioport at newgpbusif
-file arch/hpcmips/dev/ucbioport.c      ucbioport
-
 device tx39uart: txcomif
 attach tx39uart at txsim
 file arch/hpcmips/tx/tx39uart.c                tx39uart        needs-flag
@@ -292,7 +295,7 @@
 #      ITE IT8368E PCMCIA / TOSHIBA TC6345AF buffer chip (PCMCIA)
 device it8368e: pcmciabus
 attach it8368e at txcsbus
-file arch/hpcmips/dev/it8368.c it8368e
+file arch/hpcmips/dev/it8368.c         it8368e
 
 #      MITUBISHI M38813 keryboard controller
 device m38813c: hpckbdif
diff -r a7069e8129ff -r 8811148ba80c sys/arch/hpcmips/dev/hpckbd.c
--- a/sys/arch/hpcmips/dev/hpckbd.c     Sun Oct 22 10:33:01 2000 +0000
+++ b/sys/arch/hpcmips/dev/hpckbd.c     Sun Oct 22 10:42:31 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hpckbd.c,v 1.3 2000/10/21 07:27:42 takemura Exp $ */
+/*     $NetBSD: hpckbd.c,v 1.4 2000/10/22 10:42:31 uch Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000 UCHIYAMA Yasushi.  All rights reserved.
@@ -369,11 +369,12 @@
                
                if (scancode == hc->hc_special[KEY_SPECIAL_OFF])
                        printf("off button\n");
-               else if (scancode == hc->hc_special[KEY_SPECIAL_LIGHT])
+               else if (scancode == hc->hc_special[KEY_SPECIAL_LIGHT]) {
+                       static int onoff; /* XXX -uch */
                        config_hook_call(CONFIG_HOOK_BUTTONEVENT,
                                         CONFIG_HOOK_BUTTONEVENT_LIGHT, 
-                                        0);
-               else 
+                                        (void *)(onoff ^= 1));
+               } else 
                        printf("unknown special key %d\n", scancode);
                
                return (0);
diff -r a7069e8129ff -r 8811148ba80c sys/arch/hpcmips/dev/ucb1200.c
--- a/sys/arch/hpcmips/dev/ucb1200.c    Sun Oct 22 10:33:01 2000 +0000
+++ b/sys/arch/hpcmips/dev/ucb1200.c    Sun Oct 22 10:42:31 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ucb1200.c,v 1.4 2000/03/12 15:36:11 uch Exp $ */
+/*     $NetBSD: ucb1200.c,v 1.5 2000/10/22 10:42:31 uch Exp $ */
 
 /*
  * Copyright (c) 2000, by UCHIYAMA Yasushi
@@ -47,7 +47,7 @@
 #include <hpcmips/dev/ucb1200reg.h>
 
 #ifdef UCB1200DEBUG
-int    ucb1200debug = 0;
+int    ucb1200debug = 1;
 #define        DPRINTF(arg) if (ucb1200debug) printf arg;
 #define        DPRINTFN(n, arg) if (ucb1200debug > (n)) printf arg;
 #else
@@ -56,7 +56,7 @@
 #endif
 
 struct ucbchild_state {
-       int (*cs_busy) __P((void*));
+       int (*cs_busy)(void *);
        void *cs_arg;
 };



Home | Main Index | Thread Index | Old Index