Module Name:    src
Committed By:   matt
Date:           Fri Jul 17 20:32:27 UTC 2015

Modified Files:
        src/sys/arch/evbarm/bcm53xx [matt-nb5-mips64]: bcm53xx_machdep.c

Log Message:
Deal with > 1GB of memory.


To generate a diff of this commit:
cvs rdiff -u -r1.7.4.3 -r1.7.4.4 \
    src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c
diff -u src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.3 src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.4
--- src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.3	Wed Mar 26 02:15:02 2014
+++ src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c	Fri Jul 17 20:32:27 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_machdep.c,v 1.7.4.3 2014/03/26 02:15:02 matt Exp $	*/
+/*	$NetBSD: bcm53xx_machdep.c,v 1.7.4.4 2015/07/17 20:32:27 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.7.4.3 2014/03/26 02:15:02 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm53xx_machdep.c,v 1.7.4.4 2015/07/17 20:32:27 matt Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_broadcom.h"
@@ -258,6 +258,20 @@ initarm(void *arg)
 #endif
 	const bool bigmem_p = (memsize >> PGSHIFT) > bp_first256.bp_pages;
 
+#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);
 
@@ -273,7 +287,8 @@ initarm(void *arg)
 	 * 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 */

Reply via email to