Skip to content

Commit 907a3bf

Browse files
dcpleungaescolar
authored andcommitted
boards: add qemu_xtensa/sample_controller32/mpu
This adds the necessary bit to enable testing Xtensa MPU on QEMU. Signed-off-by: Daniel Leung <[email protected]>
1 parent d0e2a62 commit 907a3bf

File tree

7 files changed

+51
-3
lines changed

7 files changed

+51
-3
lines changed

boards/qemu/xtensa/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ config BOARD_QEMU_XTENSA
77
select QEMU_TARGET
88
select ARCH_SUPPORTS_COREDUMP
99
select XTENSA_MMU if BOARD_QEMU_XTENSA_DC233C_MMU
10+
select XTENSA_MPU if BOARD_QEMU_XTENSA_SAMPLE_CONTROLLER32_MPU

boards/qemu/xtensa/Kconfig.qemu_xtensa

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
# SPDX-License-Identifier: Apache-2.0
55

66
config BOARD_QEMU_XTENSA
7-
select SOC_XTENSA_DC233C
7+
select SOC_XTENSA_SAMPLE_CONTROLLER32 if BOARD_QEMU_XTENSA_SAMPLE_CONTROLLER32_MPU
8+
select SOC_XTENSA_DC233C if !BOARD_QEMU_XTENSA_SAMPLE_CONTROLLER32_MPU

boards/qemu/xtensa/board.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
set(SUPPORTED_EMU_PLATFORMS qemu)
44

55
if(CONFIG_BOARD_QEMU_XTENSA)
6-
set(QEMU_CPU_TYPE_${ARCH} dc233c)
6+
set(QEMU_CPU_TYPE_${ARCH} ${CONFIG_SOC})
77

88
set(QEMU_FLAGS_${ARCH}
9-
-machine sim -semihosting -nographic -cpu dc233c
9+
-machine sim -semihosting -nographic -cpu ${CONFIG_SOC}
1010
)
1111
endif()
1212

boards/qemu/xtensa/board.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ board:
55
- name: dc233c
66
variants:
77
- name: mmu
8+
- name: sample_controller32
9+
variants:
10+
- name: mpu
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2019, 2023 Intel Corporation.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include "sample_controller32.dtsi"
10+
11+
/ {
12+
model = "qemu_xtensa_mpu";
13+
compatible = "cdns,xtensa-sample-controller32";
14+
15+
chosen {
16+
zephyr,sram = &sram0;
17+
};
18+
};
19+
20+
&cpu0 {
21+
clock-frequency = <10000000>;
22+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
identifier: qemu_xtensa/sample_controller32/mpu
2+
name: QEMU Emulation for Xtensa with MPU
3+
type: qemu
4+
simulation: qemu
5+
arch: xtensa
6+
testing:
7+
default: true
8+
ignore_tags:
9+
- net
10+
- bluetooth
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
CONFIG_MAIN_STACK_SIZE=2048
4+
CONFIG_CONSOLE=y
5+
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=10000000
6+
CONFIG_STACK_SENTINEL=y
7+
CONFIG_GEN_ISR_TABLES=y
8+
CONFIG_GEN_IRQ_VECTOR_TABLE=n
9+
CONFIG_SIMULATOR_XTENSA=y
10+
CONFIG_QEMU_ICOUNT_SHIFT=6
11+
CONFIG_PRIVILEGED_STACK_SIZE=4096

0 commit comments

Comments
 (0)