Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport v3.7.99-ncs1-branch] drivers: serial: nrfx_uarte: Legacy shim rework to support nrf54x and runtime device PM #2175

Merged
merged 23 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
83f9d65
[nrf fromtree] drivers: serial: nrfx_uarte: Split async control block…
nordic-krch Sep 10, 2024
afbaae2
[nrf fromtree] dts: nordic: nrf-uarte: Add frame-timeout-supported pr…
nordic-krch Jun 25, 2024
6537e85
[nrf fromtree] drivers: serial: nrfx_uarte: Remove CONFIG_UART_n_GPIO…
nordic-krch Sep 20, 2024
c66f0ce
[nrf fromtree] drivers: serial: nrfx_uarte2: Remove CONFIG_UART_n_GPI…
nordic-krch Sep 24, 2024
6691a60
[nrf fromtree] doc: releases: Add not about CONFIG_UART_n_GPIO_MANAGE…
nordic-krch Sep 24, 2024
d36c55c
[nrf fromtree] drivers: serial: nrfx_uarte: Use nrfx_gppi helper
nordic-krch Sep 24, 2024
2a8dffe
[nrf fromtree] drivers: serial: nrfx_uarte: Refactor to use RX async …
nordic-krch Sep 24, 2024
d15a709
[nrf fromtree] drivers: serial: nrfx_uarte: Rework driver to support …
nordic-krch Sep 24, 2024
fdb2a68
[nrf fromtree] drivers: serial: nrfx_uarte: Add support for frame tim…
nordic-krch Jul 4, 2024
979f42f
[nrf fromtree] drivers: serial: nrfx_uarte: Add support for DMM and c…
nordic-krch Sep 16, 2024
dcb2cf3
[nrf fromtree] drivers: serial: nrfx_uarte: Improve RX FIFO flush wor…
nordic-krch Jul 9, 2024
94c724b
[nrf fromtree] drivers: serial: nrfx_uarte: Add workaround for BAUDRA…
nordic-krch Sep 17, 2024
a2a5821
[nrf fromtree] drivers: serial: nrfx_uarte: Add lock to uart_rx_disable
nordic-krch Sep 17, 2024
772621e
[nrf fromtree] boards: native: nrf_bsim: Add include path to common
nordic-krch Oct 21, 2024
fb5ce4f
[nrf fromtree] tests: drivers: uart: async_api: Make long buffer conf…
nordic-krch Jul 19, 2024
07074e5
[nrf fromtree] tests: drivers: uart: async_api: Use custom long buffe…
nordic-krch Oct 23, 2024
a844f40
[nrf fromtree] tests: drivers: uart: uart_async_api: Add nrf54l15dk//…
nordic-krch Oct 22, 2024
3d368d8
[nrf fromtree] drivers: serial: nrfx_uarte: Add missing closing bracket
nordic-krch Oct 22, 2024
b07d962
[nrf fromtree] drivers: serial: nrfx_uarte: Remove unused element fro…
nordic-krch Oct 21, 2024
fb35894
[nrf fromtree] drivers: serial: nrfx_uarte: Add runtime PM
nordic-krch Sep 16, 2024
e4cc211
[nrf fromtree] drivers: serial: nrfx_uarte: Improve RX FIFO flushing …
nordic-krch Oct 25, 2024
dcd3a45
[nrf fromtree] drivers: serial: nrfx_uarte: Use legacy shim by default
nordic-krch Oct 7, 2024
63d32a2
[nrf fromtree] drivers: serial: nrfx_uarte: Minor code size optimization
nordic-krch Oct 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions boards/native/nrf_bsim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ zephyr_include_directories(
common
common/cmsis
${NSI_DIR}/common/src/include
${ZEPHYR_BASE}/soc/nordic/common
)

zephyr_library_include_directories(
Expand Down
2 changes: 2 additions & 0 deletions doc/releases/release-notes-4.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ Drivers and Sensors
* Serial

* LiteX: Renamed the ``compatible`` from ``litex,uart0`` to :dtcompatible:`litex,uart`.
* Nordic: Removed ``CONFIG_UART_n_GPIO_MANAGEMENT`` Kconfig options (where n is an instance
index) which had no use after pinctrl driver was introduced.

* SPI

Expand Down
16 changes: 12 additions & 4 deletions drivers/serial/Kconfig.nrfx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,20 @@ config UART_NRFX_UARTE
config UART_NRFX_UARTE_LEGACY_SHIM
bool "Legacy UARTE shim"
depends on UART_NRFX_UARTE
depends on !SOC_SERIES_NRF54LX
depends on !SOC_SERIES_NRF54HX || RISCV
depends on !SOC_SERIES_NRF92X || RISCV
# New shim takes more ROM. Until it is fixed use legacy shim.
default y

config UART_NRFX_UARTE_ENHANCED_RX
bool "Enhanced RX handling"
depends on UART_ASYNC_API
depends on UART_NRFX_UARTE_LEGACY_SHIM
default y if !(UART_0_NRF_HW_ASYNC || UART_1_NRF_HW_ASYNC || UART_2_NRF_HW_ASYNC)
help
Enable RX handling mode which is switching buffers on timeout. This is an
enhancement compared to other two modes (default and hardware assisted).
Default mode could miscount bytes when interrupt was not handled on time
and hardware assisted required TIMER peripheral instance and PPI channel
for accurate byte counting.

config UART_ASYNC_TX_CACHE_SIZE
int "TX cache buffer size"
depends on UART_ASYNC_API
Expand Down
13 changes: 4 additions & 9 deletions drivers/serial/Kconfig.nrfx_uart_instance
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,14 @@ config UART_$(nrfx_uart_num)_NRF_ASYNC_LOW_POWER
depends on HAS_HW_NRF_UARTE$(nrfx_uart_num)
depends on UART_ASYNC_API
depends on UART_NRFX_UARTE_LEGACY_SHIM
default y if !PM_DEVICE
help
When enabled, UARTE is enabled before each TX or RX usage and disabled
when not used. Disabling UARTE while in idle allows to achieve lowest
power consumption. It is only feasible if receiver is not always on.
This option is irrelevant when device power management (PM) is enabled
because then device state is controlled by the PM actions.


config UART_$(nrfx_uart_num)_NRF_HW_ASYNC_TIMER
int "Timer instance"
Expand Down Expand Up @@ -119,12 +123,3 @@ config UART_$(nrfx_uart_num)_A2I_RX_BUF_COUNT
default 0
help
Number of chunks into RX space is divided.

config UART_$(nrfx_uart_num)_GPIO_MANAGEMENT
bool "GPIO management on port $(nrfx_uart_num)"
depends on PM_DEVICE
default y
help
If enabled, the driver will configure the GPIOs used by the uart to
their default configuration when device is powered down. The GPIOs
will be configured back to correct state when UART is powered up.
19 changes: 6 additions & 13 deletions drivers/serial/uart_nrfx_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1087,12 +1087,9 @@ static int uart_nrfx_pm_action(const struct device *dev,

switch (action) {
case PM_DEVICE_ACTION_RESUME:
if (IS_ENABLED(CONFIG_UART_0_GPIO_MANAGEMENT)) {
ret = pinctrl_apply_state(config->pcfg,
PINCTRL_STATE_DEFAULT);
if (ret < 0) {
return ret;
}
ret = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT);
if (ret < 0) {
return ret;
}

nrf_uart_enable(uart0_addr);
Expand All @@ -1103,13 +1100,9 @@ static int uart_nrfx_pm_action(const struct device *dev,
break;
case PM_DEVICE_ACTION_SUSPEND:
nrf_uart_disable(uart0_addr);

if (IS_ENABLED(CONFIG_UART_0_GPIO_MANAGEMENT)) {
ret = pinctrl_apply_state(config->pcfg,
PINCTRL_STATE_SLEEP);
if (ret < 0) {
return ret;
}
ret = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP);
if (ret < 0) {
return ret;
}
break;
default:
Expand Down
Loading
Loading