forked from espressif/esp-idf
feat(system): add option to allow user disable assist_debug module to save power
This commit is contained in:
@@ -587,6 +587,14 @@ menu "ESP System Settings"
|
|||||||
which may increase about the boot-up time by about 200 us. Disable this when your bootloader is built with
|
which may increase about the boot-up time by about 200 us. Disable this when your bootloader is built with
|
||||||
ESP-IDF version v5.2 and above.
|
ESP-IDF version v5.2 and above.
|
||||||
|
|
||||||
|
config ESP_SYSTEM_HW_PC_RECORD
|
||||||
|
bool "Hardware PC recording"
|
||||||
|
depends on SOC_ASSIST_DEBUG_SUPPORTED
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
This option will enable the PC recording function of assist_debug module. The PC value of the CPU will be
|
||||||
|
recorded to PC record register in assist_debug module in real time. When an exception occurs and the CPU
|
||||||
|
is reset, this register will be kept, then we can use the recorded PC to debug the causes of the reset.
|
||||||
endmenu # ESP System Settings
|
endmenu # ESP System Settings
|
||||||
|
|
||||||
menu "IPC (Inter-Processor Call)"
|
menu "IPC (Inter-Processor Call)"
|
||||||
|
@@ -228,6 +228,13 @@ __attribute__((weak)) void esp_perip_clk_init(void)
|
|||||||
SYSTEM_I2C_EXT0_CLK_EN;
|
SYSTEM_I2C_EXT0_CLK_EN;
|
||||||
common_perip_clk1 = 0;
|
common_perip_clk1 = 0;
|
||||||
|
|
||||||
|
#if !CONFIG_ESP_SYSTEM_HW_PC_RECORD
|
||||||
|
/* Disable ASSIST Debug module clock if PC recoreding function is not used,
|
||||||
|
* if stack guard function needs it, it will be re-enabled at esp_hw_stack_guard_init */
|
||||||
|
CLEAR_PERI_REG_MASK(SYSTEM_CPU_PERI_CLK_EN_REG, SYSTEM_CLK_EN_ASSIST_DEBUG);
|
||||||
|
SET_PERI_REG_MASK(SYSTEM_CPU_PERI_RST_EN_REG, SYSTEM_RST_EN_ASSIST_DEBUG);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Disable some peripheral clocks. */
|
/* Disable some peripheral clocks. */
|
||||||
CLEAR_PERI_REG_MASK(SYSTEM_PERIP_CLK_EN0_REG, common_perip_clk);
|
CLEAR_PERI_REG_MASK(SYSTEM_PERIP_CLK_EN0_REG, common_perip_clk);
|
||||||
SET_PERI_REG_MASK(SYSTEM_PERIP_RST_EN0_REG, common_perip_clk);
|
SET_PERI_REG_MASK(SYSTEM_PERIP_RST_EN0_REG, common_perip_clk);
|
||||||
|
@@ -279,6 +279,13 @@ __attribute__((weak)) void esp_perip_clk_init(void)
|
|||||||
// REG_SET_FIELD(I2S_CLKM_CONF_REG(0), I2S_CLK_SEL, I2S_CLK_AUDIO_PLL);
|
// REG_SET_FIELD(I2S_CLKM_CONF_REG(0), I2S_CLK_SEL, I2S_CLK_AUDIO_PLL);
|
||||||
// REG_SET_FIELD(I2S_CLKM_CONF_REG(1), I2S_CLK_SEL, I2S_CLK_AUDIO_PLL);
|
// REG_SET_FIELD(I2S_CLKM_CONF_REG(1), I2S_CLK_SEL, I2S_CLK_AUDIO_PLL);
|
||||||
|
|
||||||
|
#if !CONFIG_ESP_SYSTEM_HW_PC_RECORD
|
||||||
|
/* Disable ASSIST Debug module clock if PC recoreding function is not used,
|
||||||
|
* if stack guard function needs it, it will be re-enabled at esp_hw_stack_guard_init */
|
||||||
|
CLEAR_PERI_REG_MASK(SYSTEM_CPU_PERI_CLK_EN_REG, SYSTEM_CLK_EN_ASSIST_DEBUG);
|
||||||
|
SET_PERI_REG_MASK(SYSTEM_CPU_PERI_RST_EN_REG, SYSTEM_RST_EN_ASSIST_DEBUG);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Disable some peripheral clocks. */
|
/* Disable some peripheral clocks. */
|
||||||
CLEAR_PERI_REG_MASK(SYSTEM_PERIP_CLK_EN0_REG, common_perip_clk);
|
CLEAR_PERI_REG_MASK(SYSTEM_PERIP_CLK_EN0_REG, common_perip_clk);
|
||||||
SET_PERI_REG_MASK(SYSTEM_PERIP_RST_EN0_REG, common_perip_clk);
|
SET_PERI_REG_MASK(SYSTEM_PERIP_RST_EN0_REG, common_perip_clk);
|
||||||
|
@@ -258,8 +258,11 @@ __attribute__((weak)) void esp_perip_clk_init(void)
|
|||||||
periph_ll_disable_clk_set_rst(PERIPH_SARADC_MODULE);
|
periph_ll_disable_clk_set_rst(PERIPH_SARADC_MODULE);
|
||||||
periph_ll_disable_clk_set_rst(PERIPH_SDIO_SLAVE_MODULE);
|
periph_ll_disable_clk_set_rst(PERIPH_SDIO_SLAVE_MODULE);
|
||||||
periph_ll_disable_clk_set_rst(PERIPH_REGDMA_MODULE);
|
periph_ll_disable_clk_set_rst(PERIPH_REGDMA_MODULE);
|
||||||
|
#if !CONFIG_ESP_SYSTEM_HW_PC_RECORD
|
||||||
|
/* Disable ASSIST Debug module clock if PC recoreding function is not used,
|
||||||
|
* if stack guard function needs it, it will be re-enabled at esp_hw_stack_guard_init */
|
||||||
periph_ll_disable_clk_set_rst(PERIPH_ASSIST_DEBUG_MODULE);
|
periph_ll_disable_clk_set_rst(PERIPH_ASSIST_DEBUG_MODULE);
|
||||||
|
#endif
|
||||||
periph_ll_disable_clk_set_rst(PERIPH_RSA_MODULE);
|
periph_ll_disable_clk_set_rst(PERIPH_RSA_MODULE);
|
||||||
periph_ll_disable_clk_set_rst(PERIPH_AES_MODULE);
|
periph_ll_disable_clk_set_rst(PERIPH_AES_MODULE);
|
||||||
periph_ll_disable_clk_set_rst(PERIPH_SHA_MODULE);
|
periph_ll_disable_clk_set_rst(PERIPH_SHA_MODULE);
|
||||||
|
@@ -249,7 +249,11 @@ __attribute__((weak)) void esp_perip_clk_init(void)
|
|||||||
periph_ll_disable_clk_set_rst(PERIPH_UHCI0_MODULE);
|
periph_ll_disable_clk_set_rst(PERIPH_UHCI0_MODULE);
|
||||||
periph_ll_disable_clk_set_rst(PERIPH_SARADC_MODULE);
|
periph_ll_disable_clk_set_rst(PERIPH_SARADC_MODULE);
|
||||||
periph_ll_disable_clk_set_rst(PERIPH_REGDMA_MODULE);
|
periph_ll_disable_clk_set_rst(PERIPH_REGDMA_MODULE);
|
||||||
|
#if !CONFIG_ESP_SYSTEM_HW_PC_RECORD
|
||||||
|
/* Disable ASSIST Debug module clock if PC recoreding function is not used,
|
||||||
|
* if stack guard function needs it, it will be re-enabled at esp_hw_stack_guard_init */
|
||||||
periph_ll_disable_clk_set_rst(PERIPH_ASSIST_DEBUG_MODULE);
|
periph_ll_disable_clk_set_rst(PERIPH_ASSIST_DEBUG_MODULE);
|
||||||
|
#endif
|
||||||
periph_ll_disable_clk_set_rst(PERIPH_RSA_MODULE);
|
periph_ll_disable_clk_set_rst(PERIPH_RSA_MODULE);
|
||||||
periph_ll_disable_clk_set_rst(PERIPH_AES_MODULE);
|
periph_ll_disable_clk_set_rst(PERIPH_AES_MODULE);
|
||||||
periph_ll_disable_clk_set_rst(PERIPH_SHA_MODULE);
|
periph_ll_disable_clk_set_rst(PERIPH_SHA_MODULE);
|
||||||
|
Reference in New Issue
Block a user