Custom Hooks - 2021.2 English

Zynq UltraScale+ MPSoC Software Developer Guide

Document ID
UG1137
Release Date
2021-10-27
Version
2021.2 English

PMU firmware does not keep track of PL peripherals. Hence, there is no idle/reset function implementation available in the PMU firmware. However, it is necessary to treat those peripherals in the same the PS peripherals are treated. You can add a custom hook in the idle_hooks.c file to idle the PL peripherals and reset them. These hooks can be called from the PmMasterIdleSlaves function in the pm_master.c file of the PMU firmware.

lib/sw_apps/zynqmp_pmufw/src/pm_master.c
:dir:dir -769,6 +769,12 :dir:dir static void PmMasterIdleSlaves(PmMaster* const master)

PmDbg(DEBUG_DETAILED,"%s\r\n", PmStrNode(master->nid));

+	/*
+	* Custom hook to idle PL peripheral before PS peripheral idle
+	*/
+
+	Xpfw_PL_Idle_HookBeforeSlaveIdle(master);
+
while (NULL != req) {
u32 usage = PmSlaveGetUsageStatus(req->slave, master); Node = &req->slave->node;
:dir:dir -783,6 +789,11 :dir:dir static void PmMasterIdleSlaves(PmMaster* const master)
}
req = req->nextSlave;
}
+
+	/*
+	* Custom hook to idle PL peripheral after PS peripheral idle
+	*/
+	Xpfw_PL_Idle_HookAfterSlaveIdle(master);
#endif
}

The Xpfw_PL_Idle_HookBeforeSlaveIdle and Xpfw_PL_Idle_HookAfterSlaveIdle can contain the code to idle the PL peripherals and reset them if necessary. The implementation can be either of the following:

  • Write AXI registers of PL IPs to bring them to idle state and reset. This is the preferred and a graceful way to idle PL peripherals.
  • Implement a signal based handshake where PMU firmware signals PL to idle all PL IPs. This implementation should be used when there is no direct control to gracefully stop traffic. For example, you can use this implementation if there are non DMA PL IPs, which does not have reset control but are connected through a firewall IP. This implementation also allows stopping all traffic passing through it unlike the other where each IP needs to be idled individually.
Note: Implementation for these custom hooks is not provided by Xilinx.