summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg/Library/QemuFwCfgLib
Commit message (Collapse)AuthorAgeFilesLines
* ArmVirtPkg/QemuFwCfgLib: allow UEFI_DRIVER modulesLaszlo Ersek2020-04-281-1/+1
| | | | | | | | | | | | | | | | | | | We don't distribute UEFI_DRIVER modules stand-alone that were built as part of an ArmVirtQemu* platform. ArmVirtQemu* UEFI_DRIVERs are allowed to inherit platform dependencies. By enabling UEFI_DRIVERs to consume QemuFwCfgLib, we can hook fw_cfg-based NULL class libraries into UEFI drivers, e.g. in order to set dynamic PCDs. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Per Sundstrom <per_sundstrom@yahoo.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2681 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20200424075353.8489-7-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* ArmVirtPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-092-15/+2
| | | | | | | | | | | | | | | | | | | | 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: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg, OvmfPkg: retire QemuFwCfgS3Enabled() from QemuFwCfgLibLaszlo Ersek2017-03-141-17/+0
| | | | | | | | | | | | | | | | | | | | At this point we're ready to retire QemuFwCfgS3Enabled() from the QemuFwCfgLib class, together with its implementations in: - ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c - OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c Extend all modules that call the function with a new QemuFwCfgS3Lib class dependency. Thanks to the previously added library class, instances, and class resolutions, we can do this switch now as tightly as possible. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=394 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* ArmVirtPkg/QemuFwCfgLib: implement QemuFwCfgSkipBytes() APILaszlo Ersek2017-01-311-0/+78
| | | | | | | | | | | | | | | | | We are now sufficiently equipped to implement the new QemuFwCfgSkipBytes() API. The previous patch and this one enable ArmVirtPkg/QemuFwCfgLib to overwrite part of a writeable fw_cfg file, which will be particularly useful for the upcoming QEMU_LOADER_WRITE_POINTER command in OvmfPkg/AcpiPlatformDxe. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* ArmVirtPkg/QemuFwCfgLib: use DMA for QemuFwCfgWriteBytes() if availableLaszlo Ersek2017-01-311-6/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | We use the "InternalQemuFwCfgReadBytes" static function pointer to dispatch the reading of fw_cfg bytes between MMIO and DMA. This pointer is initialized to MMIO, and we set it to DMA in the library constructor if DMA is available. Unlike the above, we write fw_cfg bytes only with MMIO at the moment. Extend the write functionality so that it follows the read pattern: - introduce the new function typedef WRITE_BYTES_FUNCTION, - extract the current (MMIO-only) write internals from QemuFwCfgWriteBytes() to MmioWriteBytes(), - provide a DMA-based implementation in DmaWriteBytes() -- a thin wrapper around DmaTransferBytes(), - set the new static function pointer "InternalQemuFwCfgWriteBytes" according to the DMA feature provided by QEMU, - In QemuFwCfgWriteBytes(), call the best available method through "InternalQemuFwCfgWriteBytes". Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* ArmVirtPkg/QemuFwCfgLib: extract generic DmaTransferBytes() functionLaszlo Ersek2017-01-311-6/+36
| | | | | | | | | | | | | | | | The DmaReadBytes() function that we currently use only for reading -- through the InternalQemuFwCfgReadBytes function pointer, in case the DMA interface is available -- is suitable with minimal changes for two more operations provided by the DMA interface, WRITE and SKIP. Expose the Control parameter in the function prototype, rename the function to DmaTransferBytes(), and rebase DmaReadBytes() to it. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* ArmVirtPkg/QemuFwCfgLib: rebase lib instance to updated lib class headerLaszlo Ersek2016-12-051-1/+1
| | | | | | | | | | | | Put the FW_CFG_F_DMA constant, introduced in the last patch, to use. 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: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* ArmVirtPkg, OvmfPkg: QemuFwCfgLib: move DMA-related defs to lib classLaszlo Ersek2016-12-051-20/+0
| | | | | | | | | | | | | | Move the type and macro definitions related to QEMU's DMA-like fw_cfg access method to the library class header. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* ArmVirtPkg/QemuFwCfgLib: remove superfluous InternalQemuFwCfgIsAvailable()Laszlo Ersek2016-12-051-25/+6
| | | | | | | | | | | | | | | | InternalQemuFwCfgIsAvailable() is an API that is incorrectly exposed by the "OvmfPkg/Include/Library/QemuFwCfgLib.h" library class header; the API is meant to be used internally to library instances (if it's needed at all). ArmVirtPkg's instance has no use for it actually, so simplify the code and remove the function definition. 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: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* ArmVirtPkg/FdtClientDxe: report address and size cell count directlyArd Biesheuvel2016-09-151-3/+6
| | | | | | | | | | | | | | | The FDT client protocol methods dealing with "reg" properties return the size of a "reg" element. Currently, we have hardcoded this as '8', since #address-cells == #size-cells == 2 in most cases. However, for different values, have a single 'reg' element size is not unambiguous, since - however unlikely - if #address-cells != #size-cells, we do not know which is which. So before adding more methods to the protocol, fix up this oversight. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg/QemuFwCfgLib: move to FDT client protocolArd Biesheuvel2016-04-122-10/+77
| | | | | | | | | | | | | | | | Make this library depend on the FDT client protocol to access the host supplied device tree directly rather than depending on VirtFdtDxe to set them using dynamic PCDs. Since this library is used by several drivers (BdsDxe, SmbiosPlatformDxe, SmbiosDxe and QemuFwCfgAcpiPlatformDxe), we will end up parsing the device tree and the fwcfg node at least four times. However, no dynamic PCDs are involved anymore, and will even be removed completely in a subsequent patch. So the conversion is not optimal, but guaranteed to be safe. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: QemuFwCfgLib: read bytes from fw-cfg with DMA when availableLaszlo Ersek2015-09-242-7/+121
| | | | | | | | | | | The protocol is documented in "docs/specs/fw_cfg.txt" in the QEMU tree. Cc: Ard Biesheuvel <ard.biesheuvel@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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18545 6f19259b-4bc3-4df7-8a09-765794883524
* Renamed ArmPlatformPkg/ArmVirtualizationPkg into ArmVirtPkgOlivier Martin2015-05-292-0/+410
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17537 6f19259b-4bc3-4df7-8a09-765794883524