Author Topic: Power management on the TE0808 and TE0803 boards  (Read 2408 times)

hughlewisuk

  • Active Member
  • *
  • Posts: 6
Power management on the TE0808 and TE0803 boards
« on: October 13, 2017, 10:58:05 AM »
Has anyone managed to get the power management to work on the ZU2CG or ZU9EG? Are there configuration setting that need to be change in the core module in Vivado and hence the bitstream? Do you need to load firmware into the PMU before the power management will work. If PMU firmware is necessary how do you unlock the PMU core so the system debugger can see it and load the firmware. Any help in this area would be very welcome after days of trying. A full example would be useful put just the steps to get there  would help.

Thanks
Hugh

JH

  • Hero Member
  • *****
  • Posts: 610
Re: Power management on the TE0808 and TE0803 boards
« Reply #1 on: October 18, 2017, 09:31:37 AM »
Hi,

at the moment we use default Xilinx PMU Firmware, generated with SDK for our Ultrascale+ Zynq devices.

br
John

hughlewisuk

  • Active Member
  • *
  • Posts: 6
Re: Power management on the TE0808 and TE0803 boards
« Reply #2 on: October 19, 2017, 02:51:49 PM »
Thanks John,
I have been trying the bare metal example and had not got far.
I think this example that runs on the r5_0 core assumes that the the A53 cores are already running linux and the fsbl has loaded the PMU firmware. I now have one of the A53 cores powering down by creating and installing the PMU firmware under the debugger as part of the bare metal debug of the A53 core. The other bit of the puzzle that is missing is that the PMU needs to have the security config loaded. the board support package creates pm_cfg_obj.c and pm_cfg_obj.h that contain the definitions to a XPmConfigObject structure. If this is passed to the PMU firmware using the undocumented API function XPm_SetConfiguration after initialization calls for the Zynq Power Management Framework. The calls to to the PMU work and do not return XST_PM_NO_ACCESS.

      if (XST_SUCCESS != IpiConfigure(&IpiInst)) {
         pm_dbg("Exiting main...\n\r");
         return XST_FAILURE;
      }
      if (XST_SUCCESS != XPm_InitXilpm(&IpiInst)) {
         pm_dbg("Exiting main...\n\r");
         return XST_FAILURE;
      }
      if (XST_SUCCESS != XPm_SetConfiguration((u32)XPm_ConfigObject)) {
         pm_dbg("Set config object failed - Exiting main...\n\r");
         return XST_FAILURE;
      }
Hope this explanation might help others trying to do completely bare metal power management evaluation.
Hugh 

JH

  • Hero Member
  • *****
  • Posts: 610
Re: Power management on the TE0808 and TE0803 boards
« Reply #3 on: October 19, 2017, 03:56:20 PM »
Hi,

what did you mean with "I think this example that runs on the r5_0 core"?

What did you select on SDK? Which example did you use? You can generate own PMU Firmware, depending on your example description.

PS: Vivado/Petalinux depending issues, see links on:

br
John

hughlewisuk

  • Active Member
  • *
  • Posts: 6
Re: Power management on the TE0808 and TE0803 boards
« Reply #4 on: October 19, 2017, 04:14:43 PM »
Hi John,

Here is what I did to get the power management frame work example to work with 2017.3

The route seems to be to create a pmu application project using the standard ZynqMP PMU Firmware template. Create a bsp for the R5_0 processor and add the xilpm library. Using the system.mss from the bsp import the xilpm_selfsuspend_example.

In the xilpm_selfsuspend_example.c  add a call to the undocumented  XPm_SetConfiguration function passing the security config object.

#include  "pm_cfg_obj.h"

and

      if (XST_SUCCESS != XPm_SetConfiguration((u32)XPm_ConfigObject)) {
         pm_dbg("Set config object failed - Exiting main...\n\r");
         return XST_FAILURE;
      }
To the InitApp function after
      if (XST_SUCCESS != XPm_InitXilpm(&IpiInst)) {
         pm_dbg("Exiting main...\n\r");
         return XST_FAILURE;
      }

Then run the debugger with both projects being loaded with stop "on main" selected so that the firmware on the pmu has time to run up.

Regards
Hugh


JH

  • Hero Member
  • *****
  • Posts: 610
Re: Power management on the TE0808 and TE0803 boards
« Reply #5 on: October 19, 2017, 04:22:49 PM »
Hi,

which Board did you use?

Did you use for all generate Files the same Vivado Version. Your Vivado Project with exported HDF, SDK, Linux....

br
John

hughlewisuk

  • Active Member
  • *
  • Posts: 6
Re: Power management on the TE0808 and TE0803 boards
« Reply #6 on: October 19, 2017, 04:32:01 PM »
Hi John,

Just to clarify, I am using the TE0803-01-02CG-1E on my own carrier board and a TE0790. A fresh install of Vivado 2017.3 with the SDK. Clean block design from your board definition in Vivado. No Linux or FSBL just debugging from the SDK.

Hugh

JH

  • Hero Member
  • *****
  • Posts: 610
Re: Power management on the TE0808 and TE0803 boards
« Reply #7 on: October 19, 2017, 04:34:35 PM »
Hi,
which board definition did you use this from 17.1 or older?
br
John

hughlewisuk

  • Active Member
  • *
  • Posts: 6
Re: Power management on the TE0808 and TE0803 boards
« Reply #8 on: October 19, 2017, 04:46:06 PM »
Hi,
How would I find out? They are dated 30/08/2017. But that might not mean anything.
The zusys_bd.tcl file seems to have "set scripts_vivado_version 2017.2" so I suspect that I have the board definition file from 2017.2 but I may have edited it myself.

Hugh

hughlewisuk

  • Active Member
  • *
  • Posts: 6
Re: Power management on the TE0808 and TE0803 boards
« Reply #9 on: October 19, 2017, 04:52:37 PM »
Done a bit more digging.
The board definition came from
te0803-test_board_noprebuilt-vivado_2017.1-build_04_20170728105413.zip
Hugh

JH

  • Hero Member
  • *****
  • Posts: 610
Re: Power management on the TE0808 and TE0803 boards
« Reply #10 on: October 19, 2017, 05:06:14 PM »
Hi,

17.1 is currently  newest published design. We will update to 17.2 in next weeks.
17.1 files works with 17.2. But i did not check 17.3.  This depends on changes of the ZynqMP IP.

Xilinx example is for EG version, you used EC.
Normally it doesn't matter. But maybe there is a bug with SDK and CE devices or with this libs from the example. We never try to start this example on a TE0803 or TE0808.

br
John