diff --git a/boards/arc/em_starterkit/Kconfig b/boards/arc/em_starterkit/Kconfig index 651608377e5..f9b0ebad44e 100644 --- a/boards/arc/em_starterkit/Kconfig +++ b/boards/arc/em_starterkit/Kconfig @@ -20,4 +20,4 @@ choice endchoice -endif +endif \ No newline at end of file diff --git a/boards/arc/em_starterkit/arc_mpu_regions.c b/boards/arc/em_starterkit/arc_mpu_regions.c index e75bbe5025c..1a76267e629 100644 --- a/boards/arc/em_starterkit/arc_mpu_regions.c +++ b/boards/arc/em_starterkit/arc_mpu_regions.c @@ -9,6 +9,10 @@ #include #include +/* + * 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. + */ static struct arc_mpu_region mpu_regions[] = { #if DT_ICCM_SIZE > 0 /* Region ICCM */ @@ -33,11 +37,19 @@ static struct arc_mpu_region mpu_regions[] = { AUX_MPU_ATTR_KW | AUX_MPU_ATTR_KR | AUX_MPU_ATTR_UR | AUX_MPU_ATTR_KE | AUX_MPU_ATTR_UE | REGION_DYNAMIC), #endif + +/* + * 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 /* Region Peripheral */ MPU_REGION_ENTRY("PERIPHERAL", 0xF0000000, 64 * 1024, - REGION_KERNEL_RAM_ATTR), + REGION_KERNEL_RAM_ATTR) +#endif }; struct arc_mpu_config mpu_config = { diff --git a/boards/arc/em_starterkit/em_starterkit_em7d_defconfig b/boards/arc/em_starterkit/em_starterkit_em7d_defconfig index 316aca2c399..33274adddf6 100644 --- a/boards/arc/em_starterkit/em_starterkit_em7d_defconfig +++ b/boards/arc/em_starterkit/em_starterkit_em7d_defconfig @@ -17,3 +17,5 @@ CONFIG_SERIAL=y CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_GPIO=y CONFIG_ARC_MPU_ENABLE=y +CONFIG_ARC_HAS_SECURE=y +CONFIG_TRUSTED_EXECUTION_SECURE=y diff --git a/boards/arc/em_starterkit/em_starterkit_em7d_normal.dts b/boards/arc/em_starterkit/em_starterkit_em7d_normal.dts new file mode 100644 index 00000000000..6e558253773 --- /dev/null +++ b/boards/arc/em_starterkit/em_starterkit_em7d_normal.dts @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018, Synopsys, Inc. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include +#include "em_starterkit_r23.dtsi" +#include "board.dtsi" + +/ { + model = "em_starterkit_em7d_normal"; + compatible = "snps,em_starterkit_em7d_normal", "snps,em_starterkit"; + + aliases { + uart-0 = &uart0; + uart-1 = &uart1; + uart-2 = &uart2; + }; + + chosen { + zephyr,sram = &ddr0; + zephyr,console = &uart1; + zephyr,shell-uart = &uart1; + }; + + iccm@0 { + reg = <0x20000 DT_SIZE_K(128)>; + }; + + dccm@80000000 { + reg = <0x80010000 DT_SIZE_K(64)>; + }; +}; + +&uart1 { + status = "okay"; + current-speed = <115200>; +}; diff --git a/boards/arc/em_starterkit/em_starterkit_em7d_normal.yaml b/boards/arc/em_starterkit/em_starterkit_em7d_normal.yaml new file mode 100644 index 00000000000..24e1ffa8ad3 --- /dev/null +++ b/boards/arc/em_starterkit/em_starterkit_em7d_normal.yaml @@ -0,0 +1,18 @@ +identifier: em_starterkit_em7d_normal +name: EM Starterkit EM7D normal world +type: mcu +arch: arc +toolchain: + - zephyr + - xtools +supported: + - i2c + - spi + - gpio +ram: 64 +flash: 128 +testing: + default: true + ignore_tags: + - net + - bluetooth diff --git a/boards/arc/em_starterkit/em_starterkit_em7d_normal_defconfig b/boards/arc/em_starterkit/em_starterkit_em7d_normal_defconfig new file mode 100644 index 00000000000..228dc1f0321 --- /dev/null +++ b/boards/arc/em_starterkit/em_starterkit_em7d_normal_defconfig @@ -0,0 +1,18 @@ +CONFIG_ARC=y +CONFIG_SOC_EMSK=y +CONFIG_SOC_EMSK_EM7D=y +CONFIG_BOARD_EM_STARTERKIT=y +CONFIG_BOARD_EM_STARTERKIT_R23=y +CONFIG_SYS_CLOCK_TICKS_PER_SEC=100 +CONFIG_XIP=n +CONFIG_BUILD_OUTPUT_BIN=n +CONFIG_PRINTK=y +CONFIG_ARCV2_INTERRUPT_UNIT=y +CONFIG_ARCV2_TIMER=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y +CONFIG_GPIO=y +CONFIG_ARC_MPU_ENABLE=y +CONFIG_TRUSTED_EXECUTION_NONSECURE=y diff --git a/soc/arc/snps_emsk/Kconfig b/soc/arc/snps_emsk/Kconfig index cac4fa0f9d4..8de3836f097 100644 --- a/soc/arc/snps_emsk/Kconfig +++ b/soc/arc/snps_emsk/Kconfig @@ -14,7 +14,6 @@ default SOC_EMSK_EM7D config SOC_EMSK_EM7D bool "Synopsys ARC EM7D of EMSK" select CPU_HAS_MPU - select ARC_HAS_SECURE if BOARD_EM_STARTERKIT_R23 config SOC_EMSK_EM11D bool "Synopsys ARC EM11D of EMSK" diff --git a/soc/arc/snps_emsk/Kconfig.soc b/soc/arc/snps_emsk/Kconfig.soc index fcbe59a7c02..00269c6e1fa 100644 --- a/soc/arc/snps_emsk/Kconfig.soc +++ b/soc/arc/snps_emsk/Kconfig.soc @@ -7,5 +7,5 @@ config SOC_EMSK bool "Synopsys ARC EM Starter Kit SoC" - select HAS_I2C_DW - select HAS_SPI_DW + select HAS_I2C_DW if I2C + select HAS_SPI_DW if SPI