summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg/Drivers
Commit message (Collapse)AuthorAgeFilesLines
* 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: remove ISP 1716 USB host controller driverArd Biesheuvel2020-05-053-783/+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-055-1859/+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-056-3582/+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-053-2553/+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-053-864/+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-302-2/+2
| | | | | | | | | | | | 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/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-062-0/+300
| | | | | | | | | | | | 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/DtPlatformDxe: Add DT/ACPI Default FlexibilityAshish Singhal2019-11-072-6/+12
| | | | | | | | 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/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-094-8/+34
| | | | | | | | | | | | | 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: Fix various typosCœur2019-07-049-10/+10
| | | | | | | Fix various typos in EmbeddedPkg. Signed-off-by: Coeur <coeur@gmx.fr> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-0939-276/+39
| | | | | | | | | | | | | | | | | | | | 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/VirtualKeyboard: Avoid notification called more than onceDandan Bi2018-09-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=996 Issue: In current code logic, when a key is pressed, it will search the whole NotifyList to find whether a notification has been registered with the keystroke. if yes, it will en-queue the key for notification execution later. And now if different notification functions have been registered with the same key, then the key will be en-queued more than once. Then it will cause the notification executed more than once. This patch is to enhance the code logic to fix this issue. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* EmbeddedPkg: Removing ipf which is no longer supported from edk2.chenc22018-06-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/Drivers: add virtual keyboard driverHaojian Zhuang2018-04-305-0/+2095
| | | | | | | | | | | | | | | | | | | | | | | This driver is used to simulate a keyboard. For example, user could read GPIO setting or data from RAM address. If the value matches the expected pattern, it could trigger a key pressed event. User needs to implement hooks of PLATFORM_VIRTUAL_KBD_PROTOCOL. There're 4 hooks in this protocol. Register(): Quote the interface that user needs. For example, user needs to locate GPIO protocol if he wants to simulate a GPIO value as a key. Reset(): Do the initialization before reading value. Query(): Read value. If the value matches the expected pattern, trigger a key pressed event. Clear(): Clean the value if necessary. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: use central variable definitions in .vfr filesLeif Lindholm2018-02-232-16/+2
| | | | | | | | | | Use UefiMultiPhase.h in Vfr.vfr instead of duplicating EFI_VARIABLE_* definitions. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> 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: remove FdtPlatformDxeArd Biesheuvel2017-11-267-1627/+0
| | | | | | | | | With the last users migrated to a private version, we can now remove FdtPlatformDxe. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* Drivers/SataSiI3132Dxe: Allow 64-bit DMA transferDaniil Egranov2017-10-271-1/+1
| | | | | | | | Set a PCI IO attribute allowing 64-bit DMA transfer. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Daniil Egranov <daniil.egranov@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* Drivers/SataSiI3132Dxe: Fixed PCI IO read and write operationsDaniil Egranov2017-10-271-2/+2
| | | | | | | | | | | The ATA pass through read should use PCI IO bus master write operation and ATA pass through write should use PCI IO bus master read operation as the read and write operations are executed from the bus master's point of view. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Daniil Egranov <daniil.egranov@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: add driver to set graphical/serial console preferenceArd Biesheuvel2017-10-235-0/+464
| | | | | | | | | | | | | | | | 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/EmbeddedPkg.dsc: fix build for non-ARM architecturesLeif Lindholm2017-08-301-1/+0
| | | | | | | | | | | | | | | | | | | 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/DwEmmc: Adjust FIFO thresholdJun Nie2017-07-173-0/+49
| | | | | | | | | | 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-172-0/+5
| | | | | | | | | 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: import DesignWare EMMC driverLeif Lindholm2017-05-103-0/+828
| | | | | | | | 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-193-0/+2571
| | | | | | | | | | | | | | | | | | | 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/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 DT platform driver to select between DT and ACPIArd Biesheuvel2017-03-285-0/+380
| | | | | | | | | | | | | | | | | | | | 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/AndroidFastbootTransportTcpDxe: remove broken hostname handlingArd Biesheuvel2016-10-282-26/+0
| | | | | | | | | | | The fastboot TCP connection setup routine retrieves a hostname from a UEFI variable 'hostname' that is scoped under a GUID gEfiHostnameVariableGuid whose definition is missing from the code. Since the hostname is only printed and then discarded, let's just drop the whole thing. 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: Fix typos in commentsGary Lin2016-10-192-2/+2
| | | | | | | | | | | | | | | | | - reseting -> resetting - stoping -> stopping - Libary -> Library - paramter -> parameter - availible -> available - availble -> available - proccessed -> processed Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/FdtPlatformDxe: Reference Shell protocols in MdePkgRuiyu Ni2016-10-191-2/+2
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/Lan9118Dxe: Do not return uninitialised TxBuffMichael Brown2016-05-121-0/+2
| | | | | | | | | | | Conform to the specification for GetStatus(), which states that "if there are no transmit buffers to recycle and TxBuf is not NULL, *TxBuf will be set to NULL". Cc: Leif Lindholm <leif.lindholm@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Brown <mcb30@ipxe.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/Lan9118Dxe: add mask PCD to disable auto-negotiation featuresRyan Harkin2016-05-112-0/+2
| | | | | | | | | | | | | | | | | Add a PCD to allow the platform to mask in/out specific features of the LAN9118 device advertised during auto-negotiation. For example, the Juno ARM Development Platform doesn't support full duplex mode. This PCD will allow the platform developer to prevent the full duplex modes from being advertised. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org> [ardb: change default feature mask so that full duplex is disabled] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/Lan9118Dxe: remove redundant stallsMark Rutland2016-05-102-21/+0
| | | | | | | | | | | | | | Now that the LAN9118-specific MMIO accessors provide the required delays, remove the redundant stalls. Stalls in delay loops are kept, as these give time for work to happen beyond synchronisation of the device register file. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ryan Harkin <ryan.harkin@linaro.org> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/Lan9118Dxe: Use LAN9118 MMIO wrappersMark Rutland2016-05-103-107/+107
| | | | | | | | | | | | | Migrate the existing code to use the new LAN9118 MMIO wrappers, ensuring that timing requirements are respected. The newly redundant stalls will be removed in a subsequent patch. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ryan Harkin <ryan.harkin@linaro.org> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/Lan9118Dxe: add LAN9118 MMIO wrappersMark Rutland2016-05-103-0/+136
| | | | | | | | | | | | | | | | | | | As described in the LAN9118 datasheet, delays are necessary after some reads and writes in order to ensure subsequent reads do not see stale data. This patch adds helpers to provide these delays automatically, by performing dummy reads of the BYTE_TEST register (as recommended in the LAN9118 datasheet). This approach allows the device register file itself to provide the required delay, avoiding issues with early write acknowledgement, or re-ordering of MMIO accesses aganist other instructions (e.g. the delay loop). Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ryan Harkin <ryan.harkin@linaro.org> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* Revert "EmbeddedPkg/Lan9118Dxe: use MemoryFence"Mark Rutland2016-05-102-26/+23
| | | | | | | | | | | | | | | | | | | | | | | | | Commit a4626006bbf86113 ("EmbeddedPkg/Lan9118Dxe: use MemoryFence") replaced some stalls with memory fences, on the presumption that these were erroneously being used to order memory accesses. However, this was not the case. LAN9118 devices require a timing delay between state-changing reads/writes and subsequent reads, as updates to the register file are asynchronous and the effects of state-changes are not immediately visible to subsequent reads. This delay cannot be ensured through the use of memory barriers, which only enforce observable ordering, and not timing. Thus, converting these stalls to memory fences was erroneous, and may result in stale values being read. This reverts commit a4626006bbf86113453aeb7920895e66cdd04737. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ryan Harkin <ryan.harkin@linaro.org> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/Lan9118Dxe: rename TimeOut to RetriesRyan Harkin2016-02-101-11/+11
| | | | | | | | | | | | The variable TimeOut is actually a retry, not a timeout, so I renamed the variable accordingly. This patch makes no functional change. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/Lan9118Dxe: minor DEBUG tidyupRyan Harkin2016-02-101-3/+3
| | | | | | | | | | | | | | | | | | | This patch makes a few minor DEBUG output changes: - Fix typo in DEBUG output: Negociation->Negotiation - Change DEBUG occurrences of "Lan9118" to "LAN9118" to make grepping the log output easier. - Change the warning that auto-negotiation is not supported when AutoNegotiate() returns an error. The function already reports if the feature is supported or not and can also return an error for other reasons. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/Lan9118Dxe: add PCD for negotiation timeoutRyan Harkin2016-02-102-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a PCD for the link negotiation timeout so the platform can over-ride the default value. The code previously did 2000 iterations of the loop with a 2us stall, so the code has been changed subtly to set the number of iterations equal to the PCD value divided by the stall time. Since the stall time has not changed, the default PCD value is set at 4000 so the original behaviour is not changed. The problems were discovered when the ARM Juno Development Platform used the "EFI Network" option with then LAN9118 driver. It fails to boot the first time and so the board drops back to Shell again: Warning: LAN9118 Driver in stopped state Link timeout in auto-negotiation. Lan9118: Auto Negociation not supported. EhcExecTransfer: transfer failed with 2 EhcControlTransfer: error - Device Error, transfer - 2 Buffer: EFI Hard Drive Booting EFI Misc Device Booting EFI Misc Device 1 Booting EFI Hard Drive Booting EFI Network Warning: LAN9118 Driver not initialized Link timeout in auto-negotiation. Lan9118: Auto Negociation not supported. Booting EFI Internal Shell Exiting Shell drops the user back to the Intel BDS UI. Selecting "Continue" then succeeds in booting from the EFI Network: Booting EFI Misc Device Booting EFI Misc Device 1 Booting EFI Hard Drive Booting EFI Network ..MnpFreeTxBuf: Duplicated recycle report from SNP. MnpFreeTxBuf: Duplicated recycle report from SNP. [snip repeated errors] Discussion on the edk2-devel mailing list [1] prompted Laszlo Ersek to suggest the time taken for the NIC to negotiate was causing a problem. He suggested the solution contained in this patch to provide a PCD configurable by the platform. The default PCD value does not work for Juno. Setting the PCD to a larger value works for Juno R0, R1 and R2. [1] http://article.gmane.org/gmane.comp.bios.edk2.devel/7341 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/Lan9118Dxe: use MemoryFenceRyan Harkin2016-02-102-23/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When reviewing my LAN9118 driver PCD patch [1], Ard Biesheuvel noted that most calls to gBS->Stall() in this driver seem to be used to prevent timing issues between the device updating data and the host reading the values. And that replacing most of these calls with a MemoryFence() would be more robust. The only exceptions are the stalls that are enclosed inside retry loops: - in the AutoNegotiate() function. This stall is waiting for the link to negotiate, which may require stalling until it is ready. - in the Lan9118Initialize() function. These two stalls are waiting for devices and time out after a number of retries. - in the SoftReset() function. This stall is inside a loop where the comment states: "If time taken exceeds 100us, then there was an error condition" In these instances, I kept the stall, but also added a MemoryFence(). [1] http://article.gmane.org/gmane.comp.bios.edk2.devel/7389 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: Convert all .uni files to utf-8Jordan Justen2015-12-151-0/+0
| | | | | | | | | | | | | To convert these files I ran: $ python3 BaseTools/Scripts/ConvertUni.py EmbeddedPkg Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19252 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/Lan9118Dxe: Ignore spurious RXE errorsRonald Cron2015-07-161-28/+49
| | | | | | | | | | | | | Spurious error might appear during network transaction, ignore them when there are not relevant. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ronald Cron <Ronald.Cron@arm.com> Reviewed-by: Olivier Martin <Olivier.Martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18028 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/FdtPlatformDxe: Add FdtLib to the required librariesOlivier Martin2015-05-271-0/+1
| | | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <Olivier.Martin@arm.com> Reviewed-by: Ronald Cron <Ronald.Cron@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17525 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/FdtPlatformDxe: Do not exit if RunFdtInstallation() failsOlivier Martin2015-05-131-3/+0
| | | | | | | | | | | | | | | | If the device trees are not present when loading FdtPLatformDxe driver then we should prevent to install the EFI Shell FDT commands. The EFI Shell commands could be used later to install the missing device tree. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Ronald Cron <Ronald.Cron@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17441 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg: Added SATA Silicon Image driverOlivier Martin2015-05-115-0/+1865
| | | | | | | | | | | | Note: This is the same SATA controller present on Juno R1. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Ronald Cron <Ronald.Cron@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17413 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg: Remove dependency on TimerLibOlivier Martin2015-05-063-6/+3
| | | | | | | | | | | | | UEFI drivers should not depend on TimerLib. They should use BS.Stall() instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Ronald Cron <Ronald.Cron@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17343 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg: do not ASSERT() on valid external inputArd Biesheuvel2015-05-051-7/+8
| | | | | | | | | | | | | | | | | | Since ASSERT()s are enabled even on all ArmPlatformPkg RELEASE builds, ASSERT()ing on a valid FDT header will crash the firmware if the user selects an incorrect file. Since ASSERT() is meant to catch internal inconsistencies in the firmware, its use here is inappropriate. Instead, handle it as a normal error condition. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17309 6f19259b-4bc3-4df7-8a09-765794883524