add an OCTEON_MEMSIZE option to override the uboot provided memory

size.  limiting this to 256 avoids an annoying uvm freelist problem on
the 512mb erlite, partly described here:

http://mail-index.netbsd.org/tech-kern/2016/12/20/msg021358.html
This commit is contained in:
mrg 2016-12-28 03:27:08 +00:00
parent f069472cf9
commit 1bb3df50d2
2 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.9 2016/12/22 14:47:56 cherry Exp $ */
/* $NetBSD: machdep.c,v 1.10 2016/12/28 03:27:08 mrg Exp $ */
/*
* Copyright 2001, 2002 Wasabi Systems, Inc.
@ -112,9 +112,10 @@
*/
#include "opt_multiprocessor.h"
#include "opt_cavium.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.9 2016/12/22 14:47:56 cherry Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.10 2016/12/28 03:27:08 mrg Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -203,7 +204,11 @@ mach_init(uint64_t arg0, uint64_t arg1, uint64_t arg2, uint64_t arg3)
sizeof(octeon_btinfo));
corefreq = octeon_btinfo.obt_eclock_hz;
#ifdef OCTEON_MEMSIZE // avoid uvm issue
memsize = OCTEON_MEMSIZE;
#else
memsize = octeon_btinfo.obt_dram_size * 1024 * 1024;
#endif
octeon_cal_timer(corefreq);

View File

@ -1,4 +1,4 @@
# $NetBSD: files.octeon,v 1.5 2016/12/09 10:30:48 roy Exp $
# $NetBSD: files.octeon,v 1.6 2016/12/28 03:27:08 mrg Exp $
file arch/evbmips/cavium/autoconf.c
file arch/evbmips/cavium/machdep.c
@ -18,3 +18,6 @@ include "external/bsd/sljit/conf/files.sljit"
# Memory Disk
file dev/md_root.c memory_disk_hooks
# workaround Cavium 50x0 problem vs uvm freelists
defparam opt_cavium.h OCTEON_MEMSIZE