[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/8] seabios: pciinit: make pci memory space assignm
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH 3/8] seabios: pciinit: make pci memory space assignment 64bit aware. |
Date: |
Thu, 17 Jun 2010 20:03:11 +0900 |
make pci memory space assignment 64bit aware.
If 64bit memory space is found while assigning pci memory space,
clear higher bit and skip to next bar.
This patch is preparation for q35 chipset initialization which
has 64bit bar.
Signed-off-by: Isaku Yamahata <address@hidden>
---
src/pciinit.c | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/pciinit.c b/src/pciinit.c
index 488c77b..b635e44 100644
--- a/src/pciinit.c
+++ b/src/pciinit.c
@@ -37,7 +37,12 @@ static void pci_set_io_region_addr(u16 bdf, int region_num,
u32 addr)
dprintf(1, "region %d: 0x%08x\n", region_num, addr);
}
-static void pci_bios_allocate_region(u16 bdf, int region_num)
+/*
+ * return value
+ * 0: 32bit BAR
+ * non 0: 64bit BAR
+ */
+static int pci_bios_allocate_region(u16 bdf, int region_num)
{
u32 *paddr;
int ofs;
@@ -71,13 +76,23 @@ static void pci_bios_allocate_region(u16 bdf, int
region_num)
pci_set_io_region_addr(bdf, region_num, *paddr);
*paddr += size;
}
+
+ int is_64bit = !(val & PCI_BASE_ADDRESS_SPACE_IO) &&
+ (val & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == PCI_BASE_ADDRESS_MEM_TYPE_64;
+ if (is_64bit) {
+ pci_config_writel(bdf, ofs + 4, 0);
+ }
+ return is_64bit;
}
static void pci_bios_allocate_regions(u16 bdf)
{
int i;
for (i = 0; i < PCI_NUM_REGIONS; i++) {
- pci_bios_allocate_region(bdf, i);
+ int is_64bit = pci_bios_allocate_region(bdf, i);
+ if (is_64bit){
+ i++;
+ }
}
}
--
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, 2010/06/17
- [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 <=
- [Qemu-devel] Re: [PATCH 0/8] seabios: pci: multi pci bus support, Michael S. Tsirkin, 2010/06/17