- modify debug stuff.

default all disable.
This commit is contained in:
sato 2000-01-27 06:28:41 +00:00
parent 9dbdea95dd
commit 6591d38772
1 changed files with 37 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: vrpmu.c,v 1.4 1999/12/23 06:26:10 takemura Exp $ */
/* $NetBSD: vrpmu.c,v 1.5 2000/01/27 06:28:41 sato Exp $ */
/*
* Copyright (c) 1999 M. Warner Losh. All rights reserved.
@ -43,6 +43,15 @@
#include <hpcmips/vr/bcureg.h>
#endif
#ifdef VRPMUDEBUG
#define DEBUG_BOOT 0x1 /* boot time */
#define DEBUG_INTR 0x2 /* intr */
#ifndef VRPMUDEBUG_CONF
#define VRPMUDEBUG_CONF 0
#endif /* VRPMUDEBUG_CONF */
int vrpmudebug = VRPMUDEBUG_CONF;
#endif /* VRPMUDEBUG */
static int vrpmumatch __P((struct device *, struct cfdata *, void *));
static void vrpmuattach __P((struct device *, struct device *, void *));
@ -173,34 +182,39 @@ vrpmu_dump_regs(arg)
struct vrpmu_softc *sc = arg;
unsigned int intstat1;
unsigned int intstat2;
#ifdef VRPMUDEBUG
unsigned int reg;
#if NVRBCU > 0
int cpuid;
#endif
#endif /* VRPMUDEBUG */
intstat1 = vrpmu_read(sc, PMUINT_REG_W);
intstat2 = vrpmu_read(sc, PMUINT2_REG_W);
vrpmu_dump_intr(intstat1, intstat2);
/* others? XXXX */
reg = vrpmu_read(sc, PMUCNT_REG_W);
printf("vrpmu: cnt 0x%x: ", reg);
bitdisp16(reg);
reg = vrpmu_read(sc, PMUCNT2_REG_W);
printf("vrpmu: cnt2 0x%x: ", reg);
bitdisp16(reg);
#ifdef VRPMUDEBUG
if (vrpmudebug&DEBUG_BOOT) {
/* others? XXXX */
reg = vrpmu_read(sc, PMUCNT_REG_W);
printf("vrpmu: cnt 0x%x: ", reg);
bitdisp16(reg);
reg = vrpmu_read(sc, PMUCNT2_REG_W);
printf("vrpmu: cnt2 0x%x: ", reg);
bitdisp16(reg);
#if NVRBCU > 0
cpuid = vrbcu_vrip_getcpuid();
if (cpuid >= BCUREVID_RID_4111){
reg = vrpmu_read(sc, PMUWAIT_REG_W);
printf("vrpmu: wait 0x%x", reg);
}
if (cpuid >= BCUREVID_RID_4121){
reg = vrpmu_read(sc, PMUDIV_REG_W);
printf(" div 0x%x", reg);
}
cpuid = vrbcu_vrip_getcpuid();
if (cpuid >= BCUREVID_RID_4111){
reg = vrpmu_read(sc, PMUWAIT_REG_W);
printf("vrpmu: wait 0x%x", reg);
}
if (cpuid >= BCUREVID_RID_4121){
reg = vrpmu_read(sc, PMUDIV_REG_W);
printf(" div 0x%x", reg);
}
printf("\n");
#endif
printf("\n");
}
#endif /* VRPMUDEBUG */
}
/*
@ -227,7 +241,10 @@ vrpmu_intr(arg)
/* clear interrupt status */
vrpmu_write(sc, PMUINT2_REG_W, intstat2);
vrpmu_dump_intr(intstat1, intstat2);
#ifdef VRPMUDEBUG
if (vrpmudebug&DEBUG_INTR)
vrpmu_dump_intr(intstat1, intstat2);
#endif /* VRPMUDEBUG */
if (intstat1 & PMUINT_GPIO3)
;