#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vr4122ip.c,v 1.8 2012/10/27 17:17:55 chs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/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(device_t, device_t, void *);
CFATTACH_DECL_NEW(vr4122ip, sizeof(struct vrip_softc),
vripmatch, vr4122ipattach, NULL, NULL);
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, },
VR4122_CMUMSKPCIU,
VR4122_PCIINT_REG_W,VR4122_MPCIINT_REG_W },
[VRIP_UNIT_SCU] = { "scu",
{ VRIP_INTR_SCU, },
0,
VR4122_SCUINT_REG_W,VR4122_MSCUINT_REG_W },
[VRIP_UNIT_CSI] = { "csi",
{ VRIP_INTR_CSI, },
VR4122_CMUMSKCSI,
VR4122_CSIINT_REG_W,VR4122_MCSIINT_REG_W },
[VRIP_UNIT_BCU] = { "bcu",
{ VRIP_INTR_BCU, },
0,
VR4122_BCUINT_REG_W,VR4122_MBCUINT_REG_W }
};
void
vr4122ipattach(device_t parent, device_t self, void *aux)
{
struct vrip_softc *sc = device_private(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);
}