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 vr4122ip.
details: https://anonhg.NetBSD.org/src/rev/224aa4df9135
branches: trunk
changeset: 522075:224aa4df9135
user: takemura <takemura%NetBSD.org@localhost>
date: Mon Feb 11 09:21:46 2002 +0000
description:
Added vr4122ip.
diffstat:
sys/arch/hpcmips/conf/files.hpcmips | 12 ++-
sys/arch/hpcmips/dev/hpcapm.c | 12 ++--
sys/arch/hpcmips/hpcmips/mainbus.c | 5 +-
sys/arch/hpcmips/vr/vr.c | 10 +-
sys/arch/hpcmips/vr/vr4102ip.c | 15 +----
sys/arch/hpcmips/vr/vr4122ip.c | 106 ++++++++++++++++++++++++++++++++++++
6 files changed, 130 insertions(+), 30 deletions(-)
diffs (285 lines):
diff -r 4e9f3ea44ab6 -r 224aa4df9135 sys/arch/hpcmips/conf/files.hpcmips
--- a/sys/arch/hpcmips/conf/files.hpcmips Mon Feb 11 08:28:16 2002 +0000
+++ b/sys/arch/hpcmips/conf/files.hpcmips Mon Feb 11 09:21:46 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.hpcmips,v 1.72 2002/02/11 07:55:50 takemura Exp $
+# $NetBSD: files.hpcmips,v 1.73 2002/02/11 09:21:46 takemura Exp $
# maxpartitions must be first item in files.${ARCH}.
maxpartitions 8
@@ -109,12 +109,16 @@
# Vr41xx integrated peripherals
#
device vripif { [addr=-1], [size=-1], [addr2=-1], [size2=-1], [unit=-1], [pwctl=-1], [platform = -1] }
+define vrip_common
+file arch/hpcmips/vr/vrip.c vrip_common needs-flag
device vrip: vripif
-attach vrip at mainbus
+attach vrip at mainbus: vrip_common
device vr4102ip: vripif
-attach vr4102ip at mainbus
-file arch/hpcmips/vr/vrip.c vrip|vr4102ip needs-flag
+attach vr4102ip at mainbus: vrip_common
file arch/hpcmips/vr/vr4102ip.c vr4102ip
+device vr4122ip: vripif
+attach vr4122ip at mainbus: vrip_common
+file arch/hpcmips/vr/vr4122ip.c vr4122ip
device vrbcu
attach vrbcu at vripif
diff -r 4e9f3ea44ab6 -r 224aa4df9135 sys/arch/hpcmips/dev/hpcapm.c
--- a/sys/arch/hpcmips/dev/hpcapm.c Mon Feb 11 08:28:16 2002 +0000
+++ b/sys/arch/hpcmips/dev/hpcapm.c Mon Feb 11 09:21:46 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hpcapm.c,v 1.10 2002/01/27 11:11:11 takemura Exp $ */
+/* $NetBSD: hpcapm.c,v 1.11 2002/02/11 09:21:47 takemura Exp $ */
/*
* Copyright (c) 2000 Takemura Shin
@@ -41,8 +41,8 @@
#include <machine/platid.h>
#include <machine/platid_mask.h>
-#include "vrip.h"
-#if NVRIP > 0
+#include "vrip_common.h"
+#if NVRIP_COMMON > 0
#include <hpcmips/vr/vripvar.h>
#include <hpcmips/vr/vr_asm.h>
#endif
@@ -338,7 +338,7 @@
CONFIG_HOOK_PMEVENT_HARDPOWER,
(void *)PWR_STANDBY);
sc->power_state = APM_SYS_STANDBY;
-#if NVRIP > 0
+#if NVRIP_COMMON > 0
if (platid_match(&platid, &platid_mask_CPU_MIPS_VR_41XX)) {
/*
* disable all interrupts except PIU interrupt
@@ -378,7 +378,7 @@
CONFIG_HOOK_PMEVENT_HARDPOWER,
(void *)PWR_SUSPEND);
sc->power_state = APM_SYS_SUSPEND;
-#if NVRIP > 0
+#if NVRIP_COMMON > 0
if (platid_match(&platid, &platid_mask_CPU_MIPS_VR_41XX)) {
/*
* disable all interrupts except PIU interrupt
@@ -404,7 +404,7 @@
vrip_intr_resume();
delay(1000); /* 1msec */
}
-#endif /* NVRIP > 0 */
+#endif /* NVRIP_COMMON > 0 */
#ifdef TX39XX
if (platid_match(&platid, &platid_mask_CPU_MIPS_TX)) {
tx39power_suspend_cpu();
diff -r 4e9f3ea44ab6 -r 224aa4df9135 sys/arch/hpcmips/hpcmips/mainbus.c
--- a/sys/arch/hpcmips/hpcmips/mainbus.c Mon Feb 11 08:28:16 2002 +0000
+++ b/sys/arch/hpcmips/hpcmips/mainbus.c Mon Feb 11 09:21:46 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mainbus.c,v 1.18 2002/02/11 07:55:50 takemura Exp $ */
+/* $NetBSD: mainbus.c,v 1.19 2002/02/11 09:21:47 takemura Exp $ */
/*-
* Copyright (c) 1999
@@ -73,7 +73,8 @@
{
static const char *devnames[] = { /* ATTACH ORDER */
"cpu", /* 1. CPU */
- "vrip", "vr4102ip", "txsim", /* 2. System BUS */
+ "vrip", "vr4102ip", "vr4122ip", /* 2. System BUS */
+ "txsim",
"bivideo", "btnmgr", "hpcapm", /* 3. misc */
};
struct mainbus_attach_args ma;
diff -r 4e9f3ea44ab6 -r 224aa4df9135 sys/arch/hpcmips/vr/vr.c
--- a/sys/arch/hpcmips/vr/vr.c Mon Feb 11 08:28:16 2002 +0000
+++ b/sys/arch/hpcmips/vr/vr.c Mon Feb 11 09:21:46 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vr.c,v 1.37 2002/02/10 14:38:57 takemura Exp $ */
+/* $NetBSD: vr.c,v 1.38 2002/02/11 09:21:47 takemura Exp $ */
/*-
* Copyright (c) 1999-2002
@@ -59,8 +59,8 @@
#include <hpcmips/vr/vripreg.h>
#include <hpcmips/vr/rtcreg.h>
-#include "vrip.h"
-#if NVRIP > 0
+#include "vrip_common.h"
+#if NVRIP_COMMON > 0
#include <hpcmips/vr/vripvar.h>
#endif
@@ -451,7 +451,7 @@
* halt
*/
if (howto & RB_HALT) {
-#if NVRIP > 0
+#if NVRIP_COMMON > 0
_spllower(~MIPS_INT_MASK_0);
vrip_intr_suspend();
#else
@@ -465,7 +465,7 @@
__asm("nop");
__asm("nop");
__asm(".set reorder");
-#if NVRIP > 0
+#if NVRIP_COMMON > 0
vrip_intr_resume();
#endif
}
diff -r 4e9f3ea44ab6 -r 224aa4df9135 sys/arch/hpcmips/vr/vr4102ip.c
--- a/sys/arch/hpcmips/vr/vr4102ip.c Mon Feb 11 08:28:16 2002 +0000
+++ b/sys/arch/hpcmips/vr/vr4102ip.c Mon Feb 11 09:21:46 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vr4102ip.c,v 1.2 2002/02/11 08:15:41 takemura Exp $ */
+/* $NetBSD: vr4102ip.c,v 1.3 2002/02/11 09:21:47 takemura Exp $ */
/*-
* Copyright (c) 2002 TAKEMURA Shin
@@ -29,31 +29,20 @@
* 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 "opt_vr41xx.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 = {
diff -r 4e9f3ea44ab6 -r 224aa4df9135 sys/arch/hpcmips/vr/vr4122ip.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hpcmips/vr/vr4122ip.c Mon Feb 11 09:21:46 2002 +0000
@@ -0,0 +1,106 @@
+/* $NetBSD: vr4122ip.c,v 1.1 2002/02/11 09:21:47 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 <sys/param.h>
+#include <sys/systm.h>
+
+#include <machine/bus.h>
+
+#include "opt_vr41xx.h"
+#include <hpcmips/vr/vrcpudef.h>
+#include <hpcmips/vr/vripunit.h>
+#include <hpcmips/vr/vripreg.h>
+#include <hpcmips/vr/vripvar.h>
+#include <hpcmips/vr/icureg.h>
+#include <hpcmips/vr/cmureg.h>
+
+void vr4122ipattach(struct device *, struct device *, void *);
+
+struct cfattach vr4122ip_ca = {
+ sizeof(struct vrip_softc), vripmatch, vr4122ipattach
+};
+
+static const struct vrip_unit vr4122ip_units[] = {
+ [VRIP_UNIT_PMU] = { "pmu",
+ { VRIP_INTR_POWER, VRIP_INTR_BAT, }, },
+ [VRIP_UNIT_RTC] = { "rtc",
+ { VRIP_INTR_RTCL1, }, },
+ [VRIP_UNIT_SIU] = { "siu",
+ { VRIP_INTR_SIU, }, },
+ [VRIP_UNIT_GIU] = { "giu",
+ { VRIP_INTR_GIU, },
+ 0,
+ VR4122_GIUINT_L_REG_W,VR4122_MGIUINT_L_REG_W,
+ VR4122_GIUINT_H_REG_W,VR4122_MGIUINT_H_REG_W},
+ [VRIP_UNIT_LED] = { "led",
+ { VRIP_INTR_LED, }, },
+ [VRIP_UNIT_FIR] = { "fir",
+ { VRIP_INTR_FIR, },
+ VR4122_CMUMSKFIR,
+ VR4122_FIRINT_REG_W,VR4122_MFIRINT_REG_W },
+ [VRIP_UNIT_DSIU]= { "dsiu",
+ { VRIP_INTR_DSIU, },
+ VR4122_CMUMSKDSIU,
+ VR4122_DSIUINT_REG_W,VR4122_MDSIUINT_REG_W },
+ [VRIP_UNIT_PCIU]= { "pciu",
+ { VRIP_INTR_PCI, },
+ CMUMASK_PCIU,
+ PCIINT_REG_W, MPCIINT_REG_W },
+ [VRIP_UNIT_SCU] = { "scu",
+ { VRIP_INTR_SCU, },
+ 0,
+ SCUINT_REG_W, MSCUINT_REG_W },
+ [VRIP_UNIT_CSI] = { "csi",
+ { VRIP_INTR_CSI, },
+ CMUMASK_CSI,
+ CSIINT_REG_W, MCSIINT_REG_W },
+ [VRIP_UNIT_BCU] = { "bcu",
+ { VRIP_INTR_BCU, },
+ 0,
+ VR4122_BCUINT_REG_W,VR4122_MBCUINT_REG_W }
+};
+
+void
+vr4122ipattach(struct device *parent, struct device *self, void *aux)
+{
+ struct vrip_softc *sc = (struct vrip_softc*)self;
+
+ printf("\n");
+
+ sc->sc_units = vr4122ip_units;
+ sc->sc_nunits = sizeof(vr4122ip_units)/sizeof(struct vrip_unit);
+ sc->sc_icu_addr = VR4122_ICU_ADDR;
+ sc->sc_sysint2 = VR4122_SYSINT2_REG_W;
+ sc->sc_msysint2 = VR4122_MSYSINT2_REG_W;
+
+ vripattach_common(parent, self, aux);
+}
Home |
Main Index |
Thread Index |
Old Index