UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 67819

Zynq UltraScale+ MPSoC: 2016.3 PMUFW, How to add custom initialization code.

Description

How can I add custom init code to the Performance Monitor Unit Firmware (PMUFW)?

Solution

PMU Firmware in general can be used as-is for most use-cases. This is because all of the initialization is expected to be done by the FSBL.

However, for some specific cases it might be necessary to add custom code during the initialization, particularly where the PMUFW executes before the FSBL.

Here is a flow chart showing PMUFW Initialization at a high level:


 

Per the above flow, any user code that needs to be executed at startup needs to be added in the UserStartUp stage.

In the source code, it is contained in the Xpfw_UserStartUp() function in xpfw_user_startup.c

Here is an example diff of the changes that need to be made:

Diff for xpfw_user_startup.c

@@ -43,8 +43,26 @@
 #include "xpfw_mod_rtc.h"
 #include "xpfw_mod_sched.h"
+
+static void InitExample(void)
+{
+       /**
+        * Put your custom init code here.
+        * Limit it to the minimal required functionality
+        * and ensure it doesn't change any registers local to PMU,
+        * to avoid conflicts with other parts of PMUFW
+        */
+}
+
+
+
+
 void XPfw_UserStartUp(void)
 {
+       /*****************************/
+       /* Call the custom init code */
+       InitExample();
+       /****************************/
        ModRtcInit();
        ModEmInit();
        ModPmInit();

Note: All of the init code in XPfw_UserStartUp will be executed while the interrupts are disabled, to ensure that the init sequence executes uninterrupted.

AR# 67819
Date Created 09/06/2016
Last Updated 10/27/2016
Status Active
Type General Article
Devices
  • Zynq UltraScale+ MPSoC