Skip to content

Commit 53c3f34

Browse files
mmahadevan108kartben
authored andcommitted
boards: rd_rw612_bga: Add power init code for PM3 support
1. Add the power init code. 2. Add code to support Low Power Mode support from the RTC 1HZ clock. Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent 5dda650 commit 53c3f34

File tree

5 files changed

+72
-3
lines changed

5 files changed

+72
-3
lines changed
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#
2-
# Copyright 2022-2023 NXP
2+
# Copyright 2022-2025 NXP
33
#
44
# SPDX-License-Identifier: Apache-2.0
55
#
66

7+
zephyr_library()
8+
zephyr_library_sources(init.c)
9+
710
if(CONFIG_NXP_RW6XX_BOOT_HEADER)
811
if(NOT DEFINED CONFIG_BOARD_RD_RW612_BGA)
912
message(WARNING "It appears you are using the board definition for "
@@ -12,6 +15,11 @@ if(CONFIG_NXP_RW6XX_BOOT_HEADER)
1215
endif()
1316
zephyr_compile_definitions(BOOT_HEADER_ENABLE=1)
1417
zephyr_compile_definitions(BOARD_FLASH_SIZE=CONFIG_FLASH_SIZE*1024)
15-
zephyr_library()
1618
zephyr_library_sources(MX25U51245GZ4I00_FCB.c)
1719
endif()
20+
21+
if (CONFIG_DT_HAS_NXP_ENET_MAC_ENABLED AND CONFIG_XTAL32K)
22+
message(FATAL_ERROR "Ethernet and external 32K clock source are "
23+
"mutually exclusive on RD_RW612_BGA due to shared PCB nets "
24+
"between the ethernet PHY and the external oscillator")
25+
endif()

boards/nxp/rd_rw612_bga/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_RD_RW612_BGA
5+
select BOARD_EARLY_INIT_HOOK

boards/nxp/rd_rw612_bga/Kconfig.defconfig

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RD_RW612_BGA board
22

3-
# Copyright 2022-2024 NXP
3+
# Copyright 2022-2025 NXP
44
# SPDX-License-Identifier: Apache-2.0
55

66
if BOARD_RD_RW612_BGA
@@ -37,4 +37,11 @@ config NET_L2_ETHERNET
3737

3838
endif # DT_HAS_NXP_ENET_MAC_ENABLED && NETWORKING
3939

40+
if COUNTER_MCUX_LPC_RTC_1HZ
41+
42+
config XTAL32K
43+
default y
44+
45+
endif # COUNTER_MCUX_LPC_RTC_1HZ
46+
4047
endif # BOARD_RD_RW612_BGA

boards/nxp/rd_rw612_bga/doc/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Supported Features
2525

2626
.. zephyr:board-supported-hw::
2727
28+
.. note::
29+
30+
Power modes 1, 2 and 3 are supported when using System Power Management.
31+
2832
Display Support
2933
***************
3034

boards/nxp/rd_rw612_bga/init.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright 2022, 2024-25 NXP
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <zephyr/pm/pm.h>
7+
#include <fsl_power.h>
8+
9+
static void rdrw61x_power_init_config(void)
10+
{
11+
power_init_config_t initCfg = {
12+
/* VCORE AVDD18 supplied from iBuck on RD board. */
13+
.iBuck = true,
14+
/* CAU_SOC_SLP_REF_CLK is needed for LPOSC. */
15+
.gateCauRefClk = false,
16+
};
17+
18+
POWER_InitPowerConfig(&initCfg);
19+
}
20+
21+
#if CONFIG_PM
22+
static void rdrw61x_pm_state_exit(enum pm_state state)
23+
{
24+
switch (state) {
25+
case PM_STATE_STANDBY:
26+
rdrw61x_power_init_config();
27+
break;
28+
default:
29+
break;
30+
}
31+
}
32+
#endif
33+
34+
void board_early_init_hook(void)
35+
{
36+
rdrw61x_power_init_config();
37+
38+
#if CONFIG_PM
39+
static struct pm_notifier rdrw61x_pm_notifier = {
40+
.state_exit = rdrw61x_pm_state_exit,
41+
};
42+
43+
pm_notifier_register(&rdrw61x_pm_notifier);
44+
#endif
45+
}

0 commit comments

Comments
 (0)