Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xtensa: add sample_controller32 SoC and qemu_xtensa/sample_controller32/mpu board #71893

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions boards/deprecated.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,9 @@ set(qemu_x86_virt_DEPRECATED
set(qemu_x86_xip_DEPRECATED
qemu_x86/atom/xip
)
set(qemu_xtensa_DEPRECATED
qemu_xtensa/dc233c
)
set(qemu_xtensa_mmu_DEPRECATED
qemu_xtensa/dc233c/mmu
)
Expand Down
1 change: 1 addition & 0 deletions boards/qemu/xtensa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ config BOARD_QEMU_XTENSA
select QEMU_TARGET
select ARCH_SUPPORTS_COREDUMP
select XTENSA_MMU if BOARD_QEMU_XTENSA_DC233C_MMU
select XTENSA_MPU if BOARD_QEMU_XTENSA_SAMPLE_CONTROLLER32_MPU
3 changes: 2 additions & 1 deletion boards/qemu/xtensa/Kconfig.qemu_xtensa
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
# SPDX-License-Identifier: Apache-2.0

config BOARD_QEMU_XTENSA
select SOC_XTENSA_DC233C
select SOC_XTENSA_SAMPLE_CONTROLLER32 if BOARD_QEMU_XTENSA_SAMPLE_CONTROLLER32_MPU
select SOC_XTENSA_DC233C if !BOARD_QEMU_XTENSA_SAMPLE_CONTROLLER32_MPU
4 changes: 2 additions & 2 deletions boards/qemu/xtensa/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
set(SUPPORTED_EMU_PLATFORMS qemu)

if(CONFIG_BOARD_QEMU_XTENSA)
set(QEMU_CPU_TYPE_${ARCH} dc233c)
set(QEMU_CPU_TYPE_${ARCH} ${CONFIG_SOC})

set(QEMU_FLAGS_${ARCH}
-machine sim -semihosting -nographic -cpu dc233c
-machine sim -semihosting -nographic -cpu ${CONFIG_SOC}
)
endif()

Expand Down
3 changes: 3 additions & 0 deletions boards/qemu/xtensa/board.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ board:
- name: dc233c
variants:
- name: mmu
- name: sample_controller32
variants:
- name: mpu
2 changes: 1 addition & 1 deletion boards/qemu/xtensa/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ emulated environment, for example, with the :zephyr:code-sample:`synchronization
.. zephyr-app-commands::
:zephyr-app: samples/synchronization
:host-os: unix
:board: qemu_xtensa
:board: qemu_xtensa/dc233c
:goals: run

This will build an image with the synchronization sample app, boot it using
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
identifier: qemu_xtensa
identifier: qemu_xtensa/dc233c
name: QEMU Emulation for Xtensa
type: qemu
simulation: qemu
Expand Down
22 changes: 22 additions & 0 deletions boards/qemu/xtensa/qemu_xtensa_sample_controller32_mpu.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2019, 2023 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include "sample_controller32.dtsi"

/ {
model = "qemu_xtensa_mpu";
compatible = "cdns,xtensa-sample-controller32";

chosen {
zephyr,sram = &sram0;
};
};

&cpu0 {
clock-frequency = <10000000>;
};
10 changes: 10 additions & 0 deletions boards/qemu/xtensa/qemu_xtensa_sample_controller32_mpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
identifier: qemu_xtensa/sample_controller32/mpu
name: QEMU Emulation for Xtensa with MPU
type: qemu
simulation: qemu
arch: xtensa
testing:
default: true
ignore_tags:
- net
- bluetooth
11 changes: 11 additions & 0 deletions boards/qemu/xtensa/qemu_xtensa_sample_controller32_mpu_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-License-Identifier: Apache-2.0

CONFIG_MAIN_STACK_SIZE=2048
CONFIG_CONSOLE=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=10000000
CONFIG_STACK_SENTINEL=y
CONFIG_GEN_ISR_TABLES=y
CONFIG_GEN_IRQ_VECTOR_TABLE=n
CONFIG_SIMULATOR_XTENSA=y
CONFIG_QEMU_ICOUNT_SHIFT=6
CONFIG_PRIVILEGED_STACK_SIZE=4096
2 changes: 2 additions & 0 deletions doc/releases/migration-guide-4.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Boards
* STM32WBA: The command used for fetching blobs required to build ble applications is now
``west blobs fetch hal_stm32`` instead of ``west blobs fetch stm32``.

* Board ``qemu_xtensa`` is deprecated. Use ``qemu_xtensa/dc233c`` instead.

STM32
=====

Expand Down
40 changes: 40 additions & 0 deletions dts/xtensa/sample_controller32.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2019 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "skeleton.dtsi"

/ {
cpus {
#address-cells = <1>;
#size-cells = <0>;

cpu0: cpu@0 {
device_type = "cpu";
compatible = "sample_controller";
reg = <0>;
};
};

sram0: memory@60000000 {
device_type = "memory";
compatible = "mmio-sram";
reg = <0x60000000 0x4000000>;
};

srom0: memory@fe000000 {
device_type = "memory";
compatible = "mmio-sram";
reg = <0x50000000 0x1000000>;
};

soc {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
ranges;

};
};
4 changes: 2 additions & 2 deletions samples/subsys/llext/modules/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Building and running

.. zephyr-app-commands::
:zephyr-app: samples/subsys/llext/modules
:board: qemu_xtensa
:board: qemu_xtensa/dc233c
:goals: build run
:compact:

Expand All @@ -50,7 +50,7 @@ Building and running

.. zephyr-app-commands::
:zephyr-app: samples/subsys/llext/modules
:board: qemu_xtensa
:board: qemu_xtensa/dc233c
:goals: build run
:west-args: -T sample.llext.modules.module_build
:compact:
Expand Down
4 changes: 2 additions & 2 deletions samples/subsys/llext/modules/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ common:
- qemu_cortex_a53 # ARM Cortex-A53 (ARMv8-A ISA)
- mps2/an385 # ARM Cortex-M3 (ARMv7-M ISA)
- mps2/an521/cpu0 # ARM Cortex-M33 (ARMv8-M ISA)
- qemu_xtensa
- qemu_xtensa/dc233c
integration_platforms:
- qemu_xtensa
- qemu_xtensa/dc233c
- mps2/an385
- qemu_cortex_a53
harness: console
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ osSemaphoreId forks[NUM_PHIL];
#define fork(x) (forks[x])

/*
* CMSIS limits the stack size, but qemu_x86_64, qemu_xtensa,
* CMSIS limits the stack size, but qemu_x86_64, qemu_xtensa (all),
* qemu_leon3 and the boards such as up_squared, intel_ehl_crb,
* acrn_ehl_crb need 1024 to run this.
* For other arch and boards suggested stack size is 512.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ common:
min_ram: 32
min_flash: 34
platform_exclude:
- qemu_xtensa
- qemu_xtensa/dc233c
- qemu_x86_64
harness: console
harness_config:
Expand Down
7 changes: 7 additions & 0 deletions soc/cdns/sample_controller32/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_include_directories(include)

zephyr_library_sources_ifdef(CONFIG_XTENSA_MPU mpu.c)

set(SOC_LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/include/xtensa-sample-controller32.ld CACHE INTERNAL "")
9 changes: 9 additions & 0 deletions soc/cdns/sample_controller32/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

config SOC_XTENSA_SAMPLE_CONTROLLER32
select XTENSA
select XTENSA_HAL
select ATOMIC_OPERATIONS_C
select CPU_HAS_MPU
select ARCH_HAS_USERSPACE if XTENSA_MPU
12 changes: 12 additions & 0 deletions soc/cdns/sample_controller32/Kconfig.soc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

config SOC_XTENSA_SAMPLE_CONTROLLER32
bool

config SOC
default "sample_controller32" if SOC_XTENSA_SAMPLE_CONTROLLER32

config SOC_TOOLCHAIN_NAME
string
default "sample_controller32" if SOC_XTENSA_SAMPLE_CONTROLLER32
Loading
Loading