Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,20 @@
SUMMARY = "XML-based binary image generator"
DESCRIPTION = "XML-based binary image generator"
HOMEPAGE = "https://github.com/Nuvoton-Israel/bingo"
PR = "r1"
PV = "0.1+git${SRCPV}"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRC_URI = "git://github.com/Nuvoton-Israel/bingo;branch=master;protocol=https"
SRCREV = "7c35658b667d04d6cc78b7ed569f4401168ae133"
S = "${WORKDIR}/git"
do_install () {
install -d "${D}${bindir}"
install deliverables/linux/Release/bingo ${D}${bindir}
}
inherit native
@@ -0,0 +1,26 @@
SUMMARY = "Primary bootloader for NPCM7XX (Poleg) devices"
DESCRIPTION = "Primary bootloader for NPCM7XX (Poleg) devices"
HOMEPAGE = "https://github.com/Nuvoton-Israel/npcm7xx-bootblock"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
FILENAME = "Poleg_bootblock_${PV}.bin"
S = "${WORKDIR}"
SRCREV = "4fa655f95547b927b0133c8ed96c88c5d14ac7b3"
SRC_URI = " \
https://raw.githubusercontent.com/Nuvoton-Israel/bootblock/${SRCREV}/LICENSE;name=lic \
https://github.com/Nuvoton-Israel/bootblock/releases/download/BootBlock_${PV}/Poleg_bootblock_basic.bin;downloadfilename=${FILENAME};name=bin \
"
SRC_URI[lic.md5sum] = "b234ee4d69f5fce4486a80fdaf4a4263"
SRC_URI[bin.sha256sum] = "a33f3fe96786929a8f35e986ae76bbd1bf53459770a6ece7d6777dced1d62ddf"
inherit deploy
do_deploy () {
install -D -m 644 ${WORKDIR}/${FILENAME} ${DEPLOYDIR}/Poleg_bootblock.bin
}
addtask deploy before do_build after do_compile
@@ -0,0 +1,25 @@
SUMMARY = "Image Generation and Programming Scripts for NPCM7XX (Poleg) devices"
DESCRIPTION = "Image Generation and Programming Scripts for NPCM7XX (Poleg) devices"
HOMEPAGE = "https://github.com/Nuvoton-Israel/igps"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRC_URI = " \
git://github.com/Nuvoton-Israel/igps;branch=master;protocol=https \
file://0001-Adjust-paths-for-use-with-Bitbake.patch \
"
# tag IGPS_02.01.18
SRCREV = "e0fc2ba58d561220a957bc06aefe1ac7f6e96126"
S = "${WORKDIR}/git"
DEST = "${D}${datadir}/${BPN}"
do_install() {
install -d ${DEST}
install ImageGeneration/references/BootBlockAndHeader_${IGPS_MACHINE}.xml ${DEST}
install ImageGeneration/references/UbootHeader_${IGPS_MACHINE}.xml ${DEST}
install ImageGeneration/inputs/mergedBootBlockAndUboot.xml ${DEST}
}
inherit native
@@ -0,0 +1,145 @@
From 215a2d9660a929beae8bc420239467fc9e135b4f Mon Sep 17 00:00:00 2001
From: Benjamin Fair <benjaminfair@google.com>
Date: Wed, 23 Oct 2019 14:23:08 -0700
Subject: [PATCH] Adjust paths for use with Bitbake
Signed-off-by: Benjamin Fair <benjaminfair@google.com>
---
ImageGeneration/inputs/mergedBootBlockAndUboot.xml | 10 +++++-----
ImageGeneration/references/BootBlockAndHeader_EB.xml | 6 +++---
.../references/BootBlockAndHeader_RunBMC.xml | 6 +++---
ImageGeneration/references/UbootHeader_EB.xml | 6 +++---
ImageGeneration/references/UbootHeader_RunBMC.xml | 6 +++---
5 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/ImageGeneration/inputs/mergedBootBlockAndUboot.xml b/ImageGeneration/inputs/mergedBootBlockAndUboot.xml
index d832f96..f4c7756 100644
--- a/ImageGeneration/inputs/mergedBootBlockAndUboot.xml
+++ b/ImageGeneration/inputs/mergedBootBlockAndUboot.xml
@@ -18,18 +18,18 @@
<name>BootBlock</name> <!-- name of field -->
<config>
<offset>0</offset> <!-- offset in the header -->
- <size format='FileSize'>output_binaries/BootBlockAndHeader.bin</size> <!-- size in the header -->
+ <size format='FileSize'>Poleg_bootblock.bin.full</size> <!-- size in the header -->
</config>
- <content format='FileContent'>output_binaries/BootBlockAndHeader.bin</content> <!-- content the user should fill -->
+ <content format='FileContent'>Poleg_bootblock.bin.full</content> <!-- content the user should fill -->
</BinField>
<BinField>
<name>u-boot</name> <!-- name of field -->
<config>
- <offset format='FileSize' align='0x1000'>output_binaries/BootBlockAndHeader.bin</offset> <!-- offset in the header -->
- <size format='FileSize'>output_binaries/UbootAndHeader.bin</size> <!-- size in the header -->
+ <offset format='FileSize' align='0x1000'>Poleg_bootblock.bin.full</offset> <!-- offset in the header -->
+ <size format='FileSize'>u-boot.bin.full</size> <!-- size in the header -->
</config>
- <content format='FileContent'>output_binaries/UbootAndHeader.bin</content> <!-- content the user should fill -->
+ <content format='FileContent'>u-boot.bin.full</content> <!-- content the user should fill -->
</BinField>
</Bin_Ecc_Map>
diff --git a/ImageGeneration/references/BootBlockAndHeader_EB.xml b/ImageGeneration/references/BootBlockAndHeader_EB.xml
index 775534f..157535d 100644
--- a/ImageGeneration/references/BootBlockAndHeader_EB.xml
+++ b/ImageGeneration/references/BootBlockAndHeader_EB.xml
@@ -42,7 +42,7 @@
<offset>0x144</offset>
<size>0x4</size>
</config>
- <content format='FileSize'>inputs/Poleg_bootblock.bin</content> <!-- content the user should fill -->
+ <content format='FileSize'>Poleg_bootblock.bin</content> <!-- content the user should fill -->
</BinField>
<BinField>
@@ -50,9 +50,9 @@
<name>Code</name> <!-- name of field -->
<config>
<offset>0x200</offset>
- <size format='FileSize'>inputs/Poleg_bootblock.bin</size> <!-- size in the header calculated by tool-->
+ <size format='FileSize'>Poleg_bootblock.bin</size> <!-- size in the header calculated by tool-->
</config>
- <content format='FileContent'>inputs/Poleg_bootblock.bin</content> <!-- content the user should fill -->
+ <content format='FileContent'>Poleg_bootblock.bin</content> <!-- content the user should fill -->
</BinField>
<!-- BMC optional fields -->
diff --git a/ImageGeneration/references/BootBlockAndHeader_RunBMC.xml b/ImageGeneration/references/BootBlockAndHeader_RunBMC.xml
index cc719e9..4d1e972 100644
--- a/ImageGeneration/references/BootBlockAndHeader_RunBMC.xml
+++ b/ImageGeneration/references/BootBlockAndHeader_RunBMC.xml
@@ -42,7 +42,7 @@
<offset>0x144</offset>
<size>0x4</size>
</config>
- <content format='FileSize'>inputs/Poleg_bootblock.bin</content> <!-- content the user should fill -->
+ <content format='FileSize'>Poleg_bootblock.bin</content> <!-- content the user should fill -->
</BinField>
<BinField>
@@ -50,9 +50,9 @@
<name>Code</name>
<config>
<offset>0x200</offset>
- <size format='FileSize'>inputs/Poleg_bootblock.bin</size> <!-- size in the header calculated by tool-->
+ <size format='FileSize'>Poleg_bootblock.bin</size> <!-- size in the header calculated by tool-->
</config>
- <content format='FileContent'>inputs/Poleg_bootblock.bin</content> <!-- content the user should fill -->
+ <content format='FileContent'>Poleg_bootblock.bin</content> <!-- content the user should fill -->
</BinField>
<!-- BMC optional fields -->
diff --git a/ImageGeneration/references/UbootHeader_EB.xml b/ImageGeneration/references/UbootHeader_EB.xml
index 1e72e22..475ec45 100644
--- a/ImageGeneration/references/UbootHeader_EB.xml
+++ b/ImageGeneration/references/UbootHeader_EB.xml
@@ -42,7 +42,7 @@
<offset>0x144</offset> <!-- offset in the header -->
<size>0x4</size> <!-- size in the header -->
</config>
- <content format='FileSize'>inputs/u-boot.bin</content> <!-- content the user should fill -->
+ <content format='FileSize'>u-boot.bin</content> <!-- content the user should fill -->
</BinField>
<BinField>
@@ -50,9 +50,9 @@
<name>Code</name> <!-- name of field -->
<config>
<offset>0x200</offset> <!-- offset in the header -->
- <size format='FileSize'>inputs/u-boot.bin</size> <!-- size in the header calculated by tool-->
+ <size format='FileSize'>u-boot.bin</size> <!-- size in the header calculated by tool-->
</config>
- <content format='FileContent'>inputs/u-boot.bin</content> <!-- content the user should fill -->
+ <content format='FileContent'>u-boot.bin</content> <!-- content the user should fill -->
</BinField>
<!-- BMC optional fields -->
diff --git a/ImageGeneration/references/UbootHeader_RunBMC.xml b/ImageGeneration/references/UbootHeader_RunBMC.xml
index 7eb3076..481ed2f 100644
--- a/ImageGeneration/references/UbootHeader_RunBMC.xml
+++ b/ImageGeneration/references/UbootHeader_RunBMC.xml
@@ -42,7 +42,7 @@
<offset>0x144</offset> <!-- offset in the header -->
<size>0x4</size> <!-- size in the header -->
</config>
- <content format='FileSize'>inputs/u-boot.bin</content> <!-- content the user should fill -->
+ <content format='FileSize'>u-boot.bin</content> <!-- content the user should fill -->
</BinField>
<BinField>
@@ -50,9 +50,9 @@
<name>Code</name> <!-- name of field -->
<config>
<offset>0x200</offset> <!-- offset in the header -->
- <size format='FileSize'>inputs/u-boot.bin</size> <!-- size in the header calculated by tool-->
+ <size format='FileSize'>u-boot.bin</size> <!-- size in the header calculated by tool-->
</config>
- <content format='FileContent'>inputs/u-boot.bin</content> <!-- content the user should fill -->
+ <content format='FileContent'>u-boot.bin</content> <!-- content the user should fill -->
</BinField>
<!-- BMC optional fields -->
--
2.24.0.rc0.303.g954a862665-goog
@@ -0,0 +1,28 @@
SUMMARY = "Primary bootloader for NPCM8XX (Arbel) devices"
DESCRIPTION = "Primary bootloader for NPCM8XX (Arbel) devices"
HOMEPAGE = "https://github.com/Nuvoton-Israel/npcm8xx-bootblock"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
BB_TIP = "arbel_a35_bootblock.bin"
BB_NO_TIP = "arbel_a35_bootblock_no_tip.bin"
OUTPUT_BB_TIP_BIN = "Images/tip"
OUTPUT_BB_NO_TIP_BIN = "Images/no_tip"
S = "${WORKDIR}/git"
SRC_URI = " \
git://github.com/Nuvoton-Israel/npcm8xx-bootblock;branch=main;protocol=https"
inherit deploy
do_deploy () {
if [ "${TIP_IMAGE}" = "True" ] ; then
install -D -m 644 ${OUTPUT_BB_TIP_BIN}/${BB_TIP} ${DEPLOYDIR}/${BB_TIP}
else
install -D -m 644 ${OUTPUT_BB_NO_TIP_BIN}/${BB_NO_TIP} ${DEPLOYDIR}/${BB_NO_TIP}
fi
}
addtask deploy before do_build after do_compile
@@ -0,0 +1,3 @@
SRCREV = "bc1b9c304490e54553f2d449fa2e9950a6f9e4ae"
require npcm8xx-bootblock.inc
@@ -0,0 +1,4 @@
# tag IGPS_03.09.02
SRCREV = "c087fcc14a67ae912a51d6fd90c3daa27560d8bc"
require npcm8xx-igps.inc
@@ -0,0 +1,46 @@
SUMMARY = "Image Generation and Programming Scripts for NPCM8XX (Arbel) devices"
DESCRIPTION = "Image Generation and Programming Scripts for NPCM8XX (Arbel) devices"
HOMEPAGE = "https://github.com/Nuvoton-Israel/igps-npcm8xx"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
IGPS_BRANCH ?= "main"
SRC_URI = " \
git://github.com/Nuvoton-Israel/igps-npcm8xx;branch=${IGPS_BRANCH};protocol=https \
"
S = "${WORKDIR}/git"
DEST = "${D}${datadir}/${BPN}"
# Adjust paths for use with bitbake
do_patch() {
sed -i -e 's,inputs/,,g' ${S}/py_scripts/ImageGeneration/references/*.xml \
${S}/py_scripts/ImageGeneration/inputs/*.xml
}
do_install() {
install -d ${DEST}
if [ "${TIP_IMAGE}" = "True" ] ; then
install py_scripts/ImageGeneration/references/BootBlockAndHeader_${DEVICE_GEN}_${IGPS_MACHINE}.xml ${DEST}
else
install py_scripts/ImageGeneration/references/BootBlockAndHeader_${DEVICE_GEN}_${IGPS_MACHINE}_NoTip.xml ${DEST}
fi
install py_scripts/ImageGeneration/references/UbootHeader_${DEVICE_GEN}.xml ${DEST}
install py_scripts/ImageGeneration/inputs/BL31_AndHeader.xml ${DEST}
install py_scripts/ImageGeneration/inputs/OpTeeAndHeader.xml ${DEST}
install py_scripts/ImageGeneration/asn1.py ${DEST}
install py_scripts/ImageGeneration/BinarySignatureGenerator.py ${DEST}
}
inherit deploy
do_deploy () {
# copy default keys to deploy folder
install -d ${DEPLOYDIR}
cp -vur py_scripts/ImageGeneration/keys/${SIGN_TYPE} ${DEPLOYDIR}/
}
inherit native
addtask deploy before do_build after do_compile
@@ -0,0 +1,17 @@
SUMMARY = "TIP FW for NPCM8XX (Arbel) devices"
DESCRIPTION = "TIP FW for NPCM8XX (Arbel) devices"
HOMEPAGE = "https://github.com/Nuvoton-Israel/npcm8xx-tip-fw"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=f789971f29c65e31dbb33ed209b4dc91"
TIP_FW = "Kmt_TipFwL0_Skmt_TipFwL1.bin"
S = "${WORKDIR}/git"
SRC_URI = "git://github.com/Nuvoton-Israel/npcm8xx-tip-fw;branch=main;protocol=https"
inherit deploy
do_deploy () {
install -D -m 644 ${OUTPUT_BIN}/${TIP_FW} ${DEPLOYDIR}/${TIP_FW}
}
addtask deploy before do_build after do_compile
@@ -0,0 +1,5 @@
SRCREV = "49c4ddb7feed3653dde1c77e235e41e42c3e73e5"
OUTPUT_BIN = "output_binaries_${DEVICE_GEN}_${IGPS_MACHINE}"
require npcm8xx-tip-fw.inc
@@ -0,0 +1,2 @@
# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd/u-boot-env 0x0000 0x40000 0x4000
@@ -0,0 +1,5 @@
CONFIG_CMD_EXT4=y
CONFIG_CMD_FS_GENERIC=y
CONFIG_CMD_GPT=y
CONFIG_CMD_PART=y
CONFIG_CMD_UNZIP=y
@@ -0,0 +1,14 @@
HOMEPAGE = "https://github.com/Nuvoton-Israel/u-boot"
SECTION = "bootloaders"
DEPENDS += "flex-native bison-native"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://Licenses/README;md5=5a7450c57ffe5ae63fd732446b988025"
UBRANCH = "npcm-v2021.04"
SRC_URI = "git://github.com/Nuvoton-Israel/u-boot.git;branch=${UBRANCH};protocol=https"
SRCREV = "02f2872a1c408396dd0703f9b38853aa72bb5976"
S = "${WORKDIR}/git"
PV .= "+${UBRANCH}+"
@@ -0,0 +1,42 @@
require u-boot-common-nuvoton.inc
SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
DEPENDS = "mtd-utils bison-native"
RDEPENDS:${PN} = "udev-nuvoton-mtd-partitions"
PROVIDES += "u-boot-fw-utils"
SRC_URI += "file://fw_env.config"
INSANE_SKIP:${PN} = "already-stripped"
EXTRA_OEMAKE:class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" HOSTCC="${BUILD_CC} ${BUILD_FLAGS} ${BUILD_LDFLAGS}" CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1'
EXTRA_OEMAKE:class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
inherit uboot-config
do_compile () {
oe_runmake ${UBOOT_MACHINE}
oe_runmake envtools
}
do_install () {
install -d ${D}${base_sbindir}
install -d ${D}${sysconfdir}
install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
install -m 0644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
}
do_install:class-cross () {
install -d ${D}${bindir_cross}
install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
}
SYSROOT_PREPROCESS_FUNCS:class-cross = "uboot_fw_utils_cross"
uboot_fw_utils_cross() {
sysroot_stage_dir ${D}${bindir_cross} ${SYSROOT_DESTDIR}${bindir_cross}
}
PACKAGE_ARCH = "${MACHINE_ARCH}"
BBCLASSEXTEND = "cross"
@@ -0,0 +1,337 @@
SUMMARY = "Universal Boot Loader for embedded devices"
PROVIDES = "virtual/bootloader"
B = "${WORKDIR}/build"
PACKAGE_ARCH = "${MACHINE_ARCH}"
DEPENDS += "kern-tools-native"
inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1 python3native
DEPENDS += "swig-native"
EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1'
EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'
PACKAGECONFIG ??= "openssl"
# u-boot will compile its own tools during the build, with specific
# configurations (aka when CONFIG_FIT_SIGNATURE is enabled) openssl is needed as
# a host build dependency.
PACKAGECONFIG[openssl] = ",,openssl-native"
# Allow setting an additional version string that will be picked up by the
# u-boot build system and appended to the u-boot version. If the .scmversion
# file already exists it will not be overwritten.
UBOOT_LOCALVERSION ?= ""
# 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_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_SUFFIX}"
UBOOT_MAKE_TARGET ?= "all"
# Output the ELF generated. Some platforms can use the ELF file and directly
# load it (JTAG booting, QEMU) additionally the ELF can be used for debugging
# purposes.
UBOOT_ELF ?= ""
UBOOT_ELF_SUFFIX ?= "elf"
UBOOT_ELF_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}"
UBOOT_ELF_BINARY ?= "u-boot.${UBOOT_ELF_SUFFIX}"
UBOOT_ELF_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_ELF_SUFFIX}"
# Some versions of u-boot build an SPL (Second Program Loader) image that
# should be packaged along with the u-boot binary as well as placed in the
# deploy directory. For those versions they can set the following variables
# to allow packaging the SPL.
SPL_BINARY ?= ""
SPL_BINARYNAME ?= "${@os.path.basename(d.getVar("SPL_BINARY"))}"
SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${PV}-${PR}"
SPL_SYMLINK ?= "${SPL_BINARYNAME}-${MACHINE}"
# Additional environment variables or a script can be installed alongside
# u-boot to be used automatically on boot. This file, typically 'uEnv.txt'
# or 'boot.scr', should be packaged along with u-boot as well as placed in the
# deploy directory. Machine configurations needing one of these files should
# include it in the SRC_URI and set the UBOOT_ENV parameter.
UBOOT_ENV_SUFFIX ?= "txt"
UBOOT_ENV ?= ""
UBOOT_ENV_BINARY ?= "${UBOOT_ENV}.${UBOOT_ENV_SUFFIX}"
UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}"
UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}"
# U-Boot EXTLINUX variables. U-Boot searches for /boot/extlinux/extlinux.conf
# to find EXTLINUX conf file.
UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux"
UBOOT_EXTLINUX_CONF_NAME ?= "extlinux.conf"
UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${PR}"
# Set Device tree from the machine config automatically
UBOOT_MAKE_TARGET += '${@"" if d.getVar("UBOOT_DEVICETREE") is None \
else " DEVICE_TREE=" + d.getVar("UBOOT_DEVICETREE")}'
# returns all the elements from the src uri that are .cfg files
def find_cfgs(d):
sources=src_patches(d, True)
sources_list=[]
for s in sources:
if s.endswith('.cfg'):
sources_list.append(s)
return sources_list
do_configure () {
if [ -z "${UBOOT_CONFIG}" ]; then
if [ -n "${UBOOT_MACHINE}" ]; then
oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
else
oe_runmake -C ${S} O=${B} oldconfig
fi
merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
cml1_do_configure
fi
}
do_compile () {
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then
sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/config.mk
fi
unset LDFLAGS
unset CFLAGS
unset CPPFLAGS
if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
then
echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion
echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
fi
if [ -n "${UBOOT_CONFIG}" ]
then
unset i j k
for config in ${UBOOT_MACHINE}; do
i=$(expr $i + 1);
for type in ${UBOOT_CONFIG}; do
j=$(expr $j + 1);
if [ $j -eq $i ]
then
oe_runmake -C ${S} O=${B}/${config} ${config}
oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET}
for binary in ${UBOOT_BINARIES}; do
k=$(expr $k + 1);
if [ $k -eq $i ]; then
cp ${B}/${config}/${binary} ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
fi
done
unset k
fi
done
unset j
done
unset i
else
oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET}
fi
}
do_install () {
if [ -n "${UBOOT_CONFIG}" ]
then
for config in ${UBOOT_MACHINE}; do
i=$(expr $i + 1);
for type in ${UBOOT_CONFIG}; do
j=$(expr $j + 1);
if [ $j -eq $i ]
then
install -d ${D}/boot
install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
fi
done
unset j
done
unset i
else
install -d ${D}/boot
install -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
fi
if [ -n "${UBOOT_ELF}" ]
then
if [ -n "${UBOOT_CONFIG}" ]
then
for config in ${UBOOT_MACHINE}; do
i=$(expr $i + 1);
for type in ${UBOOT_CONFIG}; do
j=$(expr $j + 1);
if [ $j -eq $i ]
then
install -m 644 ${B}/${config}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}
fi
done
unset j
done
unset i
else
install -m 644 ${B}/${UBOOT_ELF} ${D}/boot/${UBOOT_ELF_IMAGE}
ln -sf ${UBOOT_ELF_IMAGE} ${D}/boot/${UBOOT_ELF_BINARY}
fi
fi
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 [ -n "${SPL_BINARY}" ]
then
if [ -n "${UBOOT_CONFIG}" ]
then
for config in ${UBOOT_MACHINE}; do
i=$(expr $i + 1);
for type in ${UBOOT_CONFIG}; do
j=$(expr $j + 1);
if [ $j -eq $i ]
then
install -m 644 ${B}/${config}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}-${type}-${PV}-${PR}
ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARYNAME}-${type}
ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARYNAME}
fi
done
unset j
done
unset i
else
install -m 644 ${B}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}
ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYNAME}
fi
fi
if [ -n "${UBOOT_ENV}" ]
then
install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${D}/boot/${UBOOT_ENV_IMAGE}
ln -sf ${UBOOT_ENV_IMAGE} ${D}/boot/${UBOOT_ENV_BINARY}
fi
if [ "${UBOOT_EXTLINUX}" = "1" ]
then
install -Dm 0644 ${UBOOT_EXTLINUX_CONFIG} ${D}/${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME}
fi
}
FILES:${PN} = "/boot ${sysconfdir} ${datadir}"
do_deploy () {
if [ -n "${UBOOT_CONFIG}" ]
then
for config in ${UBOOT_MACHINE}; do
i=$(expr $i + 1);
for type in ${UBOOT_CONFIG}; do
j=$(expr $j + 1);
if [ $j -eq $i ]
then
install -d ${DEPLOYDIR}
install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
cd ${DEPLOYDIR}
ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type}
ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}
ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type}
ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}
fi
done
unset j
done
unset i
else
install -d ${DEPLOYDIR}
install -m 644 ${B}/${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}
fi
if [ -n "${UBOOT_ELF}" ]
then
if [ -n "${UBOOT_CONFIG}" ]
then
for config in ${UBOOT_MACHINE}; do
i=$(expr $i + 1);
for type in ${UBOOT_CONFIG}; do
j=$(expr $j + 1);
if [ $j -eq $i ]
then
install -m 644 ${B}/${config}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type}
ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type}
ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
fi
done
unset j
done
unset i
else
install -m 644 ${B}/${UBOOT_ELF} ${DEPLOYDIR}/${UBOOT_ELF_IMAGE}
ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
fi
fi
if [ -n "${SPL_BINARY}" ]
then
if [ -n "${UBOOT_CONFIG}" ]
then
for config in ${UBOOT_MACHINE}; do
i=$(expr $i + 1);
for type in ${UBOOT_CONFIG}; do
j=$(expr $j + 1);
if [ $j -eq $i ]
then
install -m 644 ${B}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}-${type}-${PV}-${PR}
rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type}
ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARYNAME}
ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK}
fi
done
unset j
done
unset i
else
install -m 644 ${B}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}
rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK}
ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARYNAME}
ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK}
fi
fi
if [ -n "${UBOOT_ENV}" ]
then
install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_IMAGE}
rm -f ${DEPLOYDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_BINARY}
ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
fi
if [ "${UBOOT_EXTLINUX}" = "1" ]
then
install -m 644 ${UBOOT_EXTLINUX_CONFIG} ${DEPLOYDIR}/${UBOOT_EXTLINUX_SYMLINK}
ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}
ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME}
fi
}
addtask deploy before do_build after do_compile
@@ -0,0 +1,10 @@
DESCRIPTION = "U-boot for Nuvoton NPCM7xx/NPCM8xx Baseboard Management Controller"
require u-boot-common-nuvoton.inc
require u-boot-nuvoton.inc
PROVIDES += "u-boot"
DEPENDS += "dtc-native"
SRC_URI:append:df-phosphor-mmc = " file://u-boot-emmc.cfg"