summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg
Commit message (Collapse)AuthorAgeFilesLines
...
* EmbeddedPkg: add driver to set graphical/serial console preferenceArd Biesheuvel2017-10-237-0/+490
| | | | | | | | | | | | | | | | Linux on ARM/arm64 will infer from the presence of a /chosen/stdout-path DT property or of a SPCR ACPI table that the primary console is the serial port, even if a graphical console is available as well. So let's introduce a driver that allows the user to set a preference between graphical and serial if both are available. If the preference is set to 'Graphical', and any GOP protocol instances have been installed by the time the ReadyToBoot event is signalled, remove the DT property and/or the SPCR table entirely. 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 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: Introduce HardwareInterrupt2 protocolArd Biesheuvel2017-10-052-0/+183
| | | | | | | | | | | | | | The existing HardwareInterrupt protocol lacks the means to configure the level/edge and polarity properties of an interrupt. So introduce a new protocol HardwareInterrupt2, and add some new members that allow manipulation of those properties. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Girish Pathak <girish.pathak@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Tested-by: Girish Pathak <girish.pathak@arm.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* SD : Updated CMD 6 implememtation.Meenakshi Aggarwal2017-09-072-5/+56
| | | | | | | | | | | | | | | | | For setting high speed in SD card, First CMD 6 (Switch) is send to check if card supports High Speed and Second command is send to switch card to high speed mode. In current inplementation, CMD 6 was sent only once to switch the card into HS mode without checking if card supports HS or not, which is not as per specification and also we are not setting the HS i.e. 50000000 but directly asking the card to switch to 26000000 which is incorrect as SD card supports either 25000000 or 50000000. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Reviewed-by: Jun Nie <jun.nie@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* MMC : Added missing __FUNCTION__ macro.Meenakshi Aggarwal2017-09-071-7/+7
| | | | | | | | | We want to print name of the function resulted in error, but __FUNCTION__ macro was missing. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: MmcDxe - Recieve response was missing after CMD12Meenakshi Aggarwal2017-09-011-0/+1
| | | | | | | | | | We are not recieving the response from memory card after sending CMD 12. It was not resulting in any failure but we should recieve response after sending a command. Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Reviewed-by: Jun Nie <jun.nie@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: implement NonCoherentDmaLib based on ArmDmaLibArd Biesheuvel2017-08-303-0/+542
| | | | | | | | | | 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>
* EmbeddedPkg/CoherentDmaLib: add support for non-1:1 DMA translationArd Biesheuvel2017-08-303-1/+19
| | | | | | | | | | Bring CoherentDmaLib in line with ArmDmaLib, and add support for defining a static offset between the host's and the bus master's view of memory. 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: rename NullDmaLib to CoherentDmaLibArd Biesheuvel2017-08-303-15/+7
| | | | | | | | | | | | | The name NullDmaLib suggests that this library is a placeholder that only exists to fulfil formal dependencies on the DmaLib library class without providing an actual implementation. This is not the case, though: NullDmaLib does implement DmaLib fully, but doing so simply requires very little effort on a cache coherent platform. So let's rename it to CoherentDmaLib instead. 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/EmbeddedPkg.dsc: fix build for non-ARM architecturesLeif Lindholm2017-08-303-21/+20
| | | | | | | | | | | | | | | | | | | EmbeddedPkg should be architecture agnostic, but a few issues were preventing other architectures to build individual components directly from the .dsc: - The AndroidBoot/AndroidFastBoot support have a dependency on BdsLib, which only has resolutions for ARM/AARCH64. Move them to an arch-restricted Components section. - The Isp1761UsbDxe driver is not 64-bit compatible. It should be converted to UEFI driver model, but for now just move it to a new Components.ARM section. (Also delete non-useful declaration for AARCH64 in EmbeddedPkg.dec.) - Lan9118Dxe has an unused ArmLib entry. Drop 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/DmaLib: add routine to allocate aligned buffersArd Biesheuvel2017-08-292-6/+72
| | | | | | | | | | | DmaLib's purpose is to manage memory that is shared between the host and DMA capable devices. In some cases, this requires a larger alignment than page size, and we currently don't cater for that in DmaLib. So add a variant of DmaAllocateBuffer () that takes an alignment parameter. 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/AndroidBoot: boot android kernel from storageJun Nie2017-08-208-0/+779
| | | | | | | | | | | | | | Add an android kernel loader that could load kernel from storage device. This android boot image BDS add addtitional cmdline/dtb/ramfs support besides kernel that is introduced by Android boot header. This patch is derived from Haojian's code as below link. https://patches.linaro.org/patch/94683/ Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jun Nie <jun.nie@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/AndroidFastboot: split android boot headerJun Nie2017-08-074-31/+65
| | | | | | | | | Split android boot header definition to share code among different applications and libraries. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jun Nie <jun.nie@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* edk2: Move License.txt file to rootMichael D Kinney2017-08-031-26/+0
| | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=642 Add top level License.txt file with the BSD 2-Clause License that is used by the majority of the EKD II open source project content. Merge copyright statements from the BSD 2-Clause License files in each package directory and remove the duplication License.txt file from package directories. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Andrew Fish <afish@apple.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* edk2: Move TianoCore Contribution Agreement to rootMichael D Kinney2017-08-031-218/+0
| | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=629 Move Contributions.txt that contains the TianoCore Contribution Agreement 1.0 to the root of the edk2 repository and remove the duplicate Contributions.txt files from all packages. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Andrew Fish <afish@apple.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/DwEmmc: Adjust FIFO thresholdJun Nie2017-07-174-0/+50
| | | | | | | | | | Adjust FIFO threshold according to FIFO depth. Skip the adjustment if we do not have FIFO depth info. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jun Nie <jun.nie@linaro.org> Acked-by: Haojian Zhuang <haojian.zhuang@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/DwEmmcDxe: limit max clock for platformJun Nie2017-07-173-0/+6
| | | | | | | | | Some boards may have max clock limitation. Add a Pcd to notify driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jun Nie <jun.nie@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/MmcDxe: Align the ExtCSD bufferJun Nie2017-07-053-6/+18
| | | | | | | | | ExtCSD structure may be read via DMA. So align it to page to avoid data corruption. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jun Nie <jun.nie@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/MmcDxe: Correct argument of ECSD readJun Nie2017-06-291-1/+1
| | | | | | | | | The argument of CMD8 should be stuff bits according to standard JESD84-A44. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jun Nie <jun.nie@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/MmcDxe: Add non-DDR timing mode supportJun Nie2017-06-291-2/+14
| | | | | | | | | Only DDR mode is support for 8bit mode currently. Add non-DDR case when configuring ECSD. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jun Nie <jun.nie@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: import EfiTimeBaseLib (as TimeBaseLib)Leif Lindholm2017-05-103-0/+273
| | | | | | | | | | | Some generic RTC helper functions were broken out from the PL031 library for use with other RTCs in OpenPlatformPkg. Import the code back here, realigning it with the current state of PL031RealTimeClockLib to simplify comparisons. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: import DesignWare EMMC driverLeif Lindholm2017-05-104-0/+832
| | | | | | | | Imported from OpenPlatformPkg 0434ff62e3eb896e6c561dea84cfb8b80391603e. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: import Lan91x Ethernet controller driverLeif Lindholm2017-04-194-0/+2575
| | | | | | | | | | | | | | | | | | | OpenPlatformPkg (https://git.linaro.org/uefi/OpenPlatformPkg.git) holds a driver for the SMSC LAN91x, used (among other places) in several ARM Ltd. software system models. Import it to EDK2 EmbeddedPkg in preparation for migrating those model platforms to edk2-platforms. On the way, update the files to pass PatchCheck.py without warnings (EFI_D_ -> DEBUG_ and purging tab characters). Also update .inf file to current version (and sort entries within sections). And update copyright dates to reflect this. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/AndroidFastbootApp: remove dependency on deprecated BdsLibArd Biesheuvel2017-04-192-2/+57
| | | | | | | | | | | | | | | | | | | | | | | | | One of the last remaining modules with a dependency on the deprecated BdsLib implementation from ArmPkg is the Android fastboot application. Its only dependency on BdsLib is BdsStartEfiApplication(), which is used in the most peculiar way: the fastboot app loads the kernel image into memory, and creates a MemoryMapped() device path for it. It then proceeds and calls BdsStartEfiApplication(), which explicitly loads the contents of the devicepath into memory, creating a second in-memory copy of the kernel image, after which it invokes gBS->LoadImage() with a buffer address and size (while it is perfectly capable of loading from a devicepath directly) Since we know the device path is fully qualified and connected, and does not require any of the additional processing that BdsStartEfiApplication() does when dereferencing a device path, we should be able to pass this devicepath into LoadImage() directly. So create a simplified local clone of BdsStartEfiApplication(), and drop the dependency on BdsLib. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* MdeModulePkg: move PlatformHasAcpiGuid from EmbeddedPkgArd Biesheuvel2017-04-053-39/+1
| | | | | | | | | | | | Given the agreement on the edk2-devel regarding the fact that the notion whether or not a 'platform has ACPI' is a universal one, move the PlatformHasAcpi GUID to MdeModulePkg. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: "Zeng, Star" <star.zeng@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/DtPlatformDxe: load platform DTB via new libraryArd Biesheuvel2017-03-312-19/+17
| | | | | | | | | | To give platforms some room to decide which DTB is suitable and where to load it from, load the DTB image indirectly via the new DtPlatformDtbLoaderLib library class. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* EmbeddedPkg: add base DtPlatformDtbLoaderLib implementationArd Biesheuvel2017-03-313-0/+100
| | | | | | | | | | Introduce an implementation of the new DtPlatformDtbLoaderLib library class that simply retrieves the first raw section of an FV file named 'gDtPlatformDefaultDtbFileGuid'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* EmbeddedPkg: add DtPlatformDtbLoaderLib library classArd Biesheuvel2017-03-312-0/+40
| | | | | | | | | | To abstract the way a platform reasons about which DTB is appropriate, and the way it ultimately supplies the DTB image, introduce a new library class to encapsulate this functionality. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* EmbeddedPkg: add DtPlatformDxe to .dsc fileArd Biesheuvel2017-03-311-0/+2
| | | | | | | | | Add the new DtPlatformDxe driver to EmbeddedPkg's .dsc file so that we can build it outside the context of a platform. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* EmbeddedPkg: add DT platform driver to select between DT and ACPIArd Biesheuvel2017-03-288-0/+432
| | | | | | | | | | | | | | | | | | | | As a follow up to the changes proposed by Laszlo to make ACPI and DT mutually exclusive on ArmVirtQemu, this patch proposes a DT platform DXE driver that either installs the NULL protocol PlatformHasAcpiGuid, or installs the FV embedded DTB binary as a configuration table under the appropriate GUID, depending on a preference setting recorded as a UEFI variable, and configurable via a HII screen. The DTB binary can be embedded in the firmware image by adding the following to the platform .fdf file: FILE FREEFORM = 25462CDA-221F-47DF-AC1D-259CFAA4E326 { SECTION RAW = SomePkg/path/to/foo.dtb } Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* EmbeddedPkg: introduce EDKII Platform Has Device Tree GUIDLaszlo Ersek2017-03-282-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The presence of this GUID in the PPI database, and/or in the DXE protocol database (as dictated by the platform's needs in these firmware phases) implies that the platform provides the operating system with a Device Tree-based hardware description. This is not necessarily exclusive with other types of hardware description (for example, an ACPI-based one). A platform PEIM and/or DXE driver is supposed to produce a single instance of the PPI and/or protocol (with NULL contents), if appropriate. The decision to produce the PPI and/or protocol is platform specific; for example, in the DXE phase, it could depend on an HII checkbox / underlying non-volatile UEFI variable. In the DXE phase, the protocol is meant to be consumed by the platform driver that - owns the Device Tree description of the hardware, and - is responsible for installing it as a system configuration table. Said FDT-owner driver can wait for the protocol via DEPEX or protocol notify. Because this GUID is not standard, it is prefixed with EDKII / Edkii, as seen elsewhere (for example in MdeModulePkg and SecurityPkg). Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: introduce PlatformHasAcpiLibLaszlo Ersek2017-03-282-0/+76
| | | | | | | | | | | | Add the shorter-term library instance outlined in the previous patch to EmbeddedPkg, so that we can imbue AcpiTableDxe with a protocol dependency on EDKII_PLATFORM_HAS_ACPI_GUID. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: introduce EDKII Platform Has ACPI GUIDLaszlo Ersek2017-03-282-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The presence of this GUID in the PPI database, and/or in the DXE protocol database (as dictated by the platform's needs in these firmware phases) implies that the platform provides the operating system with an ACPI-based hardware description. This is not necessarily exclusive with other types of hardware description (for example, a Device Tree-based one). A platform PEIM and/or DXE driver is supposed to produce a single instance of the PPI and/or protocol (with NULL contents), if appropriate. The decision to produce the PPI and/or protocol is platform specific; for example, in the DXE phase, it could depend on an HII checkbox / underlying non-volatile UEFI variable. In the DXE phase, the protocol is meant to be depended-upon by "MdeModulePkg/Universal/Acpi/AcpiTableDxe", indirectly: * In the long term, interested platforms will establish this dependency by hooking an (upcoming) NULL-class DepexLib instance into AcpiTableDxe in their DSC files, pointing DepexLib's DEPEX through a FixedAtBuild PCD to the GUID introduced here. (For the prerequisite BaseTools feature, refer to <https://bugzilla.tianocore.org/show_bug.cgi?id=443>). * In the short term, an interested platform may hook a private NULL-class library instance (called e.g. "PlatformHasAcpiLib") into AcpiTableDxe. Such a library instance would be a specialization of the above described generic DepexLib, with the DEPEX open-coded on the GUID introduced here. Either way, the platform makes EFI_ACPI_TABLE_PROTOCOL and (if enabled) EFI_ACPI_SDT_PROTOCOL dependent on the platform's dynamic decision to produce or not to produce a NULL protocol instance with this GUID. In turn, other (platform and universal) DXE drivers that produce ACPI tables will wait for EFI_ACPI_TABLE_PROTOCOL / EFI_ACPI_SDT_PROTOCOL, via DEPEX, protocol notify, or a simple gBS->LocateProtocol() in a "late enough" callback (such as Ready To Boot). Because this GUID is not standard, it is prefixed with EDKII / Edkii, as seen elsewhere in MdeModulePkg and SecurityPkg. In addition, an effort is made to avoid the phrase "AcpiPlatform", as that belongs to drivers / libraries that produce platform specific ACPI content (as opposed to deciding whether the entire firmware will have access to EFI_ACPI_TABLE_PROTOCOL, or any similar facilities in the PEI phase). Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/PrePiLib: allocate code pages for DxeCoreArd Biesheuvel2017-03-142-1/+33
| | | | | | | | | | | | | | The recently introduced memory protection features inadvertently broke the boot on all PrePi platforms, because the changes to explicitly use EfiBootServicesCode for loading the DxeCore PE/COFF image need to be applied in a different way for PrePi. So add a simple helper function that sets the type of an allocation to EfiBootServicesCode, and invoke it to allocate the space for DxeCore. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Michael Zimmermann <sigmaepsilon92@gmail.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: Remove use of IntelFrameworkModulePkg legacy libsLeif Lindholm2016-12-051-1/+1
| | | | | | | | | | | | | LzmaCustomDecompressLib and PeiDxeDebugLibReportStatusCode were copied from IntelFrameworkModulePkg to MdeModulePkg, but the originals were kept for compatibility. Since the libraries are identical, move EmbeddedPkg to use the MdeModulePkg versions instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/AndroidFastboot: drop dependency on the LinuxLoaderArd Biesheuvel2016-11-251-48/+22
| | | | | | | | | | | When booting the kernel via Fastboot, invoke the kernel image directly rather than passing it to the LinuxLoader app. This requires the kernel image to be built with UEFI stub support. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
* EmbeddedPkg/MmcDxe: expand to support multiple blocksHaojian Zhuang2016-11-242-59/+121
| | | | | | | | | | Make use of DMA to transfer multiple blocks at one time. It could improve the performance on MMC/SD driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/MmcDxe: set I/O speed and bus width in SD stackHaojian Zhuang2016-11-242-0/+122
| | | | | | | | | Add more SD commands to support 4-bit bus width & iospeed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/MmcDxe: invoke SetIos() protocol method to set speed and widthHaojian Zhuang2016-11-242-3/+187
| | | | | | | | | | | | | | | | Add the interface to change the bus width and speed. By default, MMC is initialized with 1-bit mode and less than 400KHz bus clock. It causes MMC working inefficiently. Set I/O bus width on both MMC controller and EXTCSD. Otherwise, it may cause unmatched failure case. And support more timing mode, high speed, HS200 & HS400 mode. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/Protocol/MmcHost: add new methods for I/O width and multiblockHaojian Zhuang2016-11-241-1/+34
| | | | | | | | | | | | | Add new protocol methods to change the bus width, speed and check for multiblock support. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Split off protocol changes from implementation changes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: MmcDxe: add SPEC_VERS field in CSD structureHaojian Zhuang2016-11-141-1/+2
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: MmcDxe: declare ECSD structureHaojian Zhuang2016-11-142-3/+158
| | | | | | | | | | Declare fields in ECSD structure. And drop the original 128 words arrary. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: MmcDxe: move ECSD into CardInfo structureHaojian Zhuang2016-11-142-3/+3
| | | | | | | | | | Since ECSD also describes the information of card, move it into structure CardInfo. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: MmcDxe: wait OCR busy bit freeHaojian Zhuang2016-11-141-3/+8
| | | | | | | | | | | According to eMMC spec, OCR.PowerUp bit is also busy bit. If the busy bit is '0', CMD1 should be sent and OCR should be fetched again. And add a timeout counter on the repeated steps. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: enable -DDISABLE_NEW_DEPRECATED_INTERFACESArd Biesheuvel2016-10-281-1/+2
| | | | | | | | | | | Define DISABLE_NEW_DEPRECATED_INTERFACES on the compiler command line by default, to prevent deprecated interfaces from being used in core EDK2 code. Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=164 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/MmcDxe: eliminate deprecated string function callsArd Biesheuvel2016-10-281-2/+2
| | | | | | | | | | | | | Get rid of calls to unsafe string functions. These are deprecated and may be removed in the future. Note that this also fixes an existing issue in the code, where the buffer may be overrun by one character when en == mLogRemainChar, in which case the NUL terminator ends up after the end of the buffer. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/EfiFileLib: eliminate deprecated string function callsArd Biesheuvel2016-10-281-19/+24
| | | | | | | | | | Get rid of calls to unsafe string functions. These are deprecated and may be removed in the future. Contributed-under: TianoCore Contribution Agreement 1.0 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/Ebl: eliminate deprecated string function callsArd Biesheuvel2016-10-285-18/+25
| | | | | | | | | | Get rid of calls to unsafe string functions. These are deprecated and may be removed in the future. Contributed-under: TianoCore Contribution Agreement 1.0 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/AndroidFastboot: eliminate deprecated string function callsArd Biesheuvel2016-10-282-6/+8
| | | | | | | | | | | | | | | Get rid of calls to unsafe string functions. These are deprecated and may be removed in the future. Note that this also addresses a latent potential issue in HandleDownload(), where NumBytesString[] (which comes from the wire) is assumed to contain a string representation of a number with all the significant digits in the first 8 bytes, which is not guaranteed by the protocol. Contributed-under: TianoCore Contribution Agreement 1.0 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/GdbDebugAgent: fix VOID* cast of incorrect sizeArd Biesheuvel2016-10-281-1/+1
| | | | | | | | | | The result of PcdGet64() can only be cast to VOID* on 64-bit platforms, so add an intermediate UINTN cast to make this code build again on 32 bit. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>