-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Add mcxw23 power management support #98986
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
base: main
Are you sure you want to change the base?
Add mcxw23 power management support #98986
Conversation
zejiang0jason
commented
Nov 6, 2025
Add to support reset OS_TIMER in driver Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
Use reset API to reset OSTIMER for better portability. Improve RW610 for this change. Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
Call pm_policy_device_power_lock_put/pm_policy_device_power_lock_get to coordinate with system level power modes. Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
Add for the case that the registers are not kept in some low power modes. Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
Call pm_policy_device_power_lock_put/pm_policy_device_power_lock_get to coordinate with system level power modes. Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
PINT connects GPIO pin to seperate IRQ slot. Add new API to get which IRQ slot is connected to, based on pin index. Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
4d0b6b2 to
0bd9b0f
Compare
f8f5741 to
465082f
Compare
|
Builds are failing when CONFIG_LOG is enabled, @zejiang0jason can you check please? |
Enabled modes: idle: SLEEP suspend: DEEP-SLEEP standby: POWER-DOWN with CPU retention OS Time Base: OSTIMER with 32K clock source Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
Add mcxw23_evk and frdm_mcxw23 platforms to the power management test suite to validate power management functionality on MCXW23 hardware. Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
Add poweroff MCXW2xx SoCs, support btn_wk pin wakeup. Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
Fix the error: File:dts/arm/nxp/nxp_mcxw23x_common.dtsi ERROR : Test DevicetreeLinting failed: :Fix indentation. Expecting →→→····· Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
465082f to
7920277
Compare
This comment was marked as resolved.
This comment was marked as resolved.
|
| */ | ||
| cyc_sys_compensated += OSTIMER_GetCurrentTimerValue(base); | ||
| } | ||
| #if defined(CONFIG_MCUX_OS_TIMER_PM_POWERED_OFF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to know why the code needs to change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the usage of IS_ENABLED, the original implementation is the right way, will revert back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved the ostimer change to a separate PR: #100134
| return 0; | ||
| } | ||
|
|
||
| #if CONFIG_PM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be #if CONFIG_PM_DEVICE instead #if CONFIG_PM
| * | ||
| * @param pin: The pin to get the PINT slot index for | ||
| * @return The allocated slot index, if not allocated, return -1 | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same doxygen comments (compare with the .h) can remove.
| int slot; | ||
|
|
||
| if (pin > ARRAY_SIZE(pin_pint_id)) { | ||
| return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return -EINVAL; is better maybe.
| Power Management | ||
| ================ | ||
|
|
||
| When Power Management is enabled, OSTIMER is used as OS tick timer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about: When Power Management :kconfig:option:CONFIG_PM is enabled. add kconfig option makes the information clearer.
| *** Booting Zephyr OS build v4.2.0-2105-g48f2ffda26de *** | ||
| Hello World! frdm_mcxw23/mcxw236 | ||
| Power Management |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not ok with this, since it will require adding the overlay on each app that will run with PM. I expect to have everything I need once I enable CONFIG_PM.
To avoid this lets set the os_timer status to okay by default in the nxp_mcxw23x_common.dtsi file, and change the MCUX_OS_TIMER redefinition in Kconfig.defconfig to:
config MCUX_OS_TIMER
- default y if PM
+ default n if !PM
This will allow to run on the CORTEX_M_SYSTICK when PM is not defined and switch to OS_TIMER when PM is enabled.


