blob: 68845cf93abe81662b8a7463f4d07d2c96a9e777 [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
14SRCREV_tfm = "94c55967cbd1832681f07074a0945605b02ec8d0"
15SRCREV_mcuboot = "9e8eddcecba931f99297765779f8b130d808a9a3"
16SRCREV_mbedtls = "8c89224991adff88d53cd380f42a2baa36f91454"
Andrew Geissler517393d2023-01-13 08:55:19 -060017
18# libmetal
19LICENSE += "& BSD-3-Clause"
20LIC_FILES_CHKSUM += "file://../libmetal/LICENSE.md;md5=fe0b8a4beea8f0813b606d15a3df3d3c"
21SRC_URI += "git://github.com/OpenAMP/libmetal.git;protocol=https;branch=main;name=libmetal;destsuffix=git/libmetal"
22SRCREV_libmetal = "f252f0e007fbfb8b3a52b1d5901250ddac96baad"
23EXTRA_OECMAKE += "-DLIBMETAL_SRC_PATH=${S}/../libmetal -DLIBMETAL_BIN_PATH=${B}/libmetal-build"
24
25# OpenAMP
26LICENSE += "& BSD-2-Clause & BSD-3-Clause"
27LIC_FILES_CHKSUM += "file://../openamp/LICENSE.md;md5=a8d8cf662ef6bf9936a1e1413585ecbf"
28SRC_URI += "git://github.com/OpenAMP/open-amp.git;protocol=https;branch=main;name=openamp;destsuffix=git/openamp"
29SRCREV_openamp = "347397decaa43372fc4d00f965640ebde042966d"
30EXTRA_OECMAKE += "-DLIBOPENAMP_SRC_PATH=${S}/../openamp -DLIBOPENAMP_BIN_PATH=${B}/libopenamp-build"
31
32
Patrick Williams8e7b46e2023-05-01 14:19:06 -050033SRC_URI:remove:corstone1000 =" \
34 file://rwx.patch \
35"
36
Andrew Geissler9347dd42023-03-03 12:38:41 -060037FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
Andrew Geissler2daf84b2023-03-31 09:57:23 -050038SRC_URI:append:corstone1000 = " \
Patrick Williams8e7b46e2023-05-01 14:19:06 -050039 file://0001-Platform-corstone1000-make-sure-to-write-fwu-metadata-to-repl.patch \
40 file://0002-Platform-corstone1000-get-fwu-and-private-metadata-f.patch \
41 file://0003-Platform-corstone1000-Add-watchdog_reset_timer.patch \
42 file://0004-Platform-corstone1000-Replace-MCUBOOT-BL1-by-TFM-s.patch \
43 file://0005-Platform-corstone1000-Replace-MCUBOOT-BL1-by-TFM-s-B.patch \
44 file://0006-Platform-corstone1000-Reorganize-bl2-files.patch \
45 file://0007-Platform-corstone1000-Fix-linker-script-comment.patch \
46 file://0008-Platform-corstone1000-Fix-linkerscripts-copyright-ye.patch \
47 file://0009-Platform-corstone1000-fix-flash-reading-issue-for-fi.patch \
48 file://0010-Platform-corstone1000-Adds-compiler-flags-to-FWU-age.patch \
49 file://0011-Platform-corstone1000-adjust-PS-asset-configuration.patch \
50 file://0012-Platform-corstone1000-Increase-number-of-assets.patch \
51 file://corstone1000/rwx.patch \
52 "
53
54# TF-M ships patches for external dependencies that needs to be applied
55apply_tfm_patches() {
56 find ${S}/lib/ext/qcbor -type f -name '*.patch' -print0 | sort -z | xargs -r -t -0 -n 1 patch -p1 -d ${S}/../qcbor/ -i
57 find ${S}/lib/ext/mbedcrypto -type f -name '*.patch' -print0 | sort -z | xargs -r -t -0 -n 1 patch -p1 -d ${S}/../mbedtls/ -i
58 find ${S}/lib/ext/mcuboot -type f -name '*.patch' -print0 | sort -z | xargs -r -t -0 -n 1 patch -p1 -d ${S}/../mcuboot/ -i
59 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
60}
61
62do_patch[postfuncs] += "apply_tfm_patches"
Andrew Geissler9347dd42023-03-03 12:38:41 -060063
Andrew Geissler517393d2023-01-13 08:55:19 -060064do_install() {
65 install -D -p -m 0644 ${B}/install/outputs/tfm_s_signed.bin ${D}/firmware/tfm_s_signed.bin
66 install -D -p -m 0644 ${B}/install/outputs/bl2_signed.bin ${D}/firmware/bl2_signed.bin
Patrick Williams8e7b46e2023-05-01 14:19:06 -050067 install -D -p -m 0644 ${B}/install/outputs/bl1_1.bin ${D}/firmware/bl1_1.bin
68 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 -060069}
Patrick Williams8e7b46e2023-05-01 14:19:06 -050070
71create_bl1_image(){
72 dd conv=notrunc bs=1 if=${D}/firmware/bl1_1.bin of=${D}/firmware/bl1.bin seek=0
73 dd conv=notrunc bs=1 if=${D}/firmware/bl1_provisioning_bundle.bin of=${D}/firmware/bl1.bin seek=40960
74}
75do_install[postfuncs] += "create_bl1_image"