[U-Boot] Zynq Zybo booting with mainline U-Boot

Simon Glass sjg at chromium.org
Wed Apr 15 05:02:12 CEST 2015


(Correcting address for Masahiro)

On 14 April 2015 at 21:00, Simon Glass <sjg at chromium.org> wrote:
> Hi,
>
> On 3 February 2015 at 03:08, Michal Simek <monstr at monstr.eu> wrote:
>> Hi Simon and Masahiro,
>>
>> On 02/03/2015 08:32 AM, Masahiro Yamada wrote:
>>> Hi Simon,
>>>
>>>
>>> On Mon, 2 Feb 2015 22:00:25 -0700
>>> Simon Glass <sjg at chromium.org> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have one of boards and would like to get mainline U-Boot booting on it.
>>>>
>>>> I have followed the instructions for creating a BOOT.BIN file comprised of:
>>>>
>>>> - boot.elf
>>>> - .bit file
>>>> - u-boot.elf
>>>>
>>>> and putting it on a a micro-SD card.
>>>>
>>>> This works OK with the diligent master branch from github. I can boot normally.
>>>>
>>>> However this is 2013.10. Mainline U-Boot uses device tree so
>>>> presumably the elf file does not work. I expect we need to use
>>>> u-boot-dtb.bin.
>>
>> I think the best what you can do is simple disable CONFIG_OF_CONTROL
>> from mainline u-boot and do not use now.
>> This is what I do in xilinx tree but OF_CONTROL is also working fine
>> but needs some setup.
>>
>>>>
>>>> However since this is not an elf file I'm not sure how to build the
>>>> image using the 'Create Zynq Boot Image' tool.
>>>>
>>>> I don't see any instructions in REAME.zynq about how to create an SD card.
>>>>
>>>> Any pointers please?
>>>>
>>>
>>>
>>> I have a Zynq ZC706 board.
>>>
>>> The follwing is what I tried to run u-boot mainline.
>>>
>>>
>>> I hope it will work for Zybo board, too.
>>
>> Zybo will be just the same.
>>
>>>
>>>
>>> [1] If you are using Xilinx hardware tool (Vivado or ISE)
>>>     you can generate  ps7_init.[ch] or ps7_init_gpl.[ch].
>>>
>>>     Copy the C file and the header into borad/xilinx/zynq directory
>>>
>>>
>>> [2] Build
>>>
>>>     make zynq_zybo_defconfig  && make
>>>
>>>
>>> [3] Download the python script to generate boot.bin
>>>
>>>    git clone git://github.com/Xilinx/u-boot-xlnx.git
>>>
>>>     Copy  tools/zynq-boot-bin.py   to  ~/bin  or somewhere you like
>>
>>
>> In future I want to move this script to be the part of mkimage
>> but it has low priority now.
>>
>>
>>
>>> [4] Generate boot.bin
>>>
>>> zynq-boot-bin.py -o boot.bin -u u-boot/spl/u-boot-spl.bin
>>>
>>>
>>> [5] Copy  boot.bin and u-boot-dtb.img  to your SD card
>>>
>>>
>>>
>>>
>>> Please give it a try.
>>>
>>> The problem about the instruction above is FPAG bit file is not loaded.
>>
>> yes - but if you use xilinx tree I have also added support for loading
>> bitstream by SPL. I just haven't sent it to mainline yet.
>> But you can simple load bitstream in full u-boot which is fully supported
>> in mainline.
>>
>>
>>> Another way instead of [4] might be:
>>>
>>>
>>> Describe foo.bif as follows
>>>
>>> image:
>>> {
>>>         [bootloader]fsbl.elf
>>>         fpga.bit
>>>         [load=0x04000000,startup=0x04000000]u-boot/u-boot-dtb.bin
>>> }
>>>
>>> and
>>> $ bootgen -image foo.bif -w on -o boot.bin
>>>
>>
>> yes - this should also work.
>>
>>> I have not working on Zynq these days.
>>
>> why not? :-)
>>
>>> I hope Michal can support us.
>>
>> Simon: Let me know if you need any my help on this.
>> I have zybo here that I can try it.
>
> Thanks for your help!
>
> Here's what works for me:
>
> CROSS_COMPILE=/opt/xilinx/SDK/2014.4/gnu/arm/lin/bin/arm-xilinx-linux-gnueabi-
> make O=b/zynq_zybo zynq_zybo_defconfig
>
> CROSS_COMPILE=/opt/xilinx/SDK/2014.4/gnu/arm/lin/bin/arm-xilinx-linux-gnueabi-
> make O=b/zynq_zybo  -j10 -s
>
> /opt/xilinx/SDK/2014.4/bin/bootgen -image try.bif -w on -o boot.bin;
> cp boot.bin  /media/sglass/A097-A1D5/BOOT.bin; cp u-boot-dtb.img
> /media/sglass/A097-A1D5/.
>
> try.bif:
> image:
> {
> [bootloader]/vid/software/devel/zynq/play/play.sdk/boot/Debug/boot.elf
> /vid/software/devel/zynq/play/play.sdk/design_1_wrapper_hw_platform_0/design_1_wrapper.bit
> [load = 0x04000000,startup=0x04000000]/vid/software/devel/zynq/u-boot-dtb.bin
> }
>
> I'm a bit unclear why I say u-boot-dtb.bin in the try.big file but it
> actually loads u-boot-dtb.img.
>
>
> If I use the zynq-boot script I can do this:
>
> zynq-boot-bin.py -o boot.bin -u spl/u-boot-spl.bin
> cp boot.bin  /media/sglass/A097-A1D5/BOOT.bin; cp u-boot-dtb.img
> /media/sglass/A097-A1D5/.
>
> and then I get a message from SPL and it boots also. I'm not sure why.
>
> Regards,
> Simon


More information about the U-Boot mailing list