cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rogerrb1
Visitor
Visitor
9,873 Views
Registered: ‎06-23-2010

zynq ultrascale+ fpga manager

Jump to solution

I am trying to reprogram the PL from linux on the ZU+ by following the information here: http://www.wiki.xilinx.com/Solution+ZynqMP+PL+Programming, but receive the error "fpga_manager fpga0: Error while writing image data to FPGA".  I've traced it to the call to do_fw_call_smc() in <kernel_src>/drivers/soc/xilinx/pm.c.  The smc call fails, but I can't figure out why.  I built a version of the pmufw with debug enabled, but don't see any pmu prints while trying to load the fpga firmware.  Kernel version 4.6.0 (master branch of linux-xlnx).  Any suggestions of where to look next?

 

0 Kudos
1 Solution

Accepted Solutions
rogerrb1
Visitor
Visitor
14,739 Views
Registered: ‎06-23-2010

So I traced it down the the ARM trusted firmware (bl31.elf).  I had been using an older version of the file, can't remember where I got it from- after switching to a more recent version of the firmware, I am now able to load the fpga from linux.  

 

The ATF/trustzone stuff is still all magic to me- if anyone has a link to a good tutorial, that would be helpful.

 

 

View solution in original post

0 Kudos
19 Replies
stephenm
Xilinx Employee
Xilinx Employee
9,776 Views
Registered: ‎09-12-2007

The driver is added to the mainline kernel, and no need for patches if using petalinux 2016.4

Try this one here that is updated for the 2016.4 zcu102:. this shows how to use linus, uboot, or baremetal to program the FPGA

http://www.wiki.xilinx.com/FPGA+Manager+ZCU102

0 Kudos
rogerrb1
Visitor
Visitor
14,740 Views
Registered: ‎06-23-2010

So I traced it down the the ARM trusted firmware (bl31.elf).  I had been using an older version of the file, can't remember where I got it from- after switching to a more recent version of the firmware, I am now able to load the fpga from linux.  

 

The ATF/trustzone stuff is still all magic to me- if anyone has a link to a good tutorial, that would be helpful.

 

 

View solution in original post

0 Kudos
cdarok2
Visitor
Visitor
9,187 Views
Registered: ‎03-15-2017

Hi, Rogerrb1

 

I´m facing the same problem and not able to solve it. I´m trying to load a bitstream from Linux, following the steps of the guide, but I have the same error log:

----------------------------------------

fpga_manager fpga0: Error while writing image data to FPGA
-sh: echo: write error: No such device

----------------------------------------

 

I tried to use a new ATF, compiled from last Xilinx git... but no changes.

 

do you have any idea?

 

Thanks!

 

0 Kudos
cdarok2
Visitor
Visitor
9,186 Views
Registered: ‎03-15-2017
Also: I´m using 2016.3
0 Kudos
rogerrb1
Visitor
Visitor
9,177 Views
Registered: ‎06-23-2010

cdarak2, another variable is the PMU firmware.  You should see a line in dmesg that starts with " zynqmp_plat_init power management API version".  I was able to get linux fpga reprogramming to work with PMU firmware v0.2.  You will most likely have to build it from the sdk- can't find the link right now, but basically, it's the same process as building the fsbl, just select the microblaze pmu in the drop down box for target processor and the wizard will give you the option to build the pmu firmware. Then include it in your boot.bin.  Your best bet is with 2016.4.  

0 Kudos
debrajr
Moderator
Moderator
9,150 Views
Registered: ‎04-17-2011
Refer: https://www.xilinx.com/support/answers/68246.html
Regards,
Debraj
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
shabbirk
Moderator
Moderator
9,146 Views
Registered: ‎12-04-2016

Hi rogerrb1 & cdarak2

 

Here are the steps to build PMU FW:

 

Building PMU Firmware using SDK

  1. Open XSDK
  2. Create a new application with the following settings:
    1. Name your project / Board support package
    2. OS Platform : Standalone
    3. Hardware Platform : ZynqMP_ZCU102_hw_platform
    4. Processor : psu_pmu_0
       
  3. Click next. You will see "ZynqMP PMU Firmware" in the available templates.
  4. Click on Finish to generate the PMUFW.
  5. Connect to the local board and test the connection. You should see a pop-up showing that the connection was established successfully.
  6. Connect to the COM port on the terminal to view the UART prints.
    Note: PMUFW uses psu_uart_0 as the default STDOUT. This can be changed to other UARTs using the "Modify BSP Settings" dialogue.
    To disable debug prints from PMUFW, undef/remove/comment out the line "#define DEBUG_MODE" in the file xpfw_config.h file from the PMUFW source code.
  7. In the XSCT Console, Connect to the board and Run the PMU firmware.
  8. View the PMU firmware prints on the Terminal console.

 

Best Regards

Shabbir

0 Kudos
cdarok2
Visitor
Visitor
9,048 Views
Registered: ‎03-15-2017

Solved!

 

The key was solving the bug that exist on  PMU sources on 2016.3 version. Following Debraj indications on note AR#68246.

 

Link to the note: https://www.xilinx.com/support/answers/68246.html

 

Thanks guys!

