summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2016-08-05 21:03:38 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-08-05 21:03:38 +0000
commit1c00e86dadcfa4224ed998fe4c39662024bbe8bd (patch)
treec3570d57a17dfaeeadecbe1e552c05fdd7f15815
parent76c7cfcc22c7448638acb6f904088b2ff3f79f63 (diff)
parentd80917caaa4c0aeae471e7756b8971d84d3c4b4d (diff)
downloaddevice_linaro_bootloader_edk2-1c00e86dadcfa4224ed998fe4c39662024bbe8bd.tar.gz
device_linaro_bootloader_edk2-1c00e86dadcfa4224ed998fe4c39662024bbe8bd.tar.bz2
device_linaro_bootloader_edk2-1c00e86dadcfa4224ed998fe4c39662024bbe8bd.zip
Merge remote-tracking branch 'aosp/upstream-hikey-aosp' into edk2 am: b96baa8ce5 am: 03160a967c am: 9057be634c
am: d80917caaa Change-Id: I7d08bc440c53e920fe7c93f59dd55b5ca4738331
-rw-r--r--ArmPkg/Library/BdsLib/BdsFilePath.c20
-rw-r--r--ArmPkg/Library/BdsLib/BdsLib.inf2
-rw-r--r--IntelFspPkg/License.txt25
-rw-r--r--IntelFspWrapperPkg/License.txt25
4 files changed, 72 insertions, 0 deletions
diff --git a/ArmPkg/Library/BdsLib/BdsFilePath.c b/ArmPkg/Library/BdsLib/BdsFilePath.c
index f0120a613..b79ee78e4 100644
--- a/ArmPkg/Library/BdsLib/BdsFilePath.c
+++ b/ArmPkg/Library/BdsLib/BdsFilePath.c
@@ -1367,6 +1367,8 @@ STATIC LoadAndroidBootImg (
ANDROID_BOOTIMG_HEADER *Header;
CHAR16 KernelArgs[BOOTIMG_KERNEL_ARGS_SIZE];
CHAR16 InitrdArgs[64];
+ UINTN VariableSize, Length;
+ CHAR16 SerialNoArgs[40], DataUnicode[17];
Header = (ANDROID_BOOTIMG_HEADER *) Buffer;
@@ -1423,6 +1425,22 @@ STATIC LoadAndroidBootImg (
UnicodeSPrint (InitrdArgs, 64 * sizeof(CHAR16), L" initrd=0x%x,0x%x",
Header->RamdiskAddress, Header->RamdiskSize);
StrCat (KernelArgs, InitrdArgs);
+ VariableSize = 16 * sizeof (CHAR16);
+ Status = gRT->GetVariable (
+ (CHAR16 *)L"SerialNo",
+ &gHiKeyVariableGuid,
+ NULL,
+ &VariableSize,
+ &DataUnicode
+ );
+ if (EFI_ERROR (Status)) {
+ goto out;
+ }
+ Length = StrLen (DataUnicode);
+ DataUnicode[Length] = '\0';
+ ZeroMem (SerialNoArgs, 40 * sizeof (CHAR16));
+ UnicodeSPrint (SerialNoArgs, 40 * sizeof(CHAR16), L" androidboot.serialno=%s", DataUnicode);
+ StrCat (KernelArgs, SerialNoArgs);
ASSERT (StrSize (KernelArgs) <= BOOTIMG_KERNEL_ARGS_SIZE);
if (gArgs != NULL) {
CopyMem ((VOID *)gArgs,
@@ -1435,6 +1453,8 @@ STATIC LoadAndroidBootImg (
*Image = KernelBase;
*ImageSize = Header->KernelSize;
return EFI_SUCCESS;
+out:
+ return Status;
}
BOOLEAN
diff --git a/ArmPkg/Library/BdsLib/BdsLib.inf b/ArmPkg/Library/BdsLib/BdsLib.inf
index 116d56f0d..0574dca49 100644
--- a/ArmPkg/Library/BdsLib/BdsLib.inf
+++ b/ArmPkg/Library/BdsLib/BdsLib.inf
@@ -32,6 +32,7 @@
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
+ OpenPlatformPkg/Platforms/Hisilicon/HiKey/HiKey.dec
[LibraryClasses]
ArmLib
@@ -45,6 +46,7 @@
[Guids]
gEfiFileInfoGuid
gFdtTableGuid
+ gHiKeyVariableGuid
[Protocols]
gEfiBdsArchProtocolGuid
diff --git a/IntelFspPkg/License.txt b/IntelFspPkg/License.txt
new file mode 100644
index 000000000..87ae665ed
--- /dev/null
+++ b/IntelFspPkg/License.txt
@@ -0,0 +1,25 @@
+Copyright (c) 2016, Intel Corporation. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/IntelFspWrapperPkg/License.txt b/IntelFspWrapperPkg/License.txt
new file mode 100644
index 000000000..87ae665ed
--- /dev/null
+++ b/IntelFspWrapperPkg/License.txt
@@ -0,0 +1,25 @@
+Copyright (c) 2016, Intel Corporation. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.