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: 
1,670 Views
Registered: ‎10-23-2018

Package all files in BOOT.bin zedboard

Jump to solution

Hello,

I am stuck trying to boot Linux with uboot on my zedboard.

Usually, what I do is :

  1. build fsbl
  2. build uboot and uImage
  3. use sdk to generate BOOT.bin (with fsbl.elf, system.bit, and uboot.elf)
  4. put BOOT.bin on my SD card along with devicetree, ramdisk, and uImage.

This works fine. But now what I am trying to do is to package all the files in BOOT.bin (fsbl.elf + system.bit + u-boot.elf + devicetreee.dtb + uImage.bin + uramdisk.image.gz), so I can drop it alone on the SD card.

As I saw in this video https://www.xilinx.com/content/xilinx/en/video/soc/create-zynq-boot-image-using-xilinx-sdk.html, I have to specify the offset for devicetree, uImage, and uramdisk, so that u-boot can find it where it expects to. In u-boot source code, I found those offsets in zynq-common.h :

  • kernel_load_address = 0x2080000
  • ramdisk_load_address=0x4000000
  • devicetree_load_address=0x2000000

So I set these offset in the bootgen window, and the generation of BOOT.bin works correctly.

bootgen.pngbootgen gui

offset.png

But when put it on my SD card and try to boot, a strange TIMEOUT occurs during u-boot, which makes it fail.

It seems that uboot is trying things in USN/Ethernet, but I don't know what :

bug.pngTimeout error in uboot

I really can't figure out what is wrong with what I did, even after spending hours searching similar problems in forums.

Can someone help me with that ?

Here is the printenv output, we can see that the offsets are well set :

printenv.pngprintenv2.png

Thanks for your time,

Bastien 

 

 

0 Kudos
1 Solution

Accepted Solutions
Explorer
Explorer
1,597 Views
Registered: ‎10-21-2015

Re: Package all files in BOOT.bin zedboard

Jump to solution

The offset address is required for partitioned location for each image in QSPI Flash.

But there is no such thing  for boot.bin of sdcard.

FAT filesystem of sdcard helps u-boot to find the location(file) of each image.

Therefore  images for sdcard can't be integrated into one image(file)

0 Kudos
12 Replies
Explorer
Explorer
1,615 Views
Registered: ‎10-21-2015

Re: Package all files in BOOT.bin zedboard

Jump to solution

Hi

As I know, devicetreee.dtb  uImage.bin and  uramdisk.image.gz can't be included in BOOT.BIN

u-boot is not programmed to load them in BOOT.BIN.

 

0 Kudos
1,604 Views
Registered: ‎10-23-2018

Re: Package all files in BOOT.bin zedboard

Jump to solution

Hi hokim,

Look at this video around 5:30 https://www.xilinx.com/content/xilinx/en/video/soc/create-zynq-boot-image-using-xilinx-sdk.html.

He does include everything in BOOT.bin

And if you want to boot from flash QSPI, then you have to include everything in the .mcs file in the same way, haven't you ?

0 Kudos
Explorer
Explorer
1,598 Views
Registered: ‎10-21-2015

Re: Package all files in BOOT.bin zedboard

Jump to solution

The offset address is required for partitioned location for each image in QSPI Flash.

But there is no such thing  for boot.bin of sdcard.

FAT filesystem of sdcard helps u-boot to find the location(file) of each image.

Therefore  images for sdcard can't be integrated into one image(file)

0 Kudos
1,586 Views
Registered: ‎10-23-2018

Re: Package all files in BOOT.bin zedboard

Jump to solution

Ok so if I understand well :

  • if I boot from SD, BOOT.bin = fsbl + system.bit + uboot ; SD = ramdisk + devicetree + uimage, no offsets needed
  • if I boot from QSPI, BOOT.mcs = fsbl + system.bit + uboot + ramdisk + devicetree + uimage, with offsets

And as for the offsets, I have to put the ones found in uboot source file zynq-common.h :

  • kernel_load_address = 0x2080000
  • ramdisk_load_address=0x4000000
  • devicetree_load_address=0x2000000

 

You confirm that ? :)

0 Kudos
Explorer
Explorer
1,577 Views
Registered: ‎10-21-2015

Re: Package all files in BOOT.bin zedboard

Jump to solution

You understand it well.

 For ramdisk , devicetree , uimage(kernel image), single file of FIT format like image.ub  can be used  and  petalinux generates that file

For FIT, see https://www.denx.de/wiki/pub/U-Boot/Documentation/multi_image_booting_scenarios.pdf

0 Kudos
Explorer
Explorer
1,570 Views
Registered: ‎10-21-2015

Re: Package all files in BOOT.bin zedboard

Jump to solution

You don't need to touch u-boot source code for load addresses of separate images

Use uEnv.txt  with u-boot script code like this

bitstream_load_address=0x1000000
bitstream_image=system.bit
kernel_image=zImage
devicetree_image=system.dtb
kernel_load_address=0x1080000
devicetree_load_address=0x1000000

bootargs=console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootwait rootfstype=ext4 quiet uio_pdrv_genirq.of_id=generic-uio console=tty1 consoleblank=0

uenvcmd=mmcinfo && fatload mmc 0 ${bitstream_load_address} ${bitstream_image} && fpga loadb 0 ${bitstream_load_address} $filesize && fatload mmc 0 ${kernel_load_address} ${kernel_image} && fatload mmc 0 ${devicetree_load_address} ${devicetree_image} && bootz ${kernel_load_address} - ${devicetree_load_address}

 

0 Kudos
1,561 Views
Registered: ‎10-23-2018

Re: Package all files in BOOT.bin zedboard

Jump to solution

Ok thank you so much !

Is this script supposed to be in BOOT.bin or on the SD ?

I understand that is used for transmitting commands upon uboot start and update its environment, but my question about the offsets was rather how can I find the good values for it when I will boot in QSPI ? Do I have to search for it in uboot code in order to see where it expects to find it ?

0 Kudos
Explorer
Explorer
1,555 Views
Registered: ‎10-21-2015

Re: Package all files in BOOT.bin zedboard

Jump to solution
0 Kudos
1,540 Views
Registered: ‎10-23-2018

Re: Package all files in BOOT.bin zedboard

Jump to solution

Thanks for your time it really helped me !

0 Kudos
1,529 Views
Registered: ‎10-23-2018

Re: Package all files in BOOT.bin zedboard

Jump to solution

I have a last question.

I saw in https://github.com/Xilinx/u-boot-xlnx/blob/master/include/configs/zynq-common.h line 257 :

 "qspiboot=echo Copying Linux from QSPI flash to RAM... && " \
 "sf probe 0 0 0 && " \
 "sf read ${kernel_load_address} 0x100000 ${kernel_size} && " \
 "sf read ${devicetree_load_address} 0x600000 ${devicetree_size} && " \
 "echo Copying ramdisk... && " \
 "sf read ${ramdisk_load_address} 0x620000 ${ramdisk_size} && " \
 

"bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}\0" \

So the offsets to put in the BOOT.mcs files for a qspi boot seems to be 0x100000 for uImage, 0x600000 for devicetree, and 0x620000 for uramdisk.

But when I click on "create Image", an error occurs telling me that there is an overlap at the uImage.bin section offset of 0x100000, which olerlaps with prior section.

That previous section is my system.bit bitsream, and if I remove it the mcs can be generated.

How can I make it works with my bitstream included ? 

fsbl.png 

0 Kudos
Explorer
Explorer
1,515 Views
Registered: ‎10-21-2015

Re: Package all files in BOOT.bin zedboard

Jump to solution

The offsets should be changed depending on part, kernel size and ramdisk size

You have to find the proper offsets for yourself.

I think you can estimate the offsets from mcs size of each file. 

 

0 Kudos
1,513 Views
Registered: ‎10-23-2018

Re: Package all files in BOOT.bin zedboard

Jump to solution

Ok thanks again, have a nice day

0 Kudos