Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1 | # Corstone1000 machines specific TFM support |
| 2 | |
| 3 | COMPATIBLE_MACHINE = "(corstone1000)" |
| 4 | |
| 5 | TFM_PLATFORM = "arm/corstone1000" |
| 6 | |
| 7 | TFM_DEBUG = "1" |
| 8 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 9 | ## Default is the MPS3 board |
| 10 | TFM_PLATFORM_IS_FVP ?= "FALSE" |
| 11 | EXTRA_OECMAKE += "-DPLATFORM_IS_FVP=${TFM_PLATFORM_IS_FVP}" |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 12 | EXTRA_OECMAKE += "-DCC312_LEGACY_DRIVER_API_ENABLED=ON" |
| 13 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 14 | # libmetal |
| 15 | LICENSE += "& BSD-3-Clause" |
| 16 | LIC_FILES_CHKSUM += "file://../libmetal/LICENSE.md;md5=fe0b8a4beea8f0813b606d15a3df3d3c" |
| 17 | SRC_URI += "git://github.com/OpenAMP/libmetal.git;protocol=https;branch=main;name=libmetal;destsuffix=git/libmetal" |
| 18 | SRCREV_libmetal = "f252f0e007fbfb8b3a52b1d5901250ddac96baad" |
| 19 | EXTRA_OECMAKE += "-DLIBMETAL_SRC_PATH=${S}/../libmetal -DLIBMETAL_BIN_PATH=${B}/libmetal-build" |
| 20 | |
| 21 | # OpenAMP |
| 22 | LICENSE += "& BSD-2-Clause & BSD-3-Clause" |
| 23 | LIC_FILES_CHKSUM += "file://../openamp/LICENSE.md;md5=a8d8cf662ef6bf9936a1e1413585ecbf" |
| 24 | SRC_URI += "git://github.com/OpenAMP/open-amp.git;protocol=https;branch=main;name=openamp;destsuffix=git/openamp" |
| 25 | SRCREV_openamp = "347397decaa43372fc4d00f965640ebde042966d" |
| 26 | EXTRA_OECMAKE += "-DLIBOPENAMP_SRC_PATH=${S}/../openamp -DLIBOPENAMP_BIN_PATH=${B}/libopenamp-build" |
| 27 | |
| 28 | |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame] | 29 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 30 | SRC_URI:append:corstone1000 = " \ |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 31 | file://0001-Platform-corstone1000-Increase-BL2-size-in-flash-lay.patch \ |
| 32 | file://0002-Platform-Corstone1000-Increase-BL2_DATA_SIZE.patch \ |
| 33 | file://0003-Platform-Corstone1000-Calculate-the-new-CRC32-value-.patch \ |
| 34 | file://0004-arm-trusted-firmware-m-disable-fatal-warnings.patch \ |
Andrew Geissler | 2edf064 | 2023-09-11 08:24:07 -0400 | [diff] [blame] | 35 | file://0005-Platform-corstone1000-add-unique-firmware-GUID.patch \ |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 36 | file://0006-Platform-Corstone1000-Enable-Signed-Capsule.patch \ |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 37 | file://0007-platform-corstone1000-increase-ITS-max-asset-size.patch \ |
| 38 | file://0008-platform-corstone1000-align-capsule-update-structs.patch \ |
| 39 | file://0009-platform-corstone1000-fix-synchronization-issue-on-o.patch \ |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 40 | " |
| 41 | |
| 42 | # TF-M ships patches for external dependencies that needs to be applied |
| 43 | apply_tfm_patches() { |
| 44 | find ${S}/lib/ext/qcbor -type f -name '*.patch' -print0 | sort -z | xargs -r -t -0 -n 1 patch -p1 -d ${S}/../qcbor/ -i |
| 45 | find ${S}/lib/ext/mbedcrypto -type f -name '*.patch' -print0 | sort -z | xargs -r -t -0 -n 1 patch -p1 -d ${S}/../mbedtls/ -i |
| 46 | find ${S}/lib/ext/mcuboot -type f -name '*.patch' -print0 | sort -z | xargs -r -t -0 -n 1 patch -p1 -d ${S}/../mcuboot/ -i |
| 47 | 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 |
| 48 | } |
| 49 | |
| 50 | do_patch[postfuncs] += "apply_tfm_patches" |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame] | 51 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 52 | do_install() { |
| 53 | install -D -p -m 0644 ${B}/install/outputs/tfm_s_signed.bin ${D}/firmware/tfm_s_signed.bin |
| 54 | install -D -p -m 0644 ${B}/install/outputs/bl2_signed.bin ${D}/firmware/bl2_signed.bin |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 55 | install -D -p -m 0644 ${B}/install/outputs/bl1_1.bin ${D}/firmware/bl1_1.bin |
| 56 | install -D -p -m 0644 ${B}/install/outputs/bl1_provisioning_bundle.bin ${D}/firmware/bl1_provisioning_bundle.bin |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 57 | } |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 58 | |
| 59 | create_bl1_image(){ |
| 60 | dd conv=notrunc bs=1 if=${D}/firmware/bl1_1.bin of=${D}/firmware/bl1.bin seek=0 |
| 61 | dd conv=notrunc bs=1 if=${D}/firmware/bl1_provisioning_bundle.bin of=${D}/firmware/bl1.bin seek=40960 |
| 62 | } |
| 63 | do_install[postfuncs] += "create_bl1_image" |