Hand-rolling QorIQ PBL blobs
If you're anything like me you might find yourself up a creek trying to tweak NXP/Freescale QorIQ RCW values. In such a case, unless you're building U-Boot with OpenWRT or Yocto, you'll have to manually roll a new PBL with bundled ATF before you can boot.
I'm writing this as a reminder to myself of the steps required, after having reverse-engineered them from online documentation and OpenWRT's build process.
Step 1: Build or obtain a U-Boot binary
The QorIQ platform is fairly well supported in mainline U-Boot, and it Just Works™ using the various defconfigs:
export CROSS_COMPILE=aarch64-linux-gnu- make ls1043ardb_defconfig make
This should spit out a
Step 2: Compile your RCW
If you're reading this, you've already discounted the idea of using CodeWarrior and QCVS. There is still hope. NXP Provides a Python tool which can compile text representations of RCWs into binary. It also provides a fair few example RCWs to get your started.
git clone https://source.codeaurora.org/external/qoriq/qoriq-components/rcw
Pick an RCW for your platform, and edit it as necessary, finally compiling it with
make -C <platform>.
Step 3: Bring it all together
The QorIQ ATF is open source:
git clone https://source.codeaurora.org/external/qoriq/qoriq-components/atf/
Build it, and build your U-Boot plus firmware into a single PBL. Tweak the various parameters as you see fit. I built for the LS1043ARDB booting from SD card:
export CROSS_COMPILE=aarch64-linux-gnu- make pbl \ PLAT=ls1043ardb \ BOOT_MODE=sd \ RCW=~/path/to/rcw/ls1043ardb/RR_FQPP_1455/rcw_1600_sdboot.bin \ BL33=~/path/to/u-boot/u-boot.bin
You should now have a
bl2_sd.pbl which can be burned onto your boot media. E.g. for SD card on the LS1s:
dd if=./build/<platform>/release/bl2_sd.pbl of=/dev/whatever bs=512 seek=8