Skip to content

Commit

Permalink
Merge pull request #34 from hzhuang1/get_sn
Browse files Browse the repository at this point in the history
hikey: Add 'fastboot getvar serialno' support
  • Loading branch information
hzhuang1 authored Aug 25, 2016
2 parents 8db281a + 2a872ce commit 39add71
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Platforms/Hisilicon/HiKey/HiKeyFastbootDxe/HiKeyFastboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,11 +630,28 @@ HiKeyFastbootPlatformGetVar (
FASTBOOT_PARTITION_LIST *Entry;
CHAR16 PartitionNameUnicode[60];
BOOLEAN PartitionFound;
CHAR16 DataUnicode[17];
UINTN VariableSize;

if (!AsciiStrCmp (Name, "max-download-size")) {
AsciiStrCpy (Value, FixedPcdGetPtr (PcdArmFastbootFlashLimit));
} else if (!AsciiStrCmp (Name, "product")) {
AsciiStrCpy (Value, FixedPcdGetPtr (PcdFirmwareVendor));
} else if (!AsciiStrCmp (Name, "serialno")) {
VariableSize = 17 * sizeof (CHAR16);
Status = gRT->GetVariable (
(CHAR16 *)L"SerialNo",
&gHiKeyVariableGuid,
NULL,
&VariableSize,
&DataUnicode
);
if (EFI_ERROR (Status)) {
*Value = '\0';
return EFI_NOT_FOUND;
}
DataUnicode[(VariableSize / sizeof(CHAR16)) - 1] = '\0';
UnicodeStrToAsciiStr (DataUnicode, Value);
} else if ( !AsciiStrnCmp (Name, "partition-size", 14)) {
AsciiStrToUnicodeStr ((Name + 15), PartitionNameUnicode);
PartitionFound = FALSE;
Expand Down

0 comments on commit 39add71

Please sign in to comment.