* Add option MEMSIZE_RESERVED to reserves memory for Cortex-M4 area

* change KERNEL_BASE from 0x80008000 to 0x82000000
This commit is contained in:
ryo 2016-10-17 10:36:56 +00:00
parent 68069712b5
commit 6ee745045e
4 changed files with 16 additions and 7 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: files.imx7,v 1.1 2016/05/17 06:44:45 ryo Exp $
# $NetBSD: files.imx7,v 1.2 2016/10/17 10:36:56 ryo Exp $
#
# Configuration info for the Freescale i.MX7
#
@ -7,6 +7,7 @@ include "arch/arm/pic/files.pic"
include "arch/arm/cortex/files.cortex"
defparam opt_imx.h MEMSIZE
defparam opt_imx.h MEMSIZE_RESERVED
defflag opt_imx.h IMX7
file arch/arm/arm32/arm32_boot.c

View File

@ -1,4 +1,4 @@
# $NetBSD: ARMADILLO-IOT-G3,v 1.2 2016/08/07 10:44:05 christos Exp $
# $NetBSD: ARMADILLO-IOT-G3,v 1.3 2016/10/17 10:36:56 ryo Exp $
#
# ARMADILLO-IOT-G3 -- Atmark Techno, Armadillo-IoT G3
#
@ -22,6 +22,7 @@ options MULTIPROCESSOR
options PMAPCOUNTERS
options MEMSIZE=512
options MEMSIZE_RESERVED=32 # only reserved 32M for Cortex-M4 core
# Standard system options

View File

@ -1,4 +1,4 @@
# $NetBSD: std.imx7,v 1.1 2016/05/17 06:44:46 ryo Exp $
# $NetBSD: std.imx7,v 1.2 2016/10/17 10:36:56 ryo Exp $
#
# standard NetBSD/evbarm options for i.MX7 board
@ -25,8 +25,8 @@ options CORTEX_PMC
options CORTEX_PMC_CCNT_HZ=792000000
options KERNEL_BASE_EXT=0x80000000
makeoptions KERNEL_BASE_PHYS="0x80008000"
makeoptions KERNEL_BASE_VIRT="0x80008000"
makeoptions KERNEL_BASE_PHYS="0x82000000"
makeoptions KERNEL_BASE_VIRT="0x82000000"
makeoptions BOARDMKFRAG="${THISARM}/conf/mk.imx7"
makeoptions CPPFLAGS+="-I$S/../../../include"

View File

@ -1,4 +1,4 @@
/* $NetBSD: imx7_machdep.c,v 1.3 2016/05/30 17:43:46 dholland Exp $ */
/* $NetBSD: imx7_machdep.c,v 1.4 2016/10/17 10:36:57 ryo Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: imx7_machdep.c,v 1.3 2016/05/30 17:43:46 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: imx7_machdep.c,v 1.4 2016/10/17 10:36:57 ryo Exp $");
#include "opt_evbarm_boardtype.h"
#include "opt_arm_debug.h"
@ -220,7 +220,14 @@ initarm(void *arg)
#endif
bootconfig.dramblocks = 1;
#ifdef MEMSIZE_RESERVED
/* reserved for Cortex-M4 core */
memsize -= MEMSIZE_RESERVED * 1024 * 1024;
bootconfig.dram[0].address = KERN_VTOPHYS(KERNEL_BASE) +
MEMSIZE_RESERVED * 1024 * 1024;
#else
bootconfig.dram[0].address = KERN_VTOPHYS(KERNEL_BASE);
#endif
bootconfig.dram[0].pages = memsize / PAGE_SIZE;
#ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS