From 851c7ff26de131b871bd5a64274c1a2b13d60fc3 Mon Sep 17 00:00:00 2001 From: Ting Liu Date: Mon, 8 Jul 2013 11:08:16 +0800 Subject: change layout to follow oe-core guidelines of recipes Follow the rules defined in: http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes.txt recipes-bsp - Anything with links to specific hardware or hardware configuration information recipes-connectivity - Libraries and applications related to communication with other devices recipes-core - What's needed to build a basic working Linux image including commonly used dependencies recipes-devtools - Tools primarily used by the build system (but can also be used on targets) recipes-extended - Applications which whilst not essential add features compared to the alternatives in core. May be needed for full tool functionality or LSB compliance. recipes-gnome - All things related to the GTK+ application framework recipes-graphics - X and other graphically related system libraries recipes-kernel - The kernel and generic applications/libraries with strong kernel dependencies recipes-lsb4 - Recipes added for the sole purpose of supporting the Linux Standard Base (LSB) 4.x recipes-multimedia - Codecs and support utilties for audio, images and video recipes-rt - Provides package and image recipes for using and testing the PREEMPT_RT kernel recipes-qt - All things related to the Qt application framework recipes-sato - The Sato demo/reference UI/UX, its associated apps and configuration recipes-support - Recipes used by other recipes but that are not directly included in images recipes-dpaa - recipes related to fsl dpaa feature recipes-virtualization - recipes related to fsl virtualization feature Signed-off-by: Ting Liu --- recipes-bsp/u-boot/u-boot_git.bb | 139 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 recipes-bsp/u-boot/u-boot_git.bb (limited to 'recipes-bsp/u-boot') diff --git a/recipes-bsp/u-boot/u-boot_git.bb b/recipes-bsp/u-boot/u-boot_git.bb new file mode 100644 index 0000000..c3aa105 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot_git.bb @@ -0,0 +1,139 @@ +DESCRIPTION = "U-boot bootloader" +HOMEPAGE = "http://u-boot.sf.net" +SECTION = "bootloaders" +PROVIDES = "virtual/bootloader" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=1707d6db1d42237583f50183a5651ecb" + +PR = "r30" +INHIBIT_DEFAULT_DEPS = "1" +DEPENDS = "boot-format-native virtual/${TARGET_PREFIX}gcc libgcc" + +inherit deploy + +SRC_URI = "git://git.freescale.com/ppc/sdk/u-boot.git" +SRCREV = "831b30de4b768f0b3b7dbfa11739b14cea612d7e" + +python () { + ml = d.getVar("MULTILIB_VARIANTS", True) + arch = d.getVar("OVERRIDES", True) + + if ("e5500-64b:" in arch or "e6500-64b:" in arch) and not "lib32" in ml: + raise bb.parse.SkipPackage("Building the u-boot for this arch requires multilib to be enabled") +} + +DEPENDS_append_e5500-64b = " lib32-gcc-cross lib32-libgcc" +PATH_append_e5500-64b = ":${STAGING_BINDIR_NATIVE}/${DEFAULTTUNE_virtclass-multilib-lib32}${TARGET_VENDOR_virtclass-multilib-lib32}-${HOST_OS}/" +TOOLCHAIN_OPTIONS_append_e5500-64b = "/../lib32-${MACHINE}" +TARGET_VENDOR_virtclass-multilib-lib32 ?= "-${DISTRO}mllib32" +WRAP_TARGET_PREFIX_e5500-64b = "powerpc${TARGET_VENDOR_virtclass-multilib-lib32}-${HOST_OS}-" + +DEPENDS_append_e6500-64b = " lib32-gcc-cross lib32-libgcc" +PATH_append_e6500-64b = ":${STAGING_BINDIR_NATIVE}/${DEFAULTTUNE_virtclass-multilib-lib32}${TARGET_VENDOR_virtclass-multilib-lib32}-${HOST_OS}/" +TOOLCHAIN_OPTIONS_append_e6500-64b = "/../lib32-${MACHINE}" +TARGET_VENDOR_virtclass-multilib-lib32 ?= "-${DISTRO}mllib32" +WRAP_TARGET_PREFIX_e6500-64b = "powerpc${TARGET_VENDOR_virtclass-multilib-lib32}-${HOST_OS}-" + +WRAP_TARGET_PREFIX = "${TARGET_PREFIX}" +EXTRA_OEMAKE = 'CROSS_COMPILE=${WRAP_TARGET_PREFIX} CC="${WRAP_TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}"' + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +USRC ?= "" +S = '${@base_conditional("USRC", "", "${WORKDIR}/git", "${USRC}", d)}' + +do_compile () { + unset LDFLAGS + unset CFLAGS + unset CPPFLAGS + + 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-sd";; + *SPIFLASH*) UBOOT_TARGET="u-boot-spi";; + *NAND*) UBOOT_TARGET="u-boot-nand";; + *) UBOOT_TARGET="";; + esac + + if [ "x${UBOOT_TARGET}" != "x" ]; then + if [ "${UBOOT_TARGET}" = "u-boot-sd" ]; then + cp ${S}/${board}/u-boot.bin ${S}/${board}/${UBOOT_TARGET}.bin + elif [ "${UBOOT_TARGET}" = "u-boot-nand" ];then + if [ "${DEFAULTTUNE}" = "ppce500v2" ];then + if echo $board |egrep "(P1010RDB|P1020RDB|P1021RDB|P1024RDB|P2020RDB|P1022DS|P1025RDB|BSC9131RDB|BSC9132QDS)" 2>&1 >/dev/null;then + cp ${S}/${board}/u-boot-with-spl.bin ${S}/${board}/${UBOOT_TARGET}.bin + fi + else + cp ${S}/${board}/u-boot.bin ${S}/${board}/${UBOOT_TARGET}.bin + fi + else + if [ -n "${BOOTFORMAT_CONFIG}" ];then + ${STAGING_BINDIR_NATIVE}/boot_format \ + ${STAGING_DATADIR_NATIVE}/boot_format/${BOOTFORMAT_CONFIG} \ + ${S}/${board}/u-boot.bin -spi ${S}/${board}/${UBOOT_TARGET}.bin + else + cp ${S}/${board}/u-boot.bin ${S}/${board}/${UBOOT_TARGET}.bin + fi + fi + fi + 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-sd";; + *SPIFLASH*) UBOOT_TARGET="u-boot-spi";; + *NAND*) UBOOT_TARGET="u-boot-nand";; + *) UBOOT_TARGET="u-boot";; + esac + + if [ -f ${S}/${board}/${UBOOT_TARGET}.bin ]; then + mkdir -p ${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-sd";; + *SPIFLASH*) UBOOT_TARGET="u-boot-spi";; + *NAND*) UBOOT_TARGET="u-boot-nand";; + *) 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" -- cgit v1.2.3-54-g00ecf