[meta-xilinx] FSBL.elf and BOOT.BIN using bitbake and SDCard booting
Giordon Stark
kratsg at gmail.com
Mon Oct 10 19:15:48 PDT 2016
Thanks, some elaboration below!
On Mon, Oct 10, 2016 at 8:58 PM Nathan Rossi <nathan at nathanrossi.com> wrote:
> On Tue, Oct 11, 2016 at 9:49 AM, Giordon Stark <kratsg at gmail.com> wrote:
>
> > Hi,
>
> >
>
> > I am using bitbake to build on top of a custom machine [eg: using my
>
> > devicetree] and then generating the following files which I renamed into
> a
>
> > format appropriate for meta-xilinx
>
> >
>
> > -rwxr-xr-x 1 kratsg 59K Oct 5 17:31 BOOT.BIN
>
> > -rw-r--r-- 1 kratsg 22K Oct 5 17:30 devicetree.dtb
>
> > -rw-r--r-- 1 kratsg 3.2M Oct 5 17:30 uImage
>
> > -rw-r--r-- 1 kratsg 26M Oct 5 17:15 uramdisk.image.gz
>
> > -rwxr-xr-x 1 kratsg 2.4M Oct 5 17:30 u-boot.elf
>
> >
>
> > The machine is defined here:
>
> >
> https://github.com/kratsg/meta-l1calo/blob/master/conf/machine/gfex-prototype2.conf
>
> >
>
> > The image I make (bitbake zynq-base) is defined here:
>
> >
> https://github.com/kratsg/meta-l1calo/blob/master/recipes-core/images/zynq-base.bb
>
> >
>
> > So i'm hoping this is relatively straightforward. Now I get a little
>
> > confused about actually booting this on the board using the SD Card.
>
> > According to the docs
>
> > (https://github.com/Xilinx/meta-xilinx/blob/master/docs/BOOT.sdcard) it
>
> > seems that I need to only use four files generated from bitbake:
>
> > devicetree.dtb, uImage, uramdisk.image.gz, and u-boot.elf; and then use
> the
>
> > Xilinx SDK to create an FSBL.elf, use the u-boot.elf from bitbake, and
>
> > create a boot image (BOOT.BIN). Why isn't this able to be done using
>
> > bitbake? When I try everything without using the Xilinx SDK, I see the
> error
>
> > message [1].
>
>
>
> Those docs are a bit old, for the last release I re-wrote the
>
> documentation as README.booting.md in the root of meta-xilinx.
>
>
>
>
> https://github.com/Xilinx/meta-xilinx/blob/master/README.booting.md#loading-via-sd
>
>
>
Awesome, I was not aware that the docs were rewritten. I didn't even
realize there was a README.booting.md at the top level. Perhaps that can be
clarified somewhere?
>
> Also I am not sure about your question regarding boot.bin generation.
>
> But if you machine provides the ps7_init_gpl* files (your machine is
>
> including zc706, so they are available) it is able to build u-boot-spl
>
> (which does the same job as FSBL) and wrap that in the boot.bin format
>
> for use. If you need FSBL specifically then that is a separate issue.
>
For right now, we are using a custom board with a ZC706. We'll move to the
Zynq+ in the next generation (as well as bump up versions of everything
from Jethro). So I imagine we will always have these ps7_init_gpl available
(I imagine you refer to these:
https://github.com/Xilinx/meta-xilinx/tree/master/recipes-bsp/platform-init/platform-init/picozed-zynq7
).
I do not totally understand how/why this can replace the FSBL entirely?
http://www.wiki.xilinx.com/U-Boot+Secondary+Program+Loader#Task%20Description-Build%20U-Boot%20SPL
seems
to indicate it is not fully supported by Xilinx. In fact, I never
understood how the FSBL normally worked because I understood the process as
ROM Code -> SPL -> U-BOOT -> Kernel.
We do not necessarily require FSBL so this is fine. Looking at the files
generated (https://gist.github.com/kratsg/ba23d69a84db769cf8183b3dbc37c2f3)
with my attached local.conf there -- I do not see this. I'm guessing this
is in a later release of poky. I can certainly update later to move to this
workflow soon... unless you suggest I do it now over FSBL?
>
>
>
> >
>
> > My second (less important) question is how to get bitbake to generate the
>
> > filesystem in the right format? Right now, I have to run
>
> >
>
> > mkimage -A arm -T ramdisk -C gzip -d
>
> > zynq-base-gfex-prototype2.cpio.gz.u-boot uramdisk.image.gz
>
>
>
> *.cpio.gz.u-boot == uramdisk.image.gz. They are the same format
>
> (except that i think the default Xilinx images are "ext.gz.u-boot"),
>
> so there is no need to double wrap the ramdisk with two u-boot mkimage
>
> headers :).
>
The default appears to be cpio.gz.u-boot. If I didn't wrap it this way, I
could not get the filesystem loaded using that file. It needed the mkimage
command.
>
>
>
> >
>
> > in order to get the correct uramdisk.image.gz . Is there a way to make
>
> > bitbake generate the right image so I don't need to run this command so
> that
>
> > u-boot understands my image when booting?
>
> >
>
> > Giordon
>
> >
>
> > [1]
>
> > U-Boot SPL 2015.04 (Oct 05 2016 - 13:12:31)
>
>
>
> It looks like you are using the jethro version of OE/meta-xilinx? If
>
> so, the new documentation might not exactly match the process (e.g.
>
> "u-boot-dtb.img" instead of "u-boot.img").
>
Noted. I do have u-boot-dtb.img instead of u-boot.img
>
>
>
> > mmc boot
>
> > reading fpga.bin
>
> > spl_load_image_fat: error reading image fpga.bin, err - -1
>
> > spl: error reading image fpga.bin, err - 1
>
> > reading system.dtb
>
> > spl_load_image_fat_os: error reading image system.dtb, err - -1
>
> > reading u-boot-dtb.img
>
> > spl_load_image_fat: error reading image u-boot-dtb.img, err - -1
>
> > ### ERROR ### Please RESET the board ###
>
>
>
> If you follow the documentation I linked above it will mentioned
>
> adding the "u-boot-dtb.img" file to your SD card. This is what you are
>
> missing here, which is why you get the error.
>
Really? But as it stands, there is no FSBL or SPL in my list of files. So
how is it able to boot otherwise?
>
>
>
> Regards,
>
> Nathan
>
>
>
> >
>
> >
>
> > --
>
> > _______________________________________________
>
> > meta-xilinx mailing list
>
> > meta-xilinx at yoctoproject.org
>
> > https://lists.yoctoproject.org/listinfo/meta-xilinx
>
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/meta-xilinx/attachments/20161011/9e037a09/attachment.html>
More information about the meta-xilinx
mailing list