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

Michal Simek monstr at monstr.eu
Wed Apr 15 07:46:53 CEST 2015


Hi Simon,

On 04/15/2015 05:02 AM, Simon Glass wrote:
> (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

what's boot.elf here? Is it u-boot SPL?

>> /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 boot.elf is u-boot-spl then you don't need to add u-boot-dtb.bin to
BIF at all because in MMC mode u-boot-dtb.img will be loaded instead.

>>
>>
>> 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.

u-boot-spl.bin is placed to OCM. In SD/MMC node SPL loads u-boot-dtb.img
from SD to DDR and jump to it.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150415/5964cc8a/attachment.sig>


More information about the U-Boot mailing list