-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/esp32: add platform code for RISC-V based ESP32x SoCs #18260
Merged
benpicco
merged 4 commits into
RIOT-OS:master
from
gschorcht:cpu/esp32/add_riscv_platform_code
Jul 18, 2022
Merged
cpu/esp32: add platform code for RISC-V based ESP32x SoCs #18260
benpicco
merged 4 commits into
RIOT-OS:master
from
gschorcht:cpu/esp32/add_riscv_platform_code
Jul 18, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
Area: cpu
Area: CPU/MCU ports
Platform: ESP
Platform: This PR/issue effects ESP-based platforms
labels
Jun 25, 2022
gschorcht
added
Type: enhancement
The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
labels
Jun 25, 2022
gschorcht
force-pushed
the
cpu/esp32/add_riscv_platform_code
branch
from
June 25, 2022 21:52
bce156a
to
b1a86a9
Compare
gschorcht
requested review from
leandrolanzieri,
jia200x and
MrKevinWeiss
as code owners
June 25, 2022 21:52
gschorcht
force-pushed
the
cpu/esp32/add_riscv_platform_code
branch
2 times, most recently
from
June 26, 2022 13:22
16fc40a
to
57d12c3
Compare
Rebased after merge of PR #18259. |
benpicco
reviewed
Jun 26, 2022
gschorcht
force-pushed
the
cpu/esp32/add_riscv_platform_code
branch
from
June 27, 2022 06:30
539711f
to
24cb130
Compare
benpicco
approved these changes
Jul 17, 2022
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.
Please squash
gschorcht
force-pushed
the
cpu/esp32/add_riscv_platform_code
branch
from
July 18, 2022 05:00
24cb130
to
a0abbb0
Compare
gschorcht
force-pushed
the
cpu/esp32/add_riscv_platform_code
branch
from
July 18, 2022 11:52
a0abbb0
to
778ff10
Compare
@benpicco Thanks for reviewing and merging. |
This was referenced Jul 20, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: cpu
Area: CPU/MCU ports
Area: Kconfig
Area: Kconfig integration
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Platform: ESP
Platform: This PR/issue effects ESP-based platforms
Type: enhancement
The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
This PR is a splitt-off from PR #17841 and replaces partially PR #18247.
To allow the compilation for RISC-V based ESP32x SoCs, platform independent implementation of
tread_arch.c
,irq_arch.c
andexception.c
are required that are provided by a platform-specific moduleesp_riscv
.Additionally, some DEBUG message formatting are fixed with this PR to become platform independent.
This PR includes PR #18259 at the moment to be compilable. The first commit of this PR is d05dacd. Once PR #18529 is merged, it will be rebased.Background:
thread_arch.c
in moduleesp_xtensa
is not really independent of the used ESP SoC. Although ESP8266 and ESP32 share most of the code, they require some SoC specific code, especially inthread_yield_*
functions. These functions are something very special to ESP SoCs and not common for Xtensa cores.vectors.S
for for RISC-V interrupt handling andportasm.S
for RISC-V context switching from ESP-IDF, because they are needed by other ESP-IDF functions, e.g. by the startup function, which we also use directly from ESP-IDF. Unfortunately, they are not compatible with the RISC-V implementation incpu/riscv_common
. They use a different context frame structure, a different interrupt context structure, a different interrupt/exception handling and a different startup function. Even if we could reuse some parts ofriscv_common
, including a common folder in the compilation always means all or nothing. Therefore we can't usecpu/riscv_common
at all.irq_disable
/irq_restore
inriscv_common
only reset/set theMIE
bit inmstatus
register while the implementation for RISC-V based ESPs requires to change the value of the SoC specific interrupt level registerINTERRUPT_CORE0_CPU_INT_THRESH_REG
.Thus, neither is the Xtensa code general enough to justify a
cpu/xtensa_common
folder, nor are the thread or interrupt handling for RISC-V based ESP compatible with the implementation inriscv_common
. Thereforethread_arch.c
,irq_arch.c
andexception.c
for Xtensa-based and RISC-V-based ESP SoCs are provided by the modulesesp_xtensa
andesp_riscv
respectively.Testing procedure
Issues/PRs references
Splitt-off from PR #17841 and PR #18247
Replaces PR #18247 partially
Depends on PR #18259