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