Commit graph

144 commits

Author SHA1 Message Date
Sylvio Alves
4101401dd7 boards: esp32c3-based: update soc type info
This updates a few esp32c3-based boards accordingly to
its oficial SoC model.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-27 21:06:51 +00:00
Lucas Tamborrino
cdbd2b5558 soc: espressif: Add hardware initialization
Bring hardware initialization to zephyr code base.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-11-26 00:12:45 +01:00
Yong Cong Sin
b1def7145f arch: deprecate _current
`_current` is now functionally equals to `arch_curr_thread()`, remove
its usage in-tree and deprecate it instead of removing it outright,
as it has been with us since forever.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-23 20:12:24 -05:00
Marek Matej
98d0a2bb34 soc: espressif: esp32c6 split cached area
Split the cached area and assign both parts IROM and DROM meaning. This
is necessary to overcome the esptool section merging issues.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-11-20 15:58:07 -05:00
Sylvio Alves
c7a592b3e0 soc: esp32c6: add Wi-Fi support
Enables Wi-Fi support.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-18 13:17:54 -05:00
Raffael Rostagno
c4b7903828 pinctrl: esp32c6: Fix for input/output enable flags
Fix missing input/output enable flags on pinctrl macro, which
wouldn't allow for driver to see and apply flags configuration
made in the device tree.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-11-08 11:36:21 -06:00
Marek Matej
ed1179713c soc: esp32s3: AMP support
Updates and fixes to support APPCPU.
- fix ld scripts
- fix and update memory layout
- fix build issues
- fix sysbuild

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-11-08 11:36:09 -06:00
Sylvio Alves
07fd5600a9 kconfig: fix typo and help description.
Fix typo and re-phrase help description to improve it.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-06 16:40:30 -06:00
Nik Schewtschuk
328e4a5039 soc: espressif: esp32s3: Adjust BOOTLOADER_DRAM_SEG_LEN for worst case
Larger image partitions require more space in DRAM due to
the increase in .bss.sector_buffers.
Each sector in .bss.sector_buffers consumes 16 bytes.
In the worst case scenario, such as with the ESP32S3 N32R8V,
which has 32 MB of flash and most likely 12 MB image partition,
an addition of 0xc000 should be sufficient to accommodate this.

Signed-off-by: Nik Schewtschuk <nikita.schewtschuk@smartmechatronics.de>
2024-10-29 09:24:55 -07:00
Sylvio Alves
5678512fe8 soc: esp32s3: move cache mode call
Removed unused function declaration.
Added missing include.
Move Cache_Susped_DCache() call to proper
function configuration call.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-27 20:53:48 -05:00
Sylvio Alves
02fc5e3f66 soc: esp32s3: update linker files
Add new wifi sections into iram area.
Add new functions to iram area.
Remove unused entries.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-27 20:53:48 -05:00
Sylvio Alves
05b462a907 soc: esp32s2: add cache mode disabled option
Update data cache mode to work when data cache
is set to 0KB.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-27 20:53:48 -05:00
Sylvio Alves
279f4b8aec soc: esp32s2: update linker files
Add new wifi sections into iram area.
Add new functions to iram area.
Remove unused entries.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-27 20:53:48 -05:00
Sylvio Alves
a1a6e8a1a3 soc: esp32c6: update linker files
Add new wifi sections into iram area.
Add new functions to iram area.
Remove unused entries.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-27 20:53:48 -05:00
Sylvio Alves
be9574e482 soc: esp32c3: update linker files
Add new wifi sections into iram area.
Add new functions to iram area.
Remove unused entries.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-27 20:53:48 -05:00
Sylvio Alves
412921b594 soc: esp32c2: update linker files
Add new wifi sections into iram area.
Add new functions to iram area.
Remove unused entries.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-27 20:53:48 -05:00
Sylvio Alves
876a893018 soc: esp32: update linker files
Add new wifi sections into iram area.
Add new functions to iram area.
Remove unused entries.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-27 20:53:48 -05:00
Sylvio Alves
a70741bc82 west.yml: update hal_espressif to latest version
- Update GDMA and ADC drivers and remove deprecated entries.
- Rebased hal_espressif to latest bump sync.
- Added ESP Timer and Radio common config values

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-27 20:53:48 -05:00
Sylvio Alves
b5c53d6ac4 wifi: esp32: move kconfig to driver area
Make sure all kconfig related to Wi-Fi is
in its driver area.
This commit also removes esp_timer_init() call
from Wi-Fi driver.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-27 20:53:48 -05:00
Raffael Rostagno
4be1897519 drivers: counter: systimer: esp32c2: Fix clock parameters
Fix clock source frequency for systimer and GP timer.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-10-25 00:04:25 +01:00
Sylvio Alves
59f0418d2e soc: esp32: unify runtime heap usage
This commit applies several changes in the way "heap_runtime"
feature is used. It can't be split due to bisectability issues.

