Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hpcmips/vr access GIUIOSEL_REG and GIUINTEN_REG



details:   https://anonhg.NetBSD.org/src/rev/e2b11aae2ff9
branches:  trunk
changeset: 521959:e2b11aae2ff9
user:      sato <sato%NetBSD.org@localhost>
date:      Sat Feb 09 15:00:40 2002 +0000

description:
access GIUIOSEL_REG and GIUINTEN_REG
only if these registers are not GIU_NO_REG_W.

diffstat:

 sys/arch/hpcmips/vr/vrgiu.c    |  36 ++++++++++++++++++------------------
 sys/arch/hpcmips/vr/vrgiureg.h |  22 +++++++++++++++++++---
 2 files changed, 37 insertions(+), 21 deletions(-)

diffs (107 lines):

diff -r a054e6793fb8 -r e2b11aae2ff9 sys/arch/hpcmips/vr/vrgiu.c
--- a/sys/arch/hpcmips/vr/vrgiu.c       Sat Feb 09 14:54:05 2002 +0000
+++ b/sys/arch/hpcmips/vr/vrgiu.c       Sat Feb 09 15:00:40 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vrgiu.c,v 1.32 2002/02/02 10:50:09 takemura Exp $      */
+/*     $NetBSD: vrgiu.c,v 1.33 2002/02/09 15:00:40 sato Exp $  */
 /*-
  * Copyright (c) 1999-2001
  *         Shin Takemura and PocketBSD Project. All rights reserved.
@@ -98,11 +98,6 @@
 #define        LEGAL_INTR_PORT(x)      ((x) >= 0 && (x) < MAX_GPIO_INOUT)
 #define        LEGAL_OUT_PORT(x)       ((x) >= 0 && (x) < MAX_GPIO_OUT)
 
-/* flags for variant chips */
-#if !defined(VR4122) && !defined(VR4131)
-#define VRGIU_HAVE_PULLUPDNREGS
-#endif
-
 /*
  * type declarations
  */
@@ -292,12 +287,15 @@
        edge = vrgiu_regread_4(sc, GIUINTTYP_REG);
        hold = vrgiu_regread_4(sc, GIUINTHTSEL_REG);
        level = vrgiu_regread_4(sc, GIUINTALSEL_REG);
-#ifndef VRGIU_HAVE_PULLUPDNREGS
-       useupdn = termupdn = 0;
-#else
-       useupdn = vrgiu_regread(sc, GIUUSEUPDN_REG_W);
-       termupdn = vrgiu_regread(sc, GIUTERMUPDN_REG_W);
-#endif
+
+       if (GIUUSEUPDN_REG_W == GIU_NO_REG_W)
+               useupdn = 0;
+       else
+               useupdn = vrgiu_regread(sc, GIUUSEUPDN_REG_W);
+       if (GIUTERMUPDN_REG_W == GIU_NO_REG_W)
+               termupdn = 0;
+       else
+               termupdn = vrgiu_regread(sc, GIUTERMUPDN_REG_W);
        for (m = 0x80000000; m; m >>=1)
                printf ("%c", syms[
                        ((useupdn&m) ? 32 : 0) +
@@ -318,12 +316,14 @@
 
        iosel= vrgiu_regread_4(sc, GIUIOSEL_REG);
        inten= vrgiu_regread_4(sc, GIUINTEN_REG);
-#ifndef VRGIU_HAVE_PULLUPDNREGS
-       useupdn = termupdn = 0;
-#else
-       useupdn = vrgiu_regread(sc, GIUUSEUPDN_REG_W);
-       termupdn = vrgiu_regread(sc, GIUTERMUPDN_REG_W);
-#endif
+       if (GIUUSEUPDN_REG_W == GIU_NO_REG_W)
+               useupdn = 0;
+       else
+               useupdn = vrgiu_regread(sc, GIUUSEUPDN_REG_W);
+       if (GIUTERMUPDN_REG_W == GIU_NO_REG_W)
+               termupdn = 0;
+       else
+               termupdn = vrgiu_regread(sc, GIUTERMUPDN_REG_W);
        if (oiosel != iosel || ointen != inten ||
            ouseupdn != useupdn || otermupdn != termupdn) {
                for (m = 0x80000000; m; m >>=1)
diff -r a054e6793fb8 -r e2b11aae2ff9 sys/arch/hpcmips/vr/vrgiureg.h
--- a/sys/arch/hpcmips/vr/vrgiureg.h    Sat Feb 09 14:54:05 2002 +0000
+++ b/sys/arch/hpcmips/vr/vrgiureg.h    Sat Feb 09 15:00:40 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vrgiureg.h,v 1.1.1.1 1999/09/16 12:23:32 takemura Exp $        */
+/*     $NetBSD: vrgiureg.h,v 1.2 2002/02/09 15:00:40 sato Exp $        */
 
 /*-
  * Copyright (c) 1999
@@ -37,6 +37,7 @@
 /*
  *     VR GIU (General Purpose I/O Unit) Registers.
  */
+#define GIU_NO_REG_W           0xffffffff      /* no register */
 
 #define        GIUIOSEL_REG            0x00
 #define        GIUIOSEL_L_REG_W        0x00
@@ -62,8 +63,23 @@
 #define GIUPODAT_REG           0x1c
 #define GIUPODAT_L_REG_W       0x1c
 #define GIUPODAT_H_REG_W       0x1e
-#define GIUUSEUPDN_REG_W       0x1e0
-#define GIUTERMUPDN_REG_W      0x1e2
+
+#define VR4102_GIUUSEUPDN_REG_W                0x1e0
+#define VR4102_GIUTERMUPDN_REG_W       0x1e2
+
+#define VR4122_GIUUSEUPDN_REG_W                GIU_NO_REG_W
+#define VR4122_GIUTERMUPDN_REG_W       GIU_NO_REG_W
+
+#if defined SINGLE_VRIP_BASE
+#if defined VRGROUP_4102_4121
+#define GIUUSEUPDN_REG_W       VR4102_GIUUSEUPDN_REG_W
+#define GIUTERMUPDN_REG_W      VR4102_GIUTERMUPDN_REG_W
+#endif /* defined VRGROUP_4102_4121 */
+#if defined VRGROUP_4122_4131
+#define GIUUSEUPDN_REG_W       VR4122_GIUUSEUPDN_REG_W
+#define GIUTERMUPDN_REG_W      VR4122_GIUTERMUPDN_REG_W
+#endif /* defined VRGROUP_4122_4131 */
+#endif /* defined SINGLE_VRIP_BASE */
 
 #define GIUINTTYP_EDGE         1
 #define GIUINTTYP_LEVEL                0



Home | Main Index | Thread Index | Old Index