Skip to content

cpu/esp32: move platform code for Xtensa-based ESP32x SoCs to module esp_xtensa#18259

Merged
benpicco merged 5 commits intoRIOT-OS:masterfrom
gschorcht:cpu/esp32/separate_xtensa_platform_code
Jun 26, 2022
Merged

cpu/esp32: move platform code for Xtensa-based ESP32x SoCs to module esp_xtensa#18259
benpicco merged 5 commits intoRIOT-OS:masterfrom
gschorcht:cpu/esp32/separate_xtensa_platform_code

Conversation

@gschorcht
Copy link
Copy Markdown
Contributor

@gschorcht gschorcht commented Jun 25, 2022

Contribution description

This PR is a splitt-off from PR #17841 and replaces partially PR #18247.

To allow a platform independent implementation of tread_arch.c, irq_arch.c and exception.c for different ESP32x SoC variants, the platform specific code for Xtensa-based ESP SoCs is moved to the separate module esp_xtensa.

** Background**

The file thread_arch.c in module esp_xtensa is not really independent of the used ESP SoC. Although ESP8266 and ESP32 share most of the code, that's why thread_arch.c is defined in module esp_xtensa in cpu/esp_common, they require some SoC specific code, especially in thread_yield_* functions. These functions are something very special to ESP SoCs and not common for Xtensa cores. That is, the Xtensa code is not general enough to justify a cpu/xtensa_common folder.

Testing procedure

  1. Green CI
  2. Compile and check any simple test app, for example:
    BOARD=esp32-wroom-32 make -j8 -C tests/shell flash term
    

Issues/PRs references

Splitt-off from PR #17841 and PR #18247
Replaces PR #18247 partially

@github-actions 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 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 gschorcht requested a review from benpicco June 25, 2022 11:54
@gschorcht gschorcht force-pushed the cpu/esp32/separate_xtensa_platform_code branch from 2805c1a to ff4dcd6 Compare June 25, 2022 17:51
@github-actions github-actions bot added the Area: Kconfig Area: Kconfig integration label Jun 25, 2022
@gschorcht
Copy link
Copy Markdown
Contributor Author

@benpicco I have introduced now a separate module esp_xtensa for Xtensa-specific code for Xtensa-based ESP SoCs.

@benpicco benpicco enabled auto-merge June 25, 2022 17:56
@gschorcht
Copy link
Copy Markdown
Contributor Author

@benpicco I wonder if I should rename the folder cpu/esp_common/esp_xtensa to cpu/esp_common/esp-xtensa since all existing subfolders for ESP modules are named esp-xxxx, e.g. esp-eth, esp-idf, esp-now, esp-wifi. So esp-xtensa sounds more consistent. What do you think?

@benpicco benpicco disabled auto-merge June 25, 2022 21:13
@benpicco
Copy link
Copy Markdown
Contributor

Sure that’s more consistent

To allow a platform independent implementation of tread_arch for different ESP32x SoC variants, the platform specific code for Xtensa based ESP SoCs is moved to a separate module `esp_xtensa`.
To allow a platform independent implementation of irq_arch for different ESP32x SoC variants, the platform specific code for Xtensa based ESP SoCs is moved to a separate module `esp_xtensa`.
To allow a platform independent implementation of exceptions for different ESP32x SoC variants, the platform specific code for Xtensa based ESP SoCs is moved to a separate platform file `exception_xtensa.c`.
@gschorcht gschorcht force-pushed the cpu/esp32/separate_xtensa_platform_code branch from ff4dcd6 to 684ed28 Compare June 25, 2022 21:23
@gschorcht gschorcht changed the title cpu/esp32: separate Xtensa platform-specific code cpu/esp32: move platform-specific code for Xtensa-based ESP32x SoCs to module esp_xtensa Jun 25, 2022
@gschorcht gschorcht force-pushed the cpu/esp32/separate_xtensa_platform_code branch from 684ed28 to ea5d2b3 Compare June 25, 2022 22:10
@gschorcht gschorcht changed the title cpu/esp32: move platform-specific code for Xtensa-based ESP32x SoCs to module esp_xtensa cpu/esp32: move platform code for Xtensa-based ESP32x SoCs to module esp_xtensa Jun 25, 2022
@benpicco benpicco merged commit cff1e3c into RIOT-OS:master Jun 26, 2022
@gschorcht
Copy link
Copy Markdown
Contributor Author

@benpicco Thanks for reviewing and merging.

@gschorcht gschorcht deleted the cpu/esp32/separate_xtensa_platform_code branch June 26, 2022 13:27
@chrysn chrysn added this to the Release 2022.07 milestone Aug 25, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants