Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hpcmips Added vr4102ip.



details:   https://anonhg.NetBSD.org/src/rev/38762f264be6
branches:  trunk
changeset: 522072:38762f264be6
user:      takemura <takemura%NetBSD.org@localhost>
date:      Mon Feb 11 07:55:49 2002 +0000

description:
Added vr4102ip.

diffstat:

 sys/arch/hpcmips/conf/GENERIC          |   24 +++---
 sys/arch/hpcmips/conf/files.hpcmips    |    7 +-
 sys/arch/hpcmips/conf/std.hpcmips.vr41 |   30 ++++---
 sys/arch/hpcmips/hpcmips/mainbus.c     |    4 +-
 sys/arch/hpcmips/vr/vr4102ip.c         |  128 +++++++++++++++++++++++++++++++++
 sys/arch/hpcmips/vr/vrip.c             |    9 ++-
 6 files changed, 171 insertions(+), 31 deletions(-)

diffs (290 lines):

diff -r e60e7683c1fd -r 38762f264be6 sys/arch/hpcmips/conf/GENERIC
--- a/sys/arch/hpcmips/conf/GENERIC     Mon Feb 11 07:32:56 2002 +0000
+++ b/sys/arch/hpcmips/conf/GENERIC     Mon Feb 11 07:55:49 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.105 2002/01/27 13:23:16 jdolecek Exp $
+# $NetBSD: GENERIC,v 1.106 2002/02/11 07:55:49 takemura Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@
 include                "arch/hpcmips/conf/std.hpcmips.vr41"
 include                "arch/hpcmips/conf/std.hpcmips.tx39"
 
-#ident                 "GENERIC-$Revision: 1.105 $"
+#ident                 "GENERIC-$Revision: 1.106 $"
 
 maxusers       16
 
@@ -129,20 +129,20 @@
 
 options        MQ200_DEBUG
 #options       MQ200_USECRT
-mqvideo0 at vrip? addr 0x0a000000 size 0x800000        # MQ200 video controller
+mqvideo0 at vr4102ip? addr 0x0a000000 size 0x800000    # MQ200 video
 hpcfb*         at      mqvideo?
 
-ite8181video0 at vrip? addr 0x0a000000 size 0x800000 # ITE8181 video controller
+ite8181video0 at vr4102ip? addr 0x0a000000 size 0x800000 # ITE8181 video
 hpcfb*         at      ite8181video?
 
-vrc4172pwm*    at vrip? addr 0x15003880 size 0x6 platform NEC_MCR_430
-vrc4172pwm*    at vrip? addr 0x15003880 size 0x6 platform NEC_MCR_510
-vrc4172pwm*    at vrip? addr 0x15003880 size 0x6 platform NEC_MCR_520
-vrc4172pwm*    at vrip? addr 0x15003880 size 0x6 platform NEC_MCR_520A
-vrc4172pwm*    at vrip? addr 0x15003880 size 0x6 platform NEC_MCR_530
-vrc4172pwm*    at vrip? addr 0x15003880 size 0x6 platform NEC_MCR_SIGMARION
-vrc4172pwm*    at vrip? addr 0x15003880 size 0x6 platform NEC_MCR_530A
-vrc4172pwm*    at vrip? addr 0x15003880 size 0x6 platform NEC_MCR_700
+vrc4172pwm*    at vr4102ip? addr 0x15003880 size 0x6 platform NEC_MCR_430
+vrc4172pwm*    at vr4102ip? addr 0x15003880 size 0x6 platform NEC_MCR_510
+vrc4172pwm*    at vr4102ip? addr 0x15003880 size 0x6 platform NEC_MCR_520
+vrc4172pwm*    at vr4102ip? addr 0x15003880 size 0x6 platform NEC_MCR_520A
+vrc4172pwm*    at vr4102ip? addr 0x15003880 size 0x6 platform NEC_MCR_530
+vrc4172pwm*    at vr4102ip? addr 0x15003880 size 0x6 platform NEC_MCR_SIGMARION
+vrc4172pwm*    at vr4102ip? addr 0x15003880 size 0x6 platform NEC_MCR_530A
+vrc4172pwm*    at vr4102ip? addr 0x15003880 size 0x6 platform NEC_MCR_700
 
 #
 # hpcmips isa? bus irq locator means:
