Reviewed-By: Olivier Martin <[email protected]>
> -----Original Message----- > From: Laszlo Ersek [mailto:[email protected]] > Sent: 14 February 2015 22:02 > To: [email protected]; [email protected]; Peter Maydell; Ard > Biesheuvel; Drew Jones; Wei Huang; Donald Dutile; Wei Liu > Subject: [edk2] [PATCH 15/27] ArmVirtualizationPkg/PciHostBridgeDxe: > add room for PCI resource allocation > > VirtFdtDxe parses the following address space properties from the DTB > (and > saves them in PCDs) : > > ProcessPciHost: Config[0x3F000000+0x1000000) > Bus[0x0..0xF] > Io[0x0+0x10000)@0x3EFF0000 > Mem[0x10000000+0x2EFF0000)@0x0 > > In order to allow PCI enumeration to allocate IO and MMIO resources > from > the above ranges for devices, we must add the ranges to the Global > Coherency Domain. > > There are two ways for that: > - building resource descriptor HOBs in the HOB producer phase > (basically, > PEI), and letting the DXE core process them, > - calling gDS->AddIoSpace() and gDS->AddMemorySpace() during DXE. > > We opt for the second method for simplicity. > > In the address space maps, the corresponding ranges change from > "nonexistent" to "IO" and "MMIO", from which the gDS->AllocateIoSpace() > and gDS->AllocateMemorySpace() services can later allocate PCI BARs. > > GCD:AddIoSpace(Base=0000000000000000,Length=0000000000010000) > GcdIoType = I/O > Status = Success > GCDIoType Range > ========== ================================= > -> I/O 0000000000000000-000000000000FFFF > > GCD:AddMemorySpace(Base=0000000010000000,Length=000000002EFF0000) > GcdMemoryType = MMIO > Capabilities = 0000000000000001 > Status = Success > GCDMemType Range Capabilities > Attributes > ========== ================================= ================ > ================ > NonExist 0000000000000000-0000000003FFFFFF 0000000000000000 > 0000000000000000 > MMIO 0000000004000000-0000000007FFFFFF C000000000000001 > 8000000000000001 > NonExist 0000000008000000-000000000900FFFF 0000000000000000 > 0000000000000000 > MMIO 0000000009010000-0000000009010FFF C000000000000001 > 8000000000000001 > NonExist 0000000009011000-000000000FFFFFFF 0000000000000000 > 0000000000000000 > -> MMIO 0000000010000000-000000003EFEFFFF C000000000000001 > 0000000000000000 > NonExist 000000003EFF0000-000000003FFFFFFF 0000000000000000 > 0000000000000000 > SystemMem 0000000040000000-00000000BFFFFFFF 800000000000000F > 0000000000000008* > NonExist 00000000C0000000-0000FFFFFFFFFFFF 0000000000000000 > 0000000000000000 > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Laszlo Ersek <[email protected]> > --- > ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c | > 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git > a/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c > b/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c > index bdfd3e3..973735a 100644 > --- > a/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c > +++ > b/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c > @@ -134,6 +134,25 @@ InitializePciHostBridge ( > mResAperture[0][0].IoTranslation = PcdGet64 (PcdPciIoTranslation); > > // > + // Add IO and MMIO memory space, so that resources can be allocated > in the > + // EfiPciHostBridgeAllocateResources phase. > + // > + Status = gDS->AddIoSpace ( > + EfiGcdIoTypeIo, > + PcdGet64 (PcdPciIoBase), > + PcdGet64 (PcdPciIoSize) > + ); > + ASSERT_EFI_ERROR (Status); > + > + Status = gDS->AddMemorySpace ( > + EfiGcdMemoryTypeMemoryMappedIo, > + PcdGet64 (PcdPciMmioBase), > + PcdGet64 (PcdPciMmioSize), > + EFI_MEMORY_UC > + ); > + ASSERT_EFI_ERROR (Status); > + > + // > // Create Host Bridge Device Handle > // > for (Loop1 = 0; Loop1 < HOST_BRIDGE_NUMBER; Loop1++) { > -- > 1.8.3.1 > > > > ----------------------------------------------------------------------- > ------- > Dive into the World of Parallel Programming. The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is > your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. > Take a > look and join the conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > edk2-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
