Skip to content

soc: adi: max32: Add power management support #90430

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

Merged
merged 8 commits into from
May 27, 2025

Conversation

ttmut
Copy link
Collaborator

@ttmut ttmut commented May 24, 2025

Add SoC power management support for MAX32. Enable power_mgmt_soc tests for MAX32655EVKIT, MAX32690EVKIT and MAX78002EVKIT.

ozersa added 2 commits May 24, 2025 13:18
low-power pins can be used while device power management enabled.
Usage

...
&uart0a_rx_p0_0 {
  pinmux = <MAX32_PINMUX(0, 0, AF1)>;
  low-power-enable;
  /* Add low power mode flags, like: */
  output-high;
  bias-disable;
  ...
};
...

Default gpio sleep states are defined, user shall update sleep_pins
configuration as per of their needs

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
This commits added power management states in max32xxx MCUs
Common states added in max32xxx.dtsi file and additional ones
added in max32655.dtsi

Exit-latency-us value set as per of device datasheet spec.
The typical value is mentioned in DS is multiplied with 2.
For more information please take a look:
https://www.analog.com/en/products/max32655.html

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
return 0;
}

SYS_INIT(max32_power_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't really this AFAICS

@ceolin
Copy link
Member

ceolin commented May 25, 2025

Just a small comment. Other than that it looks good to me :)

ozersa and others added 6 commits May 26, 2025 09:54
This commit add power.c file that provides device goes to low power modes

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
To simplify usage add dependecy to MAX32_ON_ENTER_CPU_IDLE_HOOK
If CONFIG_PM not defined set to to y as current,
If CONFIG_PM defined not set it
If user set CONFIG_PM not need to disable
MAX32_ON_ENTER_CPU_IDLE_HOOK anymore

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
This commit enables power_mgmt_soc test for MAX32690 board

Low power timer is used as idle timer that will wakeup device
from sleep modes. Lowpower timer clocked with RTC clock which
always on.

RTC can be used as idle clock timer too, in that case below
line need to be added in overlay file

/ {
    chosen {
    	zephyr,cortex-m-idle-timer = &rtc;
    };
};

&rtc {
    status = okay;
    wakeup-source;
};

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
This commit enables power_mgmt_soc test for MAX32655 boards
- max32655evkit
- max32655fthr

RTC clocked in most low power modes so that this timer
is linked with idle timer. By this way device able to wakeup
from low power modes.

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
Enables power management test for MAX78002EVKIT.

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
Set new default minimum sleep amount for each power state. Users can
still update these values depending on their needs.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Copy link
Collaborator

@bjarki-andreasen bjarki-andreasen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@ttmut ttmut closed this May 27, 2025
@ttmut ttmut reopened this May 27, 2025
Copy link

@ttmut ttmut requested a review from ceolin May 27, 2025 11:15
@ttmut
Copy link
Collaborator Author

ttmut commented May 27, 2025

Closed and reopened to unstuck twister workflow.

@MaureenHelm MaureenHelm added this to the v4.2.0 milestone May 27, 2025
@kartben kartben merged commit 7ad9347 into zephyrproject-rtos:main May 27, 2025
50 of 52 checks passed
@ttmut ttmut deleted the max32/pm branch May 28, 2025 08:46
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