diff -r e60e7683c1fd -r 38762f264be6 sys/arch/hpcmips/conf/files.hpcmips
--- a/sys/arch/hpcmips/conf/files.hpcmips       Mon Feb 11 07:32:56 2002 +0000
+++ b/sys/arch/hpcmips/conf/files.hpcmips       Mon Feb 11 07:55:49 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.hpcmips,v 1.71 2002/02/11 04:33:22 takemura Exp $
+#      $NetBSD: files.hpcmips,v 1.72 2002/02/11 07:55:50 takemura Exp $
 
 # maxpartitions must be first item in files.${ARCH}.
 maxpartitions 8
@@ -111,7 +111,10 @@
 device vripif { [addr=-1], [size=-1], [addr2=-1], [size2=-1], [unit=-1], [pwctl=-1], [platform = -1] }
 device vrip: vripif
 attach vrip at mainbus
-file arch/hpcmips/vr/vrip.c            vrip needs-flag
+device vr4102ip: vripif
+attach vr4102ip at mainbus
+file arch/hpcmips/vr/vrip.c            vrip|vr4102ip needs-flag
+file arch/hpcmips/vr/vr4102ip.c                vr4102ip
 
 device vrbcu
 attach vrbcu at vripif
diff -r e60e7683c1fd -r 38762f264be6 sys/arch/hpcmips/conf/std.hpcmips.vr41
--- a/sys/arch/hpcmips/conf/std.hpcmips.vr41    Mon Feb 11 07:32:56 2002 +0000
+++ b/sys/arch/hpcmips/conf/std.hpcmips.vr41    Mon Feb 11 07:55:49 2002 +0000
@@ -1,5 +1,5 @@
 #
-#      $NetBSD: std.hpcmips.vr41,v 1.4 2002/02/11 04:35:54 takemura Exp $
+#      $NetBSD: std.hpcmips.vr41,v 1.5 2002/02/11 07:55:50 takemura Exp $
 #      VR41XX common configuration.
 #
 options        MIPS3                   # R4000/R4400/R4600 CPUs
@@ -7,21 +7,23 @@
 options        VR41XX                  # NEC VR41xx series
 options        MIPS3_L2CACHE_ABSENT
 
-vrip*  at mainbus0
-vrbcu* at vrip? addr 0x0b000000 size 0x20
-vrcmu* at vrip? addr 0x0b000060 size 0x20
-vrrtc* at vrip? addr 0x0b0000c0 size 0x20 unit VRRTC
+vr4102ip*      at mainbus0 platform GENERIC_MIPS_VR_4102
+vr4102ip*      at mainbus0 platform GENERIC_MIPS_VR_4111
+vr4102ip*      at mainbus0 platform GENERIC_MIPS_VR_4121
+vrbcu* at vr4102ip? addr 0x0b000000 size 0x20
+vrcmu* at vr4102ip? addr 0x0b000060 size 0x20
+vrrtc* at vr4102ip? addr 0x0b0000c0 size 0x20 unit VRRTC
 
-vrkiu* at vrip? addr 0x0b000180 size 0x20 unit VRKIU
+vrkiu* at vr4102ip? addr 0x0b000180 size 0x20 unit VRKIU
 hpckbd*        at vrkiu?
-com*   at vrip? addr 0x0c000000 size 0x20 unit VRSIU pwctl PWCTL_COM0
-vrgiu* at vrip? addr 0x0b000100 size 0x20 unit VRGIU
-vrpmu* at vrip? addr 0x0b0000a0 size 0x20 unit VRPMU # power switch
-vrdsu* at vrip? addr 0x0b0000e0 size 0x08
-vrpiu* at vrip? addr 0x0b000120 size 0x1a0 unit VRPIU
-vrled* at vrip? addr 0x0b000240 size 0x10 unit VRLED
-vrdmaau* at vrip? addr 0x0b000020 size 0x18 unit VRDMAAU
-vrdcu* at vrip? addr 0x0b000040 size 0x0c unit VRDCU
+com*   at vr4102ip? addr 0x0c000000 size 0x20 unit VRSIU pwctl PWCTL_COM0
+vrgiu* at vr4102ip? addr 0x0b000100 size 0x20 unit VRGIU
+vrpmu* at vr4102ip? addr 0x0b0000a0 size 0x20 unit VRPMU # power switch
+vrdsu* at vr4102ip? addr 0x0b0000e0 size 0x08
+vrpiu* at vr4102ip? addr 0x0b000120 size 0x1a0 unit VRPIU
+vrled* at vr4102ip? addr 0x0b000240 size 0x10 unit VRLED
+vrdmaau* at vr4102ip? addr 0x0b000020 size 0x18 unit VRDMAAU
+vrdcu* at vr4102ip? addr 0x0b000040 size 0x0c unit VRDCU
 
 # VR-specific debug options.
 
diff -r e60e7683c1fd -r 38762f264be6 sys/arch/hpcmips/hpcmips/mainbus.c
--- a/sys/arch/hpcmips/hpcmips/mainbus.c        Mon Feb 11 07:32:56 2002 +0000
+++ b/sys/arch/hpcmips/hpcmips/mainbus.c        Mon Feb 11 07:55:49 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mainbus.c,v 1.17 2002/02/10 15:17:24 takemura Exp $    */
+/*     $NetBSD: mainbus.c,v 1.18 2002/02/11 07:55:50 takemura Exp $    */
 
 /*-
  * Copyright (c) 1999
@@ -73,7 +73,7 @@
 {
        static const char *devnames[] = {       /* ATTACH ORDER */
                "cpu",                          /* 1. CPU */
-               "vrip", "txsim",                /* 2. System BUS */
+               "vrip", "vr4102ip", "txsim",    /* 2. System BUS */
                "bivideo", "btnmgr", "hpcapm",  /* 3. misc */
        };
        struct mainbus_attach_args ma;
diff -r e60e7683c1fd -r 38762f264be6 sys/arch/hpcmips/vr/vr4102ip.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hpcmips/vr/vr4102ip.c    Mon Feb 11 07:55:49 2002 +0000
@@ -0,0 +1,128 @@
+/*     $NetBSD: vr4102ip.c,v 1.1 2002/02/11 07:55:51 takemura Exp $    */
+
+/*-
+ * Copyright (c) 2002 TAKEMURA Shin
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#include "opt_vr41xx.h"
+#include "opt_tx39xx.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+#include <sys/reboot.h>
+
+#include <machine/cpu.h>
+#include <machine/bus.h>
+#include <machine/autoconf.h>
+#include <machine/platid.h>
+#include <machine/platid_mask.h>
+
+#include <hpcmips/vr/vr.h>
+#include <hpcmips/vr/vrcpudef.h>
+#include <hpcmips/vr/vripunit.h>
+#include <hpcmips/vr/vripif.h>
+#include <hpcmips/vr/vripreg.h>
+#include <hpcmips/vr/vripvar.h>
+#include <hpcmips/vr/icureg.h>
+#include <hpcmips/vr/cmureg.h>
+#include "locators.h"
+
+int    vr4102ipmatch(struct device *, struct cfdata *, void *);
+void   vr4102ipattach(struct device *, struct device *, void *);
+
+struct cfattach vr4102ip_ca = {
+       sizeof(struct vrip_softc), vr4102ipmatch, vr4102ipattach
+};
+
+static const struct vrip_unit vr4102ip_units[] = {
+       [VRIP_UNIT_PMU] = { "pmu",
+                           { VRIP_INTR_POWER,  VRIP_INTR_BAT,  },      },
+       [VRIP_UNIT_RTC] = { "rtc",
+                           { VRIP_INTR_RTCL1,  },              },
+       [VRIP_UNIT_PIU] = { "piu",
+                           { VRIP_INTR_PIU, },
+                           VR4102_CMUMSKPIU,
+                           ICUPIUINT_REG_W,    MPIUINT_REG_W   },
+       [VRIP_UNIT_KIU] = { "kiu",
+                           { VRIP_INTR_KIU,    },
+                           VR4102_CMUMSKKIU,
+                           VR4102_KIUINT_REG_W,VR4102_MKIUINT_REG_W    },
+       [VRIP_UNIT_SIU] = { "siu",
+                           { VRIP_INTR_SIU,    },              },
+       [VRIP_UNIT_GIU] = { "giu",
+                           { VRIP_INTR_GIU,    },
+                           0,
+                           VR4102_GIUINT_L_REG_W,VR4102_MGIUINT_L_REG_W,
+                           VR4102_GIUINT_H_REG_W,VR4102_MGIUINT_H_REG_W},
+       [VRIP_UNIT_LED] = { "led",
+                           { VRIP_INTR_LED,    },              },
+       [VRIP_UNIT_AIU] = { "aiu",
+                           { VRIP_INTR_AIU,    },
+                           VR4102_CMUMSKAIU,
+                           VR4102_AIUINT_REG_W,VR4102_MAIUINT_REG_W    },
+       [VRIP_UNIT_FIR] = { "fir",
+                           { VRIP_INTR_FIR,    },
+                           VR4102_CMUMSKFIR,
+                           VR4102_FIRINT_REG_W,VR4102_MFIRINT_REG_W    },
+       [VRIP_UNIT_DSIU]= { "dsiu",
+                           { VRIP_INTR_DSIU,   },
+                           VR4102_CMUMSKDSIU,
+                           VR4102_DSIUINT_REG_W,VR4102_MDSIUINT_REG_W  },
+       [VRIP_UNIT_BCU] = { "bcu",
+                           { VRIP_INTR_BCU,    },
+                           0,
+                           VR4102_BCUINT_REG_W,VR4102_MBCUINT_REG_W    }
+};
+
+int
+vr4102ipmatch(struct device *parent, struct cfdata *match, void *aux)
+{
+       struct mainbus_attach_args *ma = aux;
+
+       if (strcmp(ma->ma_name, match->cf_driver->cd_name))
+               return (0);
+
+       return (1);
+}
+
+void
+vr4102ipattach(struct device *parent, struct device *self, void *aux)
+{
+       struct vrip_softc *sc = (struct vrip_softc*)self;
+
+       printf("\n");
+
+       sc->sc_units = vr4102ip_units;
+       sc->sc_nunits = sizeof(vr4102ip_units)/sizeof(struct vrip_unit);
+       sc->sc_icu_addr = VR4102_ICU_ADDR;
+       sc->sc_sysint2 = VR4102_SYSINT2_REG_W;
+       sc->sc_msysint2 = VR4102_MSYSINT2_REG_W;
+
+       vripattach_common(parent, self, aux);
+}
diff -r e60e7683c1fd -r 38762f264be6 sys/arch/hpcmips/vr/vrip.c
--- a/sys/arch/hpcmips/vr/vrip.c        Mon Feb 11 07:32:56 2002 +0000
+++ b/sys/arch/hpcmips/vr/vrip.c        Mon Feb 11 07:55:49 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vrip.c,v 1.18 2002/02/11 04:56:27 takemura Exp $       */
+/*     $NetBSD: vrip.c,v 1.19 2002/02/11 07:55:51 takemura Exp $       */
 
 /*-
  * Copyright (c) 1999, 2002
@@ -206,6 +206,13 @@
        sc->sc_chipset = vrip_chipset_methods; /* structure assignment */
        sc->sc_chipset.vc_sc = sc;
 
+#ifdef DIAGNOSTIC
+       if (sc->sc_icu_addr == 0 ||
+           sc->sc_sysint2 == 0 ||
+           sc->sc_msysint2 == 0)
+               panic("vripattach: missing register info.");
+#endif /* DIAGNOSTIC */
+
        /*
         *  Map ICU (Interrupt Control Unit) register space.
         */



Home | Main Index | Thread Index | Old Index