[meta-xilinx] rel-v2018.1 / zcu102-zynqmp: U-boot crashes with error "fdt_root: FDT_ERR_BADMAGIC"
Andreas Galauner
andreas at galauner.de
Mon May 7 06:56:27 PDT 2018
On 07.05.2018 12:23, Martin Lund wrote:
> Inspired by your last post I tried adding an #undef CONFIG_ARM64 in
> arch/arm/lib/spl.c to force it to jump to the ATF without dropping to
> EL2 first. That is, to try to mimic the old hacky way of booting the ATF.
>
> Unfortunately this hack seems to be insufficient as it gets stuck at
> address 0xfffea928 so I assume the ATF has crashed ending up in a reset
> vector - probably because some preconditions not being fulfilled.
Yes, it's missing the handoff data and complains by panicing there.
> In the end, perhaps the best way forward is to try use the new ATF
> framework in u-boot but as you point out the information is sparse on
> that point.
>
> Hopefully someone out there can provide us with the missing information
> so that we can get the zynqmp booting without using the horrible xilinx
> toolchain.
I made it work. I have it working in the current mainline git HEAD of
u-boot and the xilinx fork.
I only tested it on an Ultrazed so far, because that is the only ZynqMP
board I have. Also, it's really bare bones. Still no BL32 support etc.
With the mainline u-boot, I didn't boot Linux yet, because I was too
lazy to write a proper boot script. This one contains a different
environment compared to the Xilinx fork. The xilinx fork works and boots
Linux.
Another problem is building a FIT image containing u-boot, ATF and the
DTB from within yocto. You can specify a .its file for this, but this
mechanism breaks when you build u-boot with yocto, because this feature
totally doesn't like the build dir to be different from the source dir
because relative paths are used in this file.
I have two hacks in place in the u-boot Makefile itself and the u-boot
yocto recipe, because I couldn't find a better way how to deal with it.
This should be looked at before it is upstreamed. I couldn't find an
easy general solution to this.
Both patches are attached.
Now, where would I upstream something like this? Mainline u-boot? If
somebody wants to take care of that, please go ahead.
For your boards (ZCU102 etc.), you need to change the u-boot defconfig
slightly:
CONFIG_SPL_OS_BOOT needs to be off
CONFIG_SPL_ATF_NO_PLATFORM_PARAM needs to be on
and
CONFIG_SPL_FIT_SOURCE="board/xilinx/zynqmp/fit_spl_atf.its"
That should be it. In your bitbake recipe (or bbappend) for the u-boot,
add the patch and these lines:
> # Copy the ATF BL31 into the u-boot source directory
> do_compile_zynqmp[depends] += "arm-trusted-firmware:do_deploy"
> do_compile_prepend_zynqmp() {
> cp ${DEPLOY_DIR_IMAGE}/arm-trusted-firmware.bin ${B}/bl31.bin
>
> #Fix paths in zynqmp its file for u-boot. This is a hack but works for now
> sed -i -e 's#../../../#../../../../build/#g' ${S}/board/xilinx/zynqmp/fit_spl_atf.its
> }
>
> # Hack to build itb file instead of bin
> UBOOT_SUFFIX = "itb"
> UBOOT_BINARY = "u-boot.itb"
> UBOOT_MAKE_TARGET = "all u-boot.itb"
After that do a clean build and you should have a boot.bin with the SPL
+ PMUFW and a u-boot.itb containing ATF, u-boot and the appropriate DTB.
- Andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mainline.patch
Type: text/x-patch
Size: 5101 bytes
Desc: not available
URL: <http://lists.yoctoproject.org/pipermail/meta-xilinx/attachments/20180507/c6bf96d7/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xlnx.patch
Type: text/x-patch
Size: 5099 bytes
Desc: not available
URL: <http://lists.yoctoproject.org/pipermail/meta-xilinx/attachments/20180507/c6bf96d7/attachment-0003.bin>
More information about the meta-xilinx
mailing list