fix(hal): fix the issue of dual-core contention for RTC_CNTL regs

This commit is contained in:
hebinglin
2026-06-02 12:12:54 +08:00
parent adb32107aa
commit 6bd2205d76
23 changed files with 261 additions and 60 deletions
@@ -587,6 +587,10 @@ config SOC_RTCIO_WAKE_SUPPORTED
bool
default y
config SOC_RTC_CNTL_NEEDS_ATOMIC_ACCESS
bool
default y
config SOC_SDM_GROUPS
int
default 1
@@ -281,6 +281,10 @@
#define SOC_RTCIO_HOLD_SUPPORTED 1
#define SOC_RTCIO_WAKE_SUPPORTED 1
/* RTC_CNTL registers on this SoC are not atomic and require software protection
* (e.g., spinlocks) when accessed from multiple cores or threads. */
#define SOC_RTC_CNTL_NEEDS_ATOMIC_ACCESS 1
/*-------------------------- Sigma Delta Modulator CAPS -----------------*/
#define SOC_SDM_GROUPS 1U
#define SOC_SDM_CHANNELS_PER_GROUP 8
@@ -395,6 +395,10 @@ config SOC_RTC_CNTL_CPU_PD_REG_FILE_NUM
int
default 108
config SOC_RTC_CNTL_NEEDS_ATOMIC_ACCESS
bool
default y
config SOC_RTCIO_PIN_COUNT
int
default 0
@@ -190,6 +190,10 @@
#define SOC_RTC_CNTL_CPU_PD_RETENTION_MEM_SIZE (SOC_RTC_CNTL_CPU_PD_REG_FILE_NUM * (SOC_RTC_CNTL_CPU_PD_DMA_BUS_WIDTH >> 3))
/* RTC_CNTL registers on this SoC are not atomic and require software protection
* (e.g., spinlocks) when accessed from multiple cores or threads. */
#define SOC_RTC_CNTL_NEEDS_ATOMIC_ACCESS 1
/*-------------------------- RTCIO CAPS --------------------------------------*/
/* No dedicated RTCIO subsystem on ESP32-C2. RTC functions are still supported
* for hold, wake & 32kHz crystal functions - via rtc_cntl_reg */
@@ -595,6 +595,10 @@ config SOC_RTC_CNTL_CPU_PD_REG_FILE_NUM
int
default 108
config SOC_RTC_CNTL_NEEDS_ATOMIC_ACCESS
bool
default y
config SOC_SLEEP_SYSTIMER_STALL_WORKAROUND
bool
default y
@@ -259,6 +259,10 @@
#define SOC_RTC_CNTL_CPU_PD_RETENTION_MEM_SIZE (SOC_RTC_CNTL_CPU_PD_REG_FILE_NUM * (SOC_RTC_CNTL_CPU_PD_DMA_BUS_WIDTH >> 3))
/* RTC_CNTL registers on this SoC are not atomic and require software protection
* (e.g., spinlocks) when accessed from multiple cores or threads. */
#define SOC_RTC_CNTL_NEEDS_ATOMIC_ACCESS 1
#define SOC_SLEEP_SYSTIMER_STALL_WORKAROUND 1
#define SOC_SLEEP_TGWDT_STOP_WORKAROUND 1
@@ -379,6 +379,10 @@ config SOC_GPIO_CLOCKOUT_BY_IO_MUX
bool
default y
config SOC_RTC_CNTL_NEEDS_ATOMIC_ACCESS
bool
default y
config SOC_DEDIC_GPIO_OUT_CHANNELS_NUM
int
default 8
@@ -177,6 +177,10 @@
// The Clock Out singnal is binding to the pin's IO_MUX function
#define SOC_GPIO_CLOCKOUT_BY_IO_MUX (1)
/* RTC_CNTL registers on this SoC are not atomic and require software protection
* (e.g., spinlocks) when accessed from multiple cores or threads. */
#define SOC_RTC_CNTL_NEEDS_ATOMIC_ACCESS 1
/*-------------------------- Dedicated GPIO CAPS ---------------------------------------*/
#define SOC_DEDIC_GPIO_OUT_CHANNELS_NUM (8) /*!< 8 outward channels on each CPU core */
#define SOC_DEDIC_GPIO_IN_CHANNELS_NUM (8) /*!< 8 inward channels on each CPU core */
@@ -747,6 +747,10 @@ config SOC_RTC_CNTL_TAGMEM_PD_DMA_BUS_WIDTH
int
default 128
config SOC_RTC_CNTL_NEEDS_ATOMIC_ACCESS
bool
default y
config SOC_RTCIO_PIN_COUNT
int
default 22
@@ -297,6 +297,10 @@
#define SOC_RTC_CNTL_TAGMEM_PD_DMA_BUS_WIDTH (128)
#define SOC_RTC_CNTL_TAGMEM_PD_DMA_ADDR_ALIGN (SOC_RTC_CNTL_TAGMEM_PD_DMA_BUS_WIDTH >> 3)
/* RTC_CNTL registers on this SoC are not atomic and require software protection
* (e.g., spinlocks) when accessed from multiple cores or threads. */
#define SOC_RTC_CNTL_NEEDS_ATOMIC_ACCESS 1
/*-------------------------- RTCIO CAPS --------------------------------------*/
#define SOC_RTCIO_PIN_COUNT 22
#define SOC_RTCIO_INPUT_OUTPUT_SUPPORTED 1 /* This macro indicates that the target has separate RTC IOMUX hardware feature,