summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/cgtwo.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/sparc/dev/cgtwo.c')
-rw-r--r--sys/arch/sparc/dev/cgtwo.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/arch/sparc/dev/cgtwo.c b/sys/arch/sparc/dev/cgtwo.c
index 8c5dcc8f11a..e682f6b8a26 100644
--- a/sys/arch/sparc/dev/cgtwo.c
+++ b/sys/arch/sparc/dev/cgtwo.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: cgtwo.c,v 1.10 1996/08/13 08:05:23 downsj Exp $ */
-/* $NetBSD: cgtwo.c,v 1.16 1996/05/18 12:19:14 mrg Exp $ */
+/* $OpenBSD: cgtwo.c,v 1.11 1997/08/08 08:24:55 downsj Exp $ */
+/* $NetBSD: cgtwo.c,v 1.22 1997/05/24 20:16:12 pk Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -92,14 +92,13 @@ struct cgtwo_softc {
/* autoconfiguration driver */
static void cgtwoattach __P((struct device *, struct device *, void *));
static int cgtwomatch __P((struct device *, void *, void *));
-int cgtwoopen __P((dev_t, int, int, struct proc *));
-int cgtwoclose __P((dev_t, int, int, struct proc *));
-int cgtwoioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
-int cgtwommap __P((dev_t, int, int));
static void cgtwounblank __P((struct device *));
int cgtwogetcmap __P((struct cgtwo_softc *, struct fbcmap *));
int cgtwoputcmap __P((struct cgtwo_softc *, struct fbcmap *));
+/* cdevsw prototypes */
+cdev_decl(cgtwo);
+
struct cfattach cgtwo_ca = {
sizeof(struct cgtwo_softc), cgtwomatch, cgtwoattach
};
@@ -148,7 +147,7 @@ cgtwomatch(parent, vcf, aux)
/* XXX - Must do our own mapping at CG2_CTLREG_OFF */
bus_untmp();
- tmp = (caddr_t)bus_tmp(ra->ra_paddr + CG2_CTLREG_OFF, ca->ca_bustype);
+ tmp = (caddr_t)mapdev(ra->ra_reg, TMPMAP_VA, CG2_CTLREG_OFF, NBPG);
if (probeget(tmp, 2) != -1)
return 1;
#endif
@@ -207,20 +206,21 @@ cgtwoattach(parent, self, args)
* Assume this is the console if there's no eeprom info
* to be found.
*/
- if (eep == NULL || eep->ee_diag.eed_console == EED_CONS_COLOR)
+ if (eep == NULL || eep->eeConsole == EE_CONS_COLOR)
isconsole = (fbconstty != NULL);
else
isconsole = 0;
}
#endif
sc->sc_phys = ca->ca_ra.ra_reg[0];
+ /* Apparently, the pixels are 32-bit data space */
+ sc->sc_phys.rr_iospace = PMAP_VME32;
sc->sc_bustype = ca->ca_bustype;
if ((sc->sc_fb.fb_pixels = ca->ca_ra.ra_vaddr) == NULL && isconsole) {
/* this probably cannot happen, but what the heck */
- sc->sc_fb.fb_pixels = mapiodev(ca->ca_ra.ra_reg, CG2_PIXMAP_OFF,
- CG2_PIXMAP_SIZE,
- PMAP_VME32/*ca->ca_bustype*/);
+ sc->sc_fb.fb_pixels = mapiodev(&sc->sc_phys, CG2_PIXMAP_OFF,
+ CG2_PIXMAP_SIZE);
}
#ifndef offsetof
#define offsetof(type, member) ((size_t)(&((type *)0)->member))
@@ -229,12 +229,12 @@ cgtwoattach(parent, self, args)
sc->sc_reg = (volatile struct cg2statusreg *)
mapiodev(ca->ca_ra.ra_reg,
CG2_ROPMEM_OFF + offsetof(struct cg2fb, status.reg),
- sizeof(struct cg2statusreg), ca->ca_bustype);
+ sizeof(struct cg2statusreg));
sc->sc_cmap = (volatile u_short *)
mapiodev(ca->ca_ra.ra_reg,
CG2_ROPMEM_OFF + offsetof(struct cg2fb, redmap[0]),
- 3 * CG2_CMSIZE, ca->ca_bustype);
+ 3 * CG2_CMSIZE);
if (isconsole) {
printf(" (console)\n");
@@ -432,5 +432,5 @@ cgtwommap(dev, off, prot)
if ((unsigned)off >= sc->sc_fb.fb_type.fb_size)
return (-1);
- return (REG2PHYS(&sc->sc_phys, off, PMAP_VME32/*sc->sc_bustype*/) | PMAP_NC);
+ return (REG2PHYS(&sc->sc_phys, off) | PMAP_NC);
}