Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbarm/bcm53xx Deal with more than 1GB of RAM.



details:   https://anonhg.NetBSD.org/src/rev/0e304792a775
branches:  trunk
changeset: 809516:0e304792a775
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Jul 17 20:29:29 2015 +0000

description:
Deal with more than 1GB of RAM.

diffstat:

 sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c |  21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diffs (49 lines):

diff -r a11f9944e419 -r 0e304792a775 sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c
--- a/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c Fri Jul 17 19:32:48 2015 +0000
+++ b/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c Fri Jul 17 20:29:29 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm53xx_machdep.c,v 1.8 2014/03/29 14:02:46 matt Exp $ */
+/*     $NetBSD: bcm53xx_machdep.c,v 1.9 2015/07/17 20:29:29 matt Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define IDM_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm53xx_machdep.c,v 1.8 2014/03/29 14:02:46 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm53xx_machdep.c,v 1.9 2015/07/17 20:29:29 matt Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_broadcom.h"
@@ -250,6 +250,20 @@
 #endif
        const bool bigmem_p = (memsize >> 20) > 256; 
 
+#ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
+       const bool mapallmem_p = true;
+#ifndef PMAP_NEED_ALLOC_POOLPAGE
+       if (memsize > KERNEL_VM_BASE - KERNEL_BASE) {
+               printf("%s: dropping RAM size from %luMB to %uMB\n",
+                  __func__, (unsigned long) (ram_size >> 20),
+                  (KERNEL_VM_BASE - KERNEL_BASE) >> 20);
+               memsize = KERNEL_VM_BASE - KERNEL_BASE;
+       }
+#endif
+#else
+       const bool mapallmem_p = false;
+#endif
+       KASSERT((armreg_pfr1_read() & ARM_PFR1_SEC_MASK) != 0);
        arm32_bootmem_init(KERN_VTOPHYS(KERNEL_BASE), memsize,
            (paddr_t)KERNEL_BASE_phys);
 
@@ -265,7 +279,8 @@
         * abtstack, undstack, kernelstack, msgbufphys will be set to point to
         * the memory that was allocated for them.
         */
-       arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0, devmap, true);
+       arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0, devmap,
+           mapallmem_p);
 
        cpu_reset_address = bcm53xx_system_reset;
        /* we've a specific device_register routine */



Home | Main Index | Thread Index | Old Index