Skip to content

Commit

Permalink
drivers: serial: nrfx_uarte: Deprecate non-legacy shim
Browse files Browse the repository at this point in the history
Some time ago a new shim for nRF UARTE was added (uart_nrfx_uarte2.c)
which used nrfx_uarte.c driver underneath. It was supposed to support
nrf54x platforms. However, later on legacy driver (uart_nrfx_uarte.c)
was extended to support nrf54x platforms and it takes less code size,
has better performance and more features. Shim uart_nrfx_uarte2 will
no longer be supported. As new shim is the default and there is a
Kconfig to pick the legacy shim (CONFIG_UART_NRFX_UARTE_LEGACY_SHIM=y)
it cannot be deprecated in the normal way. Additional Kconfig option
is created (DEPRECATED_UART_NRFX_UARTE_LEGACY_SHIM) which is enabled
if CONFIG_UART_NRFX_UARTE_LEGACY_SHIM=n and it selects DEPRECATED.
A warning was also added to the CMakeLists.txt.

Patch removes use CONFIG_UART_NRFX_UARTE_LEGACY_SHIM in tests.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
  • Loading branch information
nordic-krch committed Jan 10, 2025
1 parent bc6eded commit a0d45c6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 22 deletions.
2 changes: 2 additions & 0 deletions drivers/serial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ if (CONFIG_UART_NRFX_UARTE)
if (CONFIG_UART_NRFX_UARTE_LEGACY_SHIM)
zephyr_library_sources(uart_nrfx_uarte.c)
else()
message(DEPRECATION
"Do not set CONFIG_UART_NRFX_UARTE_LEGACY_SHIM=n as this option is deprecated.")
zephyr_library_sources(uart_nrfx_uarte2.c)
endif()
endif()
Expand Down
2 changes: 2 additions & 0 deletions drivers/serial/Kconfig.nrfx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ config UART_NRFX_UARTE_LEGACY_SHIM
bool "Legacy UARTE shim"
depends on UART_NRFX_UARTE
default y
help
Disabling this option is deprecated.

config UART_NRFX_UARTE_ENHANCED_RX
bool "Enhanced RX handling"
Expand Down
5 changes: 5 additions & 0 deletions soc/nordic/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,9 @@ config NRF_PLATFORM_HALTIUM
this option. This allows to easily enable common functionality on
SoCs based on the Haltium platform.

config DEPRECATED_UART_NRFX_UARTE_LEGACY_SHIM
bool
default y if !UART_NRFX_UARTE_LEGACY_SHIM
select DEPRECATED

endif # SOC_FAMILY_NORDIC_NRF
14 changes: 0 additions & 14 deletions tests/drivers/uart/uart_async_api/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,6 @@ tests:
platform_allow: nucleo_h743zi
integration_platforms:
- nucleo_h743zi
drivers.uart.async_api.nrf_uarte_new:
platform_allow:
- nrf52840dk/nrf52840
- nrf52_bsim
- nrf5340bsim/nrf5340/cpuapp
- nrf54l20pdk/nrf54l20/cpuapp
- nrf54l15bsim/nrf54l15/cpuapp
filter: CONFIG_SERIAL_SUPPORT_ASYNC
harness: ztest
harness_config:
fixture: gpio_loopback
depends_on: gpio
extra_configs:
- CONFIG_UART_NRFX_UARTE_LEGACY_SHIM=n
drivers.uart.async_api.nrf_uart:
filter: CONFIG_SERIAL_SUPPORT_ASYNC
harness: ztest
Expand Down

This file was deleted.

9 changes: 2 additions & 7 deletions tests/drivers/uart/uart_pm/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,26 @@ tests:
- CONFIG_UART_INTERRUPT_DRIVEN=n
- CONFIG_UART_ASYNC_API=n
- CONFIG_UART_0_ENHANCED_POLL_OUT=n
- CONFIG_UART_NRFX_UARTE_LEGACY_SHIM=y

drivers.uart.pm.no_rxpin:
extra_configs:
- CONFIG_UART_INTERRUPT_DRIVEN=n
- CONFIG_UART_ASYNC_API=n
- CONFIG_UART_0_ENHANCED_POLL_OUT=n
- CONFIG_UART_NRFX_UARTE_LEGACY_SHIM=y
extra_args: DTC_OVERLAY_FILE="boards/nrf52840dk_nrf52840.overlay;nrf_rx_disable.overlay"
platform_exclude:
- nrf54l15dk/nrf54l15/cpuapp
- nrf54l20pdk/nrf54l20/cpuapp
- nrf54l15bsim/nrf54l15/cpuapp
- nrf54h20dk/nrf54h20/cpuapp
- nrf52_bsim
- nrf5340bsim/nrf5340/cpuapp

drivers.uart.pm.enhanced_poll:
extra_configs:
- CONFIG_UART_INTERRUPT_DRIVEN=n
- CONFIG_UART_ASYNC_API=n
- CONFIG_UART_0_ENHANCED_POLL_OUT=y
- CONFIG_UART_NRFX_UARTE_LEGACY_SHIM=y
platform_exclude:
- nrf54l15dk/nrf54l15/cpuapp
- nrf54l20pdk/nrf54l20/cpuapp
Expand All @@ -54,15 +53,13 @@ tests:
- CONFIG_UART_0_INTERRUPT_DRIVEN=y
- CONFIG_UART_ASYNC_API=n
- CONFIG_UART_0_ENHANCED_POLL_OUT=n
- CONFIG_UART_NRFX_UARTE_LEGACY_SHIM=y

drivers.uart.pm.int_driven.enhanced_poll:
extra_configs:
- CONFIG_UART_INTERRUPT_DRIVEN=y
- CONFIG_UART_0_INTERRUPT_DRIVEN=y
- CONFIG_UART_ASYNC_API=n
- CONFIG_UART_0_ENHANCED_POLL_OUT=y
- CONFIG_UART_NRFX_UARTE_LEGACY_SHIM=y
platform_exclude:
- nrf54l15dk/nrf54l15/cpuapp
- nrf54l20pdk/nrf54l20/cpuapp
Expand All @@ -74,15 +71,13 @@ tests:
- CONFIG_UART_ASYNC_API=y
- CONFIG_UART_0_ASYNC=y
- CONFIG_UART_0_ENHANCED_POLL_OUT=n
- CONFIG_UART_NRFX_UARTE_LEGACY_SHIM=y

drivers.uart.pm.async.enhanced_poll:
extra_configs:
- CONFIG_UART_INTERRUPT_DRIVEN=n
- CONFIG_UART_ASYNC_API=y
- CONFIG_UART_0_ASYNC=y
- CONFIG_UART_0_ENHANCED_POLL_OUT=y
- CONFIG_UART_NRFX_UARTE_LEGACY_SHIM=y
platform_exclude:
- nrf54l15dk/nrf54l15/cpuapp
- nrf54l20pdk/nrf54l20/cpuapp
Expand Down

0 comments on commit a0d45c6

Please sign in to comment.