QcomModulePkg: allow retrieving oem partition guid
"oem" is a partition where device specific values are stored,
such as "serial number", "hardware revision", ...
This change allows retrieving the partition guid of "oem",
which will be used in future changes.
Change-Id: Ic0b70a312d22cc0eaaf4eaad50c2997de45a6e7d
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
diff --git a/QcomModulePkg/Include/Library/LinuxLoaderLib.h b/QcomModulePkg/Include/Library/LinuxLoaderLib.h
index 1e34256..8690405 100644
--- a/QcomModulePkg/Include/Library/LinuxLoaderLib.h
+++ b/QcomModulePkg/Include/Library/LinuxLoaderLib.h
@@ -145,6 +145,9 @@
ReadWriteDeviceInfo (vb_device_state_op_t Mode, void *DevInfo, UINT32 Sz);
EFI_STATUS
+GetNandOemPartiGuid (EFI_GUID *Ptype);
+
+EFI_STATUS
GetNandMiscPartiGuid (EFI_GUID *Ptype);
/**
Returns a list of BlkIo handles based on required criteria
diff --git a/QcomModulePkg/Library/BootLib/BootLib.inf b/QcomModulePkg/Library/BootLib/BootLib.inf
index 317b40b..6f09d07 100755
--- a/QcomModulePkg/Library/BootLib/BootLib.inf
+++ b/QcomModulePkg/Library/BootLib/BootLib.inf
@@ -111,6 +111,7 @@
gEfiLogFSPartitionGuid
gEfiNandUserPartitionGuid
gEfiMiscPartitionGuid
+ gEfiOemPartitionGuid
gEfiRNGAlgRawGuid
gEfiUfsLU0Guid
gEfiUfsLU1Guid
diff --git a/QcomModulePkg/Library/BootLib/LinuxLoaderLib.c b/QcomModulePkg/Library/BootLib/LinuxLoaderLib.c
index 5d77f34..9159434 100644
--- a/QcomModulePkg/Library/BootLib/LinuxLoaderLib.c
+++ b/QcomModulePkg/Library/BootLib/LinuxLoaderLib.c
@@ -568,6 +568,30 @@
}
EFI_STATUS
+GetNandOemPartiGuid (EFI_GUID *Ptype)
+{
+ EFI_STATUS Status = EFI_INVALID_PARAMETER;
+ EFI_NAND_PARTI_GUID_PROTOCOL *NandPartiGuid;
+
+ Status = gBS->LocateProtocol (&gEfiNandPartiGuidProtocolGuid, NULL,
+ (VOID **)&NandPartiGuid);
+ if (Status != EFI_SUCCESS) {
+ DEBUG ((EFI_D_ERROR, "Unable to locate NandPartiGuid protocol: %r.debug_x\n",
+ Status));
+ return Status;
+ }
+
+ Status = NandPartiGuid->GenGuid (NandPartiGuid, (CONST CHAR16 *)L"oem",
+ StrLen ((CONST CHAR16 *)L"oem"), Ptype);
+ if (Status != EFI_SUCCESS) {
+ DEBUG ((EFI_D_ERROR, "NandPartiGuid GenGuid failed with: %r\n", Status));
+ return Status;
+ }
+
+ return Status;
+}
+
+EFI_STATUS
GetNandMiscPartiGuid (EFI_GUID *Ptype)
{
EFI_STATUS Status = EFI_INVALID_PARAMETER;
diff --git a/QcomModulePkg/QcomModulePkg.dec b/QcomModulePkg/QcomModulePkg.dec
index 78460c5..d9c3c41 100644
--- a/QcomModulePkg/QcomModulePkg.dec
+++ b/QcomModulePkg/QcomModulePkg.dec
@@ -87,6 +87,7 @@
gEfiMdtpPartitionGuid = { 0x3878408A, 0xE263, 0x4B67, { 0xB8, 0x78, 0x63, 0x40, 0xB3, 0x5B, 0x11, 0xE3 } }
gBlockIoRefreshGuid = { 0xb1eb3d10, 0x9d67, 0x40ca, { 0x95, 0x59, 0xf1, 0x48, 0x8b, 0x1b, 0x2d, 0xdb } }
gEfiRNGAlgRawGuid = { 0xe43176d7, 0xb6e8, 0x4827, { 0xb7, 0x84, 0x7f, 0xfd, 0xc4, 0xb6, 0x85, 0x61 } }
+ gEfiOemPartitionGuid = { 0x2EF88D0E, 0x0B34, 0xB6D1, { 0x52, 0x08, 0xC5, 0x59, 0x83, 0x86, 0xD1, 0xDF } }
[Protocols]
# SCM