diff options
author | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-11-02 11:07:33 +0900 |
---|---|---|
committer | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-11-02 11:07:33 +0900 |
commit | 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf (patch) | |
tree | cd70a267a5ef105ba32f200aa088e281fbd85747 /bsp/meta-arm/meta-arm-bsp/recipes-bsp/boot-wrapper-aaarch64 | |
parent | 4204309872da5cb401cbb2729d9e2d4869a87f42 (diff) |
basesystem-jjsandbox/ToshikazuOhiwa/master-jj
recipes
Diffstat (limited to 'bsp/meta-arm/meta-arm-bsp/recipes-bsp/boot-wrapper-aaarch64')
-rw-r--r-- | bsp/meta-arm/meta-arm-bsp/recipes-bsp/boot-wrapper-aaarch64/boot-wrapper-aarch64.inc | 87 | ||||
-rw-r--r-- | bsp/meta-arm/meta-arm-bsp/recipes-bsp/boot-wrapper-aaarch64/boot-wrapper-aarch64_git.bb | 27 |
2 files changed, 114 insertions, 0 deletions
diff --git a/bsp/meta-arm/meta-arm-bsp/recipes-bsp/boot-wrapper-aaarch64/boot-wrapper-aarch64.inc b/bsp/meta-arm/meta-arm-bsp/recipes-bsp/boot-wrapper-aaarch64/boot-wrapper-aarch64.inc new file mode 100644 index 00000000..3cd39177 --- /dev/null +++ b/bsp/meta-arm/meta-arm-bsp/recipes-bsp/boot-wrapper-aaarch64/boot-wrapper-aarch64.inc @@ -0,0 +1,87 @@ + +SUMMARY = "Linux aarch64 boot wrapper with FDT support" +LICENSE = "BSD" + +inherit autotools deploy + +PROVIDES = "virtual/gem5-bootloader boot-wrapper-aarch64" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +COMPATIBLE_MACHINE ?= "" + +# Device tree to put in the image +# by default use the standard kernel devicetree +# This should be overwritten if the devicetree is not generated +# by the kernel. +# This should point to a file in the deploy image directory +BOOT_WRAPPER_AARCH64_DEVICETREE ??= "${KERNEL_DEVICETREE}" + +# Kernel image to put in the image +# This should point to a file in the deploy image directory +BOOT_WRAPPER_AARCH64_KERNEL ??= "Image" + +# Kernel command line for the image +BOOT_WRAPPER_AARCH64_CMDLINE ??= "rw" + +# Image generated by boot wrapper +BOOT_WRAPPER_AARCH64_IMAGE ??= "linux-system.axf" + +DEPENDS += "virtual/kernel dtc-native" + +EXTRA_OECONF += "--with-kernel-dir=${WORKDIR}/kernel" +EXTRA_OECONF += "--with-dtb=${WORKDIR}/kernel/dummy.dtb" +EXTRA_OECONF += "--with-cmdline=\"\"" +EXTRA_OECONF += "--enable-psci --enable-gicv3" + +# unset LDFLAGS solves this error when compiling kernel modules: +# aarch64-poky-linux-ld: unrecognized option '-Wl,-O1' +EXTRA_OEMAKE += "'LDFLAGS= --gc-sections '" + +# Strip prefix if any +REAL_DTB = "${@os.path.basename(d.getVar('BOOT_WRAPPER_AARCH64_DEVICETREE'))}" + +EXTRA_OEMAKE += "'KERNEL_DTB=${DEPLOY_DIR_IMAGE}/${REAL_DTB}'" +EXTRA_OEMAKE += "'KERNEL_IMAGE=${DEPLOY_DIR_IMAGE}/${BOOT_WRAPPER_AARCH64_KERNEL}'" +EXTRA_OEMAKE += "'CMDLINE=${BOOT_WRAPPER_AARCH64_CMDLINE}'" + + +do_configure_prepend() { + # Create dummy files to make configure happy. + # We will pass the generated ones directly to make. + mkdir -p ${WORKDIR}/kernel/arch/arm64/boot + echo "dummy" > ${WORKDIR}/kernel/arch/arm64/boot/Image + echo "dummy" > ${WORKDIR}/kernel/dummy.dtb + + # Generate configure + (cd ${S} && autoreconf -i || exit 1) +} + +do_compile[noexec] = "1" +do_install[noexec] = "1" + +# We need the kernel to create an image +do_deploy[depends] += "virtual/kernel:do_deploy" + +do_deploy() { + if [ ! -f ${DEPLOY_DIR_IMAGE}/${REAL_DTB} ]; then + echo "ERROR: cannot find ${REAL_DTB} in ${DEPLOY_DIR_IMAGE}" >&2 + echo "Please check your BOOT_WRAPPER_AARCH64_DEVICETREE settings" >&2 + exit 1 + fi + + if [ ! -f ${DEPLOY_DIR_IMAGE}/${BOOT_WRAPPER_AARCH64_KERNEL} ]; then + echo "ERROR: cannot find ${BOOT_WRAPPER_AARCH64_KERNEL}" \ + " in ${DEPLOY_DIR_IMAGE}" >&2 + echo "Please check your BOOT_WRAPPER_AARCH64_KERNEL settings" >&2 + exit 1 + fi + + oe_runmake clean + oe_runmake all + + install -D -p -m 644 ${BOOT_WRAPPER_AARCH64_IMAGE} \ + ${DEPLOYDIR}/linux-system.axf +} +addtask deploy before do_build after do_compile + diff --git a/bsp/meta-arm/meta-arm-bsp/recipes-bsp/boot-wrapper-aaarch64/boot-wrapper-aarch64_git.bb b/bsp/meta-arm/meta-arm-bsp/recipes-bsp/boot-wrapper-aaarch64/boot-wrapper-aarch64_git.bb new file mode 100644 index 00000000..a071f609 --- /dev/null +++ b/bsp/meta-arm/meta-arm-bsp/recipes-bsp/boot-wrapper-aaarch64/boot-wrapper-aarch64_git.bb @@ -0,0 +1,27 @@ + +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=bb63326febfb5fb909226c8e7ebcef5c" + +SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git" + +PV = "git${SRCPV}" + +S = "${WORKDIR}/git" + +SRCREV = "fd74c8cbd0e17483d2299208cad9742bee605ca7" + +BPN = "boot-wrapper-aarch64" + +require boot-wrapper-aarch64.inc + +# Gem5 aarch64 support +COMPATIBLE_MACHINE_gem5_arm64 = "gem5-arm64" + +# For gem5 we use the dtb generated by gem5 directly +DEPENDS_append_gem5-arm64 = " gem5-aarch64-dtb" +BOOT_WRAPPER_AARCH64_DEVICETREE_gem5-arm64 = "gem5-aarch64.dtb" + +# The dtb must be generated for us to generate the axf +DEPLOY_DEPEND_LIST ?= "" +DEPLOY_DEPEND_LIST_gem5-arm64 = " gem5-aarch64-dtb:do_deploy" +do_deploy[depends] += "${DEPLOY_DEPEND_LIST}" + |