From 242b1f53c0e14a94d6a6b29850dad29338026ce2 Mon Sep 17 00:00:00 2001 From: Andrei Gherzan Date: Tue, 2 Jul 2019 15:17:02 +0100 Subject: armstubs: Add support for compiling ARM stubs Signed-off-by: Andrei Gherzan --- recipes-bsp/armstubs/armstubs.bb | 33 ++++++++++++++++++++++ ...0001-armstubs-makefile-external-toolchain.patch | 32 +++++++++++++++++++++ recipes-bsp/common/raspberrypi-tools.inc | 9 ++++++ 3 files changed, 74 insertions(+) create mode 100644 recipes-bsp/armstubs/armstubs.bb create mode 100644 recipes-bsp/armstubs/armstubs/0001-armstubs-makefile-external-toolchain.patch create mode 100644 recipes-bsp/common/raspberrypi-tools.inc diff --git a/recipes-bsp/armstubs/armstubs.bb b/recipes-bsp/armstubs/armstubs.bb new file mode 100644 index 0000000..06f3f33 --- /dev/null +++ b/recipes-bsp/armstubs/armstubs.bb @@ -0,0 +1,33 @@ +DESCRIPTION = "Boot strap code that the GPU puts on memory to start running the boot loader" +LICENSE = "Proprietary" + +LIC_FILES_CHKSUM = "file://armstub.S;beginline=1;endline=26;md5=9888f34ac06a676129416c952a6a521e" + +inherit deploy nopackages + +include recipes-bsp/common/raspberrypi-tools.inc + +SRC_URI_append = " file://0001-armstubs-makefile-external-toolchain.patch" + +COMPATIBLE_MACHINE = "^rpi$" + +S = "${RPITOOLS_S}/armstubs" + +export CC8="${CC}" +export LD8="${LD}" +export OBJCOPY8="${OBJCOPY}" +export OBJDUMP8="${OBJDUMP} -maarch64" + +do_compile() { + oe_runmake ${ARMSTUB} +} + +do_deploy() { + install -d ${DEPLOYDIR}/${PN} + cp ${S}/armstub*.bin ${DEPLOYDIR}/${PN} +} + +addtask deploy before do_build after do_install +do_deploy[dirs] += "${DEPLOYDIR}/${PN}" + +PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/recipes-bsp/armstubs/armstubs/0001-armstubs-makefile-external-toolchain.patch b/recipes-bsp/armstubs/armstubs/0001-armstubs-makefile-external-toolchain.patch new file mode 100644 index 0000000..4e226ec --- /dev/null +++ b/recipes-bsp/armstubs/armstubs/0001-armstubs-makefile-external-toolchain.patch @@ -0,0 +1,32 @@ +armstubs: Allow using external toolchain variables in Makefile + +Upstream-status: Pending +Signed-off-by: Andrei Gherzan + +Index: armstubs/Makefile +=================================================================== +--- armstubs.orig/Makefile ++++ armstubs/Makefile +@@ -1,14 +1,14 @@ + BINS=armstub.bin armstub7.bin armstub8-32.bin armstub8-32-gic.bin armstub8.bin armstub8-gic.bin + +-CC8=aarch64-linux-gnu-gcc +-LD8=aarch64-linux-gnu-ld +-OBJCOPY8=aarch64-linux-gnu-objcopy +-OBJDUMP8=aarch64-linux-gnu-objdump -maarch64 ++CC8?=aarch64-linux-gnu-gcc ++LD8?=aarch64-linux-gnu-ld ++OBJCOPY8?=aarch64-linux-gnu-objcopy ++OBJDUMP8?=aarch64-linux-gnu-objdump -maarch64 + +-CC=arm-linux-gnueabihf-gcc -march=armv7-a +-LD=arm-linux-gnueabihf-ld +-OBJCOPY=arm-linux-gnueabihf-objcopy +-OBJDUMP=arm-linux-gnueabihf-objdump -marm ++CC?=arm-linux-gnueabihf-gcc -march=armv7-a ++LD?=arm-linux-gnueabihf-ld ++OBJCOPY?=arm-linux-gnueabihf-objcopy ++OBJDUMP?=arm-linux-gnueabihf-objdump -marm + + BIN2C=./bin2c + diff --git a/recipes-bsp/common/raspberrypi-tools.inc b/recipes-bsp/common/raspberrypi-tools.inc new file mode 100644 index 0000000..8228e08 --- /dev/null +++ b/recipes-bsp/common/raspberrypi-tools.inc @@ -0,0 +1,9 @@ +SRCREV ?= "7f4a937e1bacbc111a22552169bc890b4bb26a94" +RPITOOLS_SRC_URI ?= "https://github.com/raspberrypi/tools/archive/${SRCREV}.tar.gz" +RPITOOLS_S ?= "${WORKDIR}/tools-${SRCREV}" + +SRC_URI = "${RPITOOLS_SRC_URI}" +SRC_URI[md5sum] = "f03672c57a4f285d0583ba7028f46a83" +SRC_URI[sha256sum] = "85e884cd95207780bc03fc7dacea1f17d2462c1e8c7499b0ff30070ca1d4d48a" + +PV = "0.0+git${SRCREV}" -- cgit v1.2.3-54-g00ecf