2018-07-07 23:21:17 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 Synopsys
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2020-01-16 20:29:53 +08:00
|
|
|
#include <devicetree.h>
|
2018-07-07 23:21:17 +08:00
|
|
|
#include <soc.h>
|
|
|
|
#include <arch/arc/v2/mpu/arc_mpu.h>
|
|
|
|
#include <linker/linker-defs.h>
|
|
|
|
|
2019-08-01 14:25:50 +08:00
|
|
|
/*
|
|
|
|
* for secure firmware, MPU entries are only set up for secure world.
|
|
|
|
* All regions not listed here are shared by secure world and normal world.
|
|
|
|
*/
|
2018-07-07 23:21:17 +08:00
|
|
|
static struct arc_mpu_region mpu_regions[] = {
|
2018-11-13 22:15:23 +08:00
|
|
|
#if DT_ICCM_SIZE > 0
|
2018-07-07 23:21:17 +08:00
|
|
|
/* Region ICCM */
|
|
|
|
MPU_REGION_ENTRY("ICCM",
|
2018-11-13 22:15:23 +08:00
|
|
|
DT_ICCM_BASE_ADDRESS,
|
|
|
|
DT_ICCM_SIZE * 1024,
|
2019-03-05 10:29:16 +08:00
|
|
|
REGION_ROM_ATTR),
|
2018-07-07 23:21:17 +08:00
|
|
|
#endif
|
2018-11-13 22:15:23 +08:00
|
|
|
#if DT_DCCM_SIZE > 0
|
2018-07-07 23:21:17 +08:00
|
|
|
/* Region DCCM */
|
|
|
|
MPU_REGION_ENTRY("DCCM",
|
2018-11-13 22:15:23 +08:00
|
|
|
DT_DCCM_BASE_ADDRESS,
|
|
|
|
DT_DCCM_SIZE * 1024,
|
2019-03-05 10:29:16 +08:00
|
|
|
REGION_KERNEL_RAM_ATTR | REGION_DYNAMIC),
|
2018-07-07 23:21:17 +08:00
|
|
|
#endif
|
2019-08-01 14:25:50 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Region peripheral is shared by secure world and normal world by default,
|
|
|
|
* no need a static mpu entry. If some peripherals belong to secure world,
|
|
|
|
* add it here.
|
|
|
|
*/
|
|
|
|
#ifndef CONFIG_ARC_SECURE_FIRMWARE
|
2018-07-07 23:21:17 +08:00
|
|
|
/* Region Peripheral */
|
|
|
|
MPU_REGION_ENTRY("PERIPHERAL",
|
|
|
|
0xF0000000,
|
|
|
|
64 * 1024,
|
2019-03-05 10:29:16 +08:00
|
|
|
REGION_KERNEL_RAM_ATTR),
|
2019-08-01 14:25:50 +08:00
|
|
|
#endif
|
2018-07-07 23:21:17 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct arc_mpu_config mpu_config = {
|
|
|
|
.num_regions = ARRAY_SIZE(mpu_regions),
|
|
|
|
.mpu_regions = mpu_regions,
|
|
|
|
};
|