45900e982c9c4ccffb8531d70c18151a47ccbbe9
[openwrt/staging/pepe2k.git] / tools / firmware-utils / patches / 001-add-sifiveu-guid-types.patch
1 diff -ruN firmware-utils-2022-02-28-002cfaf0.old/src/ptgen.c firmware-utils-2022-02-28-002cfaf0/src/ptgen.c
2 --- firmware-utils-2022-02-28-002cfaf0.old/src/ptgen.c 2022-04-23 19:02:07.307896842 +0200
3 +++ firmware-utils-2022-02-28-002cfaf0/src/ptgen.c 2022-04-22 18:48:54.477970950 +0200
4 @@ -82,6 +82,14 @@
5 GUID_INIT( 0x0fc63daf, 0x8483, 0x4772, \
6 0x8e, 0x79, 0x3d, 0x69, 0xd8, 0x47, 0x7d, 0xe4)
7
8 +#define GUID_PARTITION_SIFIVE_SPL \
9 + GUID_INIT( 0x5b193300, 0xfc78, 0x40cd, \
10 + 0x80, 0x02, 0xe8, 0x6c, 0x45, 0x58, 0x0b, 0x47)
11 +
12 +#define GUID_PARTITION_SIFIVE_UBOOT \
13 + GUID_INIT( 0x2e54b353, 0x1271, 0x4842, \
14 + 0x80, 0x6f, 0xe4, 0x36, 0xd6, 0xaf, 0x69, 0x85)
15 +
16 #define GPT_HEADER_SIZE 92
17 #define GPT_ENTRY_SIZE 128
18 #define GPT_ENTRY_MAX 128
19 @@ -276,6 +284,19 @@
20 (1ULL << 56); /* success=1 */
21 return true;
22 }
23 +
24 + if (!strcmp(type, "sifiveu_spl")) {
25 + part->has_guid = true;
26 + part->guid = GUID_PARTITION_SIFIVE_SPL;
27 + return true;
28 + }
29 +
30 + if (!strcmp(type, "sifiveu_uboot")) {
31 + part->has_guid = true;
32 + part->guid = GUID_PARTITION_SIFIVE_UBOOT;
33 + return true;
34 + }
35 +
36 return false;
37 }
38