diff options
Diffstat (limited to 'sys/arch/alpha/tc/tcasic.c')
-rw-r--r-- | sys/arch/alpha/tc/tcasic.c | 117 |
1 files changed, 94 insertions, 23 deletions
diff --git a/sys/arch/alpha/tc/tcasic.c b/sys/arch/alpha/tc/tcasic.c index fe63afca03f..7ea036a533f 100644 --- a/sys/arch/alpha/tc/tcasic.c +++ b/sys/arch/alpha/tc/tcasic.c @@ -1,5 +1,5 @@ -/* $OpenBSD: tcasic.c,v 1.9 2002/03/14 01:26:28 millert Exp $ */ -/* $NetBSD: tcasic.c,v 1.14 1996/12/05 01:39:45 cgd Exp $ */ +/* $OpenBSD: tcasic.c,v 1.10 2002/05/02 22:56:06 miod Exp $ */ +/* $NetBSD: tcasic.c,v 1.36 2001/08/23 01:16:52 nisimura Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -34,16 +34,13 @@ #include <machine/autoconf.h> #include <machine/rpb.h> +#include <machine/cpu.h> #include <dev/tc/tcvar.h> #include <alpha/tc/tc_conf.h> /* Definition of the driver for autoconfig. */ -#ifdef __BROKEN_INDIRECT_CONFIG int tcasicmatch(struct device *, void *, void *); -#else -int tcasicmatch(struct device *, struct cfdata *, void *); -#endif void tcasicattach(struct device *, struct device *, void *); struct cfattach tcasic_ca = { @@ -54,9 +51,8 @@ struct cfdriver tcasic_cd = { NULL, "tcasic", DV_DULL, }; -int tcasicprint(void *, const char *); -extern int cputype; +int tcasicprint(void *, const char *); /* There can be only one. */ int tcasicfound; @@ -64,12 +60,7 @@ int tcasicfound; int tcasicmatch(parent, cfdata, aux) struct device *parent; -#ifdef __BROKEN_INDIRECT_CONFIG - void *cfdata; -#else - struct cfdata *cfdata; -#endif - void *aux; + void *cfdata, *aux; { struct mainbus_attach_args *ma = aux; @@ -107,7 +98,6 @@ tcasicattach(parent, self, aux) intr_setup = tc_3000_500_intr_setup; iointr = tc_3000_500_iointr; - tba.tba_busname = "tc"; tba.tba_speed = TC_SPEED_25_MHZ; tba.tba_nslots = tc_3000_500_nslots; tba.tba_slots = tc_3000_500_slots; @@ -118,8 +108,13 @@ tcasicattach(parent, self, aux) tba.tba_nbuiltins = tc_3000_500_nographics_nbuiltins; tba.tba_builtins = tc_3000_500_nographics_builtins; } + tba.tba_intr_evcnt = tc_3000_500_intr_evcnt; tba.tba_intr_establish = tc_3000_500_intr_establish; tba.tba_intr_disestablish = tc_3000_500_intr_disestablish; + tba.tba_get_dma_tag = tc_dma_get_tag_3000_500; + + /* Do 3000/500-specific DMA setup now. */ + tc_dma_init_3000_500(tc_3000_500_nslots); break; #endif /* DEC_3000_500 */ @@ -129,14 +124,15 @@ tcasicattach(parent, self, aux) intr_setup = tc_3000_300_intr_setup; iointr = tc_3000_300_iointr; - tba.tba_busname = "tc"; tba.tba_speed = TC_SPEED_12_5_MHZ; tba.tba_nslots = tc_3000_300_nslots; tba.tba_slots = tc_3000_300_slots; tba.tba_nbuiltins = tc_3000_300_nbuiltins; tba.tba_builtins = tc_3000_300_builtins; + tba.tba_intr_evcnt = tc_3000_300_intr_evcnt; tba.tba_intr_establish = tc_3000_300_intr_establish; tba.tba_intr_disestablish = tc_3000_300_intr_disestablish; + tba.tba_get_dma_tag = tc_dma_get_tag_3000_300; break; #endif /* DEC_3000_300 */ @@ -144,14 +140,10 @@ tcasicattach(parent, self, aux) panic("tcasicattach: bad cputype"); } + tba.tba_busname = "tc"; tba.tba_memt = tc_bus_mem_init(NULL); - - /* XXX XXX BEGIN XXX XXX */ - { /* XXX */ - extern vm_offset_t alpha_XXX_dmamap_or; /* XXX */ - alpha_XXX_dmamap_or = 0; /* XXX */ - } /* XXX */ - /* XXX XXX END XXX XXX */ + + tc_dma_init(); (*intr_setup)(); set_iointr(iointr); @@ -170,3 +162,82 @@ tcasicprint(aux, pnp) printf("tc at %s", pnp); return (UNCONF); } + +#include "wsdisplay.h" + +#if NWSDISPLAY > 0 + +#include "sfb.h" +#include "sfbp.h" +#include "cfb.h" +#include "mfb.h" +#include "tfb.h" +#include "px.h" +#include "pxg.h" + +extern void sfb_cnattach(tc_addr_t); +extern void sfbp_cnattach(tc_addr_t); +extern void cfb_cnattach(tc_addr_t); +extern void mfb_cnattach(tc_addr_t); +extern void tfb_cnattach(tc_addr_t); +extern void px_cnattach(tc_addr_t); +extern void pxg_cnattach(tc_addr_t); +extern int tc_checkslot(tc_addr_t, char *); + +struct cnboards { + const char *cb_tcname; + void (*cb_cnattach)(tc_addr_t); +} static const cnboards[] = { +#if NSFB > 0 + { "PMAGB-BA", sfb_cnattach }, +#endif +#if NSFBP > 0 + { "PMAGD ", sfbp_cnattach }, +#endif +#if NCFB > 0 + { "PMAG-BA ", cfb_cnattach }, +#endif +#if NMFB > 0 + { "PMAG-AA ", mfb_cnattach }, +#endif +#if NTFB > 0 + { "PMAG-JA ", tfb_cnattach }, +#endif +#if NPX > 0 + { "PMAG-CA ", px_cnattach }, +#endif +#if NPXG > 0 + { "PMAG-DA ", pxg_cnattach }, + { "PMAG-FA ", pxg_cnattach }, + { "PMAG-FB ", pxg_cnattach }, + { "PMAGB-FA", pxg_cnattach }, + { "PMAGB-FB", pxg_cnattach }, +#endif +}; + +/* + * tc_fb_cnattach -- + * Attempt to attach the appropriate display driver to the + * output console. + */ +int +tc_fb_cnattach(tcaddr) + tc_addr_t tcaddr; +{ + char tcname[TC_ROM_LLEN]; + int i; + + if (tc_badaddr(tcaddr) || (tc_checkslot(tcaddr, tcname) == 0)) + return (EINVAL); + + for (i = 0; i < sizeof(cnboards) / sizeof(cnboards[0]); i++) + if (strncmp(tcname, cnboards[i].cb_tcname, TC_ROM_LLEN) == 0) + break; + + if (i == sizeof(cnboards) / sizeof(cnboards[0])) + return (ENXIO); + + (cnboards[i].cb_cnattach)(tcaddr); + return (0); +} +#endif /* if NWSDISPLAY > 0 */ |