12-04-2018 07:48 AM
Hello,
I am stuck trying to boot Linux with uboot on my zedboard.
Usually, what I do is :
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 :
So I set these offset in the bootgen window, and the generation of BOOT.bin works correctly.
bootgen gui
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 :
Timeout 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 :
Thanks for your time,
Bastien
12-05-2018 02:00 AM - edited 12-05-2018 02:01 AM
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)
12-05-2018 12:13 AM - edited 12-05-2018 12:30 AM
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.
12-05-2018 12:40 AM
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 ?
12-05-2018 02:00 AM - edited 12-05-2018 02:01 AM
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)
12-05-2018 02:09 AM - edited 12-05-2018 02:18 AM
Ok so if I understand well :
And as for the offsets, I have to put the ones found in uboot source file zynq-common.h :
You confirm that ? :)
12-05-2018 02:21 AM
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
12-05-2018 02:34 AM
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}
12-05-2018 02:44 AM
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 ?
12-05-2018 03:10 AM
uEnv.txt should be located on SD card
Search CONFIG_EXTRA_ENV_SETTINGS in u-boot source
https://github.com/Xilinx/u-boot-xlnx/blob/master/include/configs/zynq-common.h
https://github.com/Xilinx/u-boot-xlnx/blob/master/include/configs/xilinx_zynqmp.h
12-05-2018 05:17 AM
Thanks for your time it really helped me !
12-05-2018 06:11 AM
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 ?
12-05-2018 07:59 AM
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.
12-05-2018 08:02 AM
Ok thanks again, have a nice day