add fpga image support in fitImage.

INFO: The image address entries in the fitImage changed
e.g. "fpga@1" -> "fpga-1"
see: commit 6047be9f8f0f5d616fda11d83b682c1b8aeaa0ae in meta-openembedded

Signed-off-by: Lucien Mueller <lucien.mueller@netmodule.com>
This commit is contained in:
Lucien Mueller 2023-09-28 13:39:12 +02:00 committed by Alexandre Bard
parent ff08561cb5
commit 6ad5d7fd94
7 changed files with 59 additions and 0 deletions

View File

@ -14,3 +14,7 @@ KERNEL_DEVICETREE = "openwrt-nbhw17.dtb"
EXT_SERIAL_CONSOLE ?= "115200;ttyS1"
SERIAL_CONSOLES = "${EXT_SERIAL_CONSOLE}"
MACHINE_FEATURES += " \
fpga \
"

View File

@ -18,3 +18,7 @@ KERNEL_DEVICETREE = " \
DEBUG_SERIAL_CONSOLE ?= "115200;ttyS0"
EXT_SERIAL_CONSOLE ?= "115200;ttyS1"
SERIAL_CONSOLES = "${EXT_SERIAL_CONSOLE} ${DEBUG_SERIAL_CONSOLE}"
MACHINE_FEATURES += " \
fpga \
"

View File

@ -0,0 +1,26 @@
DESCRIPTION = "Fpga images"
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Proprietary;md5=0557f9d92cf58f2ccdd50f62f8ac0b28"
inherit deploy
COMPATIBLE_MACHINE = "(netmodule-hw17|netmodule-hw18)"
SRC_URI = "file://LG00000000"
PACKAGE_ARCH = "${MACHINE_ARCH}"
PV = "1.0.0"
do_install () {
install -d ${D}/logic
install -m 0644 ${WORKDIR}/LG00000000 ${D}/logic/
}
do_deploy () {
cp ${WORKDIR}/LG00000000 ${DEPLOYDIR}/fpga-image-${MACHINE}
}
FILES:${PN} += "/logic/LG00000000"
addtask deploy before do_build after do_compile

View File

@ -0,0 +1,23 @@
do_assemble_fitimage[depends] += "fpga-image:do_deploy"
#
# Emit the fitImage ITS fpga section
#
# $1 ... .its filename
# $2 ... Image counter
# $3 ... Path to fpga image
fitimage_emit_section_kernel:append() {
fpgacount=1
cat << EOF >> ${1}
fpga-${fpgacount} {
description = "FPGA";
data = /incbin/("${DEPLOY_DIR_IMAGE}/fpga-image-${MACHINE}");
type = "fpga";
arch = "${UBOOT_ARCH}";
compression = "none";
hash-1 {
algo = "sha1";
};
};
EOF
}

View File

@ -19,6 +19,8 @@ kernel_do_deploy () {
inherit kernel-fitimage
inherit kernel-arch
inherit ${@bb.utils.contains('MACHINE_FEATURES', 'fpga', 'kernel-fitimage-fpga', '', d)}
do_assemble_fitimage:prepend() {
install -d ${S}/arch/${ARCH}/boot/