Module Name:    src
Committed By:   ryo
Date:           Mon Jun  1 10:10:56 UTC 2015

Modified Files:
        src/sys/arch/arm/imx: imx6_board.c

Log Message:
Limit the maximum size of memory to 3840Mbyte for 4G memory board (NITROGEN6MAX)
constrained by memory layout of i.MX6 SoC.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imx6_board.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/arm/imx/imx6_board.c
diff -u src/sys/arch/arm/imx/imx6_board.c:1.3 src/sys/arch/arm/imx/imx6_board.c:1.4
--- src/sys/arch/arm/imx/imx6_board.c:1.3	Fri Jan  9 09:50:46 2015
+++ src/sys/arch/arm/imx/imx6_board.c	Mon Jun  1 10:10:56 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_board.c,v 1.3 2015/01/09 09:50:46 ryo Exp $	*/
+/*	$NetBSD: imx6_board.c,v 1.4 2015/06/01 10:10:56 ryo Exp $	*/
 
 /*
  * Copyright (c) 2012  Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: imx6_board.c,v 1.3 2015/01/09 09:50:46 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: imx6_board.c,v 1.4 2015/06/01 10:10:56 ryo Exp $");
 
 #include "opt_imx.h"
 #include "arml2cc.h"
@@ -144,6 +144,16 @@ imx6_memprobe(void)
 	bitwidth += __SHIFTOUT(ctrl, MMDC1_MDCTL_SDE_1);
 	bitwidth += (misc & MMDC1_MDMISC_DDR_4_BANK) ? 2 : 3;
 
+	/* over 4GB ? limit 3840MB (SoC design limitation) */
+	if (bitwidth >= 32) {
+		/*
+		 * XXX: bus_dma and uvm cannot treat 0xffffffff as high address
+		 *      correctly because of 0xffffffff + 1 = 0x00000000.
+		 *      therefore use 0xffffefff.
+		 */
+		return (psize_t)IMX6_MEM_SIZE - PAGE_SIZE;
+	}
+
 	return (psize_t)1 << bitwidth;
 }
 

Reply via email to