diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-12-25 21:13:12 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-12-25 21:13:12 +0000 |
commit | 261c9342b820b0b018ad695a0e999660e009436d (patch) | |
tree | 865764c53e77e2424bee6fd3a8db8e64a961c503 /sys | |
parent | 2d570821810a28dc158190f0e72e60ad9796f63a (diff) |
Limit physmem to 32MB on 01-W3869B02[EF] boards which shipped with 64MB of
memory but a memory controller limited to 32MB.
Not tested for lack of such crippled hardware, just the average
once-per-leap-year act of niceness from me (a bit early though).
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/mvme88k/mvme88k/m197_machdep.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/sys/arch/mvme88k/mvme88k/m197_machdep.c b/sys/arch/mvme88k/mvme88k/m197_machdep.c index 8756dfbcc5e..eda80736450 100644 --- a/sys/arch/mvme88k/mvme88k/m197_machdep.c +++ b/sys/arch/mvme88k/mvme88k/m197_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m197_machdep.c,v 1.23 2007/12/15 21:19:48 miod Exp $ */ +/* $OpenBSD: m197_machdep.c,v 1.24 2007/12/25 21:13:11 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -52,6 +52,7 @@ #include <uvm/uvm_extern.h> #include <machine/asm_macro.h> +#include <machine/bugio.h> #include <machine/cmmu.h> #include <machine/cpu.h> #include <machine/reg.h> @@ -96,6 +97,30 @@ m197_memsize() int i; u_int8_t sar; u_int16_t ssar, sear; + struct mvmeprom_brdid brdid; + + /* + * MVME197LE 01-W3869B0[12][EF] boards shipped with a broken DCAM2 + * chip, which can only address 32MB of memory. Unfortunately, 02[EF] + * were fitted with 64MB... + * Note that we can't decide on letter < F since this would match + * post-Z boards (AA, AB, etc). + * + * If the CNFG memory has been lost, you're on your own... + */ + bzero(&brdid, sizeof(brdid)); + bugbrdid(&brdid); + if (bcmp(brdid.pwa, "01-W3869B02", 11) == 0) { + if (brdid.pwa[11] == 'E' || brdid.pwa[11] == 'F') + return (32 * 1024 * 1024); + } + + /* + * If we had to constrain memory access on boards with + * bogus DCAM, don't look into the decoders. + */ + if (physmem != 0) + return (ptoa(physmem)); for (i = 0; i < 4; i++) { sar = *(u_int8_t *)(BS_BASE + BS_SAR + i); |