Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/imx Limit the maximum size of memory to 3840Mby...



details:   https://anonhg.NetBSD.org/src/rev/dd44a8445f53
branches:  trunk
changeset: 338616:dd44a8445f53
user:      ryo <ryo%NetBSD.org@localhost>
date:      Mon Jun 01 10:10:56 2015 +0000

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

diffstat:

 sys/arch/arm/imx/imx6_board.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 2afc60c3ecbf -r dd44a8445f53 sys/arch/arm/imx/imx6_board.c
--- a/sys/arch/arm/imx/imx6_board.c     Mon Jun 01 09:49:36 2015 +0000
+++ b/sys/arch/arm/imx/imx6_board.c     Mon Jun 01 10:10:56 2015 +0000
@@ -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 @@
        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;
 }
 



Home | Main Index | Thread Index | Old Index