Repository navigation
BACKPORT: arch: arm: cortex_m: add ARMV8_M_CDE_CP0 option #260
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
base: v4.4.0-ti-next
Are you sure you want to change the base?
Changes from all commits
3120bb4
988298e
77a400d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| config SOC_AM13E23019 | ||
| select ARM | ||
| select ARMV8_M_DSP | ||
| select ARMV8_M_CDE_CP0 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Cde applications fault on am13 SOC_AM13E23019 selects ARMV8_M_CDE_CP0, but AM13 startup does not enable CP0 access in the coprocessor access control register. After reset, an application that uses the newly enabled CDE intrinsics can execute a CP0 instruction while access remains disabled. Agent Prompt
|
||
| select BUILD_OUTPUT_BIN | ||
| select BUILD_OUTPUT_HEX | ||
| select CPU_CORTEX_M33 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| cmake_minimum_required(VERSION 3.28.0) | ||
|
|
||
| find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
| project(arm_cde_cp0) | ||
|
|
||
| target_sources(app PRIVATE src/main.c) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Copyright (c) 2026 Texas Instruments Incorporated | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # ARMV8_M_CDE_CP0 is normally selected by the SoC. Select it here so that the | ||
| # option can be exercised on any Armv8-M Mainline target. | ||
| config TEST_ARM_CDE_CP0 | ||
| bool "Build with the CDE coprocessor on CP0 enabled" | ||
| default y | ||
| depends on ARMV8_M_MAINLINE | ||
| select ARMV8_M_CDE_CP0 | ||
|
|
||
| source "Kconfig.zephyr" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /* | ||
| * Copyright (c) 2026 Texas Instruments Incorporated | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #include <zephyr/kernel.h> | ||
| #include <arm_cde.h> | ||
|
|
||
| /* | ||
| * Build-only check that CONFIG_ARMV8_M_CDE_CP0 makes the compiler accept CDE | ||
| * instructions on coprocessor 0. The code is never run, since whether CP0 is | ||
| * implemented and enabled depends on the SoC. | ||
| */ | ||
|
|
||
| #ifndef __ARM_FEATURE_CDE | ||
| #error "CDE is not enabled by the compiler flags" | ||
| #endif | ||
|
|
||
| #if !(__ARM_FEATURE_CDE_COPROC & BIT(0)) | ||
| #error "CDE coprocessor 0 is not enabled by the compiler flags" | ||
| #endif | ||
|
|
||
| int main(void) | ||
| { | ||
| uint32_t val = __arm_cx1(0, 0); | ||
|
|
||
| val = __arm_cx2(0, val, 0); | ||
|
|
||
| return (int)val; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| tests: | ||
| arch.arm.cde_cp0: | ||
|
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. The cde build test never enters twister The new test manifest is named tests.yaml, whereas this branch's Twister discovery recognizes testcase.yaml for tests. Its directory is skipped during test discovery, so neither the build nor its compiler-feature checks run. Agent Prompt
|
||
| tags: | ||
| - arm | ||
| build_only: true | ||
| arch_allow: | ||
| - arm | ||
| platform_allow: | ||
| - mps2/an521/cpu0 | ||
| - mps2/an521/cpu0/ns | ||
| - mps3/corstone300/an547 | ||
| - mps4/corstone315/fvp | ||
| - lp_am13e230 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. Other arm toolchains leave cde disabled
🐞 Bug≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation toolsDismiss ↗ | View ↗