uart: fix misleading files for UART2

Includes: header files, ld files and clk.c

ESP32-C3 only have UART0 and UART1.
This commit is contained in:
Michael (XIAO Xufeng) 2021-04-26 12:31:53 +08:00
parent 835a652a63
commit a0d13a31ec
5 changed files with 10 additions and 17 deletions

View File

@ -1,6 +1,5 @@
PROVIDE ( UART0 = 0x60000000 ); PROVIDE ( UART0 = 0x60000000 );
PROVIDE ( UART1 = 0x60010000 ); PROVIDE ( UART1 = 0x60010000 );
PROVIDE ( UART2 = 0x6002e000 );
PROVIDE ( SPIMEM1 = 0x60002000 ); PROVIDE ( SPIMEM1 = 0x60002000 );
PROVIDE ( SPIMEM0 = 0x60003000 ); PROVIDE ( SPIMEM0 = 0x60003000 );
PROVIDE ( GPIO = 0x60004000 ); PROVIDE ( GPIO = 0x60004000 );

View File

@ -191,7 +191,7 @@ int ets_printf(const char *fmt, ...);
* @brief Set the uart channel of ets_printf(uart_tx_one_char). * @brief Set the uart channel of ets_printf(uart_tx_one_char).
* ROM will set it base on the efuse and gpio setting, however, this can be changed after booting. * ROM will set it base on the efuse and gpio setting, however, this can be changed after booting.
* *
* @param uart_no : 0 for UART0, 1 for UART1, 2 for UART2. * @param uart_no : 0 for UART0, 1 for UART1.
* *
* @return None * @return None
*/ */

View File

@ -260,7 +260,7 @@ void uart_tx_flush(uint8_t uart_no);
/** /**
* @brief Wait until uart tx full empty and the last char send ok. * @brief Wait until uart tx full empty and the last char send ok.
* *
* @param uart_no : 0 for UART0, 1 for UART1, 2 for UART2 * @param uart_no : 0 for UART0, 1 for UART1
* *
* The function defined in ROM code has a bug, so we define the correct version * The function defined in ROM code has a bug, so we define the correct version
* here for compatibility. * here for compatibility.

View File

@ -244,9 +244,6 @@ __attribute__((weak)) void esp_perip_clk_init(void)
#endif #endif
#if CONFIG_CONSOLE_UART_NUM != 1 #if CONFIG_CONSOLE_UART_NUM != 1
SYSTEM_UART1_CLK_EN | SYSTEM_UART1_CLK_EN |
#endif
#if CONFIG_CONSOLE_UART_NUM != 2
SYSTEM_UART2_CLK_EN |
#endif #endif
SYSTEM_SPI2_CLK_EN | SYSTEM_SPI2_CLK_EN |
SYSTEM_I2C_EXT0_CLK_EN | SYSTEM_I2C_EXT0_CLK_EN |
@ -278,9 +275,6 @@ __attribute__((weak)) void esp_perip_clk_init(void)
#endif #endif
#if CONFIG_CONSOLE_UART_NUM != 1 #if CONFIG_CONSOLE_UART_NUM != 1
SYSTEM_UART1_CLK_EN | SYSTEM_UART1_CLK_EN |
#endif
#if CONFIG_CONSOLE_UART_NUM != 2
SYSTEM_UART2_CLK_EN |
#endif #endif
SYSTEM_SPI2_CLK_EN | SYSTEM_SPI2_CLK_EN |
SYSTEM_I2C_EXT0_CLK_EN | SYSTEM_I2C_EXT0_CLK_EN |

View File

@ -67,14 +67,14 @@
#define DR_REG_APB_SARADC_BASE 0x60040000 #define DR_REG_APB_SARADC_BASE 0x60040000
#define DR_REG_AES_XTS_BASE 0x600CC000 #define DR_REG_AES_XTS_BASE 0x600CC000
#define REG_UHCI_BASE(i) (DR_REG_UHCI0_BASE - (i) * 0x8000) #define REG_UHCI_BASE(i) (DR_REG_UHCI0_BASE - (i) * 0x8000)
#define REG_UART_BASE( i ) (DR_REG_UART_BASE + (i) * 0x10000 + ( (i) > 1 ? 0xe000 : 0 ) ) #define REG_UART_BASE(i) (DR_REG_UART_BASE + (i) * 0x10000)
#define REG_UART_AHB_BASE(i) (0x60000000 + (i) * 0x10000 + ( (i) > 1 ? 0xe000 : 0 ) ) #define REG_UART_AHB_BASE(i) (0x60000000 + (i) * 0x10000)
#define UART_FIFO_AHB_REG(i) (REG_UART_AHB_BASE(i) + 0x0) #define UART_FIFO_AHB_REG(i) (REG_UART_AHB_BASE(i) + 0x0)
#define REG_I2S_BASE( i ) (DR_REG_I2S_BASE + (i) * 0x1E000) #define REG_I2S_BASE(i) (DR_REG_I2S_BASE + (i) * 0x1E000)
#define REG_TIMG_BASE(i) (DR_REG_TIMERGROUP0_BASE + (i)*0x1000) #define REG_TIMG_BASE(i) (DR_REG_TIMERGROUP0_BASE + (i)*0x1000)
#define REG_SPI_MEM_BASE(i) (DR_REG_SPI0_BASE - (i) * 0x1000) #define REG_SPI_MEM_BASE(i) (DR_REG_SPI0_BASE - (i) * 0x1000)
#define REG_I2C_BASE(i) (DR_REG_I2C_EXT_BASE + (i) * 0x14000 ) #define REG_I2C_BASE(i) (DR_REG_I2C_EXT_BASE + (i) * 0x14000 )
//Registers Operation {{ //Registers Operation {{
#define ETS_UNCACHED_ADDR(addr) (addr) #define ETS_UNCACHED_ADDR(addr) (addr)