From cde9f4f41fd0fbdc740dbec91ed6848f0f6aa1b7 Mon Sep 17 00:00:00 2001 From: Haojian Zhuang Date: Sun, 28 Jan 2018 23:00:15 +0800 Subject: [PATCH] hikey: fix memory overlapped in memory map MAP_TSP_MEM could be either in SRAM or DRAM. When MAP_TSP_MEM is in DRAM, it's overlapped with MAP_DDR. Since MAP_OPTEE_PAGEABLE isn't used in SRAM case, just remove it. Signed-off-by: Haojian Zhuang --- plat/hisilicon/hikey/aarch64/hikey_common.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/plat/hisilicon/hikey/aarch64/hikey_common.c b/plat/hisilicon/hikey/aarch64/hikey_common.c index d5b63cc6e..448857c28 100644 --- a/plat/hisilicon/hikey/aarch64/hikey_common.c +++ b/plat/hisilicon/hikey/aarch64/hikey_common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -17,7 +17,7 @@ #include "../hikey_def.h" #define MAP_DDR MAP_REGION_FLAT(DDR_BASE, \ - DDR_SIZE, \ + DDR_SIZE - DDR_SEC_SIZE, \ MT_DEVICE | MT_RW | MT_NS) #define MAP_DEVICE MAP_REGION_FLAT(DEVICE_BASE, \ @@ -28,15 +28,6 @@ TSP_SEC_MEM_SIZE, \ MT_MEMORY | MT_RW | MT_SECURE) -#if LOAD_IMAGE_V2 -#ifdef SPD_opteed -#define MAP_OPTEE_PAGEABLE MAP_REGION_FLAT( \ - HIKEY_OPTEE_PAGEABLE_LOAD_BASE, \ - HIKEY_OPTEE_PAGEABLE_LOAD_SIZE, \ - MT_MEMORY | MT_RW | MT_SECURE) -#endif -#endif - #define MAP_ROM_PARAM MAP_REGION_FLAT(XG2RAM0_BASE, \ BL1_XG2RAM0_OFFSET, \ MT_DEVICE | MT_RO | MT_SECURE) @@ -73,11 +64,6 @@ static const mmap_region_t hikey_mmap[] = { MAP_DDR, MAP_DEVICE, MAP_TSP_MEM, -#if LOAD_IMAGE_V2 -#ifdef SPD_opteed - MAP_OPTEE_PAGEABLE, -#endif -#endif {0} }; #endif