[meta-freescale] [meta-fsl-arm][PATCH v2 2/6] Add u-boot recipe for Layerscape1 support
zhenhua.luo at freescale.com
zhenhua.luo at freescale.com
Thu Aug 28 04:53:39 PDT 2014
> -----Original Message-----
> From: otavio.salvador at gmail.com [mailto:otavio.salvador at gmail.com] On
> Behalf Of Otavio Salvador
> Sent: Wednesday, August 27, 2014 8:55 PM
>
> On Wed, Aug 27, 2014 at 1:57 AM, Zhenhua Luo <zhenhua.luo at freescale.com>
> wrote:
>
> > +do_stage_endian_swap_tool () {
> > + install -m 755 ${S}/byte_swap.tcl ${STAGING_BINDIR_NATIVE} }
> > +
> > +addtask stage_endian_swap_tool before do_compile after do_patch
>
> What this tcl script does? it seems it should be split from here.
[Luo Zhenhua-B19537] the script swaps the byte for QSPI boot image, currently it is maintained in ls1 u-boot What do you mean by "split from here"?
> > + if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
> > + then
> > + head=`git rev-parse --verify --short HEAD 2> /dev/null`
> > + printf "%s%s%s" ${UBOOT_LOCALVERSION} +g $head >
> ${B}/.scmversion
> > + printf "%s%s%s" ${UBOOT_LOCALVERSION} +g $head >
> ${S}/.scmversion
> > + fi
>
> UBOOT_LOCALVERSION is already supported in u-boot.inc
[Luo Zhenhua-B19537] The UBOOT_LOCALVERSION code is in do_compile function, LS1 build process is different from the definition in poky/meta/recipes-bsp/u-boot/u-boot.inc, so we rewrite the function and keep the code UBOOT_LOCALVERSION code here.
> > + if [ "x${UBOOT_MACHINES}" = "x" ]; then
> > + UBOOT_MACHINES="${UBOOT_MACHINE}"
> > + fi
> > +
> > + for board in ${UBOOT_MACHINES}; do
> > + oe_runmake O=${board} distclean
> > + oe_runmake O=${board} ${board}
> > + oe_runmake O=${board} all
> > + case "${board}" in
> > + *sdcard*) UBOOT_TARGET="u-boot-with-spl-pbl";;
> > + *nand*) UBOOT_TARGET="u-boot-with-spl-pbl";;
> > + *spi*) UBOOT_TARGET="u-boot-qspiboot_swap"
> > + ${bindir}/tclsh byte_swap.tcl ${S}/${board}/u-
> boot.bin ${S}/${board}/${UBOOT_TARGET}.bin 8 ;;
> > + *) UBOOT_TARGET="u-boot";;
> > + esac
> > + done
> > +}
> > +
> > +do_install(){
> > + if [ "x${UBOOT_MACHINES}" = "x" ]; then
> > + UBOOT_MACHINES="${UBOOT_MACHINE}"
> > + fi
> > +
> > + for board in ${UBOOT_MACHINES}; do
> > + case "${board}" in
> > + *sdcard*) UBOOT_TARGET="u-boot-with-spl-pbl";;
> > + *nand*) UBOOT_TARGET="u-boot-with-spl-pbl";;
> > + *spi*) UBOOT_TARGET="u-boot-qspiboot_swap";;
> > + *) UBOOT_TARGET="u-boot";;
> > + esac
> > +
> > + if [ -f ${S}/${board}/${UBOOT_TARGET}.bin ]; then
> > + install -d ${D}/boot/
> > + install ${S}/${board}/${UBOOT_TARGET}.bin
> ${D}/boot/${UBOOT_TARGET}-${board}-${PV}-${PR}.bin
> > + ln -sf ${UBOOT_TARGET}-${board}-${PV}-${PR}.bin
> ${D}/boot/${UBOOT_TARGET}.bin
> > + fi
> > + done
> > +}
> > +
> > +do_deploy(){
> > + if [ "x${UBOOT_MACHINES}" = "x" ]; then
> > + UBOOT_MACHINES="${UBOOT_MACHINE}"
> > + fi
> > +
> > + for board in ${UBOOT_MACHINES}; do
> > + case "${board}" in
> > + *sdcard*) UBOOT_TARGET="u-boot-with-spl-pbl";;
> > + *nand*) UBOOT_TARGET="u-boot-with-spl-pbl";;
> > + *spi*) UBOOT_TARGET="u-boot-qspiboot_swap";;
> > + *) UBOOT_TARGET="u-boot";;
> > + esac
> > +
> > + if [ -f ${S}/${board}/${UBOOT_TARGET}.bin ]; then
> > + mkdir -p ${DEPLOYDIR}
> > + install ${S}/${board}/${UBOOT_TARGET}.bin
> ${DEPLOYDIR}/${UBOOT_TARGET}-${board}-${PV}-${PR}.bin
> > + cd ${DEPLOYDIR}
> > + rm -f ${UBOOT_TARGET}-${board}.bin
> > + ln -sf ${UBOOT_TARGET}-${board}-${PV}-${PR}.bin
> ${UBOOT_TARGET}-${board}.bin
> > + fi
> > + done
> > +}
> > +addtask deploy after do_install
> > +
> > +PACKAGES += "${PN}-images"
> > +FILES_${PN}-images += "/boot"
> > +
> > +ALLOW_EMPTY_${PN} = "1"
> > +
> > +PACKAGE_ARCH = "${MACHINE_ARCH}"
> > +COMPATIBLE_MACHINE = "(ls1021aqds|ls1021atwr)"
> > +
>
> I understand why you are doing this all here but I think we need to
> address this in the uboot-config.bbclass so we have a standard way for
> this.
[Luo Zhenhua-B19537] Does this mean UBOOT_MACHINE usage will be replaced by UBOOT_CONFIG usage?
Seems like only one u-boot config can be built at one time, is it possible to build multiple u-boot options at one build? This is the reason we rewrite the u-boot compile/install/deploy code.
Best Regards,
Zhenhua
More information about the meta-freescale
mailing list