Skip to content

Commit 5bb1f4f

Browse files
Wayne Renioannisg
authored andcommitted
boards: emsk: add initial support of normal/non-secure application
* Non-secure/normal application: em_starterkit_em7d_normal * secure application: em_starterkit_em7d Signed-off-by: Wayne Ren <[email protected]>
1 parent cca3920 commit 5bb1f4f

File tree

8 files changed

+96
-5
lines changed

8 files changed

+96
-5
lines changed

boards/arc/em_starterkit/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ choice
2020

2121
endchoice
2222

23-
endif
23+
endif

boards/arc/em_starterkit/arc_mpu_regions.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
#include <arch/arc/v2/mpu/arc_mpu.h>
1010
#include <linker/linker-defs.h>
1111

12+
/*
13+
* for secure firmware, MPU entries are only set up for secure world.
14+
* All regions not listed here are shared by secure world and normal world.
15+
*/
1216
static struct arc_mpu_region mpu_regions[] = {
1317
#if DT_ICCM_SIZE > 0
1418
/* Region ICCM */
@@ -33,11 +37,19 @@ static struct arc_mpu_region mpu_regions[] = {
3337
AUX_MPU_ATTR_KW | AUX_MPU_ATTR_KR | AUX_MPU_ATTR_UR |
3438
AUX_MPU_ATTR_KE | AUX_MPU_ATTR_UE | REGION_DYNAMIC),
3539
#endif
40+
41+
/*
42+
* Region peripheral is shared by secure world and normal world by default,
43+
* no need a static mpu entry. If some peripherals belong to secure world,
44+
* add it here.
45+
*/
46+
#ifndef CONFIG_ARC_SECURE_FIRMWARE
3647
/* Region Peripheral */
3748
MPU_REGION_ENTRY("PERIPHERAL",
3849
0xF0000000,
3950
64 * 1024,
40-
REGION_KERNEL_RAM_ATTR),
51+
REGION_KERNEL_RAM_ATTR)
52+
#endif
4153
};
4254

4355
struct arc_mpu_config mpu_config = {

boards/arc/em_starterkit/em_starterkit_em7d_defconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ CONFIG_SERIAL=y
1717
CONFIG_UART_INTERRUPT_DRIVEN=y
1818
CONFIG_GPIO=y
1919
CONFIG_ARC_MPU_ENABLE=y
20+
CONFIG_ARC_HAS_SECURE=y
21+
CONFIG_TRUSTED_EXECUTION_SECURE=y
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright (c) 2018, Synopsys, Inc. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <mem.h>
10+
#include <emsk.dtsi>
11+
#include "em_starterkit_r23.dtsi"
12+
#include "board.dtsi"
13+
14+
/ {
15+
model = "em_starterkit_em7d_normal";
16+
compatible = "snps,em_starterkit_em7d_normal", "snps,em_starterkit";
17+
18+
aliases {
19+
uart-0 = &uart0;
20+
uart-1 = &uart1;
21+
uart-2 = &uart2;
22+
};
23+
24+
chosen {
25+
zephyr,sram = &ddr0;
26+
zephyr,console = &uart1;
27+
zephyr,shell-uart = &uart1;
28+
};
29+
30+
iccm@0 {
31+
reg = <0x20000 DT_SIZE_K(128)>;
32+
};
33+
34+
dccm@80000000 {
35+
reg = <0x80010000 DT_SIZE_K(64)>;
36+
};
37+
};
38+
39+
&uart1 {
40+
status = "okay";
41+
current-speed = <115200>;
42+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
identifier: em_starterkit_em7d_normal
2+
name: EM Starterkit EM7D normal world
3+
type: mcu
4+
arch: arc
5+
toolchain:
6+
- zephyr
7+
- xtools
8+
supported:
9+
- i2c
10+
- spi
11+
- gpio
12+
ram: 64
13+
flash: 128
14+
testing:
15+
default: true
16+
ignore_tags:
17+
- net
18+
- bluetooth
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
CONFIG_ARC=y
2+
CONFIG_SOC_EMSK=y
3+
CONFIG_SOC_EMSK_EM7D=y
4+
CONFIG_BOARD_EM_STARTERKIT=y
5+
CONFIG_BOARD_EM_STARTERKIT_R23=y
6+
CONFIG_SYS_CLOCK_TICKS_PER_SEC=100
7+
CONFIG_XIP=n
8+
CONFIG_BUILD_OUTPUT_BIN=n
9+
CONFIG_PRINTK=y
10+
CONFIG_ARCV2_INTERRUPT_UNIT=y
11+
CONFIG_ARCV2_TIMER=y
12+
CONFIG_CONSOLE=y
13+
CONFIG_UART_CONSOLE=y
14+
CONFIG_SERIAL=y
15+
CONFIG_UART_INTERRUPT_DRIVEN=y
16+
CONFIG_GPIO=y
17+
CONFIG_ARC_MPU_ENABLE=y
18+
CONFIG_TRUSTED_EXECUTION_NONSECURE=y

soc/arc/snps_emsk/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ default SOC_EMSK_EM7D
1414
config SOC_EMSK_EM7D
1515
bool "Synopsys ARC EM7D of EMSK"
1616
select CPU_HAS_MPU
17-
select ARC_HAS_SECURE if BOARD_EM_STARTERKIT_R23
1817

1918
config SOC_EMSK_EM11D
2019
bool "Synopsys ARC EM11D of EMSK"

soc/arc/snps_emsk/Kconfig.soc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77

88
config SOC_EMSK
99
bool "Synopsys ARC EM Starter Kit SoC"
10-
select HAS_I2C_DW
11-
select HAS_SPI_DW
10+
select HAS_I2C_DW if I2C
11+
select HAS_SPI_DW if SPI

0 commit comments

Comments
 (0)