-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
soc: infineon: Support for power management on 20829 #77901
Conversation
sreeramIfx
commented
Sep 3, 2024
be2db29
to
6599a3f
Compare
power-states { | ||
idle: idle { | ||
compatible = "zephyr,power-state"; | ||
power-state-name = "suspend-to-idle"; | ||
min-residency-us = <1000000>; | ||
}; | ||
|
||
suspend_to_ram: suspend_to_ram { | ||
compatible = "zephyr,power-state"; | ||
power-state-name = "suspend-to-ram"; | ||
min-residency-us = <2000000>; | ||
}; | ||
}; | ||
|
||
cpus { | ||
cpu@0 { | ||
cpu-power-states = <&idle &suspend_to_ram>; | ||
}; | ||
}; |
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.
power states need to be part of soc dts files
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 power states to soc dtsi files..
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.
@gmarull, please review Sreeram's change at your convenience.
5408dad
to
dfd6c7e
Compare
Build failure is addressed @ #79399 |
soc/infineon/cat1b/cyw20829/power.c
Outdated
return cyhal_syspm_init(); | ||
} | ||
|
||
SYS_INIT(ifx_pm_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); |
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.
please, use hooks
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.
updated to use hooks
}; | ||
}; | ||
|
||
power-states { |
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.
not in cpus?
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 into the cpu node
4c878f5
to
4b48f56
Compare
4b48f56
to
f528c03
Compare
@@ -5,6 +5,8 @@ zephyr_sources(soc.c) | |||
zephyr_sources(app_header.c) | |||
zephyr_include_directories(.) | |||
|
|||
zephyr_sources_ifdef(CONFIG_PM ./power.c) |
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.
zephyr_sources_ifdef(CONFIG_PM ./power.c) | |
zephyr_sources_ifdef(CONFIG_PM power.c) |
}; | ||
}; | ||
|
||
|
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.
@@ -6,6 +6,13 @@ | |||
|
|||
if SOC_DIE_CYW20829 | |||
|
|||
config INFINEON_CAT1_LP_TIMER | |||
bool | |||
default n |
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.
default n |
soc/infineon/cat1b/cyw20829/power.c
Outdated
* For deep sleep pm_system_suspend has executed all the driver | ||
* power management call backs. | ||
*/ | ||
__weak void pm_state_set(enum pm_state state, uint8_t substate_id) |
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.
__weak void pm_state_set(enum pm_state state, uint8_t substate_id) | |
void pm_state_set(enum pm_state state, uint8_t substate_id) |
soc/infineon/cat1b/cyw20829/power.c
Outdated
} | ||
} | ||
|
||
__weak void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id) |
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.
__weak void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id) | |
void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id) |
soc/infineon/cat1b/cyw20829/power.c
Outdated
|
||
int ifx_pm_init(void) | ||
{ | ||
#if defined(CONFIG_BOARD_CYW920829M2EVK_02) |
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.
-1 board selective code in soc, find a better way
soc/infineon/cat1b/cyw20829/soc.c
Outdated
#ifdef CONFIG_PM | ||
ifx_pm_init(); | ||
#endif |
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.
ifdefout the entire hook?
f528c03
to
cadf68d
Compare
soc/infineon/cat1b/cyw20829/power.h
Outdated
void get_sleep_info(uint32_t *sleepattempts, uint32_t *sleepcounts, uint32_t *deepsleepattempts, | ||
uint32_t *deepsleepcounts, int64_t *sleeptime); | ||
|
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.
not used anywhere
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.
ping, impl still there
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.
@gmarull removed the implementation as well, please review
cadf68d
to
1a54d33
Compare
- Initial changes in board, dts, and soc files to support system power management Signed-off-by: Sreeram Tatapudi <[email protected]>
1a54d33
to
3cea7c8
Compare