diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-01-29 21:28:57 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-01-29 21:28:57 +0000 |
commit | 9a5cc83738bc0a7ef4ed748a92a7bb320bde0a67 (patch) | |
tree | 05b59a3d9b41f64630c8be292a8125bad3e6259c | |
parent | c288e68c4122b3c6f1c2a7d7bea930a0f23bd83c (diff) |
Print system type early in autoconf, as determined from the board status
register.
-rw-r--r-- | sys/arch/mvmeppc/dev/mainbus.c | 127 | ||||
-rw-r--r-- | sys/arch/mvmeppc/include/cpu.h | 28 |
2 files changed, 75 insertions, 80 deletions
diff --git a/sys/arch/mvmeppc/dev/mainbus.c b/sys/arch/mvmeppc/dev/mainbus.c index e779e75e7e6..0117a57ebbc 100644 --- a/sys/arch/mvmeppc/dev/mainbus.c +++ b/sys/arch/mvmeppc/dev/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.6 2004/01/26 22:57:20 miod Exp $ */ +/* $OpenBSD: mainbus.c,v 1.7 2004/01/29 21:28:54 miod Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -39,10 +39,9 @@ struct mainbus_softc { struct bushook sc_bus; }; -/* Definition of the mainbus driver. */ -static int mbmatch(struct device *, void *, void *); -static void mbattach(struct device *, struct device *, void *); -static int mbprint(void *, const char *); +void mbattach(struct device *, struct device *, void *); +int mbmatch(struct device *, void *, void *); +int mbprint(void *, const char *); struct cfattach mainbus_ca = { sizeof(struct mainbus_softc), mbmatch, mbattach @@ -51,106 +50,76 @@ struct cfdriver mainbus_cd = { NULL, "mainbus", DV_DULL }; -void mb_intr_establish(struct confargs *, int (*)(void *), void *); -void mb_intr_disestablish(struct confargs *); -caddr_t mb_cvtaddr(struct confargs *); -int mb_matchname(struct confargs *, char *); - -static int attached = 0; - -static int -mbmatch(parent, cfdata, aux) - struct device *parent; - void *cfdata; - void *aux; +int +mbmatch(struct device *parent, void *cfdata, void *aux) { - /* - * That one mainbus is always here. - */ - if (!attached) { - return(1); - } else { - return(0); - } + return (1); } -static void -mbattach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; +void +mbattach(struct device *parent, struct device *self, void *aux) { struct mainbus_softc *sc = (struct mainbus_softc *)self; struct confargs nca; - + u_int8_t systype; + extern vaddr_t isaspace_va; + + /* Pretty print the system type */ + switch ((systype = *(u_int8_t *)(isaspace_va + MVME_STATUS_REG))) { + default: + printf("unknown system type %x", systype); + break; + case MVMETYPE_RESERVED: + /* if you ever have this one, please contact me -- miod */ + printf("Dahu MVME"); + break; + case MVMETYPE_2600_712: + printf("MVME2600 or MVME2700 (712-compatible)"); + break; + case MVMETYPE_2600_761: + printf("MVME2600 or MVME2700 (761-compatible)"); + break; + case MVMETYPE_3600_712: + printf("MVME3600 or MVME4600 (712-compatible)"); + break; + case MVMETYPE_3600_761: + printf("MVME3600 or MVME4600 (761-compatible)"); + break; + case MVMETYPE_1600: + printf("MVME1600"); + break; + } printf("\n"); - attached = 1; - sc->sc_bus.bh_dv = (struct device *)sc; sc->sc_bus.bh_type = BUS_MAIN; - sc->sc_bus.bh_intr_establish = mb_intr_establish; - sc->sc_bus.bh_intr_disestablish = mb_intr_disestablish; - sc->sc_bus.bh_matchname = mb_matchname; + sc->sc_bus.bh_intr_establish = NULL; + sc->sc_bus.bh_intr_disestablish = NULL; + sc->sc_bus.bh_matchname = NULL; /* * Try to find and attach all of the CPUs in the machine. - * ( Right now only one CPU so code is simple ) + * Right now only one CPU is supported, so this is simple. + * Need to change for real MVME4600 support. */ nca.ca_name = "cpu"; nca.ca_bus = &sc->sc_bus; config_found(self, &nca, mbprint); - /* The following machines have an ISA bus */ - /* Do ISA first so the interrupt controller is set up! */ - nca.ca_name = "isabr"; - nca.ca_bus = &sc->sc_bus; - config_found(self, &nca, mbprint); - + /* + * Find and attach the PCI Northbridge. It will find and attach + * everything. + */ nca.ca_name = "mpcpcibr"; nca.ca_bus = &sc->sc_bus; config_found(self, &nca, mbprint); } -static int -mbprint(aux, pnp) - void *aux; - const char *pnp; +int +mbprint(void *aux, const char *pnp) { if (pnp) return (QUIET); return (UNCONF); } - -void -mb_intr_establish(ca, handler, val) - struct confargs *ca; - int (*handler)(void *); - void *val; -{ - panic("can never mb_intr_establish"); -} - -void -mb_intr_disestablish(ca) - struct confargs *ca; -{ - panic("can never mb_intr_disestablish"); -} - -caddr_t -mb_cvtaddr(ca) - struct confargs *ca; -{ - - return (NULL); -} - -int -mb_matchname(ca, name) - struct confargs *ca; - char *name; -{ - return (strcmp(name, ca->ca_name) == 0); -} diff --git a/sys/arch/mvmeppc/include/cpu.h b/sys/arch/mvmeppc/include/cpu.h index c2c4cfe5bbd..92e258169da 100644 --- a/sys/arch/mvmeppc/include/cpu.h +++ b/sys/arch/mvmeppc/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.7 2004/01/28 23:50:18 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.8 2004/01/29 21:28:56 miod Exp $ */ /* $NetBSD: cpu.h,v 1.1 1996/09/30 16:34:21 ws Exp $ */ /* @@ -39,4 +39,30 @@ void install_extint(void (*)(void)); void nvram_map(void); +/* + * CPU Configuration registers (in ISA space) + */ + +#define MVME_CPUCONF_REG 0x0800 +#define MVME_FEATURE_REG 0x0802 +#define MVME_STATUS_REG 0x0803 +#define MVME_SEVENSEG_REG 0x08c0 + +/* feature bits */ +#define MVME_FEATURE_SCC 0x40 +#define MVME_FEATURE_PMC2 0x20 +#define MVME_FEATURE_PMC1 0x10 +#define MVME_FEATURE_VME 0x08 +#define MVME_FEATURE_GFX 0x04 +#define MVME_FEATURE_LAN 0x02 +#define MVME_FEATURE_SCSI 0x01 + +/* status values */ +#define MVMETYPE_RESERVED 0xfa +#define MVMETYPE_2600_712 0xfb +#define MVMETYPE_2600_761 0xfc +#define MVMETYPE_3600_712 0xfd +#define MVMETYPE_3600_761 0xfe +#define MVMETYPE_1600 0xff + #endif /* _MACHINE_CPU_H_ */ |