diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2016-08-25 21:52:17 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-08-25 21:52:17 +0000 |
commit | 6e1dee2899894d55d6fc8791bcada85cdf6a5215 (patch) | |
tree | 538058f0657edb8343444b5a179ff604db33e7a5 | |
parent | 698f96bb000de7db9989ca42a5076d4bc2058117 (diff) | |
parent | 261537f6ca45cd119a820086a50f204f0a62685a (diff) | |
download | OpenPlatformPkg-6e1dee2899894d55d6fc8791bcada85cdf6a5215.tar.gz |
Merge remote-tracking branch 'aosp/upstream-hikey-aosp' into opp am: 15efc9efd6
am: 261537f6ca
Change-Id: I7982ca5c7bf272aad8992a6d3efa9b62f4ccc749
-rw-r--r-- | Platforms/Hisilicon/HiKey/HiKeyFastbootDxe/HiKeyFastboot.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Platforms/Hisilicon/HiKey/HiKeyFastbootDxe/HiKeyFastboot.c b/Platforms/Hisilicon/HiKey/HiKeyFastbootDxe/HiKeyFastboot.c index 7dafa19..d4176fe 100644 --- a/Platforms/Hisilicon/HiKey/HiKeyFastbootDxe/HiKeyFastboot.c +++ b/Platforms/Hisilicon/HiKey/HiKeyFastbootDxe/HiKeyFastboot.c @@ -363,6 +363,7 @@ HiKeyFastbootPlatformFlashPartition ( CHUNK_HEADER *ChunkHeader;
UINTN Offset = 0;
UINT32 Chunk, EntrySize, EntryOffset;
+ UINT32 *FillVal, TmpCount, FillBuf[1024];
VOID *Buffer;
@@ -469,6 +470,27 @@ HiKeyFastbootPlatformFlashPartition ( }
Image+=WriteSize;
break;
+ case CHUNK_TYPE_FILL:
+ //Assume fillVal is 0, and we can skip here
+ FillVal = (UINT32 *)Image;
+ Image += sizeof(UINT32);
+ if (*FillVal != 0){
+ mTextOut->OutputString(mTextOut, OutputString);
+ for(TmpCount = 0; TmpCount < 1024; TmpCount++){
+ FillBuf[TmpCount] = *FillVal;
+ }
+ for (TmpCount= 0; TmpCount < WriteSize; TmpCount += sizeof(FillBuf)) {
+ if ((WriteSize - TmpCount) < sizeof(FillBuf)) {
+ Status = DiskIo->WriteDisk (DiskIo, MediaId, Offset + TmpCount, WriteSize - TmpCount, FillBuf);
+ } else {
+ Status = DiskIo->WriteDisk (DiskIo, MediaId, Offset + TmpCount, sizeof(FillBuf), FillBuf);
+ }
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ }
+ }
+ break;
case CHUNK_TYPE_DONT_CARE:
break;
case CHUNK_TYPE_CRC32:
@@ -630,11 +652,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;
|