From: Kevin O'Connor Date: Mon, 26 Nov 2012 16:05:32 +0000 (-0500) Subject: pciinit: Align start of PCI memory on i440 chipset. X-Git-Tag: rel-1.7.2~44 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b1c35f2b28cc0c94ebed8176ff61ac0e0b377798;p=seabios.git pciinit: Align start of PCI memory on i440 chipset. Align the start of PCI memory space to simplify mtrr ranges. This is configured per chipset so future chipsets can configure different start addresses. Signed-off-by: Kevin O'Connor --- diff --git a/src/pciinit.c b/src/pciinit.c index d61f0a8..0e87ab0 100644 --- a/src/pciinit.c +++ b/src/pciinit.c @@ -225,6 +225,33 @@ static void pci_bios_init_devices(void) } +/**************************************************************** + * Platform device initialization + ****************************************************************/ + +void i440fx_mem_addr_init(struct pci_device *dev, void *arg) +{ + if (RamSize <= 0x80000000) + pcimem_start = 0x80000000; + else if (RamSize <= 0xc0000000) + pcimem_start = 0xc0000000; +} + +static const struct pci_device_id pci_platform_tbl[] = { + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, + i440fx_mem_addr_init), + PCI_DEVICE_END +}; + +static void pci_bios_init_platform(void) +{ + struct pci_device *pci; + foreachpci(pci) { + pci_init_device(pci_platform_tbl, pci, NULL); + } +} + + /**************************************************************** * Bus initialization ****************************************************************/ @@ -583,8 +610,6 @@ static void pci_region_map_entries(struct pci_bus *busses, struct pci_region *r) static void pci_bios_map_devices(struct pci_bus *busses) { - pcimem_start = RamSize; - if (pci_bios_init_root_regions(busses)) { struct pci_region r64_mem, r64_pref; r64_mem.list = NULL; @@ -647,6 +672,9 @@ pci_setup(void) dprintf(1, "=== PCI device probing ===\n"); pci_probe_devices(); + pcimem_start = RamSize; + pci_bios_init_platform(); + dprintf(1, "=== PCI new allocation pass #1 ===\n"); struct pci_bus *busses = malloc_tmp(sizeof(*busses) * (MaxPCIBus + 1)); if (!busses) {