[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/14] pcbios: rombios32: make pci space assigner pr
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH 06/14] pcbios: rombios32: make pci space assigner preferchable memory aware. |
Date: |
Wed, 30 Sep 2009 19:18:41 +0900 |
make pci space assigner preferchable memory aware.
This is needed for PCI bridge support because memory space and
prefetchable memory space is filtered differently beased on
memory base/limit and prefetchable memory base/limit by pci bridge.
Signed-off-by: Isaku Yamahata <address@hidden>
---
rombios32.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/rombios32.c b/rombios32.c
index 19d3579..725f206 100644
--- a/rombios32.c
+++ b/rombios32.c
@@ -721,6 +721,8 @@ typedef struct PCIDevice {
static uint32_t pci_bios_io_addr;
static uint32_t pci_bios_mem_addr;
static uint32_t pci_bios_bigmem_addr;
+static uint32_t pci_bios_prefmem_addr;
+
/* host irqs corresponding to PCI irqs A-D */
static uint8_t pci_irqs[4] = { 10, 10, 11, 11 };
static PCIDevice i440_pcidev;
@@ -938,6 +940,11 @@ static void piix4_pm_enable(PCIDevice *d)
#endif
}
+static void pci_align_addr(uint32_t *paddr, uint32_t size)
+{
+ *paddr = (*paddr + size - 1) & ~(size - 1);
+}
+
static void pci_bios_init_device(PCIDevice *d)
{
int class;
@@ -1007,11 +1014,13 @@ static void pci_bios_init_device(PCIDevice *d)
size = (~(val & ~0xf)) + 1;
if (val & PCI_ADDRESS_SPACE_IO)
paddr = &pci_bios_io_addr;
+ else if (val & PCI_ADDRESS_SPACE_MEM_PREFETCH)
+ paddr = &pci_bios_prefmem_addr;
else if (size >= 0x04000000)
paddr = &pci_bios_bigmem_addr;
else
paddr = &pci_bios_mem_addr;
- *paddr = (*paddr + size - 1) & ~(size - 1);
+ pci_align_addr(paddr, size);
pci_set_io_region_addr(d, i, *paddr);
*paddr += size;
}
@@ -1072,6 +1081,11 @@ void pci_bios_init(void)
pci_bios_bigmem_addr = ram_size;
if (pci_bios_bigmem_addr < 0x90000000)
pci_bios_bigmem_addr = 0x90000000;
+ pci_bios_prefmem_addr = pci_bios_bigmem_addr + 0x08000000;
+ pci_align_addr(&pci_bios_prefmem_addr, 0x08000000);
+ if (pci_bios_prefmem_addr >= 0xe0000000) {
+ pci_bios_prefmem_addr = 0xf800000;
+ }
pci_for_each_device(pci_bios_init_bridges);
--
1.6.0.2
- [Qemu-devel] [PATCH 00/14] pcbios: support q35 chipset, Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 13/14] pcbios: change acpi dsdt for q35 chipset., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 09/14] pcbios: comment out PCI_FIXED_HOST_BRIDGE for gmch host pci bridge to undef., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 06/14] pcbios: rombios32: make pci space assigner preferchable memory aware.,
Isaku Yamahata <=
- [Qemu-devel] [PATCH 02/14] pcbios: fix makesym.perl, Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 14/14] pcibos/acpi dsdt: APIC mode support for q35 chipset, Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 08/14] pcibos: initialize q35 chipset., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 01/14] pcbios: add generated files to dot gitignore., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 03/14] pcbios: remove iasl output file when error., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 05/14] pcbios: rombios32: make pci memory space assignment 64bit aware., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 12/14] pcbios: make pci bar initialization to be aware of preferchable memory., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 07/14] pcbios: enable debug output for debug., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 10/14] pcibos: add mcfg entry to ACPI table for q35 pcie., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 04/14] pcbios: make set_e820_range() full 64bit aware., Isaku Yamahata, 2009/09/30