Propagate changes from cfb driver to not require "needs-count" to other

pmax framebuffer drivers.
This commit is contained in:
jonathan 1996-02-15 19:13:08 +00:00
parent 2afc843cce
commit d25690e30a
6 changed files with 94 additions and 58 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: files.pmax,v 1.25 1996/01/03 20:33:25 jonathan Exp $
# $NetBSD: files.pmax,v 1.26 1996/02/15 19:13:21 jonathan Exp $
# DECstation-specific configuration info
# maxpartitions must be first item in files.${ARCH}.
@ -14,12 +14,25 @@ device mainbus at root { } # no locators
device cpu at mainbus # not optional
file arch/pmax/pmax/cpu.c cpu
#
# CPU-dependent files
#
#file arch/pmax/pmax/kn01.c kn01 # DS3100, pmax
#file arch/pmax/pmax/kn02.c kn02 # DS5000/200, 3max
#file arch/pmax/pmax/kn03.c kn03 # DS5000/240, 3maxplus
#file arch/pmax/pmax/kn02ba.c kn02ba # DS5000/1xx, 3min(kmin)
#file arch/pmax/pmax/kn02ca.c kn02ca # DS5000/1xx, maxine
#file arch/pmax/pmax/kn210.c # DS5400, mipsfair
#file arch/pmax/pmax/kn220.c # DS5500, mipsfair2
file arch/pmax/pmax/kn230.c kn230 # DS5100, mipsmate
#
# Auto-configuration driver for the turbochannel bus itself.
#
device tc at mainbus { } #{ slot = -1, offset = -1 }
file arch/pmax/tc/tc.c tc needs-flag
#define tcbus { }
device tc at mainbus {[slot = -1], [offset = -1]} ##{ }
file arch/pmax/tc/tc_subr.c tc needs-flag
file dev/tc/tc.c tc needs-flag
#
@ -74,11 +87,11 @@ file arch/pmax/dev/rz.c rz needs-count
# DC7085 (DZ-like four-port serial device) on mainbus on non-IOASIC machines.
# For the 3MAX (aka kn02 aka 5k/200) pretend that it's on an ASIC.
device dc at mainbus,ioasic
file arch/pmax/dev/dc.c dc needs-count
file arch/pmax/dev/dc.c dc needs-count
# The "desktop bus" on the MAXINE (5k/25). What is it, anyway? ADB?
device dtop at ioasic
file arch/pmax/dev/dtop.c dtop needs-count
file arch/pmax/dev/dtop.c dtop needs-flag
# LANCE ethernet driver.
# XXX Should use new machine-independent one instead.
@ -87,29 +100,29 @@ file arch/pmax/tc/if_le.c le needs-flag
# 3100 (pmax) onboard framebuffer
device pm at mainbus
file arch/pmax/dev/pm.c pm needs-count
file arch/pmax/dev/bt478.c pm
file arch/pmax/dev/pm.c pm needs-flag
file arch/pmax/dev/bt478.c pm
########################################################################
# Turbochannel options.
########################################################################
device cfb at tc
file arch/pmax/dev/cfb.c cfb needs-count
file arch/pmax/dev/cfb.c cfb needs-flag
device sfb at tc
file arch/pmax/dev/sfb.c sfb needs-count
file arch/pmax/dev/sfb.c sfb needs-flag
device mfb at tc
file arch/pmax/dev/mfb.c mfb needs-count
file arch/pmax/dev/mfb.c mfb needs-flag
# Zilog 8350/Intel 82350(?) SCC UART.
device scc at ioasic
file arch/pmax/tc/scc.c scc needs-count
file arch/pmax/tc/scc.c scc needs-count
# MAXINE onboard framebuffer
device xcfb at tc
file arch/pmax/dev/xcfb.c xcfb needs-count
file arch/pmax/dev/xcfb.c xcfb needs-flag
file arch/pmax/dev/ims332.c xcfb
# DECWRL 45Mbit T3 interface

View File

@ -1,4 +1,4 @@
/* $NetBSD: cfb.c,v 1.14 1996/02/13 18:27:28 jonathan Exp $ */
/* $NetBSD: cfb.c,v 1.15 1996/02/15 19:13:18 jonathan Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)sfb.c 8.1 (Berkeley) 6/10/93
* $Id: cfb.c,v 1.14 1996/02/13 18:27:28 jonathan Exp $
* $Id: cfb.c,v 1.15 1996/02/15 19:13:18 jonathan Exp $
*/
/*
@ -121,7 +121,7 @@ struct fbinfo cfbfi; /*XXX*/ /* should be softc */
extern struct cfdriver cfb;
#define CMAP_BITS (3 * 256) /* 256 entries, 3 bytes per. */
static u_char cmap_bits [CMAP_BITS]; /* One colormap per cfb... */
static u_char cmap_bits [CMAP_BITS]; /* colormap for console... */
/*
* Method table for standard framebuffer operations on a CFB.

View File

@ -1,4 +1,4 @@
/* $NetBSD: mfb.c,v 1.10 1996/02/02 18:07:26 mycroft Exp $ */
/* $NetBSD: mfb.c,v 1.11 1996/02/15 19:13:16 jonathan Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -197,7 +197,6 @@ mfbmatch(parent, match, aux)
{
struct cfdata *cf = match;
struct confargs *ca = aux;
static int nmfbs = 1;
#ifdef FBDRIVER_DOES_ATTACH
/* leave configuration to the fb driver */
@ -208,11 +207,6 @@ mfbmatch(parent, match, aux)
if (!TC_BUS_MATCHNAME(ca, "PMAG-AA "))
return (0);
#ifdef notyet
/* if it can't have the one mentioned, reject it */
if (cf->cf_unit >= nmfbs)
return (0);
#endif
return (1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pm.c,v 1.12 1996/02/02 18:07:29 mycroft Exp $ */
/* $NetBSD: pm.c,v 1.13 1996/02/15 19:13:08 jonathan Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -72,6 +72,7 @@ pm needs dc device
#include <sys/errno.h>
#include <sys/proc.h>
#include <sys/mman.h>
#include <sys/malloc.h>
#include <vm/vm.h>
@ -147,7 +148,7 @@ void genKbdEvent(), genMouseEvent(), genMouseButtons();
extern void pmEventQueueInit __P((pmEventQueue *qe));
#define CMAP_BITS (3 * 256) /* 256 entries, 3 bytes per. */
static u_char cmap_bits [NPM * CMAP_BITS]; /* One colormap per pm... */
static u_char cmap_bits [CMAP_BITS]; /* colormap for console... */
/*
@ -184,7 +185,6 @@ pmmatch(parent, match, aux)
{
struct cfdata *cf = match;
struct confargs *ca = aux;
static int npms = 1;
caddr_t pmaddr = (caddr_t)ca->ca_addr;
/* make sure that we're looking for this type of device. */
@ -194,11 +194,6 @@ pmmatch(parent, match, aux)
if (badaddr(pmaddr, 4))
return (0);
#ifdef notyet
/* if it can't have the one mentioned, reject it */
if (cf->cf_unit >= npms)
return (0);
#endif
return (1);
}
@ -231,7 +226,21 @@ pminit(fi, unit, silent)
{
register PCCRegs *pcc = (PCCRegs *)MACH_PHYS_TO_UNCACHED(KN01_SYS_PCC);
if (fi == 0) fi = &pmfi;
/*XXX*/
/*
* If this device is being intialized as the console, malloc()
* is not yet up and we must use statically-allocated space.
*/
if (fi == NULL) {
fi = &pmfi; /* XXX */
fi->fi_cmap_bits = (caddr_t)cmap_bits;
} else {
fi->fi_cmap_bits = malloc(CMAP_BITS, M_DEVBUF, M_NOWAIT);
if (fi->fi_cmap_bits == NULL) {
printf("cfb%d: no memory for cmap 0x%x\n", unit);
return (0);
}
}
/* Set address of frame buffer... */
fi->fi_pixels = (caddr_t)MACH_PHYS_TO_UNCACHED(KN01_PHYS_FBUF_START);
@ -305,7 +314,7 @@ pminit(fi, unit, silent)
/*
* Initialize the color map, the screen, and the mouse.
*/
bt478init(&pmfi);
bt478init(fi);
/*
* Initialize old-style pmax screen info.
@ -321,7 +330,7 @@ pminit(fi, unit, silent)
#ifdef notanymore
bt478InitColorMap(&pmfi); /* done inside bt478init() */
bt478InitColorMap(fi); /* done inside bt478init() */
#endif
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: sfb.c,v 1.6 1996/02/02 18:07:37 mycroft Exp $ */
/* $NetBSD: sfb.c,v 1.7 1996/02/15 19:13:13 jonathan Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)sfb.c 8.1 (Berkeley) 6/10/93
* $Id: sfb.c,v 1.6 1996/02/02 18:07:37 mycroft Exp $
* $Id: sfb.c,v 1.7 1996/02/15 19:13:13 jonathan Exp $
*/
/*
@ -89,6 +89,7 @@
#include <sys/errno.h>
#include <sys/device.h>
#include <sys/fcntl.h>
#include <sys/malloc.h>
#include <machine/autoconf.h>
#include <dev/tc/tcvar.h>
@ -121,7 +122,7 @@ extern int pmax_boardtype;
int sfbinit (char *, int, int);
#define CMAP_BITS (3 * 256) /* 256 entries, 3 bytes per. */
static u_char cmap_bits [NSFB * CMAP_BITS]; /* One colormap per sfb... */
static u_char cmap_bits [CMAP_BITS]; /* colormap for console... */
int sfbmatch __P((struct device *, void *, void *));
void sfbattach __P((struct device *, struct device *, void *));
@ -152,23 +153,25 @@ sfbmatch(parent, match, aux)
{
struct cfdata *cf = match;
struct confargs *ca = aux;
static int nsfbs = 1;
/* make sure that we're looking for this type of device. */
if (!TC_BUS_MATCHNAME(ca, "PMAGB-BA"))
return (0);
#ifdef notyet
/* if it can't have the one mentioned, reject it */
if (cf->cf_unit >= nsfbs)
/*
* if the TC rom ident matches, assume the VRAM is present too.
*/
#if 0
if (badaddr( ((caddr_t)ca->ca_addr) + SFB_OFFSET_VRAM, 4))
return (0);
#endif
return (1);
}
/*
* Attach a device. Hand off all the work to sfbinit(),
* so console-config cod can attach sfbs early in boot.
* so console-config code can attach sfbs early in boot.
*/
void
sfbattach(parent, self, aux)
@ -216,10 +219,21 @@ sfbinit(base, unit, silent)
struct fbinfo *fi;
u_char foo;
fi = &sfbfi; /* XXX use softc */
if (unit > NSFB)
return (0);
/*
* If this device is being intialized as the console, malloc()
* is not yet up and we must use statically-allocated space.
*/
if (fi == NULL) {
fi = &sfbfi; /* XXX */
fi->fi_cmap_bits = (caddr_t)cmap_bits;
}
else {
fi->fi_cmap_bits = malloc(CMAP_BITS, M_DEVBUF, M_NOWAIT);
if (fi->fi_cmap_bits == NULL) {
printf("cfb%d: no memory for cmap 0x%x\n", unit);
return (0);
}
}
/* check for no frame buffer */
if (badaddr(base + SFB_OFFSET_VRAM, 4))
@ -235,7 +249,6 @@ sfbinit(base, unit, silent)
fi->fi_linebytes = 1280;
fi->fi_driver = &sfb_driver;
fi->fi_blanked = 0;
fi->fi_cmap_bits = (caddr_t)&cmap_bits [CMAP_BITS * unit];
/* Fill in Frame Buffer Type struct. */
fi->fi_type.fb_boardtype = PMAX_FBTYPE_SFB;

View File

@ -1,4 +1,4 @@
/* $NetBSD: xcfb.c,v 1.11 1996/02/02 18:07:40 mycroft Exp $ */
/* $NetBSD: xcfb.c,v 1.12 1996/02/15 19:13:11 jonathan Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -97,6 +97,7 @@ xcfb needs dtop device
#include <sys/errno.h>
#include <sys/proc.h>
#include <sys/mman.h>
#include <sys/malloc.h>
#include <vm/vm.h>
@ -135,7 +136,7 @@ struct fbinfo xcfbfi; /*XXX*/
extern struct cfdriver cfb;
#define CMAP_BITS (3 * 256) /* 256 entries, 3 bytes per. */
static u_char cmap_bits [NXCFB * CMAP_BITS]; /* One colormap per cfb... */
static u_char cmap_bits [CMAP_BITS]; /* colormap for console... */
#define XCFB_FB_SIZE 0x100000 /* size of raster (mapped into userspace) */
@ -189,18 +190,12 @@ xcfbmatch(parent, match, aux)
{
struct cfdata *cf = match;
struct confargs *ca = aux;
static int nxcfbs = 1;
/* Make sure that it's an xcfb. */
if (!TC_BUS_MATCHNAME(ca, "PMAG-DV ") &&
strcmp(ca->ca_name, "xcfb") != 0)
return (0);
#ifdef notyet
/* if it can't have the one mentioned, reject it */
if (cf->cf_unit >= nxcfbs)
return (0);
#endif
return (1);
}
@ -233,8 +228,21 @@ xcfbinit(fi, base, unit, silent)
{
register u_int *reset = (u_int *)IMS332_RESET_ADDRESS;
if (fi == 0) fi = &xcfbfi;
unit = 0; /*XXX*/ /* FIXME */
/*XXX*/
/*
* If this device is being intialized as the console, malloc()
* is not yet up and we must use statically-allocated space.
*/
if (fi == NULL) {
fi = &xcfbfi; /* XXX */
fi->fi_cmap_bits = (caddr_t)cmap_bits;
} else {
fi->fi_cmap_bits = malloc(CMAP_BITS, M_DEVBUF, M_NOWAIT);
if (fi->fi_cmap_bits == NULL) {
printf("cfb%d: no memory for cmap 0x%x\n", unit);
return (0);
}
}
/*XXX*/
/*
@ -254,7 +262,6 @@ xcfbinit(fi, base, unit, silent)
fi->fi_linebytes = 1024;
fi->fi_driver = &xcfb_driver;
fi->fi_blanked = 0;
fi->fi_cmap_bits = (caddr_t)&cmap_bits [CMAP_BITS * unit];
/* Fill in Frame Buffer Type struct. */
fi->fi_type.fb_boardtype = PMAX_FBTYPE_XCFB;