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 | |
| 14 | SRCREV_tfm = "94c55967cbd1832681f07074a0945605b02ec8d0" |
| 15 | SRCREV_mcuboot = "9e8eddcecba931f99297765779f8b130d808a9a3" |
| 16 | SRCREV_mbedtls = "8c89224991adff88d53cd380f42a2baa36f91454" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 17 | |
| 18 | # libmetal |
| 19 | LICENSE += "& BSD-3-Clause" |
| 20 | LIC_FILES_CHKSUM += "file://../libmetal/LICENSE.md;md5=fe0b8a4beea8f0813b606d15a3df3d3c" |
| 21 | SRC_URI += "git://github.com/OpenAMP/libmetal.git;protocol=https;branch=main;name=libmetal;destsuffix=git/libmetal" |
| 22 | SRCREV_libmetal = "f252f0e007fbfb8b3a52b1d5901250ddac96baad" |
| 23 | EXTRA_OECMAKE += "-DLIBMETAL_SRC_PATH=${S}/../libmetal -DLIBMETAL_BIN_PATH=${B}/libmetal-build" |
| 24 | |
| 25 | # OpenAMP |
| 26 | LICENSE += "& BSD-2-Clause & BSD-3-Clause" |
| 27 | LIC_FILES_CHKSUM += "file://../openamp/LICENSE.md;md5=a8d8cf662ef6bf9936a1e1413585ecbf" |
| 28 | SRC_URI += "git://github.com/OpenAMP/open-amp.git;protocol=https;branch=main;name=openamp;destsuffix=git/openamp" |
| 29 | SRCREV_openamp = "347397decaa43372fc4d00f965640ebde042966d" |
| 30 | EXTRA_OECMAKE += "-DLIBOPENAMP_SRC_PATH=${S}/../openamp -DLIBOPENAMP_BIN_PATH=${B}/libopenamp-build" |
| 31 | |
| 32 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame^] | 33 | SRC_URI:remove:corstone1000 =" \ |
| 34 | file://rwx.patch \ |
| 35 | " |
| 36 | |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame] | 37 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 38 | SRC_URI:append:corstone1000 = " \ |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame^] | 39 | 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 |
| 55 | apply_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 | |
| 62 | do_patch[postfuncs] += "apply_tfm_patches" |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame] | 63 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 64 | do_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 Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame^] | 67 | 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 Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 69 | } |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame^] | 70 | |
| 71 | create_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 | } |
| 75 | do_install[postfuncs] += "create_bl1_image" |