001-add-sifiveu-guid-types.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. +#define GUID_PARTITION_SIFIVE_SPL \
  8. + GUID_INIT( 0x5b193300, 0xfc78, 0x40cd, \
  9. + 0x80, 0x02, 0xe8, 0x6c, 0x45, 0x58, 0x0b, 0x47)
  10. +
  11. +#define GUID_PARTITION_SIFIVE_UBOOT \
  12. + GUID_INIT( 0x2e54b353, 0x1271, 0x4842, \
  13. + 0x80, 0x6f, 0xe4, 0x36, 0xd6, 0xaf, 0x69, 0x85)
  14. +
  15. #define GPT_HEADER_SIZE 92
  16. #define GPT_ENTRY_SIZE 128
  17. #define GPT_ENTRY_MAX 128
  18. @@ -276,6 +284,19 @@
  19. (1ULL << 56); /* success=1 */
  20. return true;
  21. }
  22. +
  23. + if (!strcmp(type, "sifiveu_spl")) {
  24. + part->has_guid = true;
  25. + part->guid = GUID_PARTITION_SIFIVE_SPL;
  26. + return true;
  27. + }
  28. +
  29. + if (!strcmp(type, "sifiveu_uboot")) {
  30. + part->has_guid = true;
  31. + part->guid = GUID_PARTITION_SIFIVE_UBOOT;
  32. + return true;
  33. + }
  34. +
  35. return false;
  36. }