2014-09-18 19:59:58 +02:00
|
|
|
## @file
|
|
|
|
# Device tree enumeration DXE driver for ARM Virtual Machines
|
|
|
|
#
|
|
|
|
# Copyright (c) 2014, Linaro Ltd. All rights reserved.<BR>
|
|
|
|
#
|
|
|
|
# This program and the accompanying materials are
|
|
|
|
# licensed and made available under the terms and conditions of the BSD License
|
|
|
|
# which accompanies this distribution. The full text of the license may be found at
|
|
|
|
# http://opensource.org/licenses/bsd-license.php
|
|
|
|
#
|
|
|
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
#
|
|
|
|
##
|
|
|
|
|
|
|
|
[Defines]
|
|
|
|
INF_VERSION = 0x00010005
|
|
|
|
BASE_NAME = VirtFdtDxe
|
2015-01-02 13:08:11 +01:00
|
|
|
FILE_GUID = 9AD7DCB4-E6EC-472E-96BF-81C219A3F77E
|
2014-09-18 19:59:58 +02:00
|
|
|
MODULE_TYPE = DXE_DRIVER
|
|
|
|
VERSION_STRING = 1.0
|
|
|
|
|
|
|
|
ENTRY_POINT = InitializeVirtFdtDxe
|
|
|
|
|
|
|
|
[Sources]
|
|
|
|
VirtFdtDxe.c
|
|
|
|
|
|
|
|
[Packages]
|
|
|
|
MdePkg/MdePkg.dec
|
ArmVirtualizationPkg/VirtFdtDxe: parse "pci-host-ecam-generic" properties
In the Linux kernel tree,
"Documentation/devicetree/bindings/pci/host-generic-pci.txt" describes the
device tree bindings of a Generic PCI host controller.
Recent QEMU patches from Alexander Graf implement such a controller on the
"virt" machine type of qemu-system-(aarch64|arm):
pcie@10000000 {
//
// (devfn<<8, 0, 0) PCI irq
// ---------------- -------
interrupt-map-mask = <0x1800 0x0 0x0 0x7>;
// gic irq
// (devfn<<8, 0, 0) pin+1 phandle (type, nr, level)
// ---------------- ----- -------- -----------------
interrupt-map = < 0x0 0x0 0x0 0x1 0x8001 0x0 0x3 0x4
0x0 0x0 0x0 0x2 0x8001 0x0 0x4 0x4
0x0 0x0 0x0 0x3 0x8001 0x0 0x5 0x4
0x0 0x0 0x0 0x4 0x8001 0x0 0x6 0x4
0x800 0x0 0x0 0x1 0x8001 0x0 0x4 0x4
0x800 0x0 0x0 0x2 0x8001 0x0 0x5 0x4
0x800 0x0 0x0 0x3 0x8001 0x0 0x6 0x4
0x800 0x0 0x0 0x4 0x8001 0x0 0x3 0x4
0x1000 0x0 0x0 0x1 0x8001 0x0 0x5 0x4
0x1000 0x0 0x0 0x2 0x8001 0x0 0x6 0x4
0x1000 0x0 0x0 0x3 0x8001 0x0 0x3 0x4
0x1000 0x0 0x0 0x4 0x8001 0x0 0x4 0x4
0x1800 0x0 0x0 0x1 0x8001 0x0 0x6 0x4
0x1800 0x0 0x0 0x2 0x8001 0x0 0x3 0x4
0x1800 0x0 0x0 0x3 0x8001 0x0 0x4 0x4
0x1800 0x0 0x0 0x4 0x8001 0x0 0x5 0x4>;
#interrupt-cells = <0x1>;
//
// child base cpu base
// type address address size
// --------- -------------- -------------- --------------
ranges = <0x1000000 0x0 0x0 0x0 0x3eff0000 0x0 0x10000
0x2000000 0x0 0x10000000 0x0 0x10000000 0x0 0x2eff0000>;
//
// PCIe config PCIe config
// space base space size
// -------------- -------------
reg = <0x0 0x3f000000 0x0 0x1000000>;
//
// allowed bus numbers; inclusive range
//
bus-range = <0x0 0xf>;
#size-cells = <0x2>;
#address-cells = <0x3>;
device_type = "pci";
compatible = "pci-host-ecam-generic";
};
Parse those properties of the compatible="pci-host-ecam-generic" node into
PCDs that are relevant for PCI enumeration in edk2:
- gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress controls
MdePkg/Library/BasePciExpressLib,
- gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration controls
OvmfPkg/AcpiPlatformDxe at this point,
- the rest have been introduced earlier in this patchset, and will control
PCI range checks and translation.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16894 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-23 17:02:50 +01:00
|
|
|
MdeModulePkg/MdeModulePkg.dec
|
2014-09-18 19:59:58 +02:00
|
|
|
ArmPkg/ArmPkg.dec
|
|
|
|
ArmPlatformPkg/ArmPlatformPkg.dec
|
2015-05-29 15:50:43 +02:00
|
|
|
ArmVirtPkg/ArmVirtPkg.dec
|
2014-09-18 19:59:58 +02:00
|
|
|
EmbeddedPkg/EmbeddedPkg.dec
|
|
|
|
OvmfPkg/OvmfPkg.dec
|
|
|
|
|
|
|
|
[LibraryClasses]
|
|
|
|
BaseLib
|
|
|
|
PcdLib
|
|
|
|
UefiDriverEntryPoint
|
|
|
|
DxeServicesLib
|
|
|
|
FdtLib
|
|
|
|
VirtioMmioDeviceLib
|
2015-02-28 21:26:00 +01:00
|
|
|
HobLib
|
2015-02-28 21:34:26 +01:00
|
|
|
XenIoMmioLib
|
2014-09-18 19:59:58 +02:00
|
|
|
|
|
|
|
[Guids]
|
|
|
|
gFdtTableGuid
|
2015-01-02 13:08:11 +01:00
|
|
|
gVirtioMmioTransportGuid
|
2015-02-28 21:26:00 +01:00
|
|
|
gFdtHobGuid
|
2014-09-18 19:59:58 +02:00
|
|
|
|
|
|
|
[Pcd]
|
2015-05-29 15:50:43 +02:00
|
|
|
gArmVirtTokenSpaceGuid.PcdArmPsciMethod
|
|
|
|
gArmVirtTokenSpaceGuid.PcdFwCfgSelectorAddress
|
|
|
|
gArmVirtTokenSpaceGuid.PcdFwCfgDataAddress
|
2015-09-24 23:40:36 +02:00
|
|
|
gArmVirtTokenSpaceGuid.PcdFwCfgDmaAddress
|
2015-07-28 22:45:25 +02:00
|
|
|
gArmVirtTokenSpaceGuid.PcdArmGicRevision
|
2014-09-18 19:59:58 +02:00
|
|
|
gArmTokenSpaceGuid.PcdGicDistributorBase
|
2015-02-28 21:25:26 +01:00
|
|
|
gArmTokenSpaceGuid.PcdGicRedistributorsBase
|
2014-09-18 19:59:58 +02:00
|
|
|
gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
|
|
|
|
gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
|
|
|
|
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
|
|
|
|
gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
|
|
|
|
gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
|
|
|
|
gArmPlatformTokenSpaceGuid.PcdPL031RtcBase
|
ArmVirtualizationPkg/VirtFdtDxe: parse "pci-host-ecam-generic" properties
In the Linux kernel tree,
"Documentation/devicetree/bindings/pci/host-generic-pci.txt" describes the
device tree bindings of a Generic PCI host controller.
Recent QEMU patches from Alexander Graf implement such a controller on the
"virt" machine type of qemu-system-(aarch64|arm):
pcie@10000000 {
//
// (devfn<<8, 0, 0) PCI irq
// ---------------- -------
interrupt-map-mask = <0x1800 0x0 0x0 0x7>;
// gic irq
// (devfn<<8, 0, 0) pin+1 phandle (type, nr, level)
// ---------------- ----- -------- -----------------
interrupt-map = < 0x0 0x0 0x0 0x1 0x8001 0x0 0x3 0x4
0x0 0x0 0x0 0x2 0x8001 0x0 0x4 0x4
0x0 0x0 0x0 0x3 0x8001 0x0 0x5 0x4
0x0 0x0 0x0 0x4 0x8001 0x0 0x6 0x4
0x800 0x0 0x0 0x1 0x8001 0x0 0x4 0x4
0x800 0x0 0x0 0x2 0x8001 0x0 0x5 0x4
0x800 0x0 0x0 0x3 0x8001 0x0 0x6 0x4
0x800 0x0 0x0 0x4 0x8001 0x0 0x3 0x4
0x1000 0x0 0x0 0x1 0x8001 0x0 0x5 0x4
0x1000 0x0 0x0 0x2 0x8001 0x0 0x6 0x4
0x1000 0x0 0x0 0x3 0x8001 0x0 0x3 0x4
0x1000 0x0 0x0 0x4 0x8001 0x0 0x4 0x4
0x1800 0x0 0x0 0x1 0x8001 0x0 0x6 0x4
0x1800 0x0 0x0 0x2 0x8001 0x0 0x3 0x4
0x1800 0x0 0x0 0x3 0x8001 0x0 0x4 0x4
0x1800 0x0 0x0 0x4 0x8001 0x0 0x5 0x4>;
#interrupt-cells = <0x1>;
//
// child base cpu base
// type address address size
// --------- -------------- -------------- --------------
ranges = <0x1000000 0x0 0x0 0x0 0x3eff0000 0x0 0x10000
0x2000000 0x0 0x10000000 0x0 0x10000000 0x0 0x2eff0000>;
//
// PCIe config PCIe config
// space base space size
// -------------- -------------
reg = <0x0 0x3f000000 0x0 0x1000000>;
//
// allowed bus numbers; inclusive range
//
bus-range = <0x0 0xf>;
#size-cells = <0x2>;
#address-cells = <0x3>;
device_type = "pci";
compatible = "pci-host-ecam-generic";
};
Parse those properties of the compatible="pci-host-ecam-generic" node into
PCDs that are relevant for PCI enumeration in edk2:
- gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress controls
MdePkg/Library/BasePciExpressLib,
- gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration controls
OvmfPkg/AcpiPlatformDxe at this point,
- the rest have been introduced earlier in this patchset, and will control
PCI range checks and translation.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16894 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-23 17:02:50 +01:00
|
|
|
gArmPlatformTokenSpaceGuid.PcdPciBusMin
|
|
|
|
gArmPlatformTokenSpaceGuid.PcdPciBusMax
|
|
|
|
gArmPlatformTokenSpaceGuid.PcdPciIoBase
|
|
|
|
gArmPlatformTokenSpaceGuid.PcdPciIoSize
|
|
|
|
gArmPlatformTokenSpaceGuid.PcdPciIoTranslation
|
|
|
|
gArmPlatformTokenSpaceGuid.PcdPciMmio32Base
|
|
|
|
gArmPlatformTokenSpaceGuid.PcdPciMmio32Size
|
|
|
|
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
|
|
|
|
gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration
|
2014-09-18 19:59:58 +02:00
|
|
|
|
|
|
|
[Protocols]
|
|
|
|
gEfiDevicePathProtocolGuid
|
|
|
|
|
|
|
|
[Depex]
|
|
|
|
TRUE
|