Skip to content

Commit 026345d

Browse files
meremSTPatrice CHOTARD
authored andcommitted
stm32mp: stm32prog: add support of UUID for metadata partition
Add support of UUID for metadata partition, required by Firmware update support in TF-A: - UUID TYPE for metadata partition: 8a7a84a0-8387-40f6-ab41-a8b9a5a60d23 - "metadata1" partition UUID: 5f91c128-e120-48d7-bb64-9fa9aed4c7e3 - "metadata2" partition UUID: f469f981-5985-4206-8fb3-839956035a65 The partition UUID is detected by the partition name: "metadata1", "metadata2". Change-Id: Ibb31331d6eba4de175b8d46f867d620ad3888acb Signed-off-by: Maxime Méré <maxime.mere@foss.st.com> Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/536840 ACI: CITOOLS <MDG-smet-aci-reviews@list.st.com> Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com> Tested-by: Patrice CHOTARD <patrice.chotard@foss.st.com> ACI: CIBUILD <MDG-smet-aci-builds@list.st.com> Domain-Review: Patrice CHOTARD <patrice.chotard@foss.st.com>
1 parent c08ba5f commit 026345d

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ static const efi_guid_t uuid_mmc[3] = {
7676
/* FIP type partition UUID used by TF-A*/
7777
#define FIP_TYPE_UUID "19D5DF83-11B0-457B-BE2C-7559C13142A5"
7878

79+
/* unique partition guid (uuid) for metadata partitions */
80+
#define FWU_METADATA1_UUID \
81+
EFI_GUID(0x5F91C128U, 0xE120U, 0x48D7U, \
82+
0xBBU, 0x64U, 0x9FU, 0xA9U, 0xAEU, 0xD4U, 0xC7U, 0xE3U)
83+
84+
#define FWU_METADATA2_UUID \
85+
EFI_GUID(0xF469F981U, 0x5985U, 0x4206U, \
86+
0x8FU, 0xB3U, 0x83U, 0x99U, 0x56U, 0x03U, 0x5AU, 0x65U)
87+
7988
/* unique partition guid (uuid) for FIP partitions A/B */
8089
#define FIP_A_UUID \
8190
EFI_GUID(0x4FD84C93, 0x54EF, 0x463F, \
@@ -85,6 +94,16 @@ static const efi_guid_t uuid_mmc[3] = {
8594
EFI_GUID(0x09C54952, 0xD5BF, 0x45AF, \
8695
0xAC, 0xEE, 0x33, 0x53, 0x03, 0x76, 0x6F, 0xB3)
8796

97+
static const char * const metadata_part_name[] = {
98+
"metadata1",
99+
"metadata2"
100+
};
101+
102+
static const efi_guid_t metadata_part_uuid[] = {
103+
FWU_METADATA1_UUID,
104+
FWU_METADATA2_UUID
105+
};
106+
88107
static const char * const fip_part_name[] = {
89108
"fip-a",
90109
"fip-b"
@@ -1162,6 +1181,12 @@ static int create_gpt_partitions(struct stm32prog_data *data)
11621181
uuid_bin = (unsigned char *)fip_part_uuid[j].b;
11631182
break;
11641183
}
1184+
} else if (part->part_type == PART_FWU_MDATA) {
1185+
for (j = 0; j < ARRAY_SIZE(metadata_part_name); j++)
1186+
if (!strcmp(part->name, metadata_part_name[j])) {
1187+
uuid_bin = (unsigned char *)metadata_part_uuid[j].b;
1188+
break;
1189+
}
11651190
}
11661191
if (uuid_bin) {
11671192
uuid_bin_to_str(uuid_bin, uuid, UUID_STR_FORMAT_GUID);

0 commit comments

Comments
 (0)