From d44579e2915126042276a257a56c7f376b53f959 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sat, 4 Jan 2003 23:13:52 +0000 Subject: On MVME187, detect the on-board memory size by probing the memory controllers like on mvme68k, rather than attempting to find the first off-board memory location. --- sys/arch/mvme88k/mvme88k/machdep.c | 45 +++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c index 1c01349c853..6d479b7f3a1 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.98 2003/01/01 23:38:18 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.99 2003/01/04 23:13:51 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -127,6 +127,7 @@ void regdump(struct trapframe *f); void dumpsys(void); void consinit(void); vm_offset_t size_memory(void); +vm_offset_t memsize187(void); int getcpuspeed(void); int getscsiid(void); void identifycpu(void); @@ -304,6 +305,29 @@ consinit() #endif } +#ifdef MVME187 +/* + * Figure out how much memory is available, by querying the memory controllers + */ +#include +vm_offset_t +memsize187() +{ + struct memcreg *memc; + vm_offset_t x; + + memc = (struct memcreg *)0xfff43000; + x = MEMC_MEMCONF_RTOB(memc->memc_memconf); + + memc = (struct memcreg *)0xfff43100; + if (!badaddr((vm_offset_t)&memc->memc_memconf, 1)) + x += MEMC_MEMCONF_RTOB(memc->memc_memconf); + + return x; +} +#endif + +#if defined(MVME188) || defined(MVME197) /* * Figure out how much real memory is available. * Start looking from the megabyte after the end of the kernel data, @@ -352,9 +376,9 @@ size_memory() look = (unsigned int *)0x01FFF000; } - physmem = btoc(trunc_page((unsigned)look)); /* in pages */ return (trunc_page((unsigned)look)); } +#endif /* defined(MVME188) || defined(MVME197) */ int getcpuspeed() @@ -2375,7 +2399,22 @@ mvme_bootstrap() uvm_setpagesize(); first_addr = round_page(first_addr); - last_addr = size_memory(); + switch (brdtyp) { +#ifdef MVME187 + case BRD_187: + last_addr = memsize187(); + break; +#endif +#ifdef MVME188 + case BRD_188: +#endif +#ifdef MVME197 + case BRD_197: +#endif + last_addr = size_memory(); + break; + } + physmem = btoc(last_addr); cmmu_parity_enable(); -- cgit v1.2.3