Commit Graph

315 Commits

Author SHA1 Message Date
Dandan Bi 9c8e9e76bd EmbeddedPkg/VirtualKeyboard: Avoid notification called more than once
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>
2018-09-14 10:18:31 +08:00
Vladimir Olovyannikov c4709260f6 EmbeddedPkg/CoherentDmaLib: Add missing checks to DmaMap
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>
2018-09-07 12:23:32 +02:00
Vladimir Olovyannikov c783da6599 EmbeddedPkg/CoherentDmaLib: Fix typo in DmaAlignedBuffer
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>
2018-09-07 12:21:28 +02:00
Haojian Zhuang 6861765935 EmbeddedPkg/AndroidFastbootApp: only use ENTER or SPACE to exit
Since hotkey 'f' is used to start AndroidFastbootApp. If user
press 'f' key too long, it may be recognized pressing 'f' key
multiple times. Then AndroidFastbootApp exists since it delcares
any key press could make it exit.

So only use ENTER or SPACE key to exit AndroidFastbootApp.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2018-08-24 15:44:18 +01:00
chenc2 cb9ee5a141 EmbeddedPkg: Removing ipf which is no longer supported from edk2.
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>
2018-06-29 16:19:43 +08:00
Ard Biesheuvel 02ec23abeb EmbeddedPkg/GdbSerialLib: avoid left shift of negative quantity
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>
2018-06-19 00:05:26 +02:00
Ard Biesheuvel a50aa9dd88 Embedded/EmbeddedPkg.dsc: enable NOOPT build target
Enable to NOOPT build target so we can build this package with
optimizations disabled.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-06-18 19:35:34 +02:00
Meenakshi Aggarwal 91c31ff04a EmbeddedPkg/TimeBaseLib: Add function to get Week day.
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>
2018-06-05 16:18:21 +01:00
Haojian Zhuang 7e074d15e7 EmbeddedPkg: add platform boot manager protocol
Create the PlatformBootManagerProtocol that is used to add
predefined boot options in platform driver. This interface
will be used in ArmPkg/PlatformBootManagerLib.

