aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-01-18 08:22:29 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-01-18 08:22:29 +0000
commit1bd15f9bf53ce00e9a93974b52b79b29679f1ace (patch)
tree6d52523df6f907839b295d23d131b02a6d99e975
parent0ad1035bcda7c1cd238d8593c85d0e5bda025b4b (diff)
parent3e3800f0dc7f1ac58047c803d8d09aa91fcb4a54 (diff)
downloadOpenPlatformPkg-1bd15f9bf53ce00e9a93974b52b79b29679f1ace.tar.gz
Snap for 4551672 from 3e3800f0dc7f1ac58047c803d8d09aa91fcb4a54 to pi-release
Change-Id: I7510390abbc366c3998d57e38ac79be073edcd2e
-rw-r--r--Drivers/SdMmc/DwMmcHcDxe/DwMmcHci.c2
-rw-r--r--Drivers/SdMmc/DwMmcHcDxe/EmmcDevice.c2
-rw-r--r--Platforms/Hisilicon/HiKey/HiKey.dsc6
-rw-r--r--Platforms/Hisilicon/HiKey/HiKeyFastbootDxe/HiKeyFastbootDxe.c36
-rw-r--r--Platforms/Hisilicon/HiKey960/HiKey960.dsc7
5 files changed, 44 insertions, 9 deletions
diff --git a/Drivers/SdMmc/DwMmcHcDxe/DwMmcHci.c b/Drivers/SdMmc/DwMmcHcDxe/DwMmcHci.c
index cf34e30..533f911 100644
--- a/Drivers/SdMmc/DwMmcHcDxe/DwMmcHci.c
+++ b/Drivers/SdMmc/DwMmcHcDxe/DwMmcHci.c
@@ -35,7 +35,7 @@ DumpCapabilityReg (
// Dump Capability Data
//
DEBUG ((DEBUG_INFO, " == Slot [%d] Capability is 0x%x ==\n", Slot, Capability));
- DEBUG ((DEBUG_INFO, " Base Clk Freq %dMHz\n", Capability->BaseClkFreq));
+ DEBUG ((DEBUG_INFO, " Base Clk Freq %dKHz\n", Capability->BaseClkFreq));
DEBUG ((DEBUG_INFO, " BusWidth %d\n", Capability->BusWidth));
DEBUG ((DEBUG_INFO, " HighSpeed Support %a\n", Capability->HighSpeed ? "TRUE" : "FALSE"));
DEBUG ((DEBUG_INFO, " Voltage 1.8 %a\n", Capability->Voltage18 ? "TRUE" : "FALSE"));
diff --git a/Drivers/SdMmc/DwMmcHcDxe/EmmcDevice.c b/Drivers/SdMmc/DwMmcHcDxe/EmmcDevice.c
index c84e7f7..deeaba9 100644
--- a/Drivers/SdMmc/DwMmcHcDxe/EmmcDevice.c
+++ b/Drivers/SdMmc/DwMmcHcDxe/EmmcDevice.c
@@ -967,7 +967,7 @@ EmmcIdentification (
return Status;
}
- Timeout = 30;
+ Timeout = 100;
do {
Ocr = EMMC_CMD1_CAPACITY_GREATER_THAN_2GB;
Status = EmmcGetOcr (PassThru, Slot, &Ocr);
diff --git a/Platforms/Hisilicon/HiKey/HiKey.dsc b/Platforms/Hisilicon/HiKey/HiKey.dsc
index 3b99cf5..28bc47d 100644
--- a/Platforms/Hisilicon/HiKey/HiKey.dsc
+++ b/Platforms/Hisilicon/HiKey/HiKey.dsc
@@ -131,7 +131,7 @@
[LibraryClasses.common.SEC]
PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
- LzmaDecompressLib|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
+ LzmaDecompressLib|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf
HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf
PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf
@@ -455,7 +455,9 @@
#
EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf {
<LibraryClasses>
+ AbootimgLib|EmbeddedPkg/Library/AbootimgLib/AbootimgLib.inf
BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf
+ ZLib|EmbeddedPkg/Library/ZLib/ZLib.inf
}
#
@@ -463,7 +465,9 @@
#
EmbeddedPkg/Application/AndroidBoot/AndroidBootApp.inf {
<LibraryClasses>
+ AbootimgLib|EmbeddedPkg/Library/AbootimgLib/AbootimgLib.inf
BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf
+ ZLib|EmbeddedPkg/Library/ZLib/ZLib.inf
}
#
diff --git a/Platforms/Hisilicon/HiKey/HiKeyFastbootDxe/HiKeyFastbootDxe.c b/Platforms/Hisilicon/HiKey/HiKeyFastbootDxe/HiKeyFastbootDxe.c
index 7e62ebb..a62c094 100644
--- a/Platforms/Hisilicon/HiKey/HiKeyFastbootDxe/HiKeyFastbootDxe.c
+++ b/Platforms/Hisilicon/HiKey/HiKeyFastbootDxe/HiKeyFastbootDxe.c
@@ -133,7 +133,7 @@ ReadPartitionEntries (
GptHeader->MyLBA != 1) {
DEBUG ((EFI_D_ERROR,
"Fastboot platform: No GPT on flash. "
- "Fastboot on Versatile Express does not support MBR.\n"
+ "Fastboot on HiKey does not support MBR.\n"
));
return EFI_DEVICE_ERROR;
}
@@ -280,8 +280,12 @@ HiKeyFlashPtable (
EFI_STATUS Status;
EFI_DISK_IO_PROTOCOL *DiskIo;
UINT32 MediaId;
+ VOID *Buffer;
+ UINT32 EntrySize, EntryOffset;
+ UINTN BlockSize;
MediaId = mFlashBlockIo->Media->MediaId;
+ BlockSize = mFlashBlockIo->Media->BlockSize;
Status = gBS->OpenProtocol (
mFlashHandle,
&gEfiDiskIoProtocolGuid,
@@ -293,9 +297,33 @@ HiKeyFlashPtable (
if (EFI_ERROR (Status)) {
return Status;
}
- Status = DiskIo->WriteDisk (DiskIo, MediaId, 0, Size, Image);
- if (EFI_ERROR (Status)) {
- return Status;
+ Buffer = Image;
+ if (AsciiStrnCmp (Buffer, "ENTRYHDR", 8) != 0) {
+ DEBUG ((EFI_D_ERROR, "It should be raw ptable image\n"));
+ Status = DiskIo->WriteDisk (DiskIo, MediaId, 0, Size, Image);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ } else {
+ /* ptable with entry header */
+ Buffer += 8;
+ if (AsciiStrnCmp (Buffer, "primary", 7) != 0) {
+ DEBUG ((EFI_D_ERROR, "unknown ptable imag\n"));
+ return EFI_UNSUPPORTED;
+ }
+ Buffer += 8;
+ EntryOffset = *(UINT32 *)Buffer * BlockSize;
+ Buffer += 4;
+ EntrySize = *(UINT32 *)Buffer * BlockSize;
+ if ((EntrySize + BlockSize) > Size) {
+ DEBUG ((DEBUG_ERROR, "Entry size doesn't match\n"));
+ return EFI_UNSUPPORTED;
+ }
+ Buffer = Image + BlockSize;
+ Status = DiskIo->WriteDisk (DiskIo, MediaId, EntryOffset, EntrySize, Buffer);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
}
FreePartitionList ();
Status = LoadPtable ();
diff --git a/Platforms/Hisilicon/HiKey960/HiKey960.dsc b/Platforms/Hisilicon/HiKey960/HiKey960.dsc
index 4f40969..bf02a29 100644
--- a/Platforms/Hisilicon/HiKey960/HiKey960.dsc
+++ b/Platforms/Hisilicon/HiKey960/HiKey960.dsc
@@ -62,7 +62,6 @@
CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
PlatformBdsLib|OpenPlatformPkg/Chips/Hisilicon/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
- AbootimgLib|EmbeddedPkg/Library/AbootimgLib/AbootimgLib.inf
FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
@@ -133,7 +132,6 @@
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
- LzmaDecompressLib|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf
HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf
PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf
@@ -142,6 +140,7 @@
MemoryInitPeiLib|ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.inf
ArmGicArchLib|ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf
DefaultExceptionHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLibBase.inf
+ LzmaDecompressLib|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
[LibraryClasses.common.DXE_CORE]
DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
@@ -501,7 +500,9 @@
#
EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf {
<LibraryClasses>
+ AbootimgLib|EmbeddedPkg/Library/AbootimgLib/AbootimgLib.inf
BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf
+ ZLib|EmbeddedPkg/Library/ZLib/ZLib.inf
}
#
@@ -509,7 +510,9 @@
#
EmbeddedPkg/Application/AndroidBoot/AndroidBootApp.inf {
<LibraryClasses>
+ AbootimgLib|EmbeddedPkg/Library/AbootimgLib/AbootimgLib.inf
BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf
+ ZLib|EmbeddedPkg/Library/ZLib/ZLib.inf
}
#