[meta-freescale] [meta-fsl-arm][PATCH v2 2/6] Add u-boot recipe for Layerscape1 support
Otavio Salvador
otavio at ossystems.com.br
Wed Aug 27 05:55:06 PDT 2014
On Wed, Aug 27, 2014 at 1:57 AM, Zhenhua Luo <zhenhua.luo at freescale.com> wrote:
> Signed-off-by: Zhenhua Luo <zhenhua.luo at freescale.com>
Please follow the guidelines for commit log:
u-boot-ls1: Add recipe for Layerscape1 support
...
Signed-off-by: ...
> ---
> recipes-bsp/u-boot/u-boot-ls1_2013.10.bb | 109 +++++++++++++++++++++++++++++++
> 1 file changed, 109 insertions(+)
> create mode 100644 recipes-bsp/u-boot/u-boot-ls1_2013.10.bb
>
> diff --git a/recipes-bsp/u-boot/u-boot-ls1_2013.10.bb b/recipes-bsp/u-boot/u-boot-ls1_2013.10.bb
> new file mode 100644
> index 0000000..703c6fc
> --- /dev/null
> +++ b/recipes-bsp/u-boot/u-boot-ls1_2013.10.bb
> @@ -0,0 +1,109 @@
> +require recipes-bsp/u-boot/u-boot.inc
> +
> +LICENSE = "GPLv2 & BSD-3-Clause & BSD-2-Clause & LGPL-2.0 & LGPL-2.1"
> +LIC_FILES_CHKSUM = " \
> + file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
> + file://Licenses/bsd-2-clause.txt;md5=6a31f076f5773aabd8ff86191ad6fdd5 \
> + file://Licenses/bsd-3-clause.txt;md5=4a1190eac56a9db675d58ebe86eaf50c \
> + file://Licenses/lgpl-2.0.txt;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
> + file://Licenses/lgpl-2.1.txt;md5=4fbd65380cdd255951079008b364516c \
> +"
> +
...
> +SRC_URI = "git://git.freescale.com/layerscape/ls1021a/u-boot.git;branch=LS1-dev"
> +SRCREV = "48bfc6985a0524bc5c388bb9a9a6a6bc4a121ec5"
Use SRCBRANCH.
> +PROVIDES += "u-boot"
> +
> +UBOOT_LOCALVERSION ?= "${SDK_VERSION}"
UBOOT_LOCALVERSION is already supported in u-boot.inc
> +S = "${WORKDIR}/git"
> +
> +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.
> +do_compile () {
> + unset LDFLAGS
> + unset CFLAGS
> + unset CPPFLAGS
> +
> + 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
> + 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.
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
More information about the meta-freescale
mailing list