mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-04 20:40:00 +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 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -1256,27 +1256,6 @@ extern "C" {
|
||||
#define LP_UART_SCLK_DIV_NUM_M (LP_UART_SCLK_DIV_NUM_V << LP_UART_SCLK_DIV_NUM_S)
|
||||
#define LP_UART_SCLK_DIV_NUM_V 0x000000FFU
|
||||
#define LP_UART_SCLK_DIV_NUM_S 12
|
||||
/** LP_UART_SCLK_SEL : R/W; bitpos: [21:20]; default: 3;
|
||||
* UART clock source select. 1: 80Mhz. 2: 8Mhz. 3: XTAL.
|
||||
*/
|
||||
#define LP_UART_SCLK_SEL 0x00000003U
|
||||
#define LP_UART_SCLK_SEL_M (LP_UART_SCLK_SEL_V << LP_UART_SCLK_SEL_S)
|
||||
#define LP_UART_SCLK_SEL_V 0x00000003U
|
||||
#define LP_UART_SCLK_SEL_S 20
|
||||
/** LP_UART_SCLK_EN : R/W; bitpos: [22]; default: 1;
|
||||
* Set this bit to enable UART Tx/Rx clock.
|
||||
*/
|
||||
#define LP_UART_SCLK_EN (BIT(22))
|
||||
#define LP_UART_SCLK_EN_M (LP_UART_SCLK_EN_V << LP_UART_SCLK_EN_S)
|
||||
#define LP_UART_SCLK_EN_V 0x00000001U
|
||||
#define LP_UART_SCLK_EN_S 22
|
||||
/** LP_UART_RST_CORE : R/W; bitpos: [23]; default: 0;
|
||||
* Write 1 then write 0 to this bit to reset UART Tx/Rx.
|
||||
*/
|
||||
#define LP_UART_RST_CORE (BIT(23))
|
||||
#define LP_UART_RST_CORE_M (LP_UART_RST_CORE_V << LP_UART_RST_CORE_S)
|
||||
#define LP_UART_RST_CORE_V 0x00000001U
|
||||
#define LP_UART_RST_CORE_S 23
|
||||
/** LP_UART_TX_SCLK_EN : R/W; bitpos: [24]; default: 1;
|
||||
* Set this bit to enable UART Tx clock.
|
||||
*/
|
||||
|
@@ -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 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 register
|
||||
* UART Version register
|
||||
*/
|
||||
|
@@ -883,27 +883,16 @@ typedef union {
|
||||
/** sclk_div_b : R/W; bitpos: [5:0]; default: 0;
|
||||
* The denominator of the frequency divider factor.
|
||||
*/
|
||||
uint32_t sclk_div_b:6;
|
||||
uint32_t sclk_div_b:6; /* UART0/1 instance have this field reserved, configure in corresponding PCR registers */
|
||||
/** sclk_div_a : R/W; bitpos: [11:6]; default: 0;
|
||||
* The numerator of the frequency divider factor.
|
||||
*/
|
||||
uint32_t sclk_div_a:6;
|
||||
uint32_t sclk_div_a:6; /* UART0/1 instance have this field reserved, configure in corresponding PCR registers */
|
||||
/** sclk_div_num : R/W; bitpos: [19:12]; default: 1;
|
||||
* The integral part of the frequency divider factor.
|
||||
*/
|
||||
uint32_t sclk_div_num:8;
|
||||
/** sclk_sel : R/W; bitpos: [21:20]; default: 3;
|
||||
* UART clock source select. 1: 80Mhz. 2: 8Mhz. 3: XTAL.
|
||||
*/
|
||||
uint32_t sclk_sel:2;
|
||||
/** sclk_en : R/W; bitpos: [22]; default: 1;
|
||||
* Set this bit to enable UART Tx/Rx clock.
|
||||
*/
|
||||
uint32_t sclk_en:1;
|
||||
/** rst_core : R/W; bitpos: [23]; default: 0;
|
||||
* Write 1 then write 0 to this bit to reset UART Tx/Rx.
|
||||
*/
|
||||
uint32_t rst_core:1;
|
||||
uint32_t sclk_div_num:8; /* UART0/1 instance have this field reserved, configure in corresponding PCR registers */
|
||||
uint32_t reserved_20:4;
|
||||
/** tx_sclk_en : R/W; bitpos: [24]; default: 1;
|
||||
* Set this bit to enable UART Tx clock.
|
||||
*/
|
||||
@@ -1273,7 +1262,7 @@ typedef struct uart_dev_s {
|
||||
volatile uart_lowpulse_reg_t lowpulse; /* LP_UART instance has this register reserved */
|
||||
volatile uart_highpulse_reg_t highpulse; /* LP_UART instance has this register reserved */
|
||||
volatile uart_rxd_cnt_reg_t rxd_cnt; /* LP_UART instance has this register reserved */
|
||||
volatile uart_clk_conf_reg_t clk_conf; /* UART0/1 instance have this register reserved, configure in corresponding PCR registers */
|
||||
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;
|
||||
|
@@ -121,11 +121,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