From 1681c7e3173e3097e0dfb77085e81781c8969845 Mon Sep 17 00:00:00 2001 From: Sylvio Alves Date: Sat, 21 Dec 2024 11:55:56 -0300 Subject: [PATCH] soc: esp32: fix appcpu register access Build is failing due to wrong calls to appcpu stall and clock gating. This fixes it by using proper registers. Signed-off-by: Sylvio Alves --- soc/espressif/esp32/esp32-mp.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/soc/espressif/esp32/esp32-mp.c b/soc/espressif/esp32/esp32-mp.c index 71a6b8d7616..8733e33340c 100644 --- a/soc/espressif/esp32/esp32-mp.c +++ b/soc/espressif/esp32/esp32-mp.c @@ -181,15 +181,10 @@ void esp_appcpu_start(void *entry_point) esp_rom_ets_set_appcpu_boot_addr((void *)0); - RTC_CNTL_SW_CPU_STALL &= ~RTC_CNTL_SW_STALL_APPCPU_C1; - RTC_CNTL_OPTIONS0 &= ~RTC_CNTL_SW_STALL_APPCPU_C0; - DPORT_APPCPU_CTRL_B |= DPORT_APPCPU_CLKGATE_EN; - DPORT_APPCPU_CTRL_C &= ~DPORT_APPCPU_RUNSTALL; - - /* Pulse the RESETTING bit */ - DPORT_APPCPU_CTRL_A |= DPORT_APPCPU_RESETTING; - DPORT_APPCPU_CTRL_A &= ~DPORT_APPCPU_RESETTING; - + DPORT_SET_PERI_REG_MASK(DPORT_APPCPU_CTRL_B_REG, DPORT_APPCPU_CLKGATE_EN); + DPORT_CLEAR_PERI_REG_MASK(DPORT_APPCPU_CTRL_C_REG, DPORT_APPCPU_RUNSTALL); + DPORT_SET_PERI_REG_MASK(DPORT_APPCPU_CTRL_A_REG, DPORT_APPCPU_RESETTING); + DPORT_CLEAR_PERI_REG_MASK(DPORT_APPCPU_CTRL_A_REG, DPORT_APPCPU_RESETTING); /* extracted from SMP LOG above, THIS IS REQUIRED FOR AMP RELIABLE * OPERATION AS WELL, PLEASE DON'T touch on the dummy write below!