Skip to content
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

Merged
merged 1 commit into from
Nov 16, 2024

Conversation

sreeramIfx
Copy link
Contributor

- Initial changes in board, dts, and soc files to support system power management

@sreeramIfx sreeramIfx force-pushed the topic/cyw20829_pm branch 4 times, most recently from be2db29 to 6599a3f Compare September 4, 2024 22:07
@sreeramIfx sreeramIfx marked this pull request as ready for review September 4, 2024 22:25
@zephyrbot zephyrbot added the platform: Infineon Infineon Technologies AG label Sep 4, 2024
ifyall
ifyall previously approved these changes Sep 26, 2024
Comment on lines 28 to 46
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>;
};
};
Copy link
Member

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

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 power states to soc dtsi files..

Copy link
Collaborator

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.

@sreeramIfx
Copy link
Contributor Author

Build failure is addressed @ #79399

return cyhal_syspm_init();
}

SYS_INIT(ifx_pm_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.

please, use hooks

Copy link
Contributor Author

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 {
Copy link
Member

Choose a reason for hiding this comment

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

not in cpus?

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 into the cpu node

@sreeramIfx sreeramIfx force-pushed the topic/cyw20829_pm branch 2 times, most recently from 4c878f5 to 4b48f56 Compare October 8, 2024 05:34
ifyall
ifyall previously approved these changes Oct 8, 2024
gmarull
gmarull previously requested changes Oct 9, 2024
@@ -5,6 +5,8 @@ zephyr_sources(soc.c)
zephyr_sources(app_header.c)
zephyr_include_directories(.)

zephyr_sources_ifdef(CONFIG_PM ./power.c)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
zephyr_sources_ifdef(CONFIG_PM ./power.c)
zephyr_sources_ifdef(CONFIG_PM power.c)

};
};


Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

@@ -6,6 +6,13 @@

if SOC_DIE_CYW20829

config INFINEON_CAT1_LP_TIMER
bool
default n
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
default n

* 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)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
__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)

}
}

__weak void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
__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)


int ifx_pm_init(void)
{
#if defined(CONFIG_BOARD_CYW920829M2EVK_02)
Copy link
Member

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

Comment on lines 103 to 105
#ifdef CONFIG_PM
ifx_pm_init();
#endif
Copy link
Member

Choose a reason for hiding this comment

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

ifdefout the entire hook?

ifyall
ifyall previously approved these changes Oct 9, 2024
Comment on lines 11 to 13
void get_sleep_info(uint32_t *sleepattempts, uint32_t *sleepcounts, uint32_t *deepsleepattempts,
uint32_t *deepsleepcounts, int64_t *sleeptime);

Copy link
Member

Choose a reason for hiding this comment

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

not used anywhere

Copy link
Member

Choose a reason for hiding this comment

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

ping, impl still there

Copy link
Contributor Author

@sreeramIfx sreeramIfx Oct 24, 2024

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

- Initial changes in board, dts, and soc files to support
 system power management

Signed-off-by: Sreeram Tatapudi <[email protected]>
@nashif nashif merged commit 0a9c0f4 into zephyrproject-rtos:main Nov 16, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Infineon Infineon Technologies AG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants