aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2012-11-26 11:05:32 -0500
committerKevin O'Connor <kevin@koconnor.net>2012-11-26 11:05:32 -0500
commitb1c35f2b28cc0c94ebed8176ff61ac0e0b377798 (patch)
tree948308c2301a4ba5547f0bf90715d903065c8987
parent31dcfb0682da419376ebdf5aa61f0a6ecc9e39c0 (diff)
downloadseabios-hppa-b1c35f2b28cc0c94ebed8176ff61ac0e0b377798.zip
seabios-hppa-b1c35f2b28cc0c94ebed8176ff61ac0e0b377798.tar.gz
seabios-hppa-b1c35f2b28cc0c94ebed8176ff61ac0e0b377798.tar.bz2
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 <kevin@koconnor.net>
-rw-r--r--src/pciinit.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/pciinit.c b/src/pciinit.c
index d61f0a8..0e87ab0 100644
--- a/src/pciinit.c
+++ b/src/pciinit.c
@@ -226,6 +226,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) {