diff options
author | Andrei Narkevitch <ainh@cypress.com> | 2019-10-10 12:52:45 -0700 |
---|---|---|
committer | David Hu <david.hu@arm.com> | 2019-10-17 05:49:57 +0000 |
commit | 30706c01f7ee43364fcc2ffcbc844ccda75838cd (patch) | |
tree | 6cf1d83ed4e13dd8eae37ff20b00cff902eeba7b | |
parent | e0e4d3b7791777ce3e504712d26c8a6206ea7adb (diff) | |
download | trusted-firmware-m-30706c01f7ee43364fcc2ffcbc844ccda75838cd.tar.gz |
plat: mock mcuboot shared data (psoc64)
- Instead of TFM-customized mcuboot, at this moment psoc64 uses
Cypress version of it - CypressBootloader (CYBL). CYBL doesn't
populate BOOT_TFM_SHARED_DATA.
- as a temp workaround, mock mcuboot shared data to pass
initialization checks and attestation tests.
Signed-off-by: Andrei Narkevitch <ainh@cypress.com>
Change-Id: I535a11e1d439e0e05af9874054bf2fa6bb810e53
-rw-r--r-- | platform/ext/target/psoc64/spm_hal.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/platform/ext/target/psoc64/spm_hal.c b/platform/ext/target/psoc64/spm_hal.c index b5046212e6..98c4e6efbd 100644 --- a/platform/ext/target/psoc64/spm_hal.c +++ b/platform/ext/target/psoc64/spm_hal.c @@ -8,6 +8,7 @@ #include <stdbool.h> #include <stdio.h> +#include <string.h> #include "platform/include/tfm_spm_hal.h" @@ -392,10 +393,43 @@ enum tfm_plat_err_t tfm_spm_hal_init_debug(void) return TFM_PLAT_ERR_SUCCESS; } +/* FIXME: + * Instead of TFM-customized mcuboot, at this moment psoc64 uses + * Cypress version of it - CypressBootloader (CYBL). CYBL doesn't + * populate BOOT_TFM_SHARED_DATA. + * As a temp workaround, mock mcuboot shared data to pass + * initialization checks. +*/ +void mock_tfm_shared_data(void) +{ + const uint32_t mock_data[] = { + 0x00D92016, 0x00071103, 0x00455053, 0x30000911, + 0x302E302E, 0x00081102, 0x00000000, 0x00241108, + 0x6C170A97, 0x5645665E, 0xDB6E2BA6, 0xA4FF4D74, + 0xFD34D7DB, 0x67449A82, 0x75FD0930, 0xAA15A9F9, + 0x000A1109, 0x32414853, 0x11013635, 0xE6BF0024, + 0x26886FD8, 0xFB97FFF4, 0xFBE6C496, 0x463E99C4, + 0x5D56FC19, 0x34DF6AA2, 0x9A4829C3, 0x114338DC, + 0x534E0008, 0x11404550, 0x2E300009, 0x42302E30, + 0x00000811, 0x48000000, 0x7E002411, 0x5FD9229A, + 0xE9672A5F, 0x31AAE1EA, 0x8514D772, 0x7F3B26BC, + 0x2C7EF27A, 0x9C6047D2, 0x4937BB9F, 0x53000A11, + 0x35324148, 0x24114136, 0xCA60B300, 0x6B8CC9F5, + 0x82482A94, 0x23489DFA, 0xA966B1EF, 0x4A6E6AEF, + 0x19197CA3, 0xC0CC1FED, 0x00000049, 0x00000000 + }; + uint32_t *boot_data = (uint32_t*)BOOT_TFM_SHARED_DATA_BASE; + memcpy(boot_data, mock_data, sizeof(mock_data)); +} + enum tfm_plat_err_t tfm_spm_hal_post_platform_init(void) { platform_init(); __enable_irq(); stdio_init(); + + /* FIXME: Use the actual data from mcuboot */ + mock_tfm_shared_data(); + return TFM_PLAT_ERR_SUCCESS; } |