Skip to content

Commit bcf7776

Browse files
committed
[nrf fromtree] drivers: serial: nrfx_uarte: Rename FAST to FAST_PD
Rename UARTE_ANY_FAST to UARTE_ANY_FAST_PD. There are 2 types of 'fast' UARTE instances. In nrf54h20 instance uart120 is in fast power domain that requires additional power and clock management of that domain. In nrf54lx fast uart00 instance does not require that. Add _PD to indicate fast power domain. Signed-off-by: Krzysztof Chruściński <[email protected]> (cherry picked from commit 1573be5)
1 parent 0961f84 commit bcf7776

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

drivers/serial/uart_nrfx_uarte.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,18 @@ LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL);
111111
#include <nrf/gpd.h>
112112

113113
/* Macro must resolve to literal 0 or 1 */
114-
#define INSTANCE_IS_FAST(unused, prefix, idx, _) \
114+
#define INSTANCE_IS_FAST_PD(unused, prefix, idx, _) \
115115
COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(UARTE(idx)), \
116116
(COND_CODE_1(DT_NODE_HAS_PROP(UARTE(idx), power_domains), \
117117
(IS_EQ(DT_PHA(UARTE(idx), power_domains, id), NRF_GPD_FAST_ACTIVE1)), \
118118
(0))), (0))
119119

120-
#if UARTE_FOR_EACH_INSTANCE(INSTANCE_IS_FAST, (||), (0))
121-
/* Fast instance requires special PM treatment so device runtime PM must be enabled. */
120+
#if UARTE_FOR_EACH_INSTANCE(INSTANCE_IS_FAST_PD, (||), (0))
121+
/* Instance in fast power domain (PD) requires special PM treatment so device runtime PM must
122+
* be enabled.
123+
*/
122124
BUILD_ASSERT(IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME));
123-
#define UARTE_ANY_FAST 1
125+
#define UARTE_ANY_FAST_PD 1
124126
#endif
125127
#endif
126128

@@ -293,7 +295,7 @@ struct uarte_nrfx_data {
293295
* @retval false if device PM is not ISR safe.
294296
*/
295297
#define IS_PM_ISR_SAFE(dev) \
296-
(!IS_ENABLED(UARTE_ANY_FAST) ||\
298+
(!IS_ENABLED(UARTE_ANY_FAST_PD) ||\
297299
COND_CODE_1(CONFIG_PM_DEVICE,\
298300
((dev->pm_base->flags & BIT(PM_DEVICE_FLAG_ISR_SAFE))), \
299301
(0)))
@@ -309,7 +311,7 @@ struct uarte_nrfx_config {
309311
#ifdef CONFIG_HAS_NORDIC_DMM
310312
void *mem_reg;
311313
#endif
312-
#ifdef UARTE_ANY_FAST
314+
#ifdef UARTE_ANY_FAST_PD
313315
const struct device *clk_dev;
314316
struct nrf_clock_spec clk_spec;
315317
#endif
@@ -662,7 +664,7 @@ static void uarte_periph_enable(const struct device *dev)
662664
struct uarte_nrfx_data *data = dev->data;
663665

664666
(void)data;
665-
#ifdef UARTE_ANY_FAST
667+
#ifdef UARTE_ANY_FAST_PD
666668
if (config->clk_dev) {
667669
int err;
668670

@@ -2218,7 +2220,7 @@ static void uarte_pm_suspend(const struct device *dev)
22182220
struct uarte_nrfx_data *data = dev->data;
22192221

22202222
(void)data;
2221-
#ifdef UARTE_ANY_FAST
2223+
#ifdef UARTE_ANY_FAST_PD
22222224
if (cfg->clk_dev) {
22232225
int err;
22242226

@@ -2427,13 +2429,13 @@ static int uarte_instance_init(const struct device *dev,
24272429
* which is using nrfs (IPC) are initialized later.
24282430
*/
24292431
#define UARTE_INIT_LEVEL(idx) \
2430-
COND_CODE_1(INSTANCE_IS_FAST(_, /*empty*/, idx, _), (POST_KERNEL), (PRE_KERNEL_1))
2432+
COND_CODE_1(INSTANCE_IS_FAST_PD(_, /*empty*/, idx, _), (POST_KERNEL), (PRE_KERNEL_1))
24312433

24322434
/* Get initialization priority of an instance. Instances that requires clock control
24332435
* which is using nrfs (IPC) are initialized later.
24342436
*/
24352437
#define UARTE_INIT_PRIO(idx) \
2436-
COND_CODE_1(INSTANCE_IS_FAST(_, /*empty*/, idx, _), \
2438+
COND_CODE_1(INSTANCE_IS_FAST_PD(_, /*empty*/, idx, _), \
24372439
(UTIL_INC(CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_INIT_PRIORITY)), \
24382440
(CONFIG_SERIAL_INIT_PRIORITY))
24392441

@@ -2518,7 +2520,7 @@ static int uarte_instance_init(const struct device *dev,
25182520
IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC, \
25192521
(.timer = NRFX_TIMER_INSTANCE( \
25202522
CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER),)) \
2521-
IF_ENABLED(INSTANCE_IS_FAST(_, /*empty*/, idx, _), \
2523+
IF_ENABLED(INSTANCE_IS_FAST_PD(_, /*empty*/, idx, _), \
25222524
(.clk_dev = DEVICE_DT_GET(DT_CLOCKS_CTLR(UARTE(idx))), \
25232525
.clk_spec = { \
25242526
.frequency = NRF_PERIPH_GET_FREQUENCY(UARTE(idx)),\
@@ -2537,7 +2539,7 @@ static int uarte_instance_init(const struct device *dev,
25372539
} \
25382540
\
25392541
PM_DEVICE_DT_DEFINE(UARTE(idx), uarte_nrfx_pm_action, \
2540-
COND_CODE_1(INSTANCE_IS_FAST(_, /*empty*/, idx, _),\
2542+
COND_CODE_1(INSTANCE_IS_FAST_PD(_, /*empty*/, idx, _),\
25412543
(0), (PM_DEVICE_ISR_SAFE))); \
25422544
\
25432545
DEVICE_DT_DEFINE(UARTE(idx), \

0 commit comments

Comments
 (0)