Update for new intio parent interface.
This commit is contained in:
parent
224cd45a75
commit
3cf284349d
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: frodo.c,v 1.5 1999/07/31 21:15:20 thorpej Exp $ */
|
||||
/* $NetBSD: frodo.c,v 1.6 2001/11/17 23:35:31 gmcgarry Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
|
||||
@ -96,6 +96,7 @@ struct frodo_softc {
|
||||
struct device sc_dev; /* generic device glue */
|
||||
volatile u_int8_t *sc_regs; /* register base */
|
||||
struct frodo_isr sc_intr[FRODO_NINTR]; /* interrupt handlers */
|
||||
int sc_ipl;
|
||||
void *sc_ih; /* out interrupt cookie */
|
||||
int sc_refcnt; /* number of interrupt refs */
|
||||
};
|
||||
@ -129,31 +130,19 @@ frodomatch(parent, match, aux)
|
||||
void *aux;
|
||||
{
|
||||
struct intio_attach_args *ia = aux;
|
||||
caddr_t va;
|
||||
static int frodo_matched = 0;
|
||||
|
||||
/* only allow one instance */
|
||||
if (frodo_matched)
|
||||
return (0);
|
||||
|
||||
/* only 4xx workstations can have this */
|
||||
switch (machineid) {
|
||||
case HP_400:
|
||||
case HP_425:
|
||||
case HP_433:
|
||||
break;
|
||||
|
||||
default:
|
||||
if (strcmp(ia->ia_modname, "frodo ") != 0)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* make sure the hardware is there in any case */
|
||||
va = (caddr_t)IIOV(FRODO_BASE);
|
||||
if (badaddr(va))
|
||||
if (badaddr((caddr_t)ia->ia_addr))
|
||||
return (0);
|
||||
|
||||
frodo_matched = 1;
|
||||
ia->ia_addr = FRODO_BASE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
@ -166,7 +155,8 @@ frodoattach(parent, self, aux)
|
||||
struct intio_attach_args *ia = aux;
|
||||
int i;
|
||||
|
||||
sc->sc_regs = (volatile u_int8_t *)IIOV(ia->ia_addr);
|
||||
sc->sc_regs = (volatile u_int8_t *)ia->ia_addr;
|
||||
sc->sc_ipl = ia->ia_ipl;
|
||||
|
||||
if ((FRODO_READ(sc, FRODO_IISR) & FRODO_IISR_SERVICE) == 0)
|
||||
printf(": service mode enabled");
|
||||
@ -276,7 +266,7 @@ frodo_intr_establish(frdev, func, arg, line, priority)
|
||||
if (isr == NULL || isr->isr_priority < priority) {
|
||||
if (isr != NULL)
|
||||
intr_disestablish(isr);
|
||||
sc->sc_ih = intr_establish(frodointr, sc, 5, priority);
|
||||
sc->sc_ih = intr_establish(frodointr, sc, sc->sc_ipl, priority);
|
||||
}
|
||||
|
||||
sc->sc_refcnt++;
|
||||
@ -320,7 +310,7 @@ frodo_intr_disestablish(frdev, line)
|
||||
|
||||
if (newpri != isr->isr_priority) {
|
||||
intr_disestablish(isr);
|
||||
sc->sc_ih = intr_establish(frodointr, sc, 5, newpri);
|
||||
sc->sc_ih = intr_establish(frodointr, sc, sc->sc_ipl, newpri);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: grf_dv.c,v 1.16 2001/07/22 13:34:04 wiz Exp $ */
|
||||
/* $NetBSD: grf_dv.c,v 1.17 2001/11/17 23:35:31 gmcgarry Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
|
||||
@ -165,13 +165,16 @@ dvbox_intio_match(parent, match, aux)
|
||||
struct intio_attach_args *ia = aux;
|
||||
struct grfreg *grf;
|
||||
|
||||
grf = (struct grfreg *)IIOV(GRFIADDR);
|
||||
if (badaddr((caddr_t)grf))
|
||||
if (strcmp("fb ",ia->ia_modname) != 0)
|
||||
return (0);
|
||||
|
||||
if (badaddr((caddr_t)ia->ia_addr))
|
||||
return (0);
|
||||
|
||||
grf = (struct grfreg *)ia->ia_addr;
|
||||
|
||||
if (grf->gr_id == DIO_DEVICE_ID_FRAMEBUFFER &&
|
||||
grf->gr_id2 == DIO_DEVICE_SECID_DAVINCI) {
|
||||
ia->ia_addr = (bus_addr_t)GRFIADDR;
|
||||
return (1);
|
||||
}
|
||||
|
||||
@ -184,9 +187,10 @@ dvbox_intio_attach(parent, self, aux)
|
||||
void *aux;
|
||||
{
|
||||
struct grfdev_softc *sc = (struct grfdev_softc *)self;
|
||||
struct intio_attach_args *ia = aux;
|
||||
caddr_t grf;
|
||||
|
||||
grf = (caddr_t)IIOV(GRFIADDR);
|
||||
grf = (caddr_t)ia->ia_addr;
|
||||
sc->sc_scode = -1; /* XXX internal i/o */
|
||||
|
||||
grfdev_attach(sc, dv_init, grf, &dvbox_grfsw);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: grf_gb.c,v 1.15 1998/06/25 23:57:33 thorpej Exp $ */
|
||||
/* $NetBSD: grf_gb.c,v 1.16 2001/11/17 23:35:31 gmcgarry Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
|
||||
@ -175,13 +175,16 @@ gbox_intio_match(parent, match, aux)
|
||||
struct intio_attach_args *ia = aux;
|
||||
struct grfreg *grf;
|
||||
|
||||
grf = (struct grfreg *)IIOV(GRFIADDR);
|
||||
if (badaddr((caddr_t)grf))
|
||||
if (strcmp("fb ",ia->ia_modname) != 0)
|
||||
return (0);
|
||||
|
||||
if (badaddr((caddr_t)ia->ia_addr))
|
||||
return (0);
|
||||
|
||||
grf = (struct grfreg *)ia->ia_addr;
|
||||
|
||||
if (grf->gr_id == DIO_DEVICE_ID_FRAMEBUFFER &&
|
||||
grf->gr_id2 == DIO_DEVICE_SECID_GATORBOX) {
|
||||
ia->ia_addr = (bus_addr_t)GRFIADDR;
|
||||
return (1);
|
||||
}
|
||||
|
||||
@ -194,9 +197,10 @@ gbox_intio_attach(parent, self, aux)
|
||||
void *aux;
|
||||
{
|
||||
struct grfdev_softc *sc = (struct grfdev_softc *)self;
|
||||
struct intio_attach_args *ia = aux;
|
||||
caddr_t grf;
|
||||
|
||||
grf = (caddr_t)IIOV(GRFIADDR);
|
||||
grf = (caddr_t)ia->ia_addr;
|
||||
sc->sc_scode = -1; /* XXX internal i/o */
|
||||
|
||||
grfdev_attach(sc, gb_init, grf, &gbox_grfsw);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: grf_rb.c,v 1.16 2001/07/22 13:34:04 wiz Exp $ */
|
||||
/* $NetBSD: grf_rb.c,v 1.17 2001/11/17 23:35:31 gmcgarry Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
|
||||
@ -164,13 +164,16 @@ rbox_intio_match(parent, match, aux)
|
||||
struct intio_attach_args *ia = aux;
|
||||
struct grfreg *grf;
|
||||
|
||||
grf = (struct grfreg *)IIOV(GRFIADDR);
|
||||
if (badaddr((caddr_t)grf))
|
||||
if (strcmp("fb ",ia->ia_modname) != 0)
|
||||
return (0);
|
||||
|
||||
if (badaddr((caddr_t)ia->ia_addr))
|
||||
return (0);
|
||||
|
||||
grf = (struct grfreg *)ia->ia_addr;
|
||||
|
||||
if (grf->gr_id == DIO_DEVICE_ID_FRAMEBUFFER &&
|
||||
grf->gr_id2 == DIO_DEVICE_SECID_RENASSIANCE) {
|
||||
ia->ia_addr = (bus_addr_t)GRFIADDR;
|
||||
return (1);
|
||||
}
|
||||
|
||||
@ -183,9 +186,10 @@ rbox_intio_attach(parent, self, aux)
|
||||
void *aux;
|
||||
{
|
||||
struct grfdev_softc *sc = (struct grfdev_softc *)self;
|
||||
struct intio_attach_args *ia = aux;
|
||||
caddr_t grf;
|
||||
|
||||
grf = (caddr_t)IIOV(GRFIADDR);
|
||||
grf = (caddr_t)ia->ia_addr;
|
||||
sc->sc_scode = -1; /* XXX internal i/o */
|
||||
|
||||
grfdev_attach(sc, rb_init, grf, &rbox_grfsw);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: grf_tc.c,v 1.16 2001/07/22 13:34:04 wiz Exp $ */
|
||||
/* $NetBSD: grf_tc.c,v 1.17 2001/11/17 23:35:31 gmcgarry Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
|
||||
@ -181,11 +181,14 @@ topcat_intio_match(parent, match, aux)
|
||||
struct intio_attach_args *ia = aux;
|
||||
struct grfreg *grf;
|
||||
|
||||
grf = (struct grfreg *)IIOV(GRFIADDR);
|
||||
|
||||
if (badaddr((caddr_t)grf))
|
||||
if (strcmp("fb ",ia->ia_modname) != 0)
|
||||
return (0);
|
||||
|
||||
if (badaddr((caddr_t)ia->ia_addr))
|
||||
return (0);
|
||||
|
||||
grf = (struct grfreg *)ia->ia_addr;
|
||||
|
||||
if (grf->gr_id == DIO_DEVICE_ID_FRAMEBUFFER) {
|
||||
switch (grf->gr_id2) {
|
||||
case DIO_DEVICE_SECID_TOPCAT:
|
||||
@ -195,7 +198,6 @@ topcat_intio_match(parent, match, aux)
|
||||
#if 0
|
||||
case DIO_DEVICE_SECID_XXXCATSEYE:
|
||||
#endif
|
||||
ia->ia_addr = (bus_addr_t)GRFIADDR;
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
@ -208,10 +210,11 @@ topcat_intio_attach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
{
|
||||
struct intio_attach_args *ia = aux;
|
||||
struct grfdev_softc *sc = (struct grfdev_softc *)self;
|
||||
struct grfreg *grf;
|
||||
|
||||
grf = (struct grfreg *)IIOV(GRFIADDR);
|
||||
grf = (struct grfreg *)ia->ia_addr;
|
||||
sc->sc_scode = -1; /* XXX internal i/o */
|
||||
|
||||
topcat_common_attach(sc, (caddr_t)grf, grf->gr_id2);
|
||||
@ -301,6 +304,7 @@ topcat_common_attach(sc, grf, secid)
|
||||
}
|
||||
|
||||
grfdev_attach(sc, tc_init, grf, sw);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@ -485,6 +489,7 @@ void
|
||||
topcat_init(ip)
|
||||
struct ite_data *ip;
|
||||
{
|
||||
|
||||
/* XXX */
|
||||
if (ip->regbase == NULL) {
|
||||
struct grf_data *gp = ip->grf;
|
||||
@ -589,6 +594,7 @@ void
|
||||
topcat_deinit(ip)
|
||||
struct ite_data *ip;
|
||||
{
|
||||
|
||||
topcat_windowmove(ip, 0, 0, 0, 0, ip->fbheight, ip->fbwidth, RR_CLEAR);
|
||||
tc_waitbusy(ip->regbase, ip->planemask);
|
||||
|
||||
@ -601,8 +607,8 @@ topcat_putc(ip, c, dy, dx, mode)
|
||||
struct ite_data *ip;
|
||||
int c, dy, dx, mode;
|
||||
{
|
||||
int wmrr = ((mode == ATTR_INV) ? RR_COPYINVERTED : RR_COPY);
|
||||
|
||||
int wmrr = ((mode == ATTR_INV) ? RR_COPYINVERTED : RR_COPY);
|
||||
|
||||
topcat_windowmove(ip, charY(ip, c), charX(ip, c),
|
||||
dy * ip->ftheight, dx * ip->ftwidth,
|
||||
ip->ftheight, ip->ftwidth, wmrr);
|
||||
@ -613,6 +619,7 @@ topcat_cursor(ip, flag)
|
||||
struct ite_data *ip;
|
||||
int flag;
|
||||
{
|
||||
|
||||
if (flag == DRAW_CURSOR)
|
||||
draw_cursor(ip)
|
||||
else if (flag == MOVE_CURSOR) {
|
||||
@ -675,7 +682,7 @@ topcat_windowmove(ip, sy, sx, dy, dx, h, w, func)
|
||||
int sy, sx, dy, dx, h, w, func;
|
||||
{
|
||||
struct tcboxfb *rp = REGBASE;
|
||||
|
||||
|
||||
if (h == 0 || w == 0)
|
||||
return;
|
||||
tc_waitbusy(ip->regbase, ip->planemask);
|
||||
|
Loading…
Reference in New Issue
Block a user