From c9da9647526ba96aa1c8caaaf002b3381ed1c8e5 Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Fri, 6 Dec 2019 10:42:26 +0100 Subject: [PATCH] soc: arm: silabs: remove custom fixed MPU region definition We remove the custom fixed MPU region definition from Silicon Labs exx32 SoC definitions, as the common fixed MPU region definition is now used. Signed-off-by: Ioannis Glaropoulos --- soc/arm/silabs_exx32/common/CMakeLists.txt | 2 - soc/arm/silabs_exx32/common/arm_mpu_mem_cfg.h | 55 ------------------- soc/arm/silabs_exx32/common/arm_mpu_regions.c | 33 ----------- 3 files changed, 90 deletions(-) delete mode 100644 soc/arm/silabs_exx32/common/arm_mpu_mem_cfg.h delete mode 100644 soc/arm/silabs_exx32/common/arm_mpu_regions.c diff --git a/soc/arm/silabs_exx32/common/CMakeLists.txt b/soc/arm/silabs_exx32/common/CMakeLists.txt index 4faeb491893..0436151c4cb 100644 --- a/soc/arm/silabs_exx32/common/CMakeLists.txt +++ b/soc/arm/silabs_exx32/common/CMakeLists.txt @@ -3,5 +3,3 @@ zephyr_sources(soc.c soc_gpio.c) zephyr_sources_ifdef(CONFIG_SYS_POWER_MANAGEMENT soc_power.c) - -zephyr_sources_ifdef(CONFIG_ARM_MPU arm_mpu_regions.c) diff --git a/soc/arm/silabs_exx32/common/arm_mpu_mem_cfg.h b/soc/arm/silabs_exx32/common/arm_mpu_mem_cfg.h deleted file mode 100644 index 67d78723716..00000000000 --- a/soc/arm/silabs_exx32/common/arm_mpu_mem_cfg.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2017 Linaro Limited. - * Copyright (c) 2019 Christian Taedcke - * - * SPDX-License-Identifier: Apache-2.0 - */ -#ifndef _ARM_MPU_MEM_CFG_H_ -#define _ARM_MPU_MEM_CFG_H_ - -#include -#include - -/* Flash Region Definitions */ -#if CONFIG_FLASH_SIZE == 64 -#define REGION_FLASH_SIZE REGION_64K -#elif CONFIG_FLASH_SIZE == 128 -#define REGION_FLASH_SIZE REGION_128K -#elif CONFIG_FLASH_SIZE == 256 -#define REGION_FLASH_SIZE REGION_256K -#elif CONFIG_FLASH_SIZE == 512 -#define REGION_FLASH_SIZE REGION_512K -#elif CONFIG_FLASH_SIZE == 1024 -#define REGION_FLASH_SIZE REGION_1M -#elif CONFIG_FLASH_SIZE == 2048 -#define REGION_FLASH_SIZE REGION_2M -#else -#error "Unsupported configuration" -#endif - -/* SRAM Region Definitions */ -#if CONFIG_SRAM_SIZE == 16 -#define REGION_SRAM_0_SIZE REGION_16K -#elif CONFIG_SRAM_SIZE == 32 -#define REGION_SRAM_0_SIZE REGION_32K -#elif CONFIG_SRAM_SIZE == 64 -#define REGION_SRAM_0_SIZE REGION_64K -#elif CONFIG_SRAM_SIZE == 128 -#define REGION_SRAM_0_SIZE REGION_128K -#elif CONFIG_SRAM_SIZE == 192 -#define REGION_SRAM_0_SIZE REGION_128K -#define REGION_SRAM_1_START 0x20000 -#define REGION_SRAM_1_SIZE REGION_64K -#elif CONFIG_SRAM_SIZE == 256 -#define REGION_SRAM_0_SIZE REGION_256K -#elif CONFIG_SRAM_SIZE == 384 -#define REGION_SRAM_0_SIZE REGION_256K -#define REGION_SRAM_1_START 0x40000 -#define REGION_SRAM_1_SIZE REGION_128K -#elif CONFIG_SRAM_SIZE == 512 -#define REGION_SRAM_0_SIZE REGION_512K -#else -#error "Unsupported configuration" -#endif - -#endif /* _ARM_MPU_MEM_CFG_H_ */ diff --git a/soc/arm/silabs_exx32/common/arm_mpu_regions.c b/soc/arm/silabs_exx32/common/arm_mpu_regions.c deleted file mode 100644 index da9d998f396..00000000000 --- a/soc/arm/silabs_exx32/common/arm_mpu_regions.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2017 Linaro Limited. - * Copyright (c) 2019 Christian Taedcke - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -#include "arm_mpu_mem_cfg.h" - -static const struct arm_mpu_region mpu_regions[] = { - /* Region 0 */ - MPU_REGION_ENTRY("FLASH_0", - CONFIG_FLASH_BASE_ADDRESS, - REGION_FLASH_ATTR(REGION_FLASH_SIZE)), - /* Region 1 */ - MPU_REGION_ENTRY("RAM_0", - CONFIG_SRAM_BASE_ADDRESS, - REGION_RAM_ATTR(REGION_SRAM_0_SIZE)), - /* Region 2 */ -#ifdef REGION_SRAM_1_SIZE - MPU_REGION_ENTRY("RAM_1", - (CONFIG_SRAM_BASE_ADDRESS + REGION_SRAM_1_START), - REGION_RAM_ATTR(REGION_SRAM_1_SIZE)), -#endif -}; - -const struct arm_mpu_config mpu_config = { - .num_regions = ARRAY_SIZE(mpu_regions), - .mpu_regions = mpu_regions, -};