[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/8] seabios: pciinit: make pci bar assigner preferc
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH 4/8] seabios: pciinit: make pci bar assigner preferchable memory aware. |
Date: |
Thu, 17 Jun 2010 20:03:12 +0900 |
Make pci bar assigner preferchable memory aware.
This is needed for PCI bridge support because memory space and
prefetchable memory space is filtered independently based on
memory base/limit and prefetchable memory base/limit of pci bridge.
On bus 0, such a distinction isn't necessary so keep existing behavior
by checking bus=0.
Signed-off-by: Isaku Yamahata <address@hidden>
---
src/pciinit.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/pciinit.c b/src/pciinit.c
index b635e44..b6ab157 100644
--- a/src/pciinit.c
+++ b/src/pciinit.c
@@ -16,6 +16,7 @@
static u32 pci_bios_io_addr;
static u32 pci_bios_mem_addr;
+static u32 pci_bios_prefmem_addr;
/* host irqs corresponding to PCI irqs A-D */
static u8 pci_irqs[4] = {
10, 10, 11, 11
@@ -70,6 +71,12 @@ static int pci_bios_allocate_region(u16 bdf, int region_num)
u32 size = (~(val & mask)) + 1;
if (val & PCI_BASE_ADDRESS_SPACE_IO)
paddr = &pci_bios_io_addr;
+ else if ((val & PCI_BASE_ADDRESS_MEM_PREFETCH) &&
+ /* keep behaviour on bus = 0 */
+ pci_bdf_to_bus(bdf) != 0 &&
+ /* If pci_bios_prefmem_addr == 0, keep old behaviour */
+ pci_bios_prefmem_addr != 0)
+ paddr = &pci_bios_prefmem_addr;
else
paddr = &pci_bios_mem_addr;
*paddr = ALIGN(*paddr, size);
@@ -221,6 +228,9 @@ pci_setup(void)
pci_bios_io_addr = 0xc000;
pci_bios_mem_addr = BUILD_PCIMEM_START;
+ /* pci_bios_mem_addr + <some value> */
+ pci_bios_prefmem_addr = pci_bios_mem_addr + 0x08000000;
+
int bdf, max;
foreachpci(bdf, max) {
pci_bios_init_bridges(bdf);
--
1.6.6.1
- [Qemu-devel] [PATCH 0/8] seabios: pci: multi pci bus support, Isaku Yamahata, 2010/06/17
- [Qemu-devel] [PATCH 7/8] seabios: pciinit: pci bridge bus initialization., Isaku Yamahata, 2010/06/17
- [Qemu-devel] [PATCH 2/8] seabios: pciinit: factor out pci bar region allocation logic., Isaku Yamahata, 2010/06/17
- [Qemu-devel] [PATCH 4/8] seabios: pciinit: make pci bar assigner preferchable memory aware.,
Isaku Yamahata <=
- [Qemu-devel] [PATCH 1/8] seabios: pci: introduce foreachpci_in_bus() helper macro., Isaku Yamahata, 2010/06/17
- [Qemu-devel] [PATCH 5/8] seabios: pciinit: factor out bar offset calculation., Isaku Yamahata, 2010/06/17
- [Qemu-devel] [PATCH 8/8] seabios: pciinit: initialize pci bridge filtering registers., Isaku Yamahata, 2010/06/17
- [Qemu-devel] [PATCH 6/8] seabios: pciinit: make bar offset calculation pci bridge aware., Isaku Yamahata, 2010/06/17
- [Qemu-devel] [PATCH 3/8] seabios: pciinit: make pci memory space assignment 64bit aware., Isaku Yamahata, 2010/06/17
- [Qemu-devel] Re: [PATCH 0/8] seabios: pci: multi pci bus support, Michael S. Tsirkin, 2010/06/17