2018-11-16 12:10:55 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Synopsys
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2020-01-16 20:29:53 +08:00
|
|
|
#include <devicetree.h>
|
2018-11-16 12:10:55 +08:00
|
|
|
#include <soc.h>
|
|
|
|
#include <arch/arc/v2/mpu/arc_mpu.h>
|
|
|
|
#include <linker/linker-defs.h>
|
|
|
|
|
|
|
|
static struct arc_mpu_region mpu_regions[] = {
|
|
|
|
/* Region ICCM */
|
|
|
|
MPU_REGION_ENTRY("ICCM",
|
2020-04-30 22:34:04 +08:00
|
|
|
DT_REG_ADDR(DT_INST(0, arc_iccm)),
|
|
|
|
DT_REG_SIZE(DT_INST(0, arc_iccm)),
|
2019-03-05 10:29:16 +08:00
|
|
|
REGION_ROM_ATTR),
|
2018-11-16 12:10:55 +08:00
|
|
|
/* Region DCCM */
|
|
|
|
MPU_REGION_ENTRY("DCCM",
|
2020-04-30 22:34:04 +08:00
|
|
|
DT_REG_ADDR(DT_INST(0, arc_dccm)),
|
|
|
|
DT_REG_SIZE(DT_INST(0, arc_dccm)),
|
2019-03-05 10:29:16 +08:00
|
|
|
REGION_KERNEL_RAM_ATTR),
|
2018-11-16 12:10:55 +08:00
|
|
|
/* Region DDR RAM */
|
|
|
|
MPU_REGION_ENTRY("SRAM",
|
|
|
|
CONFIG_SRAM_BASE_ADDRESS,
|
|
|
|
CONFIG_SRAM_SIZE * 1024,
|
2019-03-05 10:29:16 +08:00
|
|
|
REGION_KERNEL_RAM_ATTR |
|
|
|
|
AUX_MPU_ATTR_KE | AUX_MPU_ATTR_UE),
|
2018-11-16 12:10:55 +08:00
|
|
|
MPU_REGION_ENTRY("FLASH_0",
|
|
|
|
CONFIG_FLASH_BASE_ADDRESS,
|
|
|
|
CONFIG_FLASH_SIZE * 1024,
|
2019-03-05 10:29:16 +08:00
|
|
|
REGION_ROM_ATTR),
|
2018-11-16 12:10:55 +08:00
|
|
|
/* Region Peripheral */
|
|
|
|
MPU_REGION_ENTRY("PERIPHERAL",
|
|
|
|
0xF0000000,
|
|
|
|
64 * 1024,
|
2019-03-05 10:29:16 +08:00
|
|
|
REGION_KERNEL_RAM_ATTR),
|
2018-11-16 12:10:55 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct arc_mpu_config mpu_config = {
|
|
|
|
.num_regions = ARRAY_SIZE(mpu_regions),
|
|
|
|
.mpu_regions = mpu_regions,
|
|
|
|
};
|