PMU related functions need to be located in IRAM when sleep
process is triggered, as cache is disabled past a certain point
in the execution of the sleep process.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Use esp_restart call to guarantee and registered
shutdown handlers will be triggered before rebooting.
This guarantees that subsystems like Wi-Fi and BLE
will deinit correctly.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add ULP Coprocessor board support for C6.
This requires a change in the board qualifier depending on the build
target.
Update esp32c6 overlay and configuration files to the proper name.
Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
Current interrupt allocator is not taking into account
reserved areas. In case of esp32c6, Wi-Fi isn't properly
configured, causing instability or even non-functional feature.
This adds the reserved area ranges for all risc-v based SoC and
unify the slot finding based on interrupt source.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Make sure chip revision reading returns real value
for some especific chip revision, which is currently
failing.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
When DEBUG_OPTIMIZATION or NO_OPTIMIZATION is
enabled, efuse reading fails during bootloader start.
Move those calls into IRAM area so that reading when
cache is disabled works without any faults.
In HAL side, we need to use low level calls to read
CPU id instead of Zephyr's default one.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
As a result of flash initialization improvements
and fixes, some of the mcuboot linker entries
are no longer necessary.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Currently, each SoC has its own CMakeLists.txt file
to handle esp32 runner.
This PR merged it all in a common file and fixes
missing configuration such as flashing frequency,
mode and size.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Removes the VDDSDIO control during boot for some SoCs.
Only ESP32 allows managing such configuration during
initialization.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Update and enable Wi-Fi/Bluetooth software coexistence management.
This improves package handling and is recommended to be used
in high traffic scenarios.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Remove ESP heap from the sources. System heap is default heap.
Use heap adapter layer to configure used heap.
Use MEM_POOL memory request config to Wi-Fi and Bluetooth drivers.
Update the Wi-Fi and BLE memory needs.
Signed-off-by: Marek Matej <marek.matej@espressif.com>
Makes the esp_console_init() calling during hardware initialization
conditioned to CONFIG_ESP_CONSOLE
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
Add new fields to the `esp_image_load_header_t`
* provide IROM and DROM fields to fix debugging features
* extend the header to up to 96 Bytes for future use
Signed-off-by: Marek Matej <marek.matej@espressif.com>
This PR includes changes in all Espressif's SoCs to enable
keeping data in RTC memory after deep-sleep.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Replaces hard-coded memory addresses and sizes with macros that retrieve
such values from the device tree.
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
Introduce `CONFIG_RISCV_GP_PURPOSE` choice to make sure that only
one of `CONFIG_RISCV_GP` or `CONFIG_RISCV_CURRENT_VIA_GP` can be
enabled, instead of relying of dependencies.
To do that, introduce a new
`CONFIG_RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING` that can be selected
by SoC when it implemented global pointer (GP) initialization for
relative addressing in its linker.
`CONFIG_RISCV_GP` will be the default choice when
`CONFIG_RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING=y`
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
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>
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>
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>
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>
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>
The source files required for this features are not present
in the tree for this SOC.
So if CONFIG_PM or CONFIG_POWEROFF are enabled, there would
be a cmake failure.
Let's just indicate these features are not supported in
kconfig.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
SARADC was kept enabled to feed RNG entropy peripheral,
adding instability to Wi-Fi connection. So we disable it
before app runs as RNG driver already got initial entropy values.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
risc-v idle call is being fetched from arch/ implementation.
This soc file is not used and can be removed.
Fixes#75540
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
ESP32 requires proper alignment between sections. There are some
scenarios, as reported in #74533, that the section can
get shifted, causing runtime failure.
Making sure SECTION_PROLOGUE is used with ALIGN_WITH_INPUT
will guarantee its consistency.
Fixes#74533
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
- Fix the build issues with the insufficient memory for
the MCUboot.
- Fix the sysbuild with MCUboot tests on all ESP32xx SoCs.
Signed-off-by: Marek Matej <marek.matej@espressif.com>
* Move ctors and init_array from the CPP library
to the kernel library, as this is common for both C
and C++ and it is the kernel who is running it.
* Rename the hidden kconfig option CPP_STATIC_INIT_GNU
STATIC_INIT_GNU instead.
* If STATIC_INIT_GNU is not selected verify there is
constructors left behind.
* Rename common-rom-cpp.ld to common-rom-init.ld
* Rename z_cpp_init_static to z_init_static,
and have the kernel always call it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Signed-off-by: Keith Packard <keithp@keithp.com>
Kconfig, .ld and comments fixing
Fixed address of UART1, WDT and RTC timer disabled by default
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Fix to properly allocate IRQs for interrupt sources over 60.
It also screens out non-allocatable IRQs used by the CPU.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>