summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-12-08edk2: QcomModulePkg: Calculate image offsets based on Header Versiondb845cPrakruthi Deepak Heragu
[Cherry-picked from https://source.codeaurora.org/quic/la/abl/tianocore/edk2/commit/?id=221dc1de0c97e4eb91262e67539908fb0b0f14e3] When we disable avb feature, calculate the size of the data needed to be read from the flash completely. Add suport to read the dtb.img which is present at the end of the boot image in case of the header version 2. This change is needed because up until header version 2, dtbs were appended to the kernel and in kernel size, dtbs were included. Change-Id: Iad055672e473951fc92c4138c98555e67875aeb0 Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2019-11-27QcomModulePkg: BootLib: set DTB best match explicitlyAmit Pundir
GetSocDtb() match and load the best DTB in dtb.img. This match is done based on non-upstream DT properties i.e. qcom,{msm-id/board-id/pmic-id}, which are not supported on db845c. Since we do not support multiple DTBs in dtb.img anyway, we set the current (and only available dtb in dtb.img) as the best match explicitly. Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2019-11-27QcomModulePkg: BootLib: skip dtbo image loadingAmit Pundir
Skip loading dtb overlay image from dtbo partition because there isn't any. In case of missing dtbo image, DTBImgCheckAndAppendDT assumes that we are booting with appended dtb (Image.gz-dtb) format and fail to load dtb from boot.img (boot image header v2 format). So we fix that by loading dtb from boot.img explicitly in case of missing DTBO image. Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2019-11-27QcomModulePkg: Fastboot: Add extend Fastboot menu to UART interfaceJohn Stultz
We can already somewhat control the fastboot menu over the serial UART, as up and down changes action mode. However, there's no way to select the mode over the UART. So add some feedback over the UART as to the current mode and use SCAN_RIGHT as the selection option (equivalent to the power button). Signed-off-by: John Stultz <john.stultz@linaro.org> [AmitP: It is equivalent of using VOL+ (up), VOL- (down) and POWER keys on db845c to scroll thru or select fastboot options displayed over HDMI display.] Tested-by: Amit Pundir <amit.pundir@linaro.org> Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
2019-11-27QcomModulePkg: LinuxLoader: Add explicit message on serial line as to boot ↵John Stultz
mode keys Pressing <DOWN> over serial UART console will force the loader to enter fastboot mode, and similarly with <UP> and <ESC>, so lets make these helpful keys more discoverable with an explicit message on the serial line. Signed-off-by: John Stultz <john.stultz@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Tested-by: Amit Pundir <amit.pundir@linaro.org> Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
2019-11-27QcomModulePkg: BootLib: skip ValidateSlotGuids()Nicolas Dechesne
When using community builds, we want to depend as less as possible on Qualcomm internal builds quirks. This function does a few checks which are relevant when booting a Qualcomm Android image, but not well suited for community builds. For example users might choose to remove system_x partition, in which case the bootloader wouldn't boot anymore. Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
2019-11-27BaseTools/header.makefile: add "-Wno-stringop-truncation"Laszlo Ersek
gcc-8 (which is part of Fedora 28) enables the new warning "-Wstringop-truncation" in "-Wall". This warning is documented in detail at <https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html>; the introduction says > Warn for calls to bounded string manipulation functions such as strncat, > strncpy, and stpncpy that may either truncate the copied string or leave > the destination unchanged. It breaks the BaseTools build with: > EfiUtilityMsgs.c: In function 'PrintMessage': > EfiUtilityMsgs.c:484:9: error: 'strncat' output may be truncated copying > between 0 and 511 bytes from a string of length 511 > [-Werror=stringop-truncation] > strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > EfiUtilityMsgs.c:469:9: error: 'strncat' output may be truncated copying > between 0 and 511 bytes from a string of length 511 > [-Werror=stringop-truncation] > strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > EfiUtilityMsgs.c:511:5: error: 'strncat' output may be truncated copying > between 0 and 511 bytes from a string of length 511 > [-Werror=stringop-truncation] > strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The right way to fix the warning would be to implement string concat with snprintf(). However, Microsoft does not appear to support snprintf() before VS2015 <https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010>, so we just have to shut up the warning. The strncat() calls flagged above are valid BTW. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Cole Robinson <crobinso@redhat.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit 1d212a83df0eaf32a6f5d4159beb2d77832e0231)
2019-11-27MdePkg/BaseLib: do not rely on undefined behavior in arithmetic shiftArd Biesheuvel
The runtime test whether the compiler supports arithmetic shift of negative signed numbers currently relies on undefined behavior in C, which means that all bets are off regarding whether the condition that follows passes or fails, regardless of whether the compiler in fact supports arithmetic shift or not. Relevant quote from ISO C99 (6.5.7/4) The result of E1 << E2 is E1 left-shifted E2 bit positions; vacated bits are filled with zeros. If E1 has an unsigned type, the value of the result is E1 × 2^E2, reduced modulo one more than the maximum value representable in the result type. If E1 has a signed type and nonnegative value, and E1 × 2^E2 is representable in the result type, then that is the resulting value; otherwise, the behavior is undefined. For historic purposes, let's keep the test in place (although it is doubtful we actually need it) but rewrite it in a way that prevents compilers from this century from doing whacky things with it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19580 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit b331b99fae1298232cc4ab1e4bfedf79935fe2e6)
2019-11-27QcomModulePkg: Pass KeymasterLoadState to kernel if secure boot is enabledZhenlin Lian
Change-Id: I74cda7c0dbb679631e923caaf11f2a7bf421ef98
2019-10-10Merge 84a07bbd2f7e0d5c7b906a74b006c17cf05f931c on remote branchLinux Build Service Account
Change-Id: I7427f32b145162f16b9bae11bc51f1a56f1933aa
2019-09-02Merge 80152fde1a8a62c4a94a1272f8f164a9d98f4730 on remote branchLinux Build Service Account
Change-Id: I463bbf4c7bbeb0b2c8c35baee29d3ab712096255
2019-08-26Fix the identification of vbmeta partitionxu yiping
After dynamic partition, vbmeta_system and vbemta_vendor partitions are added. Therefore, partitions with 'vbmeta' prefix should be treated as vbmeta partition. This makes libavb avoid locating avb footer from the end of vbmeta_* partitions. And will not emit the following error message, which could be confusing even if the following read of vbmeta succeeds from the beginning of the partition. Run the following test case will show different results after this change. $ ./out/host/linux-x86/nativetest64/libavb_host_unittest/libavb_host_unittest --gtest_filter=AvbSlotVerifyTest.HashDescriptorInOtherVBMetaPartition Before this change ------------------------------------------------------------------------------- [ RUN ] AvbSlotVerifyTest.HashDescriptorInOtherVBMetaPartition avb_slot_verify.c:678: DEBUG: Loading vbmeta struct from partition 'vbmeta'. avb_footer.c:41: ERROR: Footer magic is incorrect. avb_slot_verify.c:650: DEBUG: vbmeta_google: No footer detected. avb_slot_verify.c:678: DEBUG: Loading vbmeta struct from partition 'vbmeta_google'. [ OK ] AvbSlotVerifyTest.HashDescriptorInOtherVBMetaPartition (960 ms) After this change ------------------------------------------------------------------------------- [ RUN ] AvbSlotVerifyTest.HashDescriptorInOtherVBMetaPartition avb_slot_verify.c:683: DEBUG: Loading vbmeta struct from partition 'vbmeta'. avb_slot_verify.c:683: DEBUG: Loading vbmeta struct from partition 'vbmeta_google'. [ OK ] AvbSlotVerifyTest.HashDescriptorInOtherVBMetaPartition (961ms) Bug: b/134989217 Test: device launch, verify vbmeta, vbmeta_system, vbmeta_vendor. Test: m libavb_host_unittest -j8 && \ ./out/host/linux-x86/nativetest64/libavb_host_unittest/libavb_host_unittest Change-Id: Ib0c2cd56197508fef8c12985e8cc0cd79469556c
2019-08-15Merge "bootloader:edk2: Do not clean abl objects in incremental builds"qctecmdr
2019-08-06Merge "avb: Fix antirollback check for non HLOS images"qctecmdr
2019-08-02bootloader:edk2: Do not clean abl objects in incremental buildsTengfei Fan
abl objects are completely removed/cleaned for every compilation. Do no clean abl compiled objects as it increases the time for incremental build with or without any changes. Change-Id: I3416c2d491ac8b5f1cbc6709fd2a6a7f8f8d57b4
2019-07-30QcomModulePkg: Add getvar variable for parallel-download-flashJeevan Shriram
Add getvar variable to query the status of the parallel download flash in the fastboot mode. Change-Id: If4082474cee4444574c233ca1d7f6931b8af9084
2019-07-08avb: Fix antirollback check for non HLOS imagesGaurav Kashyap
Fix the check for Update Rollback syscall returned from TZ. Change-Id: I2ed86277b2f150a569c4425f65cacc756470f77d
2019-07-01Merge "QcomModulePkg: avb: Fix AvbSlotVerifyData->cmdline might be NULL"qctecmdr
2019-07-01Merge "QcomModulePkg: Add NOTICE file"qctecmdr
2019-06-28Merge "QcomModulePkg: Add max row check when chosening font scale factor"qctecmdr
2019-06-25Merge "QcomModulePkg: Return pointer instead of structure in ↵qctecmdr
GetFastbootDeviceData"
2019-06-26QcomModulePkg: Add max row check when chosening font scale factorlijuang
Add max row check when chosening the font scale factor. Base on the max support row and the character number per line to chosen the best font scale factor. Change-Id: I261782574826cf487c0bdbeb66bd6364f8793c3b
2019-06-20QcomModulePkg: Add NOTICE fileAnilKumar Chimata
Add NOTICE files to add license's as the code is taken from other repository and adding to bootloader code. Change-Id: If5e755b279af5a929e64a57d4f28c927a4fc18d4
2019-06-18QcomModulePkg: avb: Fix AvbSlotVerifyData->cmdline might be NULLBowgo Tsai
When AVB_VBMETA_IMAGE_FLAGS_VERIFICATION_DISABLED is set, AvbSlotVerifyData->cmdline should be a NUL-terminated string instead of NULL. Bug: 119551429 Test: atest libavb_host_unittest Git-repo: https://source.codeaurora.org/quic/la/platform/external/avb Git-Commit: 9ba3b6613b4e5130fa01a11d984c6b5f0eb3af05 Change-Id: If9cc5feb4f59b0f6b73b577fbff84bb34e514304
2019-06-18QcomModulePkg: avb: Allow system partition to be absentBowgo Tsai
On devices with dynamic partitions, 'system' partition might not exist. Therefore, we should not add root=$(ANDROID_SYSTEM_PARTUUID) in kernel cmdline and resolve it for devices without system partition. Bug: 119551429 Test: m libavb_host_unittest && ../../out/host/linux-x86/nativetest64/libavb_host_unittest/libavb_host_unittest Git-repo: https://source.codeaurora.org/quic/la/platform/external/avb Git-Commit: 5abd6bc2578968d24406d834471adfd995a0c2e9 Change-Id: I767fb1b18182663d8401cf0e8d19930d45c4b83a
2019-06-04Merge "QcomModulePkg : Update the CPU's information to support partial bins"qctecmdr
2019-06-03Merge "QcomModulePkg: Correct the Lun info for eMMC device"qctecmdr
2019-06-03QcomModulePkg : Update the CPU's information to support partial binsSaranya Chidura
Set the number of CPUs present in the target. Change-Id: I4640dddee68d90f298c836b86f9d6f2cfca15b71 Signed-off-by: Saranya Chidura <schidura@codeaurora.org>
2019-06-03EmbeddedPkg: Fixed markings issuelijuang
Fixed markings issue Change-Id: I71157ccc5d34251c577e08876b6e9ce062edb08d
2019-05-31QcomModulePkg: Correct the Lun info for eMMC devicelijuang
For eMMC device, it will be treated as UFS device if the parameter is got from PC is not correct that will cause the GPT partition update fail. Change-Id: I8b2d0757be2646b2e0c8611efb9aae28b33a9e03
2019-05-29Merge "QcomModulePkg : Update Partial bins nodes"qctecmdr
2019-05-29Merge "EmbeddedPkg: Add optimization levels in FdtLib and LibUfdt"qctecmdr
2019-05-29Merge "QcomModulePkg : Update chip info header files"qctecmdr
2019-05-29QcomModulePkg : Update Partial bins nodesParth Dixit
Add new nodes device tree nodes to the table. Change-Id: I2d7ce33957a2220388cdc0e16b3b7f9732a8aa68
2019-05-29QcomModulePkg : Update Partial bins supportParth Dixit
Move updating of partial nodes inside update device tree. Search for nodes only if it is defective. Add support for adding a property to disable defective node. Change-Id: Ic9a7d5c6bb43395a2739aebb2259bcdff5db4acf
2019-05-21EmbeddedPkg: Add optimization levels in FdtLib and LibUfdtlijuang
There are many recursive functions in FdtLib and LibUfdt, if the stack size of abl is too small, it maybe cause the thread pointer corrupted. Change-Id: Iee5c9774df453c66f44bb465566100fdb1c04e3a
2019-05-20QcomModulePkg : Update chip info header filesParth Dixit
Update chip info header files to be in sync with uefi. Change-Id: I77fa41df35d92e23567eb820c68288dd66c87a04
2019-05-10Merge "QcomModulePkg : Fix getddrinfo function"qctecmdr
2019-05-10Merge "edk2: QcomModulePkg: Support new Header Version 2 of the bootimage"qctecmdr
2019-05-10edk2: QcomModulePkg: Support new Header Version 2 of the bootimagePrakruthi Deepak Heragu
Bootimage header version v2 changes the way dtb's are appended. Boot image with header version v2 will not have kernel Image appended dtb but it is added to boot.img at an offset. It requires a new version to maintain backward compatibility of images. Change-Id: I8be2f4fe881180eaf7e60f998ed389a72f3a3b1c
2019-05-10QcomModulePkg: Removing extra space character while appending DtboIdxPrakruthi Deepak Heragu
Removing an extra space in the string which adds DtboIdx to the CmdLine Change-Id: I9e38aa8b6cfbe1ba118a4e8e095bda00040b7ec9
2019-05-09QcomModulePkg : Fix getddrinfo functionParth Dixit
In getddrinfo function ddr type is getting updated even after call has failed. This is unnecessary remove it. Change-Id: I06ef8d1d1aec247b57b6a9cefcb9c4cccb9672cf
2019-05-09QcomModulePkg : Move querying for granule size before querying dtParth Dixit
Right now memory node for granule is queried before querying the hardware. This is not required if hardware doesn't supports it and is expensive operation. Move it so that it is queried only if hardware support is present. Change-Id: I02cf31f2894f1609a6a23f4b652d76859bc339ad
2019-05-08Merge "avb: Include date in boot security patch"qctecmdr
2019-04-30Merge "Add support for updating rollback version"qctecmdr
2019-04-25Merge "QcomModulePkg: Update CmdLine to handle Squash FS"qctecmdr
2019-04-25avb: Include date in boot security patchMonika Singh
Read the value of boot security patch containing date information, from the property com.android. build.boot.security_patch in vbmeta data and send it to keymaster TA. This new patch value contains date information as well. If the property is not defined or keymaster TA is not updated, send the security patch value read from boot image header as before. Change-Id: I82e0894a178927e9fa2f884896fbaf14724e4f13
2019-04-23Add support for updating rollback versionGaurav Kashyap
Update rollback version using new TZ syscall when one of the slots has a higher image version. Change-Id: I0cff3771f932e4af7d965501fbd25eb7b91a308f
2019-04-22QcomModulePkg: Return pointer instead of structure in GetFastbootDeviceDatajianzhou
There is stack smashing issue when return the whole structure in GetFastbootDeviceData. Return pointer instead of the whole structure to make compiler easy refer to stack usage. Change-Id: Ia4893e8b2a712fa340afdc85772876a390f2e3dd
2019-04-16QcomModulePkg: Disable fstab node for dynamic partition support.Mayank Grover
To support dynamic partition, disable firmware entries in fstab nodes. Partitions will be mounted as part of super partition. Change-Id: Iffc22005c2b7d8b64bf10687049a720bd891b59c