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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Participant haibingma
Participant
16,129 Views
Registered: ‎09-05-2012

zynq u-boot fpga command?

I see the fpga command is supported in the u-boot of 14.2 release. Is there a link / exmaple showing how to use the command to download bitstream?

 

Thanks.

 

Haibing

0 Kudos
9 Replies
Xilinx Employee
Xilinx Employee
16,126 Views
Registered: ‎09-10-2008

Re: zynq u-boot fpga command?

Hi Haibing,

 

This was commited by the community as Xilinx has not done testing on it yet.

 

Thanks.

0 Kudos
Adventurer
Adventurer
15,921 Views
Registered: ‎05-03-2012

Re: zynq u-boot fpga command?

Hi together,

 

I've made some tests with the "fpga" command on U-Boot 2012.04.01

It is possible to get some informations:

zynq-uboot> fpga info 0
Xilinx Device
Descriptor @ 0x3ffb8df4
Family:         Zynq PL
Interface type: Device configuration interface (Zynq)
Device Size:    4045564 bytes
Cookie:         0x0 (0)
No Device Function Table.

 

But not to load the *.bit file (Original system.bit from 14.3 TRD)

zynq-uboot> fpga load 0 0x3000000 4045679
Error: Timeout waiting for FPGA to config.
fpga - loadable FPGA image support

Due to it is not fully tested, I have some doubts to head on with testing because of bricking the dev board...

 

To load the bitstream from Linux, the FPGA bitstream must be in a binary format and byte swapped. 

Is this also the requirement for loading FPGA bitstreams from U-Boot?

I cannot find any more profound documentation regarding this issue till now.

 

Thanks and Regards,

Helmut

 

0 Kudos
Scholar milosoftware
Scholar
15,914 Views
Registered: ‎10-26-2012

Re: zynq u-boot fpga command?

See my last mail in this topic for a simple Python script that converts a "bit" to "bin" file for direct programming:

http://forums.xilinx.com/t5/Embedded-Linux/Zynq-Loading-bitfile-into-FPGA-from-Linux-xdevcfg/td-p/237850

0 Kudos
Scholar milosoftware
Scholar
15,913 Views
Registered: ‎10-26-2012

Re: zynq u-boot fpga command?

Seems to work fine, after loading a bin file, the "done" LED is lit. Writing the bin file takes less than a second.

zynq-uboot> fatload mmc 0 0 fpga.bin                                            
reading fpga.bin                                                                
                                                                                
4045564 bytes read                                                              
zynq-uboot> fpga load 0 0 0x3dbafc                                              
Wrong parameters for FPGA request                                               
fpga - loadable FPGA image support                                              
                                                                                
zynq-uboot> fatload mmc 0 0x1000000 fpga.bin                                    
reading fpga.bin                                                                
                                                                                
4045564 bytes read                                                              
zynq-uboot> fpga info 0                                                         
Xilinx Device                                                                   
Descriptor @ 0x3ffb89c4                                                         
Family:         Zynq PL                                                         
Interface type: Device configuration interface (Zynq)                           
Device Size:    4045564 bytes                                                   
Cookie:         0x0 (0)                                                         
No Device Function Table.                                                       
zynq-uboot> fpga load 0 0x1000000 0x3dbafc                                      
zynq-uboot> 
0 Kudos
Adventurer
Adventurer
15,890 Views
Registered: ‎05-03-2012

Re: zynq u-boot fpga command?

Works well!

 

Thanks a lot!

0 Kudos
Observer niroshan
Observer
14,424 Views
Registered: ‎10-17-2009

Re: zynq u-boot fpga command?

Hello,

 

Has anyone been able to configure PL with an encrypted bitstream from u-boot? I've booted PS in secure mode by creating an encrypted BOOT.BIN then tried to configure PL with the encrypted bitstream but u-boot fpga command just prints the help screen and the FPGA doesn't get configured. If I then run u-boot fpga command again with an unencrypted bitstream, it gets configured OK. Encrypted bitstreams do work OK from FSBL but ultimately I want to be able to configure the FPGA with encrypted bitstreams from Linux.

 

Regards,

Niro.

 

 

0 Kudos
Adventurer
Adventurer
14,406 Views
Registered: ‎05-03-2012

Re: zynq u-boot fpga command?

Hi Niro,

 

unfortunately not.

But maybe the newest version of the software guide can help.

http://www.xilinx.com/support/documentation/user_guides/ug821-zynq-7000-swdev.pdf

 

There are some topic changes regarding encryption mentioned in the revision history

 

Best regards,

Helmut

0 Kudos
Observer niroshan
Observer
14,370 Views
Registered: ‎10-17-2009

Re: zynq u-boot fpga command?

Hi Helmut,

 

Thanks for your response - Latest u-boot from Xilinx's git repository can configure PL with encrypted bitstreams. However, it only works once. Subsequent attempts to configure PL with the same encrypted bitstream fails but this was good enough for me to know that it is possible to configure PL with encrypted bitstreams outside of FSBL.

 

On a side note, Linux's /dev/xdevcfg driver also didn't work with encrypted bitstreams and it was causing Linux to lock-up. After some debug I found that the lock-up was by Linux being flooded with PCAP IRQs after trying to configure PL. After adding 250us of delay between assertion and deassertion of PCFG_PROG_B bit in PCAP CTRL register (used to reset PL) fixed this issue and now I am able to configure PL with encrypted bitstreams from Linux as many times as I want.

 

Regards,

Niro.

0 Kudos
Adventurer
Adventurer
14,354 Views
Registered: ‎05-03-2012

Re: zynq u-boot fpga command?

Niro,

 

sounds very good that you had success.

 

Best regards,

Helmut

0 Kudos