summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg
Commit message (Collapse)AuthorAgeFilesLines
* EmbeddedPkg/RealTimeClockRuntimeDxe: depend on gEfiVariableArchProtocolGuidNhi Pham2021-01-101-1/+1
| | | | | | | | | | | | | | The EfiGetVariable() is used in the entry of this module. So, the variable services are required to be ready before they are used. This patch adds the arch protocol gEfiVariableArchProtocolGuid to dependency expression to guarantee that this module will be started once the variable protocol is available. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg: add TimeBaseLib resolution to EmbeddedPkg.dscLeif Lindholm2021-01-081-0/+2
| | | | | | | | | | | | | | Commit 55ee36b0c490 ("EmbeddedPkg/RealTimeClockRuntimeDxe: Use helper functions from TimeBaseLib") added a TimeBaseLib dependency to RealTimeClockRuntimeDxe, which now breaks build of EmbeddedPkg.dsc. Add a resolution for EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Nhi Pham <nhi@os.amperecomputing.com> Signed-off-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
* EmbeddedPkg/PrePiMemoryAllocationLib: use correct size for pool hobArd Biesheuvel2021-01-081-1/+3
| | | | | | | | | Use the correct type in the sizeof() expression to calculate the size of the newly allocated EFI_HOB_MEMORY_POOL hob. Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3139 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg/RealTimeClockRuntimeDxe: Use helper functions from TimeBaseLibNhi Pham2021-01-072-86/+4
| | | | | | | | | | This patch replaces all time checking functions and leverage the helper functions in TimeBaseLib library. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg/TimeBaseLib: Add function to check Timezone and DaylightNhi Pham2021-01-072-2/+83
| | | | | | | | | | | | This adds two functions IsValidTimeZone() and IsValidDaylight() to check the time zone and daylight value from EFI time. These functions are retrieved from the RealTimeClockRuntimeDxe module as they reduce duplicated code in RTC modules. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg/TimeBaseLib: Fix for minor code formattingNhi Pham2021-01-071-12/+11
| | | | | | | | | There is no functional modification in this change. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg/TimeBaseLib: Update comment blocks for API functionsNhi Pham2021-01-072-14/+104
| | | | | | | | | This updates Doxygen comment blocks for API library functions. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg/TimeBaseLib: remove useless truncation to 32-bitLaszlo Ersek2020-12-212-4/+4
| | | | | | | | | | | | | | | | | | | EfiTimeToEpoch() calls EfiGetEpochDays() internally, which (reasonably) returns a UINTN. But then EfiTimeToEpoch() truncates the EfiGetEpochDays() retval to UINT32 for no good reason, effectively restricting Time->Year under 2106. This truncation was pointed out with a valid warning (= build error) by VS2019. Allow EfiTimeToEpoch() to return / propagate a UINTN value. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20201221113657.6779-3-lersek@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
* EmbeddedPkg/VirtualRealTimeClockLib: Explicit cast to UINT32Pete Batard2020-10-221-2/+2
| | | | | | | | | | | | | | | | | Addresses BZ https://bugzilla.tianocore.org/show_bug.cgi?id=2380 where explicit casts are required for 64 to 32 bit assignment. We can apply a straight cast for Time->Nanosecond since we already checked for overflow. On the other hand, we may have a frequency that is greater than UINT32_MAX for Capabilities->Resolution. But using the frequency for the resolution is the wrong approach anyway, since we can't actually vouch for the actual resolution of the virtual library. Instead, play it safe by defaulting to 1 Hz, which is what a standard PC-AT CMOS RTC device would use. Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
* EmbeddedPkg/TimeBaseLib: remove the SEC_PER_MONTH, SEC_PER_YEAR macrosLaszlo Ersek2020-09-081-2/+0
| | | | | | | | | | | | | | | | | | The SEC_PER_MONTH and SEC_PER_YEAR macros are wrong: they both evaluate to 0 (of type "int"). They are also unused (they could never be used for division, for example); so remove them. The macros were originally introduced in commit 0f4386e775c7 ("ArmPlatformPkg/PL031RealTimeClockLib: Implement PL031 RTC drive", 2011-06-11). Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Reported-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20200904154541.23340-1-lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg/libfdt: Add strncmp macro to use AsciiStrnCmpAbner Chang2020-08-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For the implementation which utilizes libfdt provided in EmbeddedPkg however it uses strncmp function in the libfdt helper library, libfdt_env.h should provide the macro implied with edk2 strncmp implementation. The example is RISC-V OpenSBI library. edk2 RISC-V port uses OpenSBI library and incorporate with edk2 libfdt. edk2 libfdt_env.h provides the necessary macros to build OpenSBI which uses fdt functions in edk2 environment. However, OpenSBI also has libfdt helper library that uses strncmp function which is not defined in edk2 libfdt_env.h. This commit addresses the build issue caused by missing strncmp macro in libfdt_env.h. Check below three commits for the corresponding changes on OpenSBI, https://github.com/riscv/opensbi/commit/8e47649eff96c303e02fbd58cdc6c4ed341066ec https://github.com/riscv/opensbi/commit/2845d2d2cf4fb74a89452ba223995aa4a118c07e https://github.com/riscv/opensbi/commit/2cfd2fc9048806353298a1b967abf985901e36e8 Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Message-Id: <20200806023421.25161-1-abner.chang@hpe.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com> [lersek@redhat.com: remove stray newline between S-o-b and first Cc]
* EmbeddedPkg/NonCoherentIoMmuDxe: Apply BSD-2-Clause-PatentMichael D Kinney2020-08-062-17/+2
| | | | | | | | | | | Change license to BSD-2-Clause-Patent using an SPDX-License-Identifier statement. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
* EmbeddedPkg/TimeBaseLib: Add macros to get build year/month/dayPete Batard2020-08-031-0/+32
| | | | | | | | | | | | | | | | | | These can be used, for instance, to automate the population of an SMBIOS Type 0 BIOS Release Date when building a UEFI firmware (which is how we plan to use these macros for the Raspberry Pi platform). These macros should work for any compiler that follows ISO/IEC 9899, but we add a check for the compiler we have tested to be on the safe side. Note that we decided against adding a #error or #warn for compilers that haven't been validated, as we don't want to introduce breakage for people who may already be using the header with something else than gcc, MSVC or Clang. Instead, we expect those to send a patch that adds their compiler to the list, once they have tested the macros there. Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg: fix gcc build errors in AndroidBootImgLibLeif Lindholm2020-07-231-2/+2
| | | | | | | | | | | | | | Commit dbd546a32d5a ("BaseTools: Add gcc flag to warn on void* pointer arithmetic") does its work and triggers build errors in this library. Update the affected code to build correctly again. Cc: Pierre Gondois <pierre.gondois@arm.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Bob Feng<bob.c.feng@intel.com> Reported-by: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* EmbeddedPkg: Fix build error for MmcDxePierre Gondois2020-07-232-6/+10
| | | | | | | | | | | | | | | | | | | The following command line: build -b NOOPT -a IA32 -t VS2017 -p edk2\EmbeddedPkg\EmbeddedPkg.dsc Generates the following error: MmcDxe.lib(Diagnostics.obj) : error LNK2001: unresolved external symbol __allshl MmcDxe.lib(Diagnostics.obj) : error LNK2001: unresolved external symbol __aullshr MmcDxe.lib(MmcBlockIo.obj) : error LNK2001: unresolved external symbol __allmul These erros are due to the use of shift/multiply operations on UINT64 variable on a IA32 architecture. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg/NonCoherentDmaLib: avoid dereferencing bogus buffer addressArd Biesheuvel2020-06-171-2/+1
| | | | | | | | | | The bounce buffering code in NonCoherentDmaLib copies data into the bounce buffer using CopyMem(), but passes Map->HostAddress as the source of the copy before it has been assigned its correct value. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Andrei Warkentin <awarkentin@vmware.com>
* EmbeddedPkg/MmcDxe: Added MaxBlock Transfer Limit 65535 in R/W.Gaurav Jain2020-06-121-11/+23
| | | | | | | | | | | | | | | | | | | | Moved BlockCount calculation below BufferSize Validation checks. First Ensure Buffersize is Not Zero and multiple of Media BlockSize. then calculate BlockCount and perform Block checks. Corrected BlockCount calculation, as BufferSize is multiple of BlockSize, So adding (BlockSize-1) bytes to BufferSize and then divide by BlockSize will have no impact on BlockCount. Reading Large Images from MMC causes errors. As per SD Host Controller Spec version 4.20, Restriction of 16-bit Block Count transfer is 65535. Max block transfer limit in single cmd is 65535 blocks. Added Max Block check that can be processed is 0xFFFF. then Update BlockCount on the basis of MaxBlock. Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com> Reviewed-by: "Loh, Tien Hock" <tien.hock.loh@intel.com>
* EmbeddedPkg/EmbeddedPkg.dsc: remove some stale component referencesArd Biesheuvel2020-05-061-7/+0
| | | | | | | | Some driver were recently moved to edk2-platforms, but the DSC file in EmbeddedPkg still refers to them. Drop these references. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg: remove ISP 1716 USB host controller driverArd Biesheuvel2020-05-054-786/+0
| | | | | | | | | | | | | | | The ISP 1716 USB host controller driver does not implement the UEFI driver model, and is not a suitable example for new drivers to be based on. Also, it is currently only used on a limited set of ARM development platforms. Due to this, it has been moved into the edk2-platforms repository, alongside its remaining users, which have been updated to refer to it in its new location. So drop this version from EmbeddedPkg. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg: remove SiI3132 SATA controller driverArd Biesheuvel2020-05-056-1862/+0
| | | | | | | | | | | | | | | The SiI3132 SATA controller driver does not implement the UEFI driver model, and is not a suitable example for new drivers to be based on. Also, it is currently only used on a limited set of ARM development platforms. Due to this, it has been moved into the edk2-platforms repository, alongside its remaining users, which have been updated to refer to it in its new location. So drop this version from EmbeddedPkg. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg: remove Lan9118 network controller driverArd Biesheuvel2020-05-057-3590/+0
| | | | | | | | | | | | | | | The Lan9118 network controller driver does not implement the UEFI driver model, and is not a suitable example for new drivers to be based on. Also, it is currently only used on a limited set of ARM development platforms. Due to this, it has been moved into the edk2-platforms repository, alongside its remaining users, which have been updated to refer to it in its new location. So drop this version from EmbeddedPkg. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg: remove Lan91x network controller driverArd Biesheuvel2020-05-054-2556/+0
| | | | | | | | | | | | | | | The Lan91x network controller driver does not implement the UEFI driver model, and is not a suitable example for new drivers to be based on. Also, it is currently only used on a limited set of ARM development platforms. Due to this, it has been moved into the edk2-platforms repository, alongside its remaining users, which have been updated to refer to it in its new location. So drop this version from EmbeddedPkg. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg: remove DwEmmcDxe host controller driverArd Biesheuvel2020-05-054-870/+0
| | | | | | | | | | | | | | | The Synopsys DesignWare eMMC host controller driver does not implement that SD/MMC host controller protocol that the UEFI spec defines, but an obsolete EDK2-specific one that predates it. It also does not implement the UEFI driver model. Due to this, it has been moved into the edk2-platforms repository, alongside its remaining users, which have been updated to refer to it in its new location. So drop this version from EmbeddedPkg. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg: rename gEfiMmcHostProtocolGuid to gEmbeddedMmcHostProtocolGuidArd Biesheuvel2020-04-306-11/+11
| | | | | | | | | | | | In EDK2, identifiers carrying the EFI prefix are reserved for ones that are defined in the UEFI or PI specifications. Since the MMC host protocol defined in EmbeddedPkg is not the one that the UEFI spec defines, and given the confusion around this, let's rename it to from gEfiMmcHostProtocolGuid to gEmbeddedMmcHostProtocolGuid. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg/AcpiLib: add GICC table init macro for ACPI 6.3Pete Batard2020-03-301-0/+8
| | | | | | | | | | | ACPI 6.3 added a 16-bit SPE overflow Interrupt field, replacing 2 of the 3 reserved bytes that are defined at the end of the GICC structure for 6.0. Add a new macro to initialise the new field. Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/RealTimeClockRuntimeDxe: Drop ASSERTs on function argumentsGaurav Jain2020-03-261-4/+1
| | | | | | | | | | | | ASSERT in SetTime_Conf Consistency Test. SCT Test expect return as Invalid Parameter. So removed ASSERT(). While at it, check that the NanoSecond field is within the range given by the UEFI specification. Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/VirtualKeyboard: Fix few typosAntoine Coeur2020-02-102-15/+15
| | | | | | | | | | | | Fix few typos in the documentation. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Antoine Coeur <coeur@gmx.fr> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com> Message-Id: <20200207010831.9046-4-philmd@redhat.com>
* EmbeddedPkg/VirtualKeyboard: Fix a typo in EFI_INVALID_PARAMETERPhilippe Mathieu-Daudé2020-02-101-11/+11
| | | | | | | | | | Correctly write 'EFI_INVALID_PARAMETER' in documentation. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com> Message-Id: <20200207010831.9046-3-philmd@redhat.com>
* EmbeddedPkg: implement EDK2 IoMmu protocol wrapping DmaLibArd Biesheuvel2019-12-063-0/+305
| | | | | | | | | | | | Implement a version of the EDK2 IoMmu protocol that is a simple wrapper around DmaLib. This is intended to be used to wrap NonCoherentDmaLib so that the generic PCI infrastructure can be used to implement support for non cache-coherent DMA. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Tested-by: Pete Batard <pete@akeo.ie>
* EmbeddedPkg/NonCoherentDmaLib: implement support for DMA range limitsArd Biesheuvel2019-12-063-12/+160
| | | | | | | | | | | | Implement support for driving peripherals with limited DMA ranges to NonCoherentDmaLib, by adding a device address limit, and taking it, along with the device offset, into account when allocating or mapping DMA buffers. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Pete Batard <pete@akeo.ie> Acked-by: Philippe Mathieu-Daude <philmd@redhat.com> Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/DtPlatformDxe: Add DT/ACPI Default FlexibilityAshish Singhal2019-11-073-6/+17
| | | | | | | | Add a PCD to govern whether to use DT or ACPI in case the variable governing this is not found or is not valid. Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/Universal/MmcDxe: "fix" CloseProtocol() call in BindingStop()Laszlo Ersek2019-10-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | The 3rd and 4th parameters of the CloseProtocol() call are wrong. Given that we're not dissociating a child controller from a parent controller (= closing a BY_CHILD_CONTROLLER open), but closing a BY_DRIVER open, the 4th parameter (ControllerHandle) should equal the 1st parameter (Handle). It's unclear why this code hasn't crashed before. Note that the patch doesn't fix the underlying driver model bug. I don't understand what the loop in MmcDriverBindingStop() attempts to do. Is this driver supposed to be a bus driver? It seems to create new handles, and to append device path nodes. But it doesn't set up proper parent/child protocol opens, and it doesn't close them. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/AndroidFastbootTransportTcpDxe: fix DestroyChild() callLaszlo Ersek2019-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | - The 2nd parameter of EFI_SERVICE_BINDING_CREATE_CHILD is: IN OUT EFI_HANDLE *ChildHandle - The 2nd parameter of EFI_SERVICE_BINDING_DESTROY_CHILD is: IN EFI_HANDLE ChildHandle Fix the DestroyChild() call in TcpFastbootTransportStop(). This is an actual bugfix; I don't know why the current code doesn't crash. Perhaps the function is never reached in practice? (It could be tied to an error path.) Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: add missing EFIAPI calling convention specifiersLaszlo Ersek2019-10-096-8/+44
| | | | | | | | | | | | | This patch is unrelated to the rest of the series; it just makes sure that "EmbeddedPkg/EmbeddedPkg.dsc" builds for all platforms advertised in SUPPORTED_ARCHITECTURES (in particular, X64). No functional changes. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: convert Lauterbach README.txt to 7-bit safe Readme.mdLeif Lindholm2019-10-042-7/+16
| | | | | | | | | | | | This file contained what looked like windows 1250 encoded single quotation marks. Convert them to regular 's. Rework the file to markdown format and and rename it Readme.md while we're at it. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: "Kinney, Michael D" <michael.d.kinney@intel.com> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
* EmbeddedPkg: delete outdated FdtLib README.txtLeif Lindholm2019-10-041-1/+0
| | | | | | | | | | | | While looking at encoding and line ending errors, I found this file in fact simply points to a sourceforge page which no longer exists. Since there is nothing more to say than "this is an import of libfdt", let's just delete it. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
* EmbeddedPkg: add missing newline at end of TemplateResetSystemLib.infLeif Lindholm2019-10-041-1/+1
| | | | | | | Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
* EmbeddedPkg: Unload image on EFI_SECURITY_VIOLATIONDandan Bi2019-09-252-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | For the LoadImage() boot service, with EFI_SECURITY_VIOLATION retval, the Image was loaded and an ImageHandle was created with a valid EFI_LOADED_IMAGE_PROTOCOL, but the image can not be started right now. This follows UEFI Spec. But if the caller of LoadImage() doesn't have the option to defer the execution of an image, we can not treat EFI_SECURITY_VIOLATION like any other LoadImage() error, we should unload image for the EFI_SECURITY_VIOLATION to avoid resource leak. This patch is to do error handling for EFI_SECURITY_VIOLATION explicitly for the callers in EmbeddedPkg which don't have the policy to defer the execution of the image. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Philippe Mathieu-Daude <philmd@redhat.com> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1992 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
* EmbeddedPkg: list module-internal header files in INF [Sources]Laszlo Ersek2019-07-232-0/+2
| | | | | | | | | | | | | | | | | | The BaseTools build feature introduced for TianoCore#1804 / in commit 1fa6699e6cd4 ("BaseTools: Add a checking for Sources section in INF file", 2019-06-10) logs some (non-fatal) warnings about unlisted internal header files. List those files explicitly. Note: header files are added in lexicographical order only if the underlying INF file already keeps the [Sources] and [LibraryClasses] sections in lexicographical order. Otherwise, header files are added in rough "logical" order. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: Fix various typosCœur2019-07-0434-84/+84
| | | | | | | Fix various typos in EmbeddedPkg. Signed-off-by: Coeur <coeur@gmx.fr> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: improve TimeBaseLib type safetyLeif Lindholm2019-06-172-11/+11
| | | | | | | | | | | | | | | EfiTimeToEpoch currently returns a UINTN. Also, some internal calculations was using UINTN for fixed-width. Both of these lead to warnings/errors with VS2017. Replace with appropriate fixed-size types. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=997 Cc: Alexei Fedorov <Alexei.Fedorov@arm.com> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
* EmbeddedPkg/PrePiLib: remove dead status code reporting codeArd Biesheuvel2019-06-063-329/+0
| | | | | | | | The status code reporting functionality in PrePiLib is never invoked so let's just remove it. Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: Update DSC to use NetworkPkg's include fragment fileLiming Gao2019-05-191-1/+1
| | | | | | | Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/PrePiLib: Drop dependency on IntelFramework[Module]PkgHao A Wu2019-05-152-4/+0
| | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1720 This commit will remove the dependency on IntelFramework[Module]Pkg from the PrePiLib. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg DSC: Use ReportStatusCodeLib (DXE) in MdeModulePkgHao A Wu2019-05-151-3/+3
| | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1720 This commit will update the package DSC file to consume the ReportStatusCodeLib (DXE phase instance) in MdeModulePkg, instead of using the one in IntelFrameworkModulePkg. Please note that, the 2 ReportStatusCodeLib are almost identical. Thus, there is no functional impact for this commit. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASSMarcin Wojtas2019-04-291-1/+1
| | | | | | | | | | Latest change allowed to add dependency on NvVarStoreFormattedLib for the DXE_DRIVER modules. Although effectively it is hooked using the 'NULL' class, extend the LIBRARY_CLASS with according type for consistency sake. Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: Allow DXE_DRIVER to depend on NvVarStoreFormattedLibMarcin Wojtas2019-04-251-2/+2
| | | | | | | | | | | | | | | Some modules (such as FaultTolerantWriteDxe) use the FlashNvStorage PCDs (PcdFlashNvStorageFtw*). In case the flash contents are not mapped in memory, the module loading order of the FVB driver may become important. To handle above, this patch allows to hook the dependency of desired DXE_DRIVER type module in the .DSC file via NvVarStoreFormattedLib NULL resolution. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-09160-1111/+160
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/MmcDxe: Enable 4-bit mode even if SD_HIGH_SPEED is not supportedLoh, Tien Hock2019-03-151-18/+17
| | | | | | | | | | | | | | If SD doesn't support SD_HIGH_SPEED, function should still continue to setup SD to go into 4 bits more if it is supported. Currently, the code inadvertently exits early, but with a EFI_SUCCESS return code, and so execution proceeds without ever attempting to enable 4-bit mode. Since not having SD_HIGH_SPEED support is not an error, downgrade the message that reports this to DEBUG_INFO. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Loh Tien Hock <tien.hock.loh@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/VirtualRealTimeClockLib: Fix correctness issuesPete Batard2019-02-261-9/+25
| | | | | | | | | | | | | | | | | | LibGetTime(): - Two variables were used for the epoch, where only one should have been [*]. - Also harmonize variable name to match the one used in LibSetTime. LibSetTime(): - Address possible underflows if time is set to start of epoch. - Ensure that time being read does actually match time that was manually set (plus the time elapsed since), by subtracting number of seconds since reset. [*] This fixes a build breakage, since one of these variables was set but never used, triggering a compiler diagnostic at some optimization levels. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>