Skip to content

Commit 3e7df7f

Browse files
muditsharmaa-armAnton-TF
authored andcommitted
rp2350: Clear shared boot data in BL2 post init
For this platform, BL2 is the first stage of the TF-M boot process. The shared buffer used between the bootloader and runtime must be cleared after each reset or reboot. This prevents residual state from previous boots from affecting subsequent boot measurement related checks performed in function `boot_add_data_to_shared_area`. Signed-off-by: Mudit Sharma <mudit.sharma@arm.com> Change-Id: Ic5856ccabb84538643da190d3d33e1d38cb0c0a7
1 parent e88101a commit 3e7df7f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

platform/ext/target/rpi/rp2350/bl2/boot_hal_bl2.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
* SPDX-FileCopyrightText: Copyright The TrustedFirmware-M Contributors
44
*/
55

6-
#include "boot_hal.h"
7-
86
#include <string.h>
7+
8+
#include "boot_hal.h"
99
#include "bl2_image_id.h"
10+
#include "tfm_plat_shared_measurement_data.h"
1011

1112
bool boot_platform_should_load_image(uint32_t image_id)
1213
{
@@ -18,3 +19,12 @@ bool boot_platform_should_load_image(uint32_t image_id)
1819

1920
return true;
2021
}
22+
23+
int32_t boot_platform_post_init(void)
24+
{
25+
/* Clear boot data area */
26+
memset((void *)tfm_plat_get_shared_measurement_data_base(), 0,
27+
tfm_plat_get_shared_measurement_data_size());
28+
29+
return 0;
30+
}

0 commit comments

Comments
 (0)