summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg
Commit message (Collapse)AuthorAgeFilesLines
* EmbeddedPkg: Remove RVCT supportRebecca Cran2022-05-132-11/+0
| | | | | | | | RVCT is obsolete and no longer used. Remove support for it. Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* EmbeddedPkg: Fix a build error in FwVol.c in X64 archMin Xu2022-01-271-3/+3
| | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3814 CompressedDataLength is declared as UINTN which is UINT64 in X64 arch. But the second parameter of UefiDecompressGetInfo() is declared as UINT32. So a build error is triggered. To declare CompressedDataLength as UINT32 to fix the build error. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Abner Chang <abner.chang@hpe.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
* EmbeddedPkg/AcpiLib: Add more helper functionsNhi Pham2021-12-173-0/+291
| | | | | | | | | | | This adds more helper functions that assist in calculating the checksum, locating an ACPI table by signature, and updating an AML integer object. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com> Acked-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Abner Chang <abner.chang@hpe.com>
* EmbeddedPkg: Apply uncrustify changesMichael Kubacki2021-12-07106-7837/+9431
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the EmbeddedPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Andrew Fish <afish@apple.com>
* EmbeddedPkg: Change OPTIONAL keyword usage styleMichael D Kinney2021-12-075-6/+5
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3760 Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Andrew Fish <afish@apple.com>
* EmbeddedPkg: Change use of EFI_D_* to DEBUG_*Michael D Kinney2021-12-0715-179/+170
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3739 Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkgAbner Chang2021-10-145-0/+638
| | | | | | | | | | | | | | | | | This is one of the series patches to restructure the location of modules under ArmVirtPkg for RiscVVirtPkg. RiscVVirtPkg leverage FDT Client protocol to parse FDT nodes. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Sunil V L <sunilvl@ventanamicro.com> Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* EmbeddedPkg: Add LoadFile2 for linux initrdJeff Brasen2021-09-233-22/+202
| | | | | | | | | | Add support under a pcd feature for using the new interface to pass initrd to the linux kernel instead of via device tree. This feature is also enabled if ACPI tables are present, and will skip locating and installation of device tree. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg: Install FDT if UpdateDtb is not presentJeff Brasen2021-09-231-5/+6
| | | | | | | | Currently if mAndroidBootImg->UpdateDtb is not supported on the platform the device tree updates of the initrd are not made. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg: AndroidBootImgBoot error handling updatesJeff Brasen2021-09-231-21/+29
| | | | | | | | Update AndroidBootImgBoot to use a single return point Make sure Kernel args are freed and Image is unloaded. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg: Remove duplicate libfdt.h includeJeff Brasen2021-09-231-2/+0
| | | | | | | Remove duplicate libfdt.h include statement in AndroidBootImgLib Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg/NonCoherentDmaLib: Avoid dereferencing unset Map fieldJeremy Linton2021-08-171-1/+1
| | | | | | | | | | Map->Operation is used to select whether a DMA region that is being bounced has the source buffer copied to it. Except Map->Operation isn't yet set, so the behavior is somewhat random. Instead use the passed in Operation parameter. Signed-off-by: Jeremy Linton <jeremy.linton@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* EmbeddedPkg/libfdt: Add strcmp and strncpy to libfdt_env.hAbner Chang2021-08-051-0/+8
| | | | | | | | | | | | | OpenSBI has started using those in v0.9. See: https://github.com/riscv/opensbi/blob/v0.9/lib/utils/fdt/fdt_domain.c 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> Cc: Anup Patel <anup.patel@wdc.com> Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com> Acked-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg/VirtualRealTimeClockLib: Fix SetTime issuesSunny Wang2021-07-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes two issues below: 1. SCT SetTime_Func failures. - https://github.com/pftf/RPi4/issues/164 2. Using shell time and date commands to set time can't work. The problem is that gRT->SetTime always returns EFI_INVALID_PARAMETER error status. The root cause is that LibSetTime() sets RtcEpochSeconds variable with inconsistent attributes. One is without EFI_VARIABLE_NON_VOLATILE, the other one is with EFI_VARIABLE_NON_VOLATILE. That caused that the variable driver returns EFI_INVALID_PARAMETER. Per UEFI spec, if a preexisting variable is rewritten with different attributes, SetVariable() shall not modify the variable and shall return EFI_INVALID_PARAMETER. Therefore, the solution is to add EFI_VARIABLE_NON_VOLATILE attribute to the first EfiSetVariable() call to make two calls consistent. By the way, this patch also fix a minor issue with a debug message. Signed-off-by: Sunny Wang <sunny.wang@arm.com> Reviewed-by: Pete Batard <pete@akeo.ie> Tested-by: Pete Batard <pete@akeo.ie>
* EmbeddedPkg/RealTimeClockRuntimeDxe: Improve GetWakeupTimeMarcin Wojtas2021-06-021-0/+11
| | | | | | | | | | | | GetWakeupTime should return full time information, including the daylight/timezone. Make use of the existing non-volatile variables for that purpose. Moreover add an error checking of possibly invalid parameters. This partially fixes FWTS and SCT Set/GetWakeupTime tests on Marvell platforms. Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* EmbeddedPkg: Consume MdeLibs.dsc.inc for RegisterFilterLibDandan Bi2021-03-311-1/+4
| | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246 MdeLibs.dsc.inc was added for some basic/default library instances provided by MdePkg and RegisterFilterLibNull Library was also added into it as the first version of MdeLibs.dsc.inc. So update platform dsc to consume MdeLibs.dsc.inc for RegisterFilterLibNull which will be consumed by IoLib and BaseLib. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
* 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/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>