mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-05 04:49:21 +00:00
Merge branch 'feature/uart_sleep_retention_support_c5_c61_v5.4' into 'release/v5.4'
feat(uart): support uart sleep retention on C5/C61 (v5.4) See merge request espressif/esp-idf!35400
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -1471,6 +1471,39 @@ extern "C" {
|
||||
#define UART_RXD_EDGE_CNT_V 0x000003FFU
|
||||
#define UART_RXD_EDGE_CNT_S 0
|
||||
|
||||
/** UART_CLK_CONF_REG(i) register
|
||||
* UART core clock configuration
|
||||
*/
|
||||
#define UART_CLK_CONF_REG(i) (REG_UART_BASE(i) + 0x88)
|
||||
/** UART_TX_SCLK_EN : R/W; bitpos: [24]; default: 1;
|
||||
* Set this bit to enable UART Tx clock.
|
||||
*/
|
||||
#define UART_TX_SCLK_EN (BIT(24))
|
||||
#define UART_TX_SCLK_EN_M (UART_TX_SCLK_EN_V << UART_TX_SCLK_EN_S)
|
||||
#define UART_TX_SCLK_EN_V 0x00000001U
|
||||
#define UART_TX_SCLK_EN_S 24
|
||||
/** UART_RX_SCLK_EN : R/W; bitpos: [25]; default: 1;
|
||||
* Set this bit to enable UART Rx clock.
|
||||
*/
|
||||
#define UART_RX_SCLK_EN (BIT(25))
|
||||
#define UART_RX_SCLK_EN_M (UART_RX_SCLK_EN_V << UART_RX_SCLK_EN_S)
|
||||
#define UART_RX_SCLK_EN_V 0x00000001U
|
||||
#define UART_RX_SCLK_EN_S 25
|
||||
/** UART_TX_RST_CORE : R/W; bitpos: [26]; default: 0;
|
||||
* Write 1 then write 0 to this bit to reset UART Tx.
|
||||
*/
|
||||
#define UART_TX_RST_CORE (BIT(26))
|
||||
#define UART_TX_RST_CORE_M (UART_TX_RST_CORE_V << UART_TX_RST_CORE_S)
|
||||
#define UART_TX_RST_CORE_V 0x00000001U
|
||||
#define UART_TX_RST_CORE_S 26
|
||||
/** UART_RX_RST_CORE : R/W; bitpos: [27]; default: 0;
|
||||
* Write 1 then write 0 to this bit to reset UART Rx.
|
||||
*/
|
||||
#define UART_RX_RST_CORE (BIT(27))
|
||||
#define UART_RX_RST_CORE_M (UART_RX_RST_CORE_V << UART_RX_RST_CORE_S)
|
||||
#define UART_RX_RST_CORE_V 0x00000001U
|
||||
#define UART_RX_RST_CORE_S 27
|
||||
|
||||
/** UART_DATE_REG(i) register
|
||||
* UART Version register
|
||||
*/
|
||||
|
@@ -875,6 +875,33 @@ typedef union {
|
||||
uint32_t val;
|
||||
} uart_rs485_conf_sync_reg_t;
|
||||
|
||||
/** Type of clk_conf register
|
||||
* UART core clock configuration
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
uint32_t reserved_0:24;
|
||||
/** tx_sclk_en : R/W; bitpos: [24]; default: 1;
|
||||
* Set this bit to enable UART Tx clock.
|
||||
*/
|
||||
uint32_t tx_sclk_en:1;
|
||||
/** rx_sclk_en : R/W; bitpos: [25]; default: 1;
|
||||
* Set this bit to enable UART Rx clock.
|
||||
*/
|
||||
uint32_t rx_sclk_en:1;
|
||||
/** tx_rst_core : R/W; bitpos: [26]; default: 0;
|
||||
* Write 1 then write 0 to this bit to reset UART Tx.
|
||||
*/
|
||||
uint32_t tx_rst_core:1;
|
||||
/** rx_rst_core : R/W; bitpos: [27]; default: 0;
|
||||
* Write 1 then write 0 to this bit to reset UART Rx.
|
||||
*/
|
||||
uint32_t rx_rst_core:1;
|
||||
uint32_t reserved_28:4;
|
||||
};
|
||||
uint32_t val;
|
||||
} uart_clk_conf_reg_t;
|
||||
|
||||
|
||||
/** Group: Status Register */
|
||||
/** Type of status register
|
||||
@@ -1223,7 +1250,7 @@ typedef struct uart_dev_s {
|
||||
volatile uart_lowpulse_reg_t lowpulse;
|
||||
volatile uart_highpulse_reg_t highpulse;
|
||||
volatile uart_rxd_cnt_reg_t rxd_cnt;
|
||||
uint32_t reserved_088;
|
||||
volatile uart_clk_conf_reg_t clk_conf;
|
||||
volatile uart_date_reg_t date;
|
||||
volatile uart_afifo_status_reg_t afifo_status;
|
||||
uint32_t reserved_094;
|
||||
|
@@ -88,11 +88,11 @@ const uart_signal_conn_t uart_periph_signal[SOC_UART_NUM] = {
|
||||
* UART_HWFC_CONF_SYNC_REG, UART_SLEEP_CONF0_REG, UART_SLEEP_CONF1_REG, UART_SLEEP_CONF2_REG,
|
||||
* UART_SWFC_CONF0_SYNC_REG, UART_SWFC_CONF1_REG, UART_TXBRK_CONF_SYNC_REG, UART_IDLE_CONF_SYNC_REG,
|
||||
* UART_RS485_CONF_SYNC_REG, UART_AT_CMD_PRECNT_SYNC_REG, UART_AT_CMD_POSTCNT_SYNC_REG, UART_AT_CMD_GAPTOUT_SYNC_REG,
|
||||
* UART_AT_CMD_CHAR_SYNC_REG, UART_MEM_CONF_REG, UART_TOUT_CONF_SYNC_REG, UART_ID_REG
|
||||
* UART_AT_CMD_CHAR_SYNC_REG, UART_MEM_CONF_REG, UART_TOUT_CONF_SYNC_REG, UART_CLK_CONF_REG, UART_ID_REG
|
||||
*/
|
||||
#define UART_RETENTION_ADDR_MAP_REGS_CNT 21
|
||||
#define UART_RETENTION_ADDR_MAP_REGS_CNT 22
|
||||
#define UART_RETENTION_REGS_BASE(i) UART_INT_ENA_REG(i)
|
||||
static const uint32_t uart_regs_map[4] = {0x7fff6d, 0x10, 0x0, 0x0};
|
||||
static const uint32_t uart_regs_map[4] = {0x807fff6d, 0x10, 0x0, 0x0};
|
||||
#define UART_SLEEP_RETENTION_ENTRIES(uart_num) { \
|
||||
[0] = {.config = REGDMA_LINK_ADDR_MAP_INIT(REGDMA_UART_LINK(0x00), \
|
||||
UART_RETENTION_REGS_BASE(uart_num), UART_RETENTION_REGS_BASE(uart_num), \
|
||||
|
Reference in New Issue
Block a user