Cc: Laszlo Ersek <lersek@redhat.com>
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: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-06-05 15:43:15 +01:00
Haojian Zhuang 1df5fb2d83 EmbeddedPkg/Drivers: add virtual keyboard driver
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>
2018-04-30 17:58:14 +01:00
Laszlo Ersek 7ab26d5180 EmbeddedPkg: introduce NvVarStoreFormattedLib
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>
2018-04-12 21:24:30 +02:00
Ge Song 9384e1c011 EmbeddedPkg: Correct the way of handling sections with a large size
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>
2018-03-13 15:26:09 +00:00
Leif Lindholm aae5def8bb EmbeddedPkg: use central variable definitions in .vfr files
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>
2018-02-23 14:23:35 +00:00
Ard Biesheuvel 44e6186eea EmbeddedPkg/FdtLib: incorporate missing overlay support
Commit a099239015 ("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>
2018-02-21 10:53:08 +00:00
Leif Lindholm 6791175f05 EmbeddedPkg: _really_ delete PcdCacheEnable from .dec
Commit e537d878 meant to, but failed to, remove PcdCacheEnable.
Address this, and get rid of this obsolete flag.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2018-02-09 09:40:14 +00:00
Leif Lindholm e537d87817 EmbeddedPkg: delete unused Pcds and guids
Delete a bunch of Pcds, a guid, and a related header file - probably Ebl
related.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2018-02-06 18:01:29 +00:00
Leif Lindholm 72dd8a53fc EmbeddedPkg: delete unused HalRuntimeServicesExampleLib
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>
2018-02-06 18:01:24 +00:00
Leif Lindholm 03823aa3c6 EmbeddedPkg: drop unused Pcds from package .dsc
A bunch of Ebl-related Pcds are still referenced in package
Pcd. Drop them.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2018-02-06 18:01:20 +00:00
Michael Zimmermann 84513df419 EmbeddedPkg/FdtLib: build fdt_empty_tree.c
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>
2018-01-15 12:07:39 +00:00
Pankaj Bansal a099239015 EmbeddedPkg/FdtLib: Update FdtLib to v1.4.5
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>
2018-01-05 12:03:27 +00:00
Leif Lindholm a7912d4ad8 EmbeddedPkg: add ConsolePrefDxe to package .dsc
Add an entry for ConsolePrefDxe under [Components.common],
to permit building standalone.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2017-12-15 17:00:28 +00:00
Michael Zimmermann 4efc8a402d EmbeddedPkg/PrePiLib: add support for v2 sections
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>
2017-12-12 10:43:28 +00:00
Leif Lindholm ac811846f2 EmbeddedPkg: AndroidBootApp: fix clang compilation
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>
2017-12-06 21:39:51 +00:00
Ard Biesheuvel 2dd8fd8f7e EmbeddedPkg BeagleBoardPkg: move special HOB reuse libraries into platform
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>
2017-11-30 16:49:11 +00:00
Leif Lindholm 97eaeaa199 EmbeddedPkg: remove nonexistent FLASH_DEFINITION from package .dsc
For whatever reason, EmbeddedPkg.dsc included a FLASH_DEFINITION entry
pointing to a nonexistent EmbeddedPkg.fdf.

This used to be silently ignored, but recent BaseTools changes
5e9256cd7f ("BaseTools: Guid.xref contain information from FILE statements in FDF")
now caused builds against EmbeddedPkg.dsc to fail.
So delete the redundant entry.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2017-11-30 10:27:47 +00:00
Ard Biesheuvel fc82cfc24c ArmPkg: remove BdsLib and remaining ARM BDS related PCDs
With the last user FdtPlatformDxe removed, we can finally get rid of the
last bit of ARM BDS related cruft.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-11-26 10:58:33 +00:00
Ard Biesheuvel 34b17101ef EmbeddedPkg: remove FdtPlatformDxe
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>
2017-11-26 10:58:33 +00:00
Ard Biesheuvel 5604d269ab EmbeddedPkg Omap35xxPkg: remove EBL and associated libraries
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>
2017-11-26 10:58:33 +00:00
Leif Lindholm a64d587294 EmbeddedPkg: get rid of BdsLib dependency from Android*Boot
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>
2017-11-25 19:01:09 +00:00
Leif Lindholm 1abf9f05de EmbeddedPkg: add UefiRuntimeLib resolution to package .dsc
Required to build Android*Boot standalone.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2017-11-25 19:00:09 +00:00
Pipat Methavanitpong ca09475626 EmbeddedPkg: add mx66u1g45g nor flash info
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>
2017-11-16 16:28:55 +00:00
Ard Biesheuvel 517cf87794 EmbeddedPkg/RealTimeClockRuntimeDxe: move common functionality into core
RealTimeClockRuntimeDxe defers the hardware/platform specific handling
of reading/setting the hardware clock to RealTimeClockLib, but for
unknown reasons, it also defers common functionality such as input
validation and recording the timezone and DST settings (which are
informational only and not managed by hardware)

This has led to a lot of duplication in implementations of RealTimeClockLib
as well as TimeBaseLib, to the point where each library implementation
has its own set of UEFI variables to record the timezone and DST settings.
This makes little sense, and so let's update RealTimeClockRuntimeDxe now
to allow future implementations to rely on the core driver to take care of
these things.

Note that reading the timezone and DST settings occurs before calling into
the library, so we can phase out this behavior gradually from library
implementations in EDK2, edk2-platforms or out of 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>
2017-11-13 13:33:26 +00:00
Marcin Wojtas 7046610163 EmbeddedPkg: Implement NorFlashInfoLib
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>
2017-11-07 15:26:41 +00:00
Ard Biesheuvel b1832e16dd EmbeddedPkg: introduce GPIO PPI
Introduce a PPI counterpart of the existing 'embedded GPIO' protocol,
so we can manipulate GPIOs from PEI modules. This allows things like
setting the boot mode based on a DIP switch setting.

Note that the naming is slightly awkward, as there is nothing 'embedded'
about a GPIO, but given that the DXE protocol already resides here and
has the 'embedded' prefix, it makes sense to retain uniformity.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-11-05 16:18:49 +00:00
Daniil Egranov bca18551f6 Drivers/SataSiI3132Dxe: Allow 64-bit DMA transfer
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>
2017-10-27 13:53:35 +01:00
Daniil Egranov 050d513bac Drivers/SataSiI3132Dxe: Fixed PCI IO read and write operations
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>
2017-10-27 13:53:27 +01:00
Ard Biesheuvel d8e36289ce EmbeddedPkg: add driver to set graphical/serial console preference
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>
2017-10-23 12:14:00 +01:00
Star Zeng e39e40caa0 EmbeddedPkg PrePiHobLib: Implement BuildFv3Hob
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>
2017-10-10 20:54:47 +08:00
Ard Biesheuvel e40c728936 EmbeddedPkg: Introduce HardwareInterrupt2 protocol
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>
2017-10-05 21:23:34 +01:00
Meenakshi Aggarwal ea21f1d98d SD : Updated CMD 6 implememtation.
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>
2017-09-07 17:06:44 +01:00
Meenakshi Aggarwal 3d43616632 MMC : Added missing __FUNCTION__ macro.
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>
2017-09-07 17:06:39 +01:00
Meenakshi Aggarwal 1cc0f69bbe EmbeddedPkg: MmcDxe - Recieve response was missing after CMD12
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>
2017-09-01 11:31:42 +01:00
Ard Biesheuvel 723102c72f EmbeddedPkg: implement NonCoherentDmaLib based on ArmDmaLib
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>
2017-08-30 14:13:30 +01:00
Ard Biesheuvel 0bcb801067 EmbeddedPkg/CoherentDmaLib: add support for non-1:1 DMA translation
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>
2017-08-30 14:13:20 +01:00
Ard Biesheuvel 7385d2543e EmbeddedPkg: rename NullDmaLib to CoherentDmaLib
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>
2017-08-30 14:12:34 +01:00
Leif Lindholm 5202e6c907 EmbeddedPkg/EmbeddedPkg.dsc: fix build for non-ARM architectures
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>
2017-08-30 12:49:00 +01:00
Ard Biesheuvel deef290f95 EmbeddedPkg/DmaLib: add routine to allocate aligned buffers
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>
2017-08-29 17:54:36 +01:00
Jun Nie fa74dd2217 EmbeddedPkg/AndroidBoot: boot android kernel from storage
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>
2017-08-20 12:36:34 +01:00
Jun Nie 6e414300b5 EmbeddedPkg/AndroidFastboot: split android boot header
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>
2017-08-07 17:25:57 +01:00
Michael D Kinney 2a98de0344 edk2: Move License.txt file to root
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>
2017-08-03 11:02:17 -07:00