Whenever the feature is enabled, a new heap is created and
custom malloc/calloc/free functions are added into the build
system. Those functions are currently used for internal Wi-Fi and BLE
drivers only.

Such changes are described below:

1) Rename heap.c to esp_heap_runtime.c for better readability.
2) Rename RUNTIME_HEAP to HEAP_RUNTIME to make it similar to what is
available in Zephyr.
3) Add runtime heap to BT as such as Wi-Fi.

Fixes #79490
Fixes #79470

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-17 09:45:02 +02:00
Marcio Ribeiro
7e7672cb4b bugfix: esp32: allows QIO and QOUT flash modes
Allows QIO and QOUT flash mode to work on:
- esp32s2
- esp32s3
- esp32c2
- esp32c3
- esp32c6

Fixes #73677

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2024-10-16 12:26:52 +02:00
Sylvio Alves
e48639e460 soc: esp32c6: add LLEXT linker entry
Make sure LLEXT sections are properly placed to avoid
orphan declaration.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-10 10:06:53 +02:00
Sylvio Alves
0d118ec1ab soc: esp32: add SPIRAM memory test kconfig option
Add kconfig to disable SPIRAM memory test. Allows
faster SoC initialization when disabled.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-09-28 11:30:34 -05:00
Marek Matej
a1c4552ea9 soc: esp32c6: Add runtime heap symbols
Update the linker scripts to provide necessary symbols.
Fix static allocation size check.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-09-21 11:29:53 +02:00
Marek Matej
bf2c67c441 soc: esp32c2: ESP WiFi heap
Provide symbols for the creation of dynamic memory pool.
Update the ROM-code SRAM usage according the IDF main.
Fix static allocations size check.
Increase iram_seg memory size for MCUboot.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-09-21 11:29:53 +02:00
Marek Matej
2683774265 soc: esp32c3: ESP WiFi heap
Provide symbols for the creation of dynamic memory pool.
Fix static allocations size check.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-09-21 11:29:53 +02:00
Marek Matej
13a59fb855 soc: esp32s3: ESP WiFi heap
Provide symbols for the creation of dynamic memory pool.
Fix static allocations size check.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-09-21 11:29:53 +02:00
Marek Matej
3784beb6cc soc: esp32s2: ESP WiFi heap
Provide symbols for the creation of dynamic memory pool.
Fix the loader ROM buffers start address.
Fix static allocation size check.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-09-21 11:29:53 +02:00
Marek Matej
94731488e7 soc: esp32: ESP WiFi heap
Provide symbols for the creation of dynamic memory pool.
Fix static allocation size check.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-09-21 11:29:53 +02:00
Marek Matej
15d0189d3e soc: espressif: Introduce runtime heap mempool
Add the `CONFIG_ESP_RUNTIME_HEAP` kconfig.
This allows the memory pool to be created starting
at `z_mapped_end` ending at `_heap_sentry`.

Added choice symbol ESP_WIFI_HEAP_* to select which
heap to use in the ESP WiFi adapter module.

Add file heap.c with code to initialize the runtime heap.
Size of the pool is checked during the runtime.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-09-21 11:29:53 +02:00
Brandon Allen
3176ec55bb soc: esp32s3: bump esp32s3 bootloader iram and dram sizes.
Currently the RAM allocated for the bootloader is not
enough to use MCUBoot with crypto signatures.
This commit bumps the #defines accordingly to fix
compile errors with ecdsa_p256 and RSA.

Signed-off-by: Brandon Allen <brandon.allen@exacttechnology.com>
2024-09-20 11:53:11 -05:00
Marek Matej
a0d7016e27 soc: espressif: Simple boot validity
Update CONFIG_ESP_SIMPLE_BOOT to exclude if CONFIG_MCUBOOT=y
Fix usage of the config according to actual definition.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-09-19 18:02:20 -04:00
Raffael Rostagno
cc6ba10142 soc: espressif: Default MCUboot mode for ESP32 family
Include default MCUboot mode for all ESP32 chips

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-09-16 20:17:44 +02:00
Sylvio Alves
aa3dd674a9 soc: esp32xx: update flash initialization
Rework how flash is initialized in esp32 SoC.
"esp_flash_app_init()" will make sure proper cache handling
will be set in place.i

Fixes #77551

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-09-13 11:36:58 -05:00
Raffael Rostagno
bd3b731ddc soc: esp32c2: esp8684: Console baudrate from device tree
Get console baudrate property from device tree to allow
proper configuration for 26 and 40 Mhz devices.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-09-10 17:17:17 -04:00
Sylvio Alves
8233b70ece espressif: clean up unused code
Remove all entries that as not being used.
This also update hal to re-enable warning flags
as such as -Wno-unused-variable.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-09-09 13:55:39 -04:00
Marcio Ribeiro
baf62b7a98 soc: esp32: XIP removed from Espressif targets
The way ESP32 XIP works (with MMU and cache) does no fit the way Zephyr XIP
is implemented, causing issues related to included Zephyr linker files.
Flash code still resides in flash for execution, but MMU/Cache handles it
in such way that XIP might not (or should not) be used with current Zephyr
approach. To address this problem, XIP configuration option is being
removed from Espressif targets.

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2024-08-31 06:47:52 -04:00
Lucas Tamborrino
5dc545290c soc: espressif: psram as shared multi heap
Currently, if the user wants to allocate heap on external RAM
he needs to enable CONFIG_ESP_SPIRAM and set a threshold defined
with CONFIG_ESP_HEAP_MIN_EXTRAM_THRESHOLD.

This approach requires that we re-implement `k_malloc` and allocate
the memory on the proper region based on the block size.

By using the shared multi heap feature the proccess of allocating
memory from external memory becomes more fluent and simple.

The attribute SMH_REG_ATTR_EXTERNAL was added to reference the
external memory.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-08-27 18:37:47 -04:00
Sylvio Alves
b7b03e5682 soc: esp32: kconfig: add unsupported revision config
ESP32 SoC has multiple revisions, some of which are not supported
by the current implementation, as such as REV0 and REV1. This PR
adds an option to indicate user that this is not recommended and not
supported.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-08-24 07:15:50 -04:00
Raffael Rostagno
4fc8033d88 soc: mp: esp32: Added IRQ priority and flags config
Interrupt priority and flags config for crosscore ISR
sourced from device tree.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-08-22 14:25:25 -04:00
Marcio Ribeiro
f86314ecb6 logging: startup: esp32: startup log messages format unification
Unification of startup log messages format while using SIMPLEBOOT.

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2024-08-20 14:53:42 -04:00
Raffael Rostagno
fad55d18ad soc: esp32c2: Add support to ESP32C2 and ESP8684
Files for SoC support: ESP32C2 and ESP8684 (same core).
Basic device tree configuration.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-08-16 14:08:22 -04:00
Raffael Rostagno
3ee2a62a55 pm: esp32c6: Power management support
Power management support (light/deep sleep) for ESP32C6

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-08-15 11:59:08 -04:00
Jamie McCrae
d4a29becf4 soc: espressif: Add default MCUboot mode to sysbuild
Adds the default MCUboot operating mode when building for these
SoCs using sysbuild

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-12 15:14:45 +02:00
Marcio Ribeiro
4bdcf44a8c cleanup: soc: esp32: IDF_TARGET parameters removal
IDF_TARGET parameters removed from soc/Kconfig and landed on Espressif hal

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2024-08-11 19:16:04 -05:00
Marek Matej
795ac34f29 soc: espressif: Use WiFi config file
Add config file to host WiFi specific settings.
Introduce CONFIG_ESP_WIFI_MAX_THREAD_PRIO to be used
as a cap for the LL driver runtime.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-08-09 09:54:36 +02:00
Anas Nashif
dbfbf0edba xtensa: adapt soc code to use prep_c
Many xtensa target jump from soc code directly into cstart and depend on
architecture code being initialized in arch_kernel_init(). Instead of
jumping to cstart, jump to newly introduced prep_c similar to all other
architectures, where common platfotm initialization will happen.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-08-07 13:50:53 +02:00
Felipe Neves
af91d06b00 drivers: mbox: mbox_esp32: add support for esp32 MBOX driver
as an alternative for IPM driver.

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
2024-08-07 07:17:01 -04:00
Sylvio Alves
c374d3147b linker: esp32: fix cpp rom region
cplusplus-rom linker initialization was wrongly placed
in RAM area when it should be in ROM area.

Fixes #75853

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-08-06 17:17:24 -04:00