[meta-lsi] [PATCH 09/86] u-boot-lsi: Add recipes-bsp/u-boot recipes for u-boot-lsi build
Daniel Dragomir
daniel.dragomir at windriver.com
Wed Oct 29 08:35:17 PDT 2014
From: Paul Butler <paul.butler at windriver.com>
- Add initial recipe for u-boot-lsi which will fetch a specific
u-boot version optimized for axm5500sim and other LSI machines.
- Adapt axm5500sim conf machine to use u-boot-lsi as bootloader.
Signed-off-by: Paul Butler <paul.butler at windriver.com>
---
conf/machine/axm5500sim.conf | 4 ++
conf/machine/elpaso.conf | 1 +
recipes-bsp/u-boot/u-boot-lsi.inc | 94 +++++++++++++++++++++++++++++
recipes-bsp/u-boot/u-boot-lsi_2013.01.01.bb | 12 ++++
4 files changed, 111 insertions(+)
create mode 100644 recipes-bsp/u-boot/u-boot-lsi.inc
create mode 100644 recipes-bsp/u-boot/u-boot-lsi_2013.01.01.bb
diff --git a/conf/machine/axm5500sim.conf b/conf/machine/axm5500sim.conf
index 016e170..78fc0d6 100644
--- a/conf/machine/axm5500sim.conf
+++ b/conf/machine/axm5500sim.conf
@@ -3,7 +3,11 @@
#@DESCRIPTION: Machine configuration for LSI AXM5500 simulator systems
PREFERRED_VERSION_linux-yocto ?= "3.4%"
+PREFERRED_VERSION_u-boot-lsi ?= "2013.01.01%"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-lsi"
+
+EXTRA_IMAGEDEPENDS = "u-boot-lsi"
MACHINE_FEATURES += "ext3"
diff --git a/conf/machine/elpaso.conf b/conf/machine/elpaso.conf
index b89416a..4e3cb0c 100644
--- a/conf/machine/elpaso.conf
+++ b/conf/machine/elpaso.conf
@@ -3,6 +3,7 @@
#@DESCRIPTION: Machine configuration for the LSI elpaso systems
PREFERRED_VERSION_linux-yocto ?= "3.4%"
+PREFERRED_VERSION_u-boot-lsi ?= "2013.01.01%"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
MACHINE_FEATURES += ""
diff --git a/recipes-bsp/u-boot/u-boot-lsi.inc b/recipes-bsp/u-boot/u-boot-lsi.inc
new file mode 100644
index 0000000..4a87acf
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-lsi.inc
@@ -0,0 +1,94 @@
+DESCRIPTION = "U-Boot - the Universal Boot Loader"
+HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome"
+SECTION = "bootloaders"
+PROVIDES = "virtual/bootloader"
+
+inherit deploy
+
+EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}"'
+
+python () {
+ if not d.getVar("UBOOT_MACHINE", True):
+ PN = d.getVar("PN", True)
+ FILE = os.path.basename(d.getVar("FILE", True))
+ bb.debug(1, "To build %s, see %s for instructions on \
+ setting up your machine config" % (PN, FILE))
+ raise bb.parse.SkipPackage("because UBOOT_MACHINE is not set")
+}
+
+# Some versions of u-boot use .bin and others use .img. By default use .bin
+# but enable individual recipes to change this value.
+UBOOT_SUFFIX ?= "bin"
+UBOOT_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}"
+UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}"
+UBOOT_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_SUFFIX}"
+UBOOT_MAKE_TARGET ?= "all"
+
+# SPL (Secondary Program Loader)
+SPL_SUFFIX = "bin"
+SPL_FILE = "u-boot-spl"
+SPL_PATH = "spl"
+SPL_BINARY = "${SPL_PATH}/${SPL_FILE}.${SPL_SUFFIX}"
+SPL_IMAGE = "${SPL_FILE}-${MACHINE}-${PV}-${PR}.${SPL_SUFFIX}"
+SPL_SYMLINK = "${SPL_FILE}-${MACHINE}.${SPL_SUFFIX}"
+
+do_compile () {
+ if [ "${@base_contains('DISTRO_FEATURES', 'ld-is-gold', 'ld-is-gold', '', d)}" = "ld-is-gold" ] ; then
+ sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' config.mk
+ fi
+
+ unset LDFLAGS
+ unset CFLAGS
+ unset CPPFLAGS
+ oe_runmake ${UBOOT_MACHINE}
+ oe_runmake ${UBOOT_MAKE_TARGET}
+}
+
+do_install () {
+ install -d ${D}/boot
+ install ${S}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
+ ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
+
+ if [ -e ${WORKDIR}/fw_env.config ] ; then
+ install -d ${D}${sysconfdir}
+ install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
+ fi
+
+ if [ "x${SPL_BINARY}" != "x" ]
+ then
+ install ${S}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}
+ ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_FILE}.${SPL_SUFFIX}
+ fi
+}
+
+FILES_${PN} = "/boot ${sysconfdir}"
+FILESPATH =. "${FILE_DIRNAME}/u-boot-git/${MACHINE}:"
+
+do_deploy () {
+ install -d ${DEPLOYDIR}
+ install ${S}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
+
+ cd ${DEPLOYDIR}
+ rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
+ ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
+ ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
+
+ if [ "x${SPL_BINARY}" != "x" ]
+ then
+ install ${S}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}
+ rm -f ${DEPLOYDIR}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_SYMLINK}
+ ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_FILE}.${SPL_SUFFIX}
+ ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK}
+ fi
+}
+
+addtask deploy before do_build after do_compile
+
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1707d6db1d42237583f50183a5651ecb"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+S = "${WORKDIR}/git"
+
diff --git a/recipes-bsp/u-boot/u-boot-lsi_2013.01.01.bb b/recipes-bsp/u-boot/u-boot-lsi_2013.01.01.bb
new file mode 100644
index 0000000..73ac02e
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-lsi_2013.01.01.bb
@@ -0,0 +1,12 @@
+require u-boot-lsi.inc
+
+UBOOT_MACHINE_elpaso = "axxia-344x_config"
+UBOOT_MACHINE_axm5500sim = "axxia-55xx_config"
+
+# This revision corresponds to the tag "lsi_axxia_u-boot_5.8.1.6"
+SRCREV = "lsi_axxia_u-boot_5.8.1.6"
+
+PV = "2013.01.01"
+PR = "r1"
+
+SRC_URI = "git://github.com/lsigithub/lsi_axxia_uboot_public.git"
--
1.8.1.4
More information about the meta-lsi
mailing list