blob: f4623f50f94958bad7d1d66f190035b48b27e36f [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001# Corstone1000 machines specific TFM support
2
3COMPATIBLE_MACHINE = "(corstone1000)"
4
5TFM_PLATFORM = "arm/corstone1000"
6
7TFM_DEBUG = "1"
8
Andrew Geissler517393d2023-01-13 08:55:19 -06009## Default is the MPS3 board
10TFM_PLATFORM_IS_FVP ?= "FALSE"
11EXTRA_OECMAKE += "-DPLATFORM_IS_FVP=${TFM_PLATFORM_IS_FVP}"
Patrick Williams8e7b46e2023-05-01 14:19:06 -050012EXTRA_OECMAKE += "-DCC312_LEGACY_DRIVER_API_ENABLED=ON"
13
Patrick Williams705982a2024-01-12 09:51:57 -060014# libmetal v2023.04.0
Andrew Geissler517393d2023-01-13 08:55:19 -060015LICENSE += "& BSD-3-Clause"
Patrick Williams705982a2024-01-12 09:51:57 -060016LIC_FILES_CHKSUM += "file://../libmetal/LICENSE.md;md5=f4d5df0f12dcea1b1a0124219c0dbab4"
17SRC_URI += "git://github.com/OpenAMP/libmetal.git;protocol=https;branch=main;name=libmetal;destsuffix=git/libmetal \
18 file://0001-cmake-modify-path-to-libmetal-version-file.patch;patchdir=../libmetal \
19 "
20SRCREV_libmetal = "28fa2351d6a8121ce6c1c2ac5ee43ce08d38dbae"
Andrew Geissler517393d2023-01-13 08:55:19 -060021EXTRA_OECMAKE += "-DLIBMETAL_SRC_PATH=${S}/../libmetal -DLIBMETAL_BIN_PATH=${B}/libmetal-build"
22
Patrick Williams705982a2024-01-12 09:51:57 -060023# OpenAMP v2023.04.0
Andrew Geissler517393d2023-01-13 08:55:19 -060024LICENSE += "& BSD-2-Clause & BSD-3-Clause"
Patrick Williams705982a2024-01-12 09:51:57 -060025LIC_FILES_CHKSUM += "file://../openamp/LICENSE.md;md5=ab88daf995c0bd0071c2e1e55f3d3505"
Andrew Geissler517393d2023-01-13 08:55:19 -060026SRC_URI += "git://github.com/OpenAMP/open-amp.git;protocol=https;branch=main;name=openamp;destsuffix=git/openamp"
Patrick Williams705982a2024-01-12 09:51:57 -060027SRCREV_openamp = "accac4d3610cbb268f3c3fe3c31dc45dd4c4dd17"
Andrew Geissler517393d2023-01-13 08:55:19 -060028EXTRA_OECMAKE += "-DLIBOPENAMP_SRC_PATH=${S}/../openamp -DLIBOPENAMP_BIN_PATH=${B}/libopenamp-build"
29
30
Andrew Geissler9347dd42023-03-03 12:38:41 -060031FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
Andrew Geissler2daf84b2023-03-31 09:57:23 -050032SRC_URI:append:corstone1000 = " \
Patrick Williams2a254922023-08-11 09:48:11 -050033 file://0001-Platform-corstone1000-Increase-BL2-size-in-flash-lay.patch \
34 file://0002-Platform-Corstone1000-Increase-BL2_DATA_SIZE.patch \
35 file://0003-Platform-Corstone1000-Calculate-the-new-CRC32-value-.patch \
36 file://0004-arm-trusted-firmware-m-disable-fatal-warnings.patch \
Andrew Geissler2edf0642023-09-11 08:24:07 -040037 file://0005-Platform-corstone1000-add-unique-firmware-GUID.patch \
Andrew Geissler220dafd2023-10-04 10:18:08 -050038 file://0006-Platform-Corstone1000-Enable-Signed-Capsule.patch \
Patrick Williamsac13d5f2023-11-24 18:59:46 -060039 file://0007-platform-corstone1000-increase-ITS-max-asset-size.patch \
40 file://0008-platform-corstone1000-align-capsule-update-structs.patch \
41 file://0009-platform-corstone1000-fix-synchronization-issue-on-o.patch \
Patrick Williams8e7b46e2023-05-01 14:19:06 -050042 "
43
44# TF-M ships patches for external dependencies that needs to be applied
45apply_tfm_patches() {
46 find ${S}/lib/ext/qcbor -type f -name '*.patch' -print0 | sort -z | xargs -r -t -0 -n 1 patch -p1 -d ${S}/../qcbor/ -i
47 find ${S}/lib/ext/mbedcrypto -type f -name '*.patch' -print0 | sort -z | xargs -r -t -0 -n 1 patch -p1 -d ${S}/../mbedtls/ -i
48 find ${S}/lib/ext/mcuboot -type f -name '*.patch' -print0 | sort -z | xargs -r -t -0 -n 1 patch -p1 -d ${S}/../mcuboot/ -i
49 find ${S}/lib/ext/tf-m-tests -type f -name '*.patch' -print0 | sort -z | xargs -r -t -0 -n 1 patch -p1 -d ${S}/../tf-m-tests/ -i
50}
51
52do_patch[postfuncs] += "apply_tfm_patches"
Andrew Geissler9347dd42023-03-03 12:38:41 -060053
Andrew Geissler517393d2023-01-13 08:55:19 -060054do_install() {
55 install -D -p -m 0644 ${B}/install/outputs/tfm_s_signed.bin ${D}/firmware/tfm_s_signed.bin
56 install -D -p -m 0644 ${B}/install/outputs/bl2_signed.bin ${D}/firmware/bl2_signed.bin
Patrick Williams8e7b46e2023-05-01 14:19:06 -050057 install -D -p -m 0644 ${B}/install/outputs/bl1_1.bin ${D}/firmware/bl1_1.bin
58 install -D -p -m 0644 ${B}/install/outputs/bl1_provisioning_bundle.bin ${D}/firmware/bl1_provisioning_bundle.bin
Andrew Geissler517393d2023-01-13 08:55:19 -060059}
Patrick Williams8e7b46e2023-05-01 14:19:06 -050060
61create_bl1_image(){
62 dd conv=notrunc bs=1 if=${D}/firmware/bl1_1.bin of=${D}/firmware/bl1.bin seek=0
63 dd conv=notrunc bs=1 if=${D}/firmware/bl1_provisioning_bundle.bin of=${D}/firmware/bl1.bin seek=40960
64}
65do_install[postfuncs] += "create_bl1_image"