From 3f7eec27c372e9008b1bd1290d085733ca132a93 Mon Sep 17 00:00:00 2001 From: Rui Miguel Silva Date: Fri, 12 Jul 2019 16:43:27 +0100 Subject: [PATCH] corstone700: add initial recipes Add need configuration and recipes to support the corstone700 in meta-arm. Change-Id: I5df7e224f4079e6d46fdd1051975772952f52ba9 Signed-off-by: Rui Miguel Silva --- meta-corstone700/conf/layer.conf | 23 ++++++++ .../conf/machine/corstone700.conf | 23 ++++++++ .../boot-firmware/boot-firmware.bb | 59 +++++++++++++++++++ .../boot-firmware/boot-firmware/license.md | 39 ++++++++++++ .../external-system/external-system.bb | 45 ++++++++++++++ .../trusted-firmware-a.bbappend | 11 ++++ .../recipes-kernel/linux/linux-arm.bbappend | 9 +++ .../recipes-test/test-app/test-app.bb | 32 ++++++++++ .../wic/iota-tiny-image.corstone700.wks | 13 ++++ 9 files changed, 254 insertions(+) create mode 100644 meta-corstone700/conf/layer.conf create mode 100644 meta-corstone700/conf/machine/corstone700.conf create mode 100644 meta-corstone700/recipes-bsp/boot-firmware/boot-firmware.bb create mode 100644 meta-corstone700/recipes-bsp/boot-firmware/boot-firmware/license.md create mode 100644 meta-corstone700/recipes-bsp/external-system/external-system.bb create mode 100644 meta-corstone700/recipes-bsp/trusted-firmware-a/trusted-firmware-a.bbappend create mode 100644 meta-corstone700/recipes-kernel/linux/linux-arm.bbappend create mode 100644 meta-corstone700/recipes-test/test-app/test-app.bb create mode 100644 meta-corstone700/wic/iota-tiny-image.corstone700.wks diff --git a/meta-corstone700/conf/layer.conf b/meta-corstone700/conf/layer.conf new file mode 100644 index 00000000..15e5f349 --- /dev/null +++ b/meta-corstone700/conf/layer.conf @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (c) 2019 Arm Limited +# +# corstone700 has a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# corstone700 has a packages directory, add to BBFILES +BBFILES += " \ + ${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "corstone700" +BBFILE_PATTERN_corstone700 := "^${LAYERDIR}/" +BBFILE_PRIORITY_corstone700 = "12" +LAYERSERIES_COMPAT_corstone700 = "warrior" + +NAME_GCC_ARM_NONE_EABI = "gcc-arm-none-eabi" +INSTALL_GCC_ARM_NONE_EABI = "${bindir}/${NAME_GCC_ARM_NONE_EABI}" +TC_GCC_ARM_NONE_EABI = "${STAGING_BINDIR_NATIVE}/${NAME_GCC_ARM_NONE_EABI}" +TC_GCC_ARM_NONE_EABI_BIN = "${TC_GCC_ARM_NONE_EABI}/bin" + +LAYERDEPENDS_corstone700 = "arm" diff --git a/meta-corstone700/conf/machine/corstone700.conf b/meta-corstone700/conf/machine/corstone700.conf new file mode 100644 index 00000000..e01ab88d --- /dev/null +++ b/meta-corstone700/conf/machine/corstone700.conf @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: MIT +# +# Copyright (c) 2019 Arm Limited +# + +require conf/machine/include/arm-common-configuration.inc +require conf/machine/include/cortex-a32.inc + +EXTRA_IMAGEDEPENDS_append = " test-app" + +CORE_IMAGE_EXTRA_INSTALL += "test-app" + +EXTRA_IMAGEDEPENDS_append = " boot-firmware external-system" + +TF-A_PLATFORM = "corstone700" +TF-A_EXTRA_OPTIONS += " \ + RESET_TO_SP_MIN=1 \ + ARM_LINUX_KERNEL_AS_BL33=1 \ + PRELOADED_BL33_BASE=0x08500000 \ + ARM_PRELOADED_DTB_BASE=0x02800000 \ + ENABLE_STACK_PROTECTOR=strong \ + ENABLE_PIE=1 \ + " diff --git a/meta-corstone700/recipes-bsp/boot-firmware/boot-firmware.bb b/meta-corstone700/recipes-bsp/boot-firmware/boot-firmware.bb new file mode 100644 index 00000000..79c271e8 --- /dev/null +++ b/meta-corstone700/recipes-bsp/boot-firmware/boot-firmware.bb @@ -0,0 +1,59 @@ +# SPDX-License-Identifier: MIT +# +# Copyright (c) 2019 Arm Limited +# + +SUMMARY = "Boot Processor firmware" +DESCRIPTION = "Boot Processor firmware" +DEPENDS += " coreutils-native gcc-arm-none-eabi-native trusted-firmware-a " +LICENSE="BSD" +LIC_FILES_CHKSUM = "file://license.md;md5=e44b2531cd6ffe9dece394dbe988d9a0" + +# Use Yocto-built python3 executable +inherit python3native + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI = "gitsm://${USER}@git.linaro.org/landing-teams/working/arm/boot-firmware.git;protocol=https;branch=master" +SRCREV = "CORSTONE-700-2019.09.23" + +S = "${WORKDIR}/git" +B = "${WORKDIR}/build" + +COMPATIBLE_MACHINE = "(corstone700)" + +PLATFORM = "corstone-700" + +LDFLAGS[unexport] = "1" + +# the gcc-arm-none-eabi version does not support -fmacro-perfix-max, so make sure to setup +DEBUG_PREFIX_MAP_pn-boot-firmware = "-fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \ + -fdebug-prefix-map=${STAGING_DIR_HOST}= \ + -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \ + " +do_compile() { + export PATH=${TC_GCC_ARM_NONE_EABI_BIN}:$PATH + mkdir -p ${B} + + oe_runmake -C ${S} BUILD_BASE=${B} \ + BUILD_PLAT=${B}/${PLATFORM}/ \ + PRODUCT=${PLATFORM} \ + CROSS_COMPILE=arm-none-eabi- \ + clean \ + all + + cp ${S}/build/product/${PLATFORM}/se_ramfw/release/bin/firmware.bin ${B}/se_ramfw.bin + cp ${S}/build/product/${PLATFORM}/se_romfw/release/bin/firmware.bin ${B}/se_romfw.bin + + oe_runmake -C ${S}/tools/spitoc BUILD_BASE=${B} \ + BUILD_PLAT=${B}/${PLATFORM}/ \ + all + + cp ${S}/tools/spitoc/spitoc ${B}/spitoc +} + +do_install() { + install -D -p -m 0644 ${B}/se_ramfw.bin ${DEPLOY_DIR_IMAGE}/se_ramfw.bin + install -D -p -m 0644 ${B}/se_romfw.bin ${DEPLOY_DIR_IMAGE}/se_romfw.bin + ${B}/spitoc --seram ${DEPLOY_DIR_IMAGE}/se_ramfw.bin --offset 1 --fip ${DEPLOY_DIR_IMAGE}/${TF-A_PLATFORM}.fip --offset 33 --out ${DEPLOY_DIR_IMAGE}/spitoc.bin +} diff --git a/meta-corstone700/recipes-bsp/boot-firmware/boot-firmware/license.md b/meta-corstone700/recipes-bsp/boot-firmware/boot-firmware/license.md new file mode 100644 index 00000000..35c5088c --- /dev/null +++ b/meta-corstone700/recipes-bsp/boot-firmware/boot-firmware/license.md @@ -0,0 +1,39 @@ +License +======= + +Copyright (c) 2019, Arm Limited and Contributors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +- Neither the name of Arm nor the names of its contributors may be used to + endorse or promote products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +__Note:__ +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: BSD-3-Clause + +This enables machine processing of license information based on the SPDX +License Identifiers that are available here: http://spdx.org/licenses/ diff --git a/meta-corstone700/recipes-bsp/external-system/external-system.bb b/meta-corstone700/recipes-bsp/external-system/external-system.bb new file mode 100644 index 00000000..c9d0bd1d --- /dev/null +++ b/meta-corstone700/recipes-bsp/external-system/external-system.bb @@ -0,0 +1,45 @@ +SUMMARY = "External system Cortex-M3 Firmware" +DESCRIPTION = "External system Firmware" +HOMEPAGE = "https://gerrit.oss.arm.com/#/admin/projects/EP/src/ExternalSystem" +DEPENDS += " coreutils-native gcc-arm-none-eabi-native" +LICENSE="BSD" +LIC_FILES_CHKSUM = "file://license.md;md5=e44b2531cd6ffe9dece394dbe988d9a0" + +# Use Yocto-built python3 executable +inherit python3native + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI = "gitsm://${USER}@git.linaro.org/landing-teams/working/arm/external-system.git;protocol=https;branch=master" +SRCREV = "CORSTONE-700-2019.09.23" + +S = "${WORKDIR}/git" +B = "${WORKDIR}/build" + +COMPATIBLE_MACHINE = "(corstone700)" + +PLATFORM = "corstone-700" + +LDFLAGS[unexport] = "1" + +DEBUG_PREFIX_MAP_pn-external-system = "-fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \ + -fdebug-prefix-map=${STAGING_DIR_HOST}= \ + -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \ + " + + +do_compile() { + export PATH=${TC_GCC_ARM_NONE_EABI_BIN}:$PATH + mkdir -p ${B} + oe_runmake -C ${S} BUILD_BASE=${B} \ + BUILD_PLAT=${B}/${PLATFORM}/ \ + PRODUCT=${PLATFORM} \ + CROSS_COMPILE=arm-none-eabi- \ + clean \ + all + cp ${S}/build/product/${PLATFORM}/firmware/release/bin/firmware.bin ${B}/es_flashfw.bin +} + +do_install() { + install -D -p -m 0644 ${B}/es_flashfw.bin ${DEPLOY_DIR_IMAGE}/es_flashfw.bin +} diff --git a/meta-corstone700/recipes-bsp/trusted-firmware-a/trusted-firmware-a.bbappend b/meta-corstone700/recipes-bsp/trusted-firmware-a/trusted-firmware-a.bbappend new file mode 100644 index 00000000..5e5abe4a --- /dev/null +++ b/meta-corstone700/recipes-bsp/trusted-firmware-a/trusted-firmware-a.bbappend @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: MIT +# +# Copyright (c) 2019 Arm Limited +# + +LIC_FILES_CHKSUM_corstone700 = "file://license.rst;md5=c709b197e22b81ede21109dbffd5f363" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI_corstone700 = "git://${USER}@git.linaro.org/landing-teams/working/arm/arm-tf.git;protocol=https;branch=iota" +SRCREV_corstone700 = "CORSTONE-700-2019.09.23" diff --git a/meta-corstone700/recipes-kernel/linux/linux-arm.bbappend b/meta-corstone700/recipes-kernel/linux/linux-arm.bbappend new file mode 100644 index 00000000..237c91a9 --- /dev/null +++ b/meta-corstone700/recipes-kernel/linux/linux-arm.bbappend @@ -0,0 +1,9 @@ +SUMMARY = "Linux Kernel provided and supported by Arm/Linaro for Cortex-A32" + +KERNEL_IMAGETYPE = "xipImage" + +KBUILD_DEFCONFIG = "corstone700_defconfig" + +SRC_URI = "git://${USER}@git.linaro.org/landing-teams/working/arm/kernel-release.git;protocol=https;branch=iota" + +SRCREV = "CORSTONE-700-2019.09.23" diff --git a/meta-corstone700/recipes-test/test-app/test-app.bb b/meta-corstone700/recipes-test/test-app/test-app.bb new file mode 100644 index 00000000..3bdb6d0d --- /dev/null +++ b/meta-corstone700/recipes-test/test-app/test-app.bb @@ -0,0 +1,32 @@ +SUMMARY = "CORSTONE700 Host Test App" +DESCRIPTION = "CORSTONE700 Host Test App" +DEPENDS += " coreutils-native " +LICENSE="BSD" +LIC_FILES_CHKSUM = "file://license.md;md5=e44b2531cd6ffe9dece394dbe988d9a0" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI = "git://${USER}@git.linaro.org/landing-teams/working/arm/test-apps.git;protocol=https;branch=master" +SRCREV = "CORSTONE-700-2019.09.23" + +S = "${WORKDIR}/git" +B = "${WORKDIR}/build" + +COMPATIBLE_MACHINE = "(corstone700)" + +PLATFORM = "corstone700" + +LDFLAGS[unexport] = "1" + +do_compile() { + mkdir -p ${B} + ${CC} ${S}/test-app.c -o ${S}/test-app --static + cp ${S}/test-app ${B}/test-app +} + +do_install() { + install -d ${D}/${bindir}/ + install -m 0755 ${B}/test-app ${D}${bindir}/test-app +} + +FILES_${PN} += "${bindir}/test-app" diff --git a/meta-corstone700/wic/iota-tiny-image.corstone700.wks b/meta-corstone700/wic/iota-tiny-image.corstone700.wks new file mode 100644 index 00000000..3a3b9739 --- /dev/null +++ b/meta-corstone700/wic/iota-tiny-image.corstone700.wks @@ -0,0 +1,13 @@ +# Partition for corstone700 +part --source rawcopy --sourceparams="file=spitoc.bin" --no-table --align 1 --fixed-size 1k + +part --source rawcopy --sourceparams="file=se_ramfw.bin" --no-table --align 1 --fixed-size 32k + +# Rawcopy of the FIP binary +part --source rawcopy --sourceparams="file=corstone700.fip" --no-table --align 1 --fixed-size 991k + +# Rawcopy of the rootfs +part --source rawcopy --sourceparams="file=${IMGDEPLOYDIR}/iota-tiny-image-corstone700.cpio.gz" --no-table --fixed-size 4 + +# Rawcopy of the kernel binary +part --source rawcopy --sourceparams="file=xipImage" --no-table --fixed-size 3