summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg/Library
Commit message (Collapse)AuthorAgeFilesLines
* EmbeddedPkg/PrePiHobLib: replace duplicate GUIDMatthew Carlson2021-03-161-1/+1
| | | | | | | | | Currently there is a duplicate GUID shared by two INFs. This rolls the INF for the PrePiHobLib. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2381 Signed-off-by: Matthew Carlson <matthewfcarlson@gmail.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* EmbeddedPkg: Only print LibGetTime message about compile time epoch onceRebecca Cran2021-03-081-1/+9
| | | | | | | | | | | | | | | | | | | | The message "LibGetTime: RtcEpochSeconds non volatile variable was not found - Using compilation time epoch." can be printed a very large number of times, causing log files to become excessively large. This is because the RtcEpochSeconds variable only gets set if LibSetTime is called, for example by running 'time 12:00' in the UEFI Shell. Avoid this by setting RtcEpochSeconds to BUILD_EPOCH (EpochSeconds) after printing the message. It's set to a volatile variable so the message will be displayed on future boots and not hidden. Commit 44ae214591e58af468eacb7b873eaa0bc187c4fa reduced the verbosity of the message to DEBUG_VERBOSE. Revert it back to DEBUG_INFO so it's more prominent now that it doesn't get printed so frequently. Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg/VirtualRealTimeClockLib: Reduce DEBUG message verbositySamer El-Haj-Mahmoud2021-02-201-1/+1
| | | | | | | | | The DEBUG message for using compilation time epoch is appearing very frequently on DEBUG firmware builds, for example during UEFI SCT runs. Reduce verbosity to avoid the annoying repetitive message. Signed-off-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* 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/TimeBaseLib: Add function to check Timezone and DaylightNhi Pham2021-01-071-2/+47
| | | | | | | | | | | | 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-071-8/+56
| | | | | | | | | 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-211-3/+3
| | | | | | | | | | | | | | | | | | | 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: 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/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/NonCoherentDmaLib: implement support for DMA range limitsArd Biesheuvel2019-12-062-12/+154
| | | | | | | | | | | | 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: 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-251-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-047-15/+15
| | | | | | | 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-171-9/+9
| | | | | | | | | | | | | | | 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-062-322/+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/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: 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-0943-294/+43
| | | | | | | | | | | | | | | | | | | | 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/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>
* EmbeddedPkg/Library: Add VirtualRealTimeClockLibPete Batard2019-02-152-0/+443
| | | | | | | | | | | | | | | | This is designed to be used on platforms where a a real RTC is not available and relies on an RtcEpochSeconds variable having been set or, if that is not the case, falls back to using the epoch embedded at compilation time. Note that, in order to keep things simple for the setting of the compilation time variable, only GCC environments with UNIX-like shells and where a 'date' command is available are meant to be supported for now. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/NorFlashInfoLib: convert to BASE libraryArd Biesheuvel2019-01-161-3/+2
| | | | | | | | | | | The library's MODULE_TYPE and the module type restrictions it defines are needlessly strict. Just change the library to BASE type and drop the restrictions entirely. Also, drop a bogus library dependency on DxeServicesLib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: remove GdbDebugAgent libraryArd Biesheuvel2018-12-199-4734/+0
| | | | | | | | | The GdbDebugAgent library is unused and unmaintained, and now it turns out it doesn't build with Clang, so let's just get rid of it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/PrePiLib: drop unused PCD referenceArd Biesheuvel2018-11-291-1/+0
| | | | | | | | | | Drop the reference to gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize which is never used. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/PrePiHobLib: drop CreateHobList() from libraryArd Biesheuvel2018-11-292-44/+0
| | | | | | | | | | Drop the declaration and the implementation of CreateHoblist(), which is not used anywhere. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/PrePiMemoryAllocationLib: Added AllocateZeroPool()Jeff Brasen2018-11-291-0/+32
| | | | | | | | | | This function is exposed by the MemoryAllocationLib header. An AllocateZeroPool() function has been added to fix modules depending on this library and this function. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/CoherentDmaLib: Add missing checks to DmaMapVladimir Olovyannikov2018-09-071-0/+6
| | | | | | | | | UEFI Sct validates Dma mapping. For CoherentDmaLib it always failed because there were no required checks present in DmaMap. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/CoherentDmaLib: Fix typo in DmaAlignedBufferVladimir Olovyannikov2018-09-071-1/+1
| | | | | | | | | | | The only valid memory types for DmaAlignedBuffer should be EfiBootServicesData and EfiRuntimeServicesData. However due to the typo, there is no way to allocate runtime pages, and INVALID_PARAMETER is always returned. Fix the typo. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: Removing ipf which is no longer supported from edk2.chenc22018-06-293-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removing rules for Ipf sources file: * Remove the source file which path with "ipf" and also listed in [Sources.IPF] section of INF file. * Remove the source file which listed in [Components.IPF] section of DSC file and not listed in any other [Components] section. * Remove the embedded Ipf code for MDE_CPU_IPF. Removing rules for Inf file: * Remove IPF from VALID_ARCHITECTURES comments. * Remove DXE_SAL_DRIVER from LIBRARY_CLASS in [Defines] section. * Remove the INF which only listed in [Components.IPF] section in DSC. * Remove statements from [BuildOptions] that provide IPF specific flags. * Remove any IPF sepcific sections. Removing rules for Dec file: * Remove [Includes.IPF] section from Dec. Removing rules for Dsc file: * Remove IPF from SUPPORTED_ARCHITECTURES in [Defines] section of DSC. * Remove any IPF specific sections. * Remove statements from [BuildOptions] that provide IPF specific flags. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/GdbSerialLib: avoid left shift of negative quantityArd Biesheuvel2018-06-191-5/+5
| | | | | | | | | | | | | | Clang complains about left shifting a negative value being undefined. EmbeddedPkg/Library/GdbSerialLib/GdbSerialLib.c:151:30: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value] OutputData = (UINT8)((~DLAB<<7)|((BreakSet<<6)|((Parity<<3)|((StopBits<<2)| Data)))); Redefine all bit pattern constants as unsigned to work around this. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/TimeBaseLib: Add function to get Week day.Meenakshi Aggarwal2018-06-051-3/+35
| | | | | | | | | | | This patch add function EfiTimeToWday() which returns day of the week. It is needed by our upcoming patches in edk2-platforms. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com> Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: introduce NvVarStoreFormattedLibLaszlo Ersek2018-04-122-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some platforms don't format a variable store template at build time; instead they format the non-volatile varstore flash chip during boot, dynamically. Introduce NvVarStoreFormattedLib to enable such platforms to delay the "variable read" service drivers until the platform specific module(s) report that the variable store has been formatted. The platform-specific module that performs the formatting during startup is usually an FVB or MM FVB driver. Under the proposed scheme, it becomes responsible for installing gEdkiiNvVarStoreFormattedGuid with a NULL interface in the protocol database. In turn, the platform DSC will hook NvVarStoreFormattedLib into the variable service driver, to make the latter wait for the FVB driver. Platforms that need not delay the variable service driver like this may still use the same FVB driver; gEdkiiNvVarStoreFormattedGuid will simply be ignored. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Steve Capper <steve.capper@linaro.org> Cc: Supreeth Venkatesh <Supreeth.Venkatesh@arm.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Steve Capper <steve.capper@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: Correct the way of handling sections with a large sizeGe Song2018-03-131-2/+16
| | | | | | | | | | | Correct the way of handling EFI_SECTION_GUID_DEFINED type sections with a large size Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ge Song <ge.song@hxt-semitech.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/FdtLib: incorporate missing overlay supportArd Biesheuvel2018-02-213-0/+958
| | | | | | | | | | | | | | | | | Commit a099239015eb ("EmbeddedPkg/FdtLib: Update FdtLib to v1.4.5") updated our FdtLib implementation to a more recent upstream version, but omitted fdt_overlay.c due to its ambiguous licensing situation. This has been resolved now, so take the latest upstream version of the file (which received no other modifications in the mean time) and add it to FdtLib. Note that fdt_overlay.c has a dependency on strtoul() which EDK does not provide natively, so add a private implementation that wraps the BaseLib routines that do roughly the same. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: delete unused HalRuntimeServicesExampleLibLeif Lindholm2018-02-066-1943/+0
| | | | | | | | | HalRuntimeServicesExampleLib contains no .inf and none of its contents are included elsewhere - so get rid of it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/FdtLib: build fdt_empty_tree.cMichael Zimmermann2018-01-151-0/+1
| | | | | | | | | | We're currently building everything except for this file. Since 'fdt_create_empty_tree' can be useful for some platforms, compile this one too. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/FdtLib: Update FdtLib to v1.4.5Pankaj Bansal2018-01-0512-56/+371
| | | | | | | | | | | | | Update the FdtLib so that new APIs provided by FdtLib like fdt_address_cells, fdt_size_cells etc. can be used. Reference code: https://git.kernel.org/pub/scm/utils/dtc/dtc.git/tree/libfdt?h=v1.4.5 Cc: Leif Lindholm <leif.lindholm@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/PrePiLib: add support for v2 sectionsMichael Zimmermann2017-12-121-12/+51
| | | | | | | | | Implement the missing support for FFS files whose size equals or exceeds 16 MiB. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: AndroidBootApp: fix clang compilationLeif Lindholm2017-12-061-4/+5
| | | | | | | | | | | | Address an incorrect function prototype (using ; instead of ,) in AndroidBootImg.h. Also restructure code slightly to avoid a "may be used uninitialized" warning. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg BeagleBoardPkg: move special HOB reuse libraries into platformArd Biesheuvel2017-11-304-432/+0
| | | | | | | | | | | | | | The BeagleBoard platform uses PeCoffLib and CustomDecompressLib implementations that invoke the library code that resides in the PrePi module via pointers exposed via special GUIDed HOBs. This is a nice hack, but not necessarily something we want to carry in reference code. So as a first step, move the libraries that expose this reused code into BeagleBoardPkg, and remove it from EmbeddedPkg. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg Omap35xxPkg: remove EBL and associated librariesArd Biesheuvel2017-11-268-2328/+0
| | | | | | | | | | | EBL is a deprecated, small memory footprint alternative for the UEFI Shell that is no longer in use by any platforms in EDK2 or in edk2-platforms. To avoid confusion, let's remove it from the tree. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: get rid of BdsLib dependency from Android*BootLeif Lindholm2017-11-251-0/+1
| | | | | | | | | | | | | The sum use these applications made of BdsLib was one invocation of the IS_DEVICE_PATH_NODE macro, and (incorrectly) being able to leave out a dependency on gEfiLoadedImageProtocolGuid. So expand the macro in place and add the missing dependency. Then clean up the .dsc, .inf and #includes accordingly. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: add mx66u1g45g nor flash infoPipat Methavanitpong2017-11-161-0/+1
| | | | | | | | | | Add Macronix MX66U1G45G definition to NorFlashInfoLib Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pipat Methavanitpong <methavanitpong.pipat@socionext.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: Implement NorFlashInfoLibMarcin Wojtas2017-11-072-0/+259
| | | | | | | | | | | | | | | | | | | | | | | | | The SPI NOR flash drivers which base on ArmPlatformPkg's NorFlashDxe usually make use of static declarations of the flash instances with their type and parameters. As a result it implies hardcoding the exact way of flash handling, not to mention the code does not look very nice. Much better solution would be obtaining the flash ID and hence its description in runtime. JEDEC compliant SPI NOR devices allow to obtain their IDs with READ_ID command (0x9f), which should return the vendor ID byte, followed by 2 to 4 following device ID bytes. Use this capability for implementing a NorFlashInfoLib that gives an access to the NOR flash description data, such as name, page size, sector (block) size and others, of more than 50 different models. The new library user should pass an output array from issuing READ_ID command to the NorFlashGetInfo () routine - if the match is found, an allocated (optionally for RT) pool with the flash description copy will be returned. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg PrePiHobLib: Implement BuildFv3HobStar Zeng2017-10-101-0/+44
| | | | | | | | | | Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: implement NonCoherentDmaLib based on ArmDmaLibArd Biesheuvel2017-08-302-0/+541
| | | | | | | | | | The non-coherent DmaLib implementation in ArmDmaLib no longer relies on anything in ArmPkg. So clone it into EmbeddedPkg, and rename it to NonCoherentDmaLib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>