From d6c783d02df093f50c6ea14e9ffdd7c7967541b8 Mon Sep 17 00:00:00 2001 From: jiangguangming Date: Mon, 7 Nov 2022 15:02:52 +0800 Subject: [PATCH] esp_system: use ESP_CONSOLE_UART_NUM instead of CONSOLE_UART_NUM --- components/esp_system/port/soc/esp32c3/clk.c | 8 ++++---- components/esp_system/port/soc/esp32h2/clk.c | 8 ++++---- components/esp_system/port/soc/esp32s3/clk.c | 17 +++++++++++------ 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/components/esp_system/port/soc/esp32c3/clk.c b/components/esp_system/port/soc/esp32c3/clk.c index e7f8a9dfdc..63130015f1 100644 --- a/components/esp_system/port/soc/esp32c3/clk.c +++ b/components/esp_system/port/soc/esp32c3/clk.c @@ -215,10 +215,10 @@ __attribute__((weak)) void esp_perip_clk_init(void) } else { common_perip_clk = SYSTEM_WDG_CLK_EN | SYSTEM_I2S0_CLK_EN | -#if CONFIG_CONSOLE_UART_NUM != 0 +#if CONFIG_ESP_CONSOLE_UART_NUM != 0 SYSTEM_UART_CLK_EN | #endif -#if CONFIG_CONSOLE_UART_NUM != 1 +#if CONFIG_ESP_CONSOLE_UART_NUM != 1 SYSTEM_UART1_CLK_EN | #endif SYSTEM_SPI2_CLK_EN | @@ -246,10 +246,10 @@ __attribute__((weak)) void esp_perip_clk_init(void) //Reset the communication peripherals like I2C, SPI, UART, I2S and bring them to known state. common_perip_clk |= SYSTEM_I2S0_CLK_EN | -#if CONFIG_CONSOLE_UART_NUM != 0 +#if CONFIG_ESP_CONSOLE_UART_NUM != 0 SYSTEM_UART_CLK_EN | #endif -#if CONFIG_CONSOLE_UART_NUM != 1 +#if CONFIG_ESP_CONSOLE_UART_NUM != 1 SYSTEM_UART1_CLK_EN | #endif SYSTEM_SPI2_CLK_EN | diff --git a/components/esp_system/port/soc/esp32h2/clk.c b/components/esp_system/port/soc/esp32h2/clk.c index d946f142dd..f6cd96be54 100644 --- a/components/esp_system/port/soc/esp32h2/clk.c +++ b/components/esp_system/port/soc/esp32h2/clk.c @@ -208,10 +208,10 @@ __attribute__((weak)) void esp_perip_clk_init(void) } else { common_perip_clk = SYSTEM_WDG_CLK_EN | SYSTEM_I2S0_CLK_EN | -#if CONFIG_CONSOLE_UART_NUM != 0 +#if CONFIG_ESP_CONSOLE_UART_NUM != 0 SYSTEM_UART_CLK_EN | #endif -#if CONFIG_CONSOLE_UART_NUM != 1 +#if CONFIG_ESP_CONSOLE_UART_NUM != 1 SYSTEM_UART1_CLK_EN | #endif SYSTEM_SPI2_CLK_EN | @@ -235,10 +235,10 @@ __attribute__((weak)) void esp_perip_clk_init(void) //Reset the communication peripherals like I2C, SPI, UART, I2S and bring them to known state. common_perip_clk |= SYSTEM_I2S0_CLK_EN | -#if CONFIG_CONSOLE_UART_NUM != 0 +#if CONFIG_ESP_CONSOLE_UART_NUM != 0 SYSTEM_UART_CLK_EN | #endif -#if CONFIG_CONSOLE_UART_NUM != 1 +#if CONFIG_ESP_CONSOLE_UART_NUM != 1 SYSTEM_UART1_CLK_EN | #endif SYSTEM_SPI2_CLK_EN | diff --git a/components/esp_system/port/soc/esp32s3/clk.c b/components/esp_system/port/soc/esp32s3/clk.c index 122e41d40f..fa0eef2114 100644 --- a/components/esp_system/port/soc/esp32s3/clk.c +++ b/components/esp_system/port/soc/esp32s3/clk.c @@ -227,13 +227,13 @@ __attribute__((weak)) void esp_perip_clk_init(void) } else { common_perip_clk = SYSTEM_WDG_CLK_EN | SYSTEM_I2S0_CLK_EN | -#if CONFIG_CONSOLE_UART_NUM != 0 +#if CONFIG_ESP_CONSOLE_UART_NUM != 0 SYSTEM_UART_CLK_EN | #endif -#if CONFIG_CONSOLE_UART_NUM != 1 +#if CONFIG_ESP_CONSOLE_UART_NUM != 1 SYSTEM_UART1_CLK_EN | #endif -#if CONFIG_CONSOLE_UART_NUM != 2 +#if CONFIG_ESP_CONSOLE_UART_NUM != 2 SYSTEM_UART2_CLK_EN | #endif SYSTEM_USB_CLK_EN | @@ -267,13 +267,13 @@ __attribute__((weak)) void esp_perip_clk_init(void) //Reset the communication peripherals like I2C, SPI, UART, I2S and bring them to known state. common_perip_clk |= SYSTEM_I2S0_CLK_EN | -#if CONFIG_CONSOLE_UART_NUM != 0 +#if CONFIG_ESP_CONSOLE_UART_NUM != 0 SYSTEM_UART_CLK_EN | #endif -#if CONFIG_CONSOLE_UART_NUM != 1 +#if CONFIG_ESP_CONSOLE_UART_NUM != 1 SYSTEM_UART1_CLK_EN | #endif -#if CONFIG_CONSOLE_UART_NUM != 2 +#if CONFIG_ESP_CONSOLE_UART_NUM != 2 SYSTEM_UART2_CLK_EN | #endif SYSTEM_USB_CLK_EN | @@ -301,6 +301,11 @@ __attribute__((weak)) void esp_perip_clk_init(void) CLEAR_PERI_REG_MASK(SYSTEM_PERIP_CLK_EN1_REG, hwcrypto_perip_clk); SET_PERI_REG_MASK(SYSTEM_PERIP_RST_EN1_REG, hwcrypto_perip_clk); + /* Force clear backup dma reset signal. This is a fix to the backup dma + * implementation in the ROM, the reset signal was not cleared when the + * backup dma was started, which caused the backup dma operation to fail. */ + CLEAR_PERI_REG_MASK(SYSTEM_PERIP_RST_EN1_REG, SYSTEM_PERI_BACKUP_RST); + /* Disable WiFi/BT/SDIO clocks. */ CLEAR_PERI_REG_MASK(SYSTEM_WIFI_CLK_EN_REG, wifi_bt_sdio_clk); SET_PERI_REG_MASK(SYSTEM_WIFI_CLK_EN_REG, SYSTEM_WIFI_CLK_EN);