Acidanthera UEFI Development Kit based on EDK II edk2-stable202311
Go to file
Heyi Guo 74d0a339b8 MdeModulePkg/PciHostBridgeDxe: Add support for address translation
PCI address translation is necessary for some non-x86 platforms. On
such platforms, address value (denoted as "device address" or "address
in PCI view") set to PCI BAR registers in configuration space might be
different from the address which is used by CPU to access the
registers in memory BAR or IO BAR spaces (denoted as "host address" or
"address in CPU view"). The difference between the two addresses is
called "Address Translation Offset" or simply "translation", and can
be represented by "Address Translation Offset" in ACPI QWORD Address
Space Descriptor (Offset 0x1E). However UEFI and ACPI differs on the
definitions of QWORD Address Space Descriptor, and we will follow UEFI
definition on UEFI protocols, such as PCI root bridge IO protocol and
PCI IO protocol. In UEFI 2.7, "Address Translation Offset" is "Offset
to apply to the Starting address to convert it to a PCI address". This
means:

1. Translation = device address - host address.

2. PciRootBridgeIo->Configuration should return CPU view address, as
well as PciIo->GetBarAttributes.

Summary of addresses used in protocol interfaces and internal
implementations:

1. *Only* the following protocol interfaces assume Address is Device
   Address:
(1). PciHostBridgeResourceAllocation.GetProposedResources()
     Otherwise PCI bus driver cannot set correct address into PCI
     BARs.
(2). PciRootBridgeIo.Mem.Read() and PciRootBridgeIo.Mem.Write()
(3). PciRootBridgeIo.CopyMem()
UEFI and PI spec have clear statements for all other protocol
interfaces about the address type.

2. Library interfaces and internal implementation:
(1). Base and Limit in PCI_ROOT_BRIDGE_APERTURE are device address.
     It is easy to check whether the address is below 4G or above 4G.
(2). Addresses in PCI_ROOT_BRIDGE_INSTANCE.ResAllocNode are host
     address, for they are allocated from GCD.
(3). Address passed to PciHostBridgeResourceConflict is host address,
     for it comes from PCI_ROOT_BRIDGE_INSTANCE.ResAllocNode.

RESTRICTION: to simplify the situation, we require the alignment of
Translation must be larger than any BAR alignment in the same root
bridge, so that resource allocation alignment can be applied to both
device address and host address.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Signed-off-by: Yi Li <phoenix.liyi@huawei.com>
Reviewed-by: Ni Ruiyu <ruiyu.ni@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2018-03-15 08:26:05 +00:00
AppPkg AppPkg/WebServer: Fix build failure. 2017-09-14 08:55:09 +08:00
ArmPkg ArmPkg/TimerDxe: Add ISB for timer compare value reload 2018-03-15 08:07:14 +00:00
ArmPlatformPkg ArmPlatformPkg/MemoryInitPeiLib: reserve rather than remove FV memory 2018-02-28 16:10:58 +00:00
ArmVirtPkg ArmVirtPkg/PlatformBootManagerLib: minimize the set of connected devices 2018-03-14 11:24:30 +01:00
BaseTools BaseTools: UPT: remove unused variable and inaccessible code. 2018-03-15 14:50:15 +08:00
BeagleBoardPkg BeagleBoardPkg: drop unused PcdCacheEnabled dependency 2018-02-09 09:40:11 +00:00
Conf EDK II: Add .gitignore 2014-10-14 16:08:15 +00:00
CorebootModulePkg CorebootModulePkg/CbSupportDxe: Remove duplicated IO Space addition 2017-11-16 10:52:00 +08:00
CorebootPayloadPkg CorebootPayloadPkg/PciHostBridgeLib: clear aperture vars for (re)init 2018-03-15 08:25:56 +00:00
CryptoPkg CryptoPkg: Update package version to 0.98 2018-01-23 08:56:27 +08:00
DuetPkg DuetPkg: Add SafeIntLib and BmpSupportLib to DSC files 2018-02-11 16:06:31 -08:00
EdkCompatibilityPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
EdkShellBinPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
EdkShellPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
EmbeddedPkg EmbeddedPkg: Correct the way of handling sections with a large size 2018-03-13 15:26:09 +00:00
EmulatorPkg EmulatorPkg: Undefine CR3 macro in Host.h 2018-02-27 18:33:51 +08:00
FatBinPkg FatBinPkg: New EnhancedFatDxe binaries for IA32, X64, EBC and IPF 2017-12-22 09:40:18 +08:00
FatPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
IntelFrameworkModulePkg IntelFrameworkModulePkg/GenericBdsLib: Remove the useless Perf codes 2018-02-12 11:36:15 +08:00
IntelFrameworkPkg IntelFrameworkPkg/FrameworkUefiLib: Sync with MdePkg/UefiLib 2018-02-11 15:10:17 -08:00
IntelFsp2Pkg IntelFsp2Pkg-Tools: GenCfgOpt.py shouldn't include specific UPD name 2017-11-08 20:44:29 +08:00
IntelFsp2WrapperPkg IntelFsp2WrapperPkg: Update BaseFspWrapperApiLib to pass XCODE5 build 2018-01-18 15:39:54 +08:00
IntelFspPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
IntelFspWrapperPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
IntelSiliconPkg IntelSiliconPkg/Vtd: Add missing dump in ExtContext. 2018-03-12 13:17:15 +08:00
MdeModulePkg MdeModulePkg/PciHostBridgeDxe: Add support for address translation 2018-03-15 08:26:05 +00:00
MdePkg MdePkg/DevicePathFromText: Fix byte orders of iSCSI.Lun 2018-03-03 15:12:50 +08:00
NetworkPkg NetworkPkg/IScsiDxe: Fix the ISCSI connection failure in certain case. 2018-03-13 16:55:24 +08:00
Nt32Pkg Nt32Pkg/Nt32Pkg.fdf: Increase the size of FLASH Device. 2018-02-08 08:23:26 +08:00
Omap35xxPkg Omap35xxPkg: add GetTimeInNanoSecond implementation 2017-11-30 14:32:30 +00:00
OptionRomPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
OvmfPkg OvmfPkg/PciHostBridgeLib: clear PCI aperture vars for (re)init 2018-03-15 08:26:05 +00:00
PcAtChipsetPkg PcAtChipsetPkg PeiAcpiTimerLib: Add the missing DebugLib header file 2018-02-07 09:16:15 +08:00
QuarkPlatformPkg QuarkPlatformPkg: Add SafeIntLib and BmpSupportLib to DSC files 2018-02-11 16:06:25 -08:00
QuarkSocPkg QuarkSocPkg/QNCSmmDispatcher: Fix use after free issue #2 2017-08-16 19:42:17 -07:00
SecurityPkg SecurityPkg/TcgPei: drop PeiReadOnlyVariable from Depex 2018-03-10 16:27:57 +01:00
ShellBinPkg ShellBinPkg: Ia32/X64 Shell binary update. 2018-03-07 16:30:32 +08:00
ShellPkg ShellPkg/[hex]edit: Fix mouse freeze issue 2018-03-14 11:25:44 +08:00
SignedCapsulePkg SignedCapsulePkg: Update EdkiiSystemCapsuleLib to check PCD value 2017-12-08 13:31:00 +08:00
SourceLevelDebugPkg SourceLevelDebugPkg DebugUsb3: Re-Support IOMMU 2018-03-15 14:14:26 +08:00
StdLib StdLib/BsdSocketLib: Remove unused variables 2017-11-13 07:39:06 -08:00
StdLibPrivateInternalFiles edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
UefiCpuPkg UefiCpuPkg/MpInitLib: put mReservedApLoopFunc in executable memory 2018-03-08 17:07:14 +08:00
UnixPkg UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg) 2013-07-29 21:09:55 +00:00
Vlv2DeviceRefCodePkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
Vlv2TbltDevicePkg Vlv2TbltDevicePkg/Override/GenericBdsLib:Remove useless Perf code 2018-02-12 11:36:15 +08:00
.gitignore edk2: Add .DS_Store to .gitignore for macOS 2017-05-19 15:14:34 -07:00
.gitmodules CryptoPkg: Adding OpenSSL as one submodule of EDKII repo 2018-01-18 14:06:15 +08:00
BuildNotes2.txt BaseTools: Updated BuildNotes URLs 2016-03-25 09:46:44 +08:00
Contributions.txt edk2: Fix typo in Contributions.txt 2017-08-16 17:50:44 +08:00
License.txt edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
Maintainers.txt Maintainers.txt: Add Jiewen to be co-maintainer of SecurityPkg. 2018-03-02 09:25:00 +08:00
Readme.md edk2: Add Readme.md to root of edk2 repository 2017-08-03 11:02:25 -07:00
edksetup.bat BaseTools: suppress usage instructions with rebuild options 2017-07-04 10:16:13 +08:00
edksetup.sh BaseTools/edksetup.sh: fix invalid test for current working directory 2017-08-10 12:54:58 +08:00

Readme.md

EDK II Project

A modern, feature-rich, cross-platform firmware development environment for the UEFI and PI specifications from www.uefi.org.

Contributions to the EDK II open source project are covered by the TianoCore Contribution Agreement 1.1

The majority of the content in the EDK II open source project uses a BSD 2-Clause License. The EDK II open source project contains the following components that are covered by additional licenses:

The EDK II Project is composed of packages. The maintainers for each package are listed in Maintainers.txt.

Resources