Using the API for Clock Management - 2021.1 English

Versal ACAP System Software Developers Guide (UG1304)

Document ID
UG1304
Release Date
2021-06-16
Version
2021.1 English

There are EEMI APIs available that allow processing units to manage clocks in the system. Each clock is identified by a unique ClockId. A PM master can use the XPm_Query API to obtain a list of ClockIds accessible to that processing unit. Before a PM master can modify any attributes of a clock, the master should request the slave device that is associated with that clock. See the XPm_RequestNode API in OS and Libraries Document Collection (UG643) for more information.

Use the following APIs to get and set a clock’s state:

  • XStatus XPm_ClockGetStatus(const u32 ClockId, u32 *const State)
  • XStatus XPm_ClockEnable(const u32 ClockId)
  • XStatus XPm_ClockDisable(const u32 ClockId)

Use the following APIs to configure a clock to operate at a different divider value:

  • XStatus XPm_ClockGetDivider(const u32 ClockId, u32 *const Divider)
  • XStatus XPm_ClockSetDivider(const u32 ClockId, const u32 Divider)

Use the following APIs to configure clocks that could be driven by different parents:

  • XStatus XPm_ClockGetParent(const u32 ClockId, u32 *const ParentId)
  • XStatus XPm_ClockSetParent(const u32 ClockId, const u32 ParentId)
    Important: ParentId is an index to possible clocks that could be configured as a parent of ClockId. In Zynq UltraScale+ MPSoC, the definition of ParentId is not unified between Linux and standalone applications. In Versal ACAP, these EEMI APIs are unified in expecting ParentId to be an index value to possible parent clocks.

Use the following APIs to configure the rate of reference clocks:

  • int XPm_ClockGetRate(const u32 ClockId, u32 *const Rate)
  • int XPm_ClockSetRate(const u32 ClockId, const u32 Rate)
Important: XPm_ClockSetRate() can only be valid during CDO loading. You cannot set the clock rate from XilPM client API.

Use the following APIs to configure PLLs that are identified by ClockId:

  • XStatus XPm_PllGetMode(const u32 ClockId, u32 *const Value)
  • XStatus XPm_PllSetMode(const u32 ClockId, const u32 Value)
  • XStatus XPm_PllGetParameter(const u32 ClockId, const enum XPm_PllConfigParams ParamId, u32 *const Value)
  • XStatus XPm_PllSetParameter(const u32 ClockId, const enum XPm_PllConfigParams ParamId, const u32 Value)

See OS and Libraries Document Collection (UG643) for more information about these APIs.