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

drivers: serial: nrfx_uarte: Add requesting of HSFLL GD clock when fast UARTE (uart120) is used #82103

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nordic-krch
Copy link
Contributor

Added clock request and release in resume and suspend actions. It is required for the fast UARTE peripheral (uart120 in nrf54h20). Since it would be tricky to handle that outside of PM actions added build time check which enforces use of device runtime PM when fast UARTE is used (device power PM is de facto a must in nrf54h20 so it is not a real limitation).

Due to device runtime PM requirement, uart_async_api test configuration for nrf54h20dk/nrf54h20/cpuapp has been extended to enable PM.
Work from PR #81527 had to be included.
DNM until #81735.

@nordic-krch nordic-krch added the DNM This PR should not be merged (Do Not Merge) label Nov 27, 2024
@bjarki-andreasen
Copy link
Collaborator

Looks correct :)

hubertmis
hubertmis previously approved these changes Nov 27, 2024
When fast UARTE instance is used (e.g. UARTE120 in nrf54h20), PM actions
are not ISR safe because they include communication over IPC so they can
only be called from the thread context. Extend driver to support both
PM modes. When non ISR mode is used then uart_rx_enable() and uart_tx()
will return error if they are called from ISR and resume operation
would need to be called because device is suspended. On completion,
driver is calling pm_device_runtime_put_async which can be called from
the ISR context.

Additionally, suspending in the TXSTOPPED and RXTO events has been
moved after user callback. It allows to support the case where
uart_rx_enable() or uart_tx() are called from that callback context.
Since suspending is called after returning from the callback it will
not trigger suspend action because API called in the callback context
will increment the usage counter (when pm_device_runtime_get() is
called).

Signed-off-by: Krzysztof Chruściński <[email protected]>
Request fast global domain to run at 320 MHz during fast UARTE
activity. As request is asynchronous it cannot be called from
an ISR. Due to complexity to handle that without device runtime
power management a requirement is added so that if fast UARTE
is used device runtime PM must be enabled. Clock is request
and released in PM resume and suspended actions which in case
of fast UARTE are only called from thread context.

Signed-off-by: Krzysztof Chruściński <[email protected]>
Enable device runtime PM for nrf54h20dk/nrf54h20/cpuapp where
fast UARTE (uart120) is tested.

Signed-off-by: Krzysztof Chruściński <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DNM This PR should not be merged (Do Not Merge)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants