You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2026/04/01 02:06:52 UTC
(nuttx) branch master updated (8b57a48d8fd -> a9142d93cd9)
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
from 8b57a48d8fd arch/intel64: add CPU affinity support for irq
new 6480bb231dd arch/risc-v/espressif: Add LPUART support for esp32p4
new ae5c08c7587 Docs/risc-v/esp32p4: Add LPUART docs for esp32p4
new 7e321e0aba3 arch/risc-v/espressif: Add LPI2C support for esp32p4
new 93ff86fab7b boards/risc-v/esp32p4: Add LPI2C board support
new a9142d93cd9 Docs/risc-v/esp32p4: Add LPI2C docs
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
Documentation/platforms/risc-v/esp32p4/index.rst | 4 +-
arch/risc-v/src/common/espressif/Kconfig | 60 ++++++++++++++++++++----
arch/risc-v/src/common/espressif/esp_i2c.c | 15 +++---
arch/risc-v/src/common/espressif/esp_lowputc.c | 37 +++++++++++----
arch/risc-v/src/common/espressif/esp_serial.c | 18 ++++++-
boards/risc-v/esp32p4/common/src/esp_board_i2c.c | 4 ++
6 files changed, 108 insertions(+), 30 deletions(-)
(nuttx) 02/05: Docs/risc-v/esp32p4: Add LPUART docs for esp32p4
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit ae5c08c7587ce02a5e01ea3186bc2e1f1073b59d
Author: Eren Terzioglu <er...@espressif.com>
AuthorDate: Thu Mar 26 14:36:45 2026 +0100
Docs/risc-v/esp32p4: Add LPUART docs for esp32p4
Add LPUART docs for esp32p4
Signed-off-by: Eren Terzioglu <er...@espressif.com>
---
Documentation/platforms/risc-v/esp32p4/index.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/platforms/risc-v/esp32p4/index.rst b/Documentation/platforms/risc-v/esp32p4/index.rst
index 8f2aee02e6a..ae22d1c1478 100644
--- a/Documentation/platforms/risc-v/esp32p4/index.rst
+++ b/Documentation/platforms/risc-v/esp32p4/index.rst
@@ -284,7 +284,7 @@ Peripheral Support NOTES
LP SPI No
LP I2C No
LP I2S No
-LP UART No
+LP UART Yes
LP GPIO No
LP Timers No
LP ADC No
(nuttx) 01/05: arch/risc-v/espressif: Add LPUART support for esp32p4
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 6480bb231dd258ebfc28a0f071bc160489b8e2ef
Author: Eren Terzioglu <er...@espressif.com>
AuthorDate: Tue Mar 24 18:24:20 2026 +0100
arch/risc-v/espressif: Add LPUART support for esp32p4
Add LPUART support for esp32p4
Signed-off-by: Eren Terzioglu <er...@espressif.com>
---
arch/risc-v/src/common/espressif/Kconfig | 32 +++++++++++++++++++++-
arch/risc-v/src/common/espressif/esp_lowputc.c | 37 +++++++++++++++++++-------
arch/risc-v/src/common/espressif/esp_serial.c | 18 +++++++++++--
3 files changed, 74 insertions(+), 13 deletions(-)
diff --git a/arch/risc-v/src/common/espressif/Kconfig b/arch/risc-v/src/common/espressif/Kconfig
index 1ffba391b51..24fcb55b890 100644
--- a/arch/risc-v/src/common/espressif/Kconfig
+++ b/arch/risc-v/src/common/espressif/Kconfig
@@ -957,7 +957,7 @@ config ESPRESSIF_UART1
config ESPRESSIF_LP_UART0
bool "LP UART0"
default n
- depends on ARCH_CHIP_ESP32C6
+ depends on ARCH_CHIP_ESP32C6 || ARCH_CHIP_ESP32P4
select ESPRESSIF_UART
select ESPRESSIF_LP_UART
select LPUART0_SERIALDRIVER
@@ -2304,6 +2304,36 @@ config ESPRESSIF_UART1_CTSPIN
endif # ESPRESSIF_UART1
+if ESPRESSIF_LP_UART0
+
+config ESPRESSIF_LPUART0_TXPIN
+ int "LPUART0 TX Pin"
+ default 5 if ARCH_CHIP_ESP32C6
+ default 14 if ARCH_CHIP_ESP32P4
+ range 0 15 if ARCH_CHIP_ESP32P4
+ range 5 5 if ARCH_CHIP_ESP32C6
+
+config ESPRESSIF_LPUART0_RXPIN
+ int "LPUART0 RX Pin"
+ default 4 if ARCH_CHIP_ESP32C6
+ default 15 if ARCH_CHIP_ESP32P4
+ range 0 15 if ARCH_CHIP_ESP32P4
+ range 4 4 if ARCH_CHIP_ESP32C6
+
+config ESPRESSIF_LPUART0_RTSPIN
+ int
+ depends on SERIAL_IFLOWCONTROL
+ default 2 if ARCH_CHIP_ESP32C6
+ default -1 if ARCH_CHIP_ESP32P4
+
+config ESPRESSIF_LPUART0_CTSPIN
+ int
+ depends on SERIAL_OFLOWCONTROL
+ default 3 if ARCH_CHIP_ESP32C6
+ default -1 if ARCH_CHIP_ESP32P4
+
+endif # ESPRESSIF_LP_UART0
+
endmenu # UART Configuration
menu "TWAI driver options"
diff --git a/arch/risc-v/src/common/espressif/esp_lowputc.c b/arch/risc-v/src/common/espressif/esp_lowputc.c
index 87d040624c5..9db69b38d72 100644
--- a/arch/risc-v/src/common/espressif/esp_lowputc.c
+++ b/arch/risc-v/src/common/espressif/esp_lowputc.c
@@ -60,6 +60,7 @@
# include "hal/uart_periph.h"
# include "driver/rtc_io.h"
# include "io_mux.h"
+# include "driver/lp_io.h"
#endif
/****************************************************************************
@@ -209,10 +210,10 @@ struct esp_uart_s g_lp_uart0_config =
.stop_b2 = CONFIG_LPUART0_2STOP,
.bits = CONFIG_LPUART0_BITS,
.parity = CONFIG_LPUART0_PARITY,
- .txpin = LP_UART_DEFAULT_TX_GPIO_NUM,
- .rxpin = LP_UART_DEFAULT_RX_GPIO_NUM,
+ .txpin = CONFIG_ESPRESSIF_LPUART0_TXPIN,
+ .rxpin = CONFIG_ESPRESSIF_LPUART0_RXPIN,
#ifdef CONFIG_SERIAL_IFLOWCONTROL
- .rtspin = LP_UART_DEFAULT_RTS_GPIO_NUM,
+ .rtspin = CONFIG_ESPRESSIF_LPUART0_RTSPIN,
#ifdef CONFIG_LPUART0_IFLOWCONTROL
.iflow = true, /* input flow control (RTS) enabled */
#else
@@ -220,7 +221,7 @@ struct esp_uart_s g_lp_uart0_config =
#endif
#endif
#ifdef CONFIG_SERIAL_OFLOWCONTROL
- .ctspin = LP_UART_DEFAULT_CTS_GPIO_NUM,
+ .ctspin = CONFIG_ESPRESSIF_LPUART0_CTSPIN,
#ifdef CONFIG_LPUART0_OFLOWCONTROL
.oflow = true, /* output flow control (CTS) enabled */
#else
@@ -301,7 +302,24 @@ static void esp_lowputc_lp_uart_config_io(const struct esp_uart_s *priv,
#if !SOC_LP_GPIO_MATRIX_SUPPORTED
rtc_gpio_iomux_func_sel(pin, upin->iomux_func);
#else
- /* ToDo: Add LP UART for LP GPIO Matrix supported devices (e.g ESP32-P4) */
+
+ if (upin->default_gpio == pin)
+ {
+ rtc_gpio_iomux_func_sel(pin, upin->iomux_func);
+ }
+ else
+ {
+ rtc_gpio_iomux_func_sel(pin, 1);
+
+ if (direction == RTC_GPIO_MODE_OUTPUT_ONLY)
+ {
+ lp_gpio_connect_out_signal(pin, upin->signal, 0, 0);
+ }
+ else
+ {
+ lp_gpio_connect_in_signal(pin, upin->signal, 0);
+ }
+ }
#endif /* SOC_LP_GPIO_MATRIX_SUPPORTED */
spin_unlock_irqrestore(&priv->lock, flags);
@@ -502,12 +520,12 @@ void esp_lowputc_config_pins(const struct esp_uart_s *priv)
esp_lowputc_lp_uart_config_io(priv,
priv->rxpin,
RTC_GPIO_MODE_INPUT_ONLY,
- SOC_UART_RX_PIN_IDX);
+ SOC_UART_PERIPH_SIGNAL_RX);
esp_lowputc_lp_uart_config_io(priv,
priv->txpin,
RTC_GPIO_MODE_OUTPUT_ONLY,
- SOC_UART_TX_PIN_IDX);
+ SOC_UART_PERIPH_SIGNAL_TX);
#ifdef CONFIG_SERIAL_IFLOWCONTROL
if (priv->iflow)
@@ -515,7 +533,7 @@ void esp_lowputc_config_pins(const struct esp_uart_s *priv)
esp_lowputc_lp_uart_config_io(priv,
priv->rtspin,
RTC_GPIO_MODE_OUTPUT_ONLY,
- SOC_UART_RTS_PIN_IDX);
+ SOC_UART_PERIPH_SIGNAL_RTS);
}
#endif
@@ -525,7 +543,7 @@ void esp_lowputc_config_pins(const struct esp_uart_s *priv)
esp_lowputc_lp_uart_config_io(priv,
priv->ctspin,
RTC_GPIO_MODE_INPUT_ONLY,
- SOC_UART_CTS_PIN_IDX);
+ SOC_UART_PERIPH_SIGNAL_CTS);
}
#endif
}
@@ -612,7 +630,6 @@ void esp_lowsetup(void)
#endif
#ifdef CONFIG_ESPRESSIF_LP_UART0
- esp_lowputc_enable_sysclk(&g_lp_uart0_config);
esp_lowputc_config_pins(&g_lp_uart0_config);
#endif
diff --git a/arch/risc-v/src/common/espressif/esp_serial.c b/arch/risc-v/src/common/espressif/esp_serial.c
index a89b739c99e..dd411120675 100644
--- a/arch/risc-v/src/common/espressif/esp_serial.c
+++ b/arch/risc-v/src/common/espressif/esp_serial.c
@@ -487,7 +487,7 @@ static int esp_setup(uart_dev_t *dev)
LP_UART_SRC_CLK_ATOMIC()
{
lp_uart_ll_enable_bus_clock(0, true);
- lp_uart_ll_set_source_clk(priv->hal->dev, sclk_freq);
+ lp_uart_ll_set_source_clk(priv->hal->dev, LP_UART_SCLK_DEFAULT);
lp_uart_ll_sclk_enable(0);
}
}
@@ -506,6 +506,21 @@ static int esp_setup(uart_dev_t *dev)
success = uart_hal_set_baudrate(priv->hal, priv->baud, sclk_freq);
}
}
+#ifdef CONFIG_ESPRESSIF_LP_UART
+ else
+ {
+ /* Override protocol parameters from the configuration */
+
+ if (!lp_uart_ll_set_baudrate(priv->hal->dev, priv->baud, sclk_freq))
+ {
+ /* Unachievable baud rate */
+
+ return ESP_FAIL;
+ }
+
+ success = true;
+ }
+#endif
uart_hal_set_parity(priv->hal, priv->parity);
set_data_length(priv);
@@ -691,7 +706,6 @@ static void esp_detach(uart_dev_t *dev)
/* Disable and detach the CPU interrupt */
up_disable_irq(ESP_SOURCE2IRQ(source));
- irq_detach(ESP_SOURCE2IRQ(source));
/* Disassociate the peripheral interrupt from the CPU interrupt */
(nuttx) 03/05: arch/risc-v/espressif: Add LPI2C support for esp32p4
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 7e321e0aba3859614dc65242a3f60737a0238cd4
Author: Eren Terzioglu <er...@espressif.com>
AuthorDate: Fri Mar 27 09:34:37 2026 +0100
arch/risc-v/espressif: Add LPI2C support for esp32p4
Add LPI2C support for esp32p4
Signed-off-by: Eren Terzioglu <er...@espressif.com>
---
arch/risc-v/src/common/espressif/Kconfig | 28 +++++++++++++++++++---------
arch/risc-v/src/common/espressif/esp_i2c.c | 15 +++++++++------
2 files changed, 28 insertions(+), 15 deletions(-)
diff --git a/arch/risc-v/src/common/espressif/Kconfig b/arch/risc-v/src/common/espressif/Kconfig
index 24fcb55b890..2c888d55f1b 100644
--- a/arch/risc-v/src/common/espressif/Kconfig
+++ b/arch/risc-v/src/common/espressif/Kconfig
@@ -3123,7 +3123,8 @@ config ESPRESSIF_I2C0_SCLPIN
config ESPRESSIF_I2C0_SDAPIN
int "I2C0 SDA Pin"
- default 5
+ default 5 if !ESPRESSIF_LPI2C
+ default 22 if ESPRESSIF_LPI2C
range 0 21 if ARCH_CHIP_ESP32C3
range 0 30 if ARCH_CHIP_ESP32C6
range 0 27 if ARCH_CHIP_ESP32H2
@@ -3175,22 +3176,31 @@ choice ESPRESSIF_LPI2C_MODE
default ESPRESSIF_LPI2C_MASTER_MODE
config ESPRESSIF_LPI2C_MASTER_MODE
- bool "I2C0 Master Mode"
+ bool "LP I2C0 Master Mode"
select ESPRESSIF_I2C_PERIPH_MASTER_MODE
endchoice # ESPRESSIF_LPI2C_MODE
-config ESPRESSIF_LPI2C_SCLPIN
- int "LPI2C SCL Pin"
- default 7
+if ESPRESSIF_LP_I2C0
+
+config ESPRESSIF_LPI2C0_SCLPIN
+ int "LPI2C0 SCL Pin"
+ default 7 if ARCH_CHIP_ESP32C6
+ default 4 if ARCH_CHIP_ESP32P4
+ range 7 7 if ARCH_CHIP_ESP32C6
+ range 0 15 if ARCH_CHIP_ESP32P4
range 7 7 if ARCH_CHIP_ESP32C6
-config ESPRESSIF_LPI2C_SDAPIN
- int "LPI2C SDA Pin"
- default 6
+config ESPRESSIF_LPI2C0_SDAPIN
+ int "LPI2C0 SDA Pin"
+ default 6 if ARCH_CHIP_ESP32C6
+ default 5 if ARCH_CHIP_ESP32P4
+ range 6 6 if ARCH_CHIP_ESP32C6
+ range 0 15 if ARCH_CHIP_ESP32P4
range 6 6 if ARCH_CHIP_ESP32C6
-endif # ESPRESSIF_LPI2C
+endif # ESPRESSIF_LP_I2C0
+endif # ESPRESSIF_LP_I2C
if ESPRESSIF_I2C_BITBANG
diff --git a/arch/risc-v/src/common/espressif/esp_i2c.c b/arch/risc-v/src/common/espressif/esp_i2c.c
index c37adb66c7d..f86ea217db5 100644
--- a/arch/risc-v/src/common/espressif/esp_i2c.c
+++ b/arch/risc-v/src/common/espressif/esp_i2c.c
@@ -70,6 +70,7 @@
# include "io_mux.h"
# include "lp_core_i2c.h"
# include "soc/i2c_struct.h"
+# include "driver/lp_io.h"
#endif
/****************************************************************************
@@ -430,8 +431,8 @@ i2c_hal_context_t lp_i2c0_ctx =
static struct esp_i2c_config_s esp_lp_i2c0_config =
{
.clk_freq = I2C_CLK_FREQ_DEF,
- .scl_pin = 7,
- .sda_pin = 6,
+ .scl_pin = CONFIG_ESPRESSIF_LPI2C0_SCLPIN,
+ .sda_pin = CONFIG_ESPRESSIF_LPI2C0_SDAPIN,
};
static struct esp_i2c_priv_s esp_lp_i2c0_priv =
@@ -891,10 +892,12 @@ static void esp_i2c_init(struct esp_i2c_priv_s *priv)
rtc_gpio_iomux_func_sel(config->sda_pin, p_i2c_pin->iomux_func);
rtc_gpio_iomux_func_sel(config->scl_pin, p_i2c_pin->iomux_func);
#else
- /* ToDo: Add LP I2C for LP GPIO Matrix
- * supported devices (e.g ESP32-P4)
- */
-
+ lp_gpio_connect_out_signal(config->sda_pin, p_i2c_pin->sda_out_sig, 0,
+ 0);
+ lp_gpio_connect_in_signal(config->sda_pin, p_i2c_pin->sda_in_sig, 0);
+ lp_gpio_connect_out_signal(config->scl_pin, p_i2c_pin->scl_out_sig, 0,
+ 0);
+ lp_gpio_connect_in_signal(config->scl_pin, p_i2c_pin->scl_in_sig, 0);
#endif /* SOC_LP_GPIO_MATRIX_SUPPORTED */
}
#endif
(nuttx) 04/05: boards/risc-v/esp32p4: Add LPI2C board support
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 93ff86fab7bd07e9c53727d57e2ce3b2888910b8
Author: Eren Terzioglu <er...@espressif.com>
AuthorDate: Fri Mar 27 10:44:34 2026 +0100
boards/risc-v/esp32p4: Add LPI2C board support
Add LPI2C board support for esp32p4
Signed-off-by: Eren Terzioglu <er...@espressif.com>
---
boards/risc-v/esp32p4/common/src/esp_board_i2c.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/boards/risc-v/esp32p4/common/src/esp_board_i2c.c b/boards/risc-v/esp32p4/common/src/esp_board_i2c.c
index 76cbbc6cf43..90a69d3f53f 100644
--- a/boards/risc-v/esp32p4/common/src/esp_board_i2c.c
+++ b/boards/risc-v/esp32p4/common/src/esp_board_i2c.c
@@ -164,5 +164,9 @@ int board_i2c_init(void)
ret = i2c_slave_driver_init(ESPRESSIF_I2C0_SLAVE, I2C0_SLAVE_ADDR);
#endif
+#ifdef CONFIG_ESPRESSIF_LP_I2C0
+ ret = i2c_driver_init(ESPRESSIF_LP_I2C0);
+#endif
+
return ret;
}
(nuttx) 05/05: Docs/risc-v/esp32p4: Add LPI2C docs
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit a9142d93cd9ce117f8ec8b88516c926c8b278bcb
Author: Eren Terzioglu <er...@espressif.com>
AuthorDate: Fri Mar 27 10:11:15 2026 +0100
Docs/risc-v/esp32p4: Add LPI2C docs
Add LPI2C docs for esp32p4
Signed-off-by: Eren Terzioglu <er...@espressif.com>
---
Documentation/platforms/risc-v/esp32p4/index.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/platforms/risc-v/esp32p4/index.rst b/Documentation/platforms/risc-v/esp32p4/index.rst
index ae22d1c1478..616c7b08bdc 100644
--- a/Documentation/platforms/risc-v/esp32p4/index.rst
+++ b/Documentation/platforms/risc-v/esp32p4/index.rst
@@ -282,7 +282,7 @@ LP Peripherals
Peripheral Support NOTES
================= ======= ==================================
LP SPI No
-LP I2C No
+LP I2C Yes
LP I2S No
LP UART Yes
LP GPIO No