summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Gherzan <andrei@gherzan.ro>2019-07-02 15:17:02 +0100
committerAndrei Gherzan <andrei@gherzan.ro>2019-07-20 21:56:21 +0100
commit242b1f53c0e14a94d6a6b29850dad29338026ce2 (patch)
tree2a67cdf5786eba10f66c2804a2a3dc6898a5994a
parent004a1ef2c25308c020993200e0bdc151d909364d (diff)
downloadmeta-raspberrypi-242b1f53c0e14a94d6a6b29850dad29338026ce2.tar.gz
armstubs: Add support for compiling ARM stubs
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
-rw-r--r--recipes-bsp/armstubs/armstubs.bb33
-rw-r--r--recipes-bsp/armstubs/armstubs/0001-armstubs-makefile-external-toolchain.patch32
-rw-r--r--recipes-bsp/common/raspberrypi-tools.inc9
3 files changed, 74 insertions, 0 deletions
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 @@
1DESCRIPTION = "Boot strap code that the GPU puts on memory to start running the boot loader"
2LICENSE = "Proprietary"
3
4LIC_FILES_CHKSUM = "file://armstub.S;beginline=1;endline=26;md5=9888f34ac06a676129416c952a6a521e"
5
6inherit deploy nopackages
7
8include recipes-bsp/common/raspberrypi-tools.inc
9
10SRC_URI_append = " file://0001-armstubs-makefile-external-toolchain.patch"
11
12COMPATIBLE_MACHINE = "^rpi$"
13
14S = "${RPITOOLS_S}/armstubs"
15
16export CC8="${CC}"
17export LD8="${LD}"
18export OBJCOPY8="${OBJCOPY}"
19export OBJDUMP8="${OBJDUMP} -maarch64"
20
21do_compile() {
22 oe_runmake ${ARMSTUB}
23}
24
25do_deploy() {
26 install -d ${DEPLOYDIR}/${PN}
27 cp ${S}/armstub*.bin ${DEPLOYDIR}/${PN}
28}
29
30addtask deploy before do_build after do_install
31do_deploy[dirs] += "${DEPLOYDIR}/${PN}"
32
33PACKAGE_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 @@
1armstubs: Allow using external toolchain variables in Makefile
2
3Upstream-status: Pending
4Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
5
6Index: armstubs/Makefile
7===================================================================
8--- armstubs.orig/Makefile
9+++ armstubs/Makefile
10@@ -1,14 +1,14 @@
11 BINS=armstub.bin armstub7.bin armstub8-32.bin armstub8-32-gic.bin armstub8.bin armstub8-gic.bin
12
13-CC8=aarch64-linux-gnu-gcc
14-LD8=aarch64-linux-gnu-ld
15-OBJCOPY8=aarch64-linux-gnu-objcopy
16-OBJDUMP8=aarch64-linux-gnu-objdump -maarch64
17+CC8?=aarch64-linux-gnu-gcc
18+LD8?=aarch64-linux-gnu-ld
19+OBJCOPY8?=aarch64-linux-gnu-objcopy
20+OBJDUMP8?=aarch64-linux-gnu-objdump -maarch64
21
22-CC=arm-linux-gnueabihf-gcc -march=armv7-a
23-LD=arm-linux-gnueabihf-ld
24-OBJCOPY=arm-linux-gnueabihf-objcopy
25-OBJDUMP=arm-linux-gnueabihf-objdump -marm
26+CC?=arm-linux-gnueabihf-gcc -march=armv7-a
27+LD?=arm-linux-gnueabihf-ld
28+OBJCOPY?=arm-linux-gnueabihf-objcopy
29+OBJDUMP?=arm-linux-gnueabihf-objdump -marm
30
31 BIN2C=./bin2c
32
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 @@
1SRCREV ?= "7f4a937e1bacbc111a22552169bc890b4bb26a94"
2RPITOOLS_SRC_URI ?= "https://github.com/raspberrypi/tools/archive/${SRCREV}.tar.gz"
3RPITOOLS_S ?= "${WORKDIR}/tools-${SRCREV}"
4
5SRC_URI = "${RPITOOLS_SRC_URI}"
6SRC_URI[md5sum] = "f03672c57a4f285d0583ba7028f46a83"
7SRC_URI[sha256sum] = "85e884cd95207780bc03fc7dacea1f17d2462c1e8c7499b0ff30070ca1d4d48a"
8
9PV = "0.0+git${SRCREV}"