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: 
Observer beaupeacock
Observer
9,564 Views
Registered: ‎12-08-2015

Creating a .bif file

I am wondering about how to correctly generate the .bif file for a custom zynq 7000 board.

 

I am guessing I need a .bif file that will look like:

image : {
        [bootloader]fsbl.elf
        u-boot.elf
        [load=0x2a00000]devicetree.dtb
        [load=0x2000000]uramdisk.image.gz
        [load=0x3000000]uImage.bin   // currently bootgen requires a file extension. this is just a renamed uImage
}

 or:

image : {
        [bootloader]fsbl.elf
        u-boot.elf
        [offset=<dt-offset>]devicetree.dtb
        [offset=<ramdisk_offset>]uramdisk.image.gz
        [offset=<uimage_offset>]uImage.bin   // currently bootgen requires a file extension. this is just a renamed uImage
}

To make the file:

go into sdk environment --> Xilinx Tools --> Create Boot Image

I select the radio buttons for Create new BIF file and set the output path to <Petalinux Project>/builds/linux/nand.bif

The output path should be in the same directory <Petalinux Project>builds/linux/BOOT.bin

Now I add the boot image partitions from my Petalinux output files:

- <Petalinux Project>/images/linux/zynq_fsbl.elf

- <Petalinux Project>/images/linux/u-boot.elf

- [offset = ?????]<Petalinux Project>/images/linux/system.dtb

- [offset = ?????]<Petalinux Project>/images/linux/rootfs.cpio.gz  (Petalinux does not produce any uramdisk.image.gz)

- [offset = ?????]<Petalinux Project>/images/linux/uImage.ub (Petalinux produces a uImage.ub and a zImage, and I don't know what these files do)

- <Petalinux Project>/images/linux/project_wrapper.bit (This is not in the above example, but how does the bit file go to the fpga during boot-up?)

 

for some simple questions:

I have a nand chip on my custom board, I am guessing that my .bif file for a QSPI device is the same as for a NAND device?

for the difference between the FSBL pre-loading the linux image and U-boot load linux image, I am unsure I understand the difference in boot up

I also don't know how to determine my Load or offset locations in the partition, I am guessing this comes from the petalinux-configure -c u-boot or kernel user interfaces, but I don't know where to look.

 

I know these are probably basic questions, and I hope you guys can help.

0 Kudos
7 Replies
Moderator
Moderator
9,528 Views
Registered: ‎04-17-2011

Re: Creating a .bif file

Section 5.2.5 Has steps on how to generate the Boot image for QSPI flash. http://www.xilinx.com/support/documentation/sw_manuals/xilinx14_7/ug873-zynq-ctt.pdf
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
Observer beaupeacock
Observer
9,518 Views
Registered: ‎12-08-2015

Re: Creating a .bif file

Thanks, 

 

So I am trying to tie this together with what I get from Petalinux.

 

Whenever I run the petalinux-config command and then go to Subsystem AUTO Hardware settings -->Flash Settings I get what looks like a breakdown of my partitions in my NAND or QSPI device. Note: this menu doesn't exist unless I have nand in my vivado project.

 

My defaults are:

     Primary Flash (ps7_nand_0) -->

[  ] Advanced Flash Auto Configuration

     *** partition 0 ***

(boot) name (new)

(0x40000) size

     *** partition 1 ***

(bootenv) name (new)

(0x20000) size (new)

    *** partition 2 ***

(kernel) name (new)

(0x600000) size (new)

   *** partition 3 ***

() name (new)

 

Looking at Ug873 section 5.2.5 I gather that I need:

zynq_fsbl_0.elf

u-boot.elf

uImage.bin

devicetree.dtb

uramdisk.image.gz

 

I don't know if any partitions set in my configuration files are supposed to correspond to my .bif file?

 

Other things:

The image file discussed in section 5.2.5 (uImage.bin) I am guessing is the same as the kernel image? I don't really know, but when I look in the petalinux configuration I see that the kernel image settings are:

   image storage media (primary flash) --->

(kernel) flash partition name (new)

(image.ub) image name

 

Should my uImage.bin actually be image.ub in my bif file? 

 

 Thanks for the help

 

0 Kudos
Voyager
Voyager
9,515 Views
Registered: ‎09-14-2016

Re: Creating a .bif file

Hi,

 

I think uImage.bin and image.ub are the same. Kernel with u-boot header :-)

 

.bin is just because Xilinx SDK seems to need extension file.

 

Regards,

Trigger

0 Kudos
Voyager
Voyager
9,512 Views
Registered: ‎09-14-2016

Re: Creating a .bif file

0 Kudos
Moderator
Moderator
9,490 Views
Registered: ‎04-17-2011

Re: Creating a .bif file

Ok, so in 5.2.5 we are asking you to use the Zynq Released binaries. Petalinux generates Image.ub (which has the device tree and rootfs embedded). If you are using Petalinux generated files, you have two options:

a) Use petalinux-package --boot --fsbl images/linux/zynq_fsbl.elf --fpga images/linux/download.bit --u-boot --kernel --boot

b) Use the bootgen to generate the boot image using the files: fsbl, download.bit, u-boot, image.ub.
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
Observer beaupeacock
Observer
9,450 Views
Registered: ‎12-08-2015

Re: Creating a .bif file

Thanks for the reply, I am hoping to load a .bin file onto nand so I am interested in the bootgen command that uses a .bif file.

 

I am close to understanding what I need to do, some additional questions:

- For the image.ub file I have usually seen an offset in the .bif file.

  - do I need an offset?

  - if I use an offset command then should this offset match the kernel offset in my flash settings

       for example: I have a boot partition size 0x40000 and a bootenv partition of 0x60000 then my image.ub offset should be

       0x100000.

- does the FSBL includes the .bit file load on the zynq chip? so I don't have to have it in my .bif file

- Does the naming of the partitions or order matter?

- I am confused on the location of the .bit file? In SDK if I generate a FSBL template (which I assume is what petalinux does) the notes say the fsbl configures the FPGA with the HW bit stream? And the wiki for preparing the boot image does not have the bit stream included? Does the FSBL configure the fpga with the bitstream?

- Also your list of items does not include the device tree blob, I know that there is a device tree padding setting that is not to clear to me what exactly I should do. Are you suggesting the u-boot has the .dtb file attached, or like in prepare boot image wiki, I see that is is placed right after the u-boot.elf file, and this .dtb padding size should correspond to the actual .dtb file size.

- Lastly, is it correct to say the the boot partition in should house the fsbl, download.bit, u-boot, .dtb (possibly) and when the zynq boots up that the fsbl loads u-boot in the boot-env partition? which then starts the kernel at image.ub offset?

0 Kudos
Explorer
Explorer
5,722 Views
Registered: ‎10-19-2017

Re: Creating a .bif file

@debrajrIs the system.dtb compiled into the image.ub. From the boot messages I get when I include 3 files (1) BOOT.BIN (generated from design_1_wrapper.bit and zynq_fsbl.elf), (2) image.ub, and (3) system.dtb suggest that u-boot needs to find image.ub, then locate system.dtb to boot Linux correctly. I see no mention of system.dtb, so I was wondering where this fits into the equation.

0 Kudos