-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Add PSCI driver #30911
Add PSCI driver #30911
Conversation
bd895d3
to
f72a81c
Compare
@carlocaione Thanks for adding psci support, your code looks good to me. Approved. |
Can we merge this? |
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.
Overall looks great but it would be better to have code coverage of the syscalls by running the test function in user mode, and have the test exercise all of the APIs.
Firmware implementing the PSCI functions described in ARM document number ARM DEN 0022A ("Power State Coordination Interface System Software on ARM processors") can be used by Zephyr to initiate various CPU-centric power operations. It is needed for virtualization, it is used to coordinate OSes and hypervisors and it provides the functions used for SMP bring-up such as CPU_ON and CPU_OFF. A new PSCI driver is introduced to setup a proper subsystem used to communicate with the PSCI firmware, implementing the basic operations: get_version, cpu_on, cpu_off and affinity_info. The current implementation only supports PSCI 0.2 and PSCI 1.0 The PSCI conduit (SMC or HVC) is setup reading the corresponding property in the DTS node. Signed-off-by: Carlo Caione <[email protected]>
@andrewboie I addressed your points. The only API I couldn't test was |
Add a simple test to the the PSCI driver Signed-off-by: Carlo Caione <[email protected]>
A bit of rationale behind this PR.
@MrVan submitted in #30676 the PR to enable SMP on AArch64. As I wrote in a review to that PR I do not particularly like the approach of using arch-specific code to interface with the PSCI firmware.
PSCI interface needs a proper driver that uses the DTS to detect the correct parameters, especially the conduit (and currently only that). This is particularly important because the choice of having SMC or HVC as conduit really depends on whether we are running an hypervisor or not in EL2, so this must be something configurable at DTS (board) level.
So here it is a proper PSCI driver with support for PSCI 0.2 and PSCI 1.0, enabled using the DT and also a tiny test to make sure that everything is working correctly.