diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2010-04-24 18:44:28 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2010-04-24 18:44:28 +0000 |
commit | 743a79e922aded7a34218322df7491c49049127d (patch) | |
tree | 72c5f9996217de6f7d8ca4639897b3ad571254bc /sys/arch/aviion/dev | |
parent | 824c0ae01a78b8cb968cd05489febb9b375cfcdd (diff) |
Replace heuristics used to figure out which model we are running on, and
trust the cpuid value returned by the prom itself (verified against
/usr/opt/sdk/include/sys/dg_sys_info.h on a DG-UX filesystem).
Diffstat (limited to 'sys/arch/aviion/dev')
-rw-r--r-- | sys/arch/aviion/dev/if_le_syscon.c | 18 | ||||
-rw-r--r-- | sys/arch/aviion/dev/mainbus.c | 6 | ||||
-rw-r--r-- | sys/arch/aviion/dev/oosiop_syscon.c | 8 | ||||
-rw-r--r-- | sys/arch/aviion/dev/vme.c | 7 |
4 files changed, 25 insertions, 14 deletions
diff --git a/sys/arch/aviion/dev/if_le_syscon.c b/sys/arch/aviion/dev/if_le_syscon.c index e684db8e4e0..06175a57d17 100644 --- a/sys/arch/aviion/dev/if_le_syscon.c +++ b/sys/arch/aviion/dev/if_le_syscon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le_syscon.c,v 1.9 2010/04/18 15:06:39 miod Exp $ */ +/* $OpenBSD: if_le_syscon.c,v 1.10 2010/04/24 18:44:27 miod Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -92,10 +92,20 @@ void le_syscon_wrcsr_interrupt(struct am7990_softc *, uint16_t, uint16_t); int le_syscon_match(struct device *parent, void *cf, void *aux) { - if (avtyp != AV_400) + switch (cpuid) { + case AVIION_300_310: + case AVIION_400_4000: + case AVIION_410_4100: + case AVIION_300C_310C: + case AVIION_300CD_310CD: + case AVIION_300D_310D: + case AVIION_4300_25: + case AVIION_4300_20: + case AVIION_4300_16: + return 1; + default: return 0; - - return 1; + } } void diff --git a/sys/arch/aviion/dev/mainbus.c b/sys/arch/aviion/dev/mainbus.c index 8d034f1c597..18ae8edb097 100644 --- a/sys/arch/aviion/dev/mainbus.c +++ b/sys/arch/aviion/dev/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.4 2010/04/21 19:33:47 miod Exp $ */ +/* $OpenBSD: mainbus.c,v 1.5 2010/04/24 18:44:27 miod Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 2004, Miodrag Vallat. @@ -130,9 +130,7 @@ mainbus_attach(struct device *parent, struct device *self, void *args) { extern char cpu_model[]; - printf(": %s, cpuid 0x%x", cpu_model, cpuid); - if (sysid != -1) - printf(", sysid %x", sysid); + printf(": %s, cpuid 0x%04x", cpu_model, cpuid); printf("\n"); /* diff --git a/sys/arch/aviion/dev/oosiop_syscon.c b/sys/arch/aviion/dev/oosiop_syscon.c index d82bbb99b5b..8fd04b27191 100644 --- a/sys/arch/aviion/dev/oosiop_syscon.c +++ b/sys/arch/aviion/dev/oosiop_syscon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: oosiop_syscon.c,v 1.2 2010/04/21 19:33:47 miod Exp $ */ +/* $OpenBSD: oosiop_syscon.c,v 1.3 2010/04/24 18:44:27 miod Exp $ */ /* * Copyright (c) 2010 Miodrag Vallat. @@ -53,8 +53,12 @@ oosiop_syscon_match(struct device *parent, void *match, void *aux) struct confargs *ca = aux; paddr_t fuse; - if (avtyp != AV_530) + switch (cpuid) { + case AVIION_4600_530: + break; + default: return 0; + } switch (ca->ca_paddr) { case AV530_SCSI1: diff --git a/sys/arch/aviion/dev/vme.c b/sys/arch/aviion/dev/vme.c index 784b841664c..0a6367e6020 100644 --- a/sys/arch/aviion/dev/vme.c +++ b/sys/arch/aviion/dev/vme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vme.c,v 1.7 2010/04/21 19:33:47 miod Exp $ */ +/* $OpenBSD: vme.c,v 1.8 2010/04/24 18:44:27 miod Exp $ */ /* * Copyright (c) 2006, 2007, 2010 Miodrag Vallat. * @@ -120,8 +120,7 @@ int vmerw(struct vme_softc *, int, int, struct uio *, int); int vmematch(struct device *parent, void *vcf, void *aux) { - /* XXX no VME on AV100/AV200/AV300, though */ - return (platform->vme_ranges != NULL && vme_cd.cd_ndevs == 0); + return (platform->get_vme_ranges() != NULL && vme_cd.cd_ndevs == 0); } void @@ -175,7 +174,7 @@ vmeattach(struct device *parent, struct device *self, void *aux) */ *(volatile u_int32_t *)AV_EXTAM = 0x0d; - sc->sc_ranges = platform->vme_ranges; + sc->sc_ranges = platform->get_vme_ranges(); printf("\n"); /* |