Skip to content

Conversation

@zejiang0jason
Copy link
Contributor

Enabled modes:
  idle: SLEEP
  suspend: DEEP-SLEEP
  standby: POWER-DOWN with CPU retention

OS Time Base: OSTIMER with fro1m clock source

@zejiang0jason zejiang0jason changed the title Feature/add mcxw23 power Add mcxw23 power management support Nov 6, 2025
@zejiang0jason zejiang0jason changed the title Add mcxw23 power management support [DRAFT]Add mcxw23 power management support Nov 6, 2025
@zejiang0jason zejiang0jason marked this pull request as draft November 6, 2025 09:26
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>
@yeaissa
Copy link
Contributor

yeaissa commented Nov 24, 2025

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>
@zejiang0jason zejiang0jason force-pushed the feature/add_mcxw23_power branch from 465082f to 7920277 Compare November 24, 2025 14:33
@zejiang0jason

This comment was marked as resolved.

@sonarqubecloud
Copy link

*/
cyc_sys_compensated += OSTIMER_GetCurrentTimerValue(base);
}
#if defined(CONFIG_MCUX_OS_TIMER_PM_POWERED_OFF)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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
Copy link
Contributor

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
*/
Copy link
Contributor

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;
Copy link
Contributor

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.
Copy link
Contributor

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
Copy link
Contributor

@yeaissa yeaissa Nov 27, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants