Versal ACAP Platform Management Unit provides centralized power state handling, clock management, reset management, pin control management. Platform Management (PM) services are used by calling PM API via IPI to firmware. The PM interface can be used to access secure resources by implementing custom PM APIs in firmware. This document describes the end-to-end flow for adding new PM API in firmware and how it can be used in any Linux driver.
Source code links mentioned in this document are from the 2020.2 release. So, you may not find the same source code on the same line in another release.
Example of processing IPI request came for PM_IOCTL API: PM_IOCTL
Add new PM API as valid feature in XilPM
Feature check API is used to determine compatibility between firmware, ATF and Linux. If there is a change in the existing PM API interface such as arguments, version of that API should be updated in the feature check, otherwise the client (i.e. ATF/Linux) would be using different argument so the PM API may not work properly. To identify this version gap, feature check is an important function that takes care of this check. So, it is required to add new PM API as a valid feature and its version.
Add the newly added PM API as a valid feature and return API version in XPm_FeatureCheck()
Example for end-to-end implementation of PM IOCTL API
Adding a new IOCTL in PM IOCTL API
Many times, it is not required to add a whole new PM API for minimal operations such as providing access to a register from secure register space to the Non-Secure Application or OS, which might not have direct access to such registers. For these trivial tasks, one can use the existing PM IOCTL API and just add a new IOCTL ID to perform that operation.