0 Kudos
khoa_pham
Contributor
Contributor
8,702 Views
Registered: ‎04-19-2017

I am trying to use the fpga_manager on PetaLinux in order to reconfigure the PL via the PCAP port. An ES1 (xczu9eg-ffvc900-1-i-es1) chip is being used to test, and I got the error message:

 

#########################################################################

root@plnx_aarch64:/lib/firmware# echo top.bit.bin > /sys/class/fpga_manager/fpga0/firmware

[  253.678396] fpga_manager fpga0: writing top.bit.bin to Xilinx ZynqMp FPGA Manager

[  253.746963] fpga_manager fpga0: Error while writing image data to FPGA

-sh: echo: write error: No such device

#########################################################################

  

Then I have used the latest PetaLinux 2016.4's firmware and kernel images, but the error still happens.

 

Do I need to use a newer version of the Zynq UltraScale+ chip to have the fpga_manager work? Or any solution in software layer could overcome it?

 

Any suggestion would be appreciated.

0 Kudos
khoa_pham
Contributor
Contributor
7,305 Views
Registered: ‎04-19-2017

Is this PMU firmware version correct?

 

root@plnx_aarch64:~# dmesg | grep -r plat_init
[ 0.021250] zynqmp_plat_init power management API version error. Expected: v0.2 - Found: v0.0
[ 0.021260] zynqmp_plat_init Power management API v0.2

 

I got the image from the latest PetaLinux 2016.04.

 

Thanks,

Khoa

0 Kudos
khoa_pham
Contributor
Contributor
7,293 Views
Registered: ‎04-19-2017

I found the way how to put the PMU FW into the BOOT.bin image by using the SDK and structuring the data as the below .bif file:

 

//arch = zynqmp; split = false; format = BIN
the_ROM_image:
{
[fsbl_config]a53_x64
[bootloader]zynqmp_fsbl.elf
[destination_cpu = pmu]pmu_fw.elf
[destination_cpu = a53-0, exception_level = el-3]bl31.elf
[destination_cpu = a53-0, exception_level = el-2]u-boot.elf
}

 

Thanks

0 Kudos
gouthamp
Adventurer
Adventurer
6,849 Views
Registered: ‎02-04-2016

Hi @khoa_pham

Are there any more variables you suspect? I modified pmufw with patch mentioned in the AR. and included it in BOOT.BIN. only difference is I am using BOOT.BIN created from petalinux-flow and not from SDK. Also , Are you using Avent Ultrazed or Xilinx board?


Thanks
Goutham

0 Kudos
khoa_pham
Contributor
Contributor
6,739 Views
Registered: ‎04-19-2017

Hi @gouthamp,

 

Sorry for late reply!

No,  that's all I applied, and it worked. I am not sure what difference between BOOT.BIN files generated by petalinux-flow and SDK. They must be identical.

 

Moreover, I am usingTrenz board.

 

Good lucks!

Khoa

0 Kudos
vn2101
Observer
Observer
6,042 Views
Registered: ‎01-30-2018

Hi,khoa_pham.I have encountered the same problem, I use petalinux2017.2, but still will be wrong, your problem solved?

0 Kudos
khoa_pham
Contributor
Contributor
6,002 Views
Registered: ‎04-19-2017

@vn2101

 

May you post your issue's log here? Or describe it a little bit more detail?

 

Thanks!

0 Kudos
vn2101
Observer
Observer
5,998 Views
Registered: ‎01-30-2018

@khoa_pham 

This is the log,

root@spi:/lib/firmware# echo design_1_wrapper.bit.bin > /sys/class/fpga_manager/fpga0/firmware
[ 286.119903] fpga_manager fpga0: writing design_1_wrapper.bit.bin to Xilinx ZynqMP FPGA Manager
[ 286.128495] fpga_manager fpga0: Direct firmware load for design_1_wrapper.bit.bin failed with error -2
[ 286.137747] fpga_manager fpga0: Error requesting firmware design_1_wrapper.bit.bin
-sh: echo: write error: No such file or directory

 

0 Kudos
khoa_pham
Contributor
Contributor
5,991 Views
Registered: ‎04-19-2017

@vn2101,

 

Please try this command "dmesg | grep -r plat_init" and see which version of the power management API!

0 Kudos
micahstev
Newbie
Newbie
5,756 Views
Registered: ‎03-09-2018

Not sure if you figured this out, but if you use the 'echo' command, it won't send the contents of the file, it will just send the filename to the device. I assume the intent is to send the contents? Seems like an obvious oversight but please correct me if I'm wrong. 

 

Try this:

 

cat top.bit.bin > /sys/class/fpga_manager/fpga0/firmware

That said.. I'm stuck at generating the bin file from a bitstream still so I can't test. 

0 Kudos
micahstev
Newbie
Newbie
5,633 Views
Registered: ‎03-09-2018

Correction - my assumption about the format of the command was wrong. 

echo top.bit.bin > /sys/class/fpga_manager/fpga0/firmware

is correct. This tells the device which filename to look for in the /lib/firmware folder. 

 

Seems a really odd way of doing it, but it works and is fast. Very un-unix like, uhg.. 

0 Kudos