From: Jan Kiszka <[email protected]> This allows to switch to upstream U-Boot and ATF, resolving all shortcomings of the pre-installed downstream version on the board. We just need to install the generated binary on an SD card at the right location and switch booting to that medium.
The build is complex and requires a little fix in ATF. But by deriving from u-boot-custom.inc, we can widely focus on specialties when bringing 5(!) different sources together to form the bootable artifact. Signed-off-by: Jan Kiszka <[email protected]> --- ...tools-Fix-broken-object-compilation-rules.patch | 59 ++++++++++++++++++++++ recipes-bsp/u-boot/files/macchiatobin-rules | 41 +++++++++++++++ .../u-boot/u-boot-macchiatobin_2018.09-atf1.6.bb | 46 +++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 recipes-bsp/u-boot/files/0001-tools-Fix-broken-object-compilation-rules.patch create mode 100644 recipes-bsp/u-boot/files/macchiatobin-rules create mode 100644 recipes-bsp/u-boot/u-boot-macchiatobin_2018.09-atf1.6.bb diff --git a/recipes-bsp/u-boot/files/0001-tools-Fix-broken-object-compilation-rules.patch b/recipes-bsp/u-boot/files/0001-tools-Fix-broken-object-compilation-rules.patch new file mode 100644 index 0000000..9e4a08a --- /dev/null +++ b/recipes-bsp/u-boot/files/0001-tools-Fix-broken-object-compilation-rules.patch @@ -0,0 +1,59 @@ +From a8e3ae2e1f391296dc95a85ca4029ccf40e9bf14 Mon Sep 17 00:00:00 2001 +From: Jan Kiszka <[email protected]> +Date: Tue, 2 Oct 2018 09:28:00 +0200 +Subject: [PATCH] tools: Fix broken object compilation rules + +As these rules depend on non-existing headers as well (likely copy & +pasted from fiptool), they never matched, and the built-in rules were +used. That led to random breakages when e.g. CPPFLAGS was suddenly +evaluated and contained invalid options. + +For the stm32image, this reveals that we were relying on the built-in +rules by passing -D_GNU_SOURCE via CPPFLAGS, rather than using CFLAGS as +used in the local rule. Fix that as well. + +Signed-off-by: Jan Kiszka <[email protected]> +--- + tools/doimage/Makefile | 2 +- + tools/stm32image/Makefile | 5 ++--- + 2 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/tools/doimage/Makefile b/tools/doimage/Makefile +index bc74369f..9cec681a 100644 +--- a/tools/doimage/Makefile ++++ b/tools/doimage/Makefile +@@ -39,7 +39,7 @@ ${PROJECT}: ${OBJECTS} Makefile + @echo "Built $@ successfully" + @echo + +-%.o: %.c %.h Makefile ++%.o: %.c Makefile + @echo " CC $<" + ${Q}${CC} -c ${CFLAGS} ${INCLUDE_PATHS} $< -o $@ + +diff --git a/tools/stm32image/Makefile b/tools/stm32image/Makefile +index 80dfbecf..a593d316 100644 +--- a/tools/stm32image/Makefile ++++ b/tools/stm32image/Makefile +@@ -12,8 +12,7 @@ PROJECT := stm32image${BIN_EXT} + OBJECTS := stm32image.o + V := 0 + +-override CPPFLAGS += -D_GNU_SOURCE +-CFLAGS := -Wall -Werror -pedantic -std=c99 ++CFLAGS := -Wall -Werror -pedantic -std=c99 -D_GNU_SOURCE + ifeq (${DEBUG},1) + CFLAGS += -g -O0 -DDEBUG + else +@@ -39,7 +38,7 @@ ${PROJECT}: ${OBJECTS} Makefile + @echo "Built $@ successfully" + @${ECHO_BLANK_LINE} + +-%.o: %.c %.h Makefile ++%.o: %.c Makefile + @echo " CC $<" + ${Q}${CC} -c ${CFLAGS} $< -o $@ + +-- +2.16.4 + diff --git a/recipes-bsp/u-boot/files/macchiatobin-rules b/recipes-bsp/u-boot/files/macchiatobin-rules new file mode 100644 index 0000000..6656660 --- /dev/null +++ b/recipes-bsp/u-boot/files/macchiatobin-rules @@ -0,0 +1,41 @@ +#!/usr/bin/make -f +# +# Jailhouse, a Linux-based partitioning hypervisor +# +# Copyright (c) Siemens AG, 2018 +# +# Authors: +# Jan Kiszka <[email protected]> +# +# SPDX-License-Identifier: MIT +# + +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) +export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)- +SET_CROSS_BUILD_TOOLS=CROSS_BUILD_TOOLS=y +endif + +PARALLEL_BUILD=-j $(shell echo $$(($$(nproc) * 2))) + +U_BOOT_DIR=$(PWD) + +override_dh_auto_build: + $(MAKE) $(PARALLEL_BUILD) $(U_BOOT_CONFIG) + $(MAKE) $(PARALLEL_BUILD) ${U_BOOT_BIN} + $(MAKE) $(PARALLEL_BUILD) $(SET_CROSS_BUILD_TOOLS) NO_SDL=1 tools-only envtools + cd ../arm-trusted-firmware-*; \ + $(MAKE) USE_COHERENT_MEM=0 \ + PLAT=a80x0_mcbin \ + MV_DDR_PATH=../mv-ddr-marvell \ + SCP_BL2=../binaries-marvell/mrvl_scp_bl2_mss_ap_cp1_a8040.img \ + BLE_PATH=../ble-marvell \ + BL33=$(U_BOOT_DIR)/u-boot.bin \ + all fip + +override_dh_auto_install: + mv tools/env/lib.a tools/env/libubootenv.a + +override_dh_auto_test: + +%: + CFLAGS= LDFLAGS= dh $@ --parallel diff --git a/recipes-bsp/u-boot/u-boot-macchiatobin_2018.09-atf1.6.bb b/recipes-bsp/u-boot/u-boot-macchiatobin_2018.09-atf1.6.bb new file mode 100644 index 0000000..0f05d76 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-macchiatobin_2018.09-atf1.6.bb @@ -0,0 +1,46 @@ +# +# Jailhouse, a Linux-based partitioning hypervisor +# +# Copyright (c) Siemens AG, 2018 +# +# Authors: +# Jan Kiszka <[email protected]> +# +# SPDX-License-Identifier: MIT +# + +require recipes-bsp/u-boot/u-boot-custom.inc + +SRC_URI += " \ + ftp://ftp.denx.de/pub/u-boot/u-boot-${U_BOOT_PV}.tar.bz2;name=u-boot \ + https://github.com/ARM-software/arm-trusted-firmware/archive/v${ATF_PV}.tar.gz;name=atf \ + git://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell;protocol=https;branch=mv_ddr-armada-atf-mainline;rev=${MV_DDR_REV};destsuffix=mv-ddr-marvell \ + git://github.com/MarvellEmbeddedProcessors/binaries-marvell;protocol=https;branch=${MV_BIN_BRANCH};rev=${MV_BIN_REV};destsuffix=binaries-marvell \ + git://github.com/MarvellEmbeddedProcessors/ble-marvell.git;protocol=https;branch=atf-mainline;rev=${MV_BLE_REV};destsuffix=ble-marvell \ + file://0001-tools-Fix-broken-object-compilation-rules.patch;apply=no \ + file://macchiatobin-rules \ + " +SRC_URI[u-boot.sha256sum] = "839bf23cfe8ce613a77e583a60375179d0ad324e92c82fbdd07bebf0fd142268" +SRC_URI[atf.sha256sum] = "62120368f2196d3e126296c8116f3399568e100960a5122e52017d22766b7009" + +U_BOOT_PV="2018.09" +ATF_PV="1.6" +MV_DDR_REV="779e860c3b81eda192dd40270f46c0ff44e52113" +MV_BIN_BRANCH="binaries-marvell-armada-18.06" +MV_BIN_REV="14481806e699dcc6f7025dbe3e46cf26bb787791" +MV_BLE_REV="61d305e3869dec8c8c5b8c2fd985548f9a424688" + +U_BOOT_CONFIG="mvebu_mcbin-88f8040_defconfig" +U_BOOT_BIN="u-boot.bin" + +S = "${WORKDIR}/u-boot-${U_BOOT_PV}" + +do_prepare_build_append() { + cp ${WORKDIR}/macchiatobin-rules ${S}/debian/rules + + echo "../arm-trusted-firmware-${ATF_PV}/build/a80x0_mcbin/release/flash-image.bin /usr/lib/u-boot/macchiatobin" > \ + ${S}/debian/u-boot-macchiatobin.install + + patch -d ${WORKDIR}/arm-trusted-firmware-${ATF_PV} -p1 \ + -i ${WORKDIR}/0001-tools-Fix-broken-object-compilation-rules.patch +} -- 2.16.4 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
