AR# 67819


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


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


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();
+       /****************************/

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
日期 10/27/2016
状态 Active
Type 综合文章
People Also Viewed