feat(ulp): add support for ulp on esp32s31

This commit is contained in:
Marius Vikhammer
2026-04-20 14:45:23 +08:00
parent dfc5bbb58c
commit 10637dbf5e
51 changed files with 536 additions and 101 deletions
@@ -13,6 +13,11 @@
#include "esp_cpu.h"
#include "hal/apm_hal.h"
#if CONFIG_IDF_TARGET_ESP32S31
#include "soc/hp_peri0_pms_reg.h"
#include "soc/hp_peri1_pms_reg.h"
#include "soc/lp_peri_pms_reg.h"
#endif
void bootloader_init_mem(void)
{
@@ -37,6 +42,22 @@ void bootloader_init_mem(void)
#endif // SOC_APM_CTRL_FILTER_SUPPORTED
#endif
#if CONFIG_IDF_TARGET_ESP32S31
/* TODO: [ESP32S31] IDF-14620
As a temp. fix to allow ULP access to all peripherals during bringup.
Open all LP/HP peripheral PMS control registers for all security modes.
*/
for (uint32_t reg = LP_PERI_PMS_LP_SYSREG_CTRL_REG; reg <= LP_PERI_PMS_LP_DAC_CTRL_REG; reg += 4) {
REG_WRITE(reg, 0xFF);
}
for (uint32_t reg = HP_PERI0_PMS_TRACE0_CTRL_REG; reg <= HP_PERI0_PMS_AXI_PERF_MON_CTRL_REG; reg += 4) {
REG_WRITE(reg, 0xFF);
}
for (uint32_t reg = HP_PERI1_PMS_HP_USBOTG_PHY_CTRL_REG; reg <= HP_PERI1_PMS_HP_PERI1_PMS_CTRL_REG; reg += 4) {
REG_WRITE(reg, 0xFF);
}
#endif
#if CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE
// protect memory region
esp_cpu_configure_region_protection();