CBMEM northbridges: Remove references to global high_tables_base
Use the new helper function set_top_of_ram() to remove remaining uses of high_tables_base and _size under northbridge/. Change-Id: I6b0d9615002ed2aff578c5811d7bd43dd2594453 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/3561 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@google.com>
This commit is contained in:
parent
2b790f6512
commit
42f4651434
|
@ -86,9 +86,7 @@ static void cpu_pci_domain_read_resources(struct device *dev)
|
|||
}
|
||||
|
||||
#if !CONFIG_DYNAMIC_CBMEM
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tomk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tomk * 1024);
|
||||
#endif
|
||||
|
||||
if (i440fx) {
|
||||
|
|
|
@ -108,9 +108,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
tolmk = tomk;
|
||||
}
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tolmk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tolmk * 1024);
|
||||
|
||||
/* Report the memory regions */
|
||||
idx = 10;
|
||||
|
|
|
@ -290,9 +290,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
ram_resource(dev, idx++, 0, 640);
|
||||
ram_resource(dev, idx++, 768, tomk - 768); /* Systop - 0xc0000 -> KB */
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tomk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tomk * 1024);
|
||||
}
|
||||
|
||||
assign_resources(dev->link_list);
|
||||
|
|
|
@ -389,9 +389,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
ram_resource(dev, idx++, 0, 640);
|
||||
ram_resource(dev, idx++, 768, tomk - 768); // Systop - 0xc0000 -> KB
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tomk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tomk * 1024);
|
||||
}
|
||||
|
||||
assign_resources(dev->link_list);
|
||||
|
|
|
@ -101,10 +101,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
*/
|
||||
tolmk = tomk;
|
||||
|
||||
high_tables_base = (tolmk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
printk(BIOS_DEBUG, "tom: %lx, high_tables_base: %llx, high_tables_size: %llx\n",
|
||||
tomk * 1024, high_tables_base, high_tables_size);
|
||||
set_top_of_ram(tolmk * 1024);
|
||||
|
||||
/* Report the memory regions */
|
||||
idx = 10;
|
||||
|
|
|
@ -84,9 +84,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
(remaplimitk + 64*1024) - remapbasek);
|
||||
}
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tolmk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tolmk * 1024);
|
||||
}
|
||||
assign_resources(dev->link_list);
|
||||
}
|
||||
|
|
|
@ -85,9 +85,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
(remaplimitk + 64*1024) - remapbasek);
|
||||
}
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tolmk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tolmk * 1024);
|
||||
}
|
||||
assign_resources(dev->link_list);
|
||||
}
|
||||
|
|
|
@ -102,9 +102,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
(remaplimitk + 64*1024) - remapbasek);
|
||||
}
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tolmk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tolmk * 1024);
|
||||
}
|
||||
assign_resources(dev->link_list);
|
||||
}
|
||||
|
|
|
@ -101,9 +101,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
(remaplimitk + 64*1024) - remapbasek);
|
||||
}
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tolmk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tolmk * 1024);
|
||||
}
|
||||
assign_resources(dev->link_list);
|
||||
}
|
||||
|
|
|
@ -166,9 +166,7 @@ static void mch_domain_read_resources(device_t dev)
|
|||
pcie_config_size >> 10, IORESOURCE_RESERVE);
|
||||
}
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tomk << 10) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tomk << 10);
|
||||
}
|
||||
|
||||
static void mch_domain_set_resources(device_t dev)
|
||||
|
|
|
@ -126,9 +126,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
(remaplimitk + 64*1024) - remapbasek);
|
||||
}
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tolmk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tolmk * 1024);
|
||||
}
|
||||
assign_resources(dev->link_list);
|
||||
}
|
||||
|
|
|
@ -67,9 +67,7 @@ static void i440bx_domain_set_resources(device_t dev)
|
|||
ram_resource(dev, idx++, 0, 640);
|
||||
ram_resource(dev, idx++, 768, tolmk - 768);
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tomk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tomk * 1024);
|
||||
}
|
||||
assign_resources(dev->link_list);
|
||||
}
|
||||
|
|
|
@ -93,9 +93,7 @@ static void i440lx_domain_set_resources(device_t dev)
|
|||
ram_resource(dev, idx++, 0, 640);
|
||||
ram_resource(dev, idx++, 768, tolmk - 768);
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tomk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tomk * 1024);
|
||||
}
|
||||
assign_resources(dev->link_list);
|
||||
}
|
||||
|
|
|
@ -111,10 +111,7 @@ static void mc_read_resources(device_t dev)
|
|||
resource->flags = IORESOURCE_MEM | IORESOURCE_RESERVE |
|
||||
IORESOURCE_FIXED | IORESOURCE_STORED | IORESOURCE_ASSIGNED;
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = tolm - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
printk(BIOS_DEBUG, "high_tables_base: %08llx, size %lld\n", high_tables_base, high_tables_size);
|
||||
set_top_of_ram(tolm);
|
||||
}
|
||||
|
||||
static struct pci_operations intel_pci_ops = {
|
||||
|
|
|
@ -121,9 +121,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
ram_resource(dev, idx++, 768, tomk - 768);
|
||||
uma_resource(dev, idx++, uma_memory_base >> 10, uma_memory_size >> 10);
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tomk_stolen * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tomk_stolen * 1024);
|
||||
|
||||
assign_resources(dev->link_list);
|
||||
}
|
||||
|
|
|
@ -90,9 +90,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
|
||||
assign_resources(dev->link_list);
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tomk_stolen * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tomk_stolen * 1024);
|
||||
}
|
||||
|
||||
static struct device_operations pci_domain_ops = {
|
||||
|
|
|
@ -105,9 +105,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
/* ram_resource(dev, idx++, 1024, tolmk - 1024); */
|
||||
ram_resource(dev, idx++, 768, tolmk - 768);
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tomk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tomk * 1024);
|
||||
}
|
||||
assign_resources(dev->link_list);
|
||||
}
|
||||
|
|
|
@ -170,9 +170,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
|
||||
assign_resources(dev->link_list);
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tomk_stolen * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tomk_stolen * 1024);
|
||||
}
|
||||
|
||||
/* TODO We could determine how many PCIe busses we need in
|
||||
|
|
|
@ -274,9 +274,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
|
||||
assign_resources(dev->link_list);
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tomk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tomk * 1024);
|
||||
}
|
||||
|
||||
/* TODO We could determine how many PCIe busses we need in
|
||||
|
|
|
@ -182,11 +182,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
|
||||
assign_resources(dev->link_list);
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables. */
|
||||
high_tables_base = tomk * 1024 - HIGH_MEMORY_SIZE;
|
||||
high_tables_base -= uma_memory_size;
|
||||
high_tables_base -= tseg_memory_base;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tomk * 1024 - uma_memory_size - tseg_memory_base);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -64,9 +64,7 @@ static void cpu_pci_domain_set_resources(device_t dev)
|
|||
ram_resource(dev, idx++, 0, 640);
|
||||
ram_resource(dev, idx++, 768, tolmk - 768);
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tomk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
set_top_of_ram(tomk * 1024);
|
||||
|
||||
assign_resources(dev->link_list);
|
||||
}
|
||||
|
|
|
@ -204,10 +204,7 @@ static void cn400_domain_set_resources(device_t dev)
|
|||
}
|
||||
|
||||
/* Locate the High Tables at the Top of Low Memory below the Video RAM */
|
||||
high_tables_base = ((tolmk - (CONFIG_VIDEO_MB *1024)) * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
printk(BIOS_SPEW, "tom: %lx, high_tables_base: %llx, high_tables_size: %llx\n",
|
||||
tomk*1024, high_tables_base, high_tables_size);
|
||||
set_top_of_ram((tolmk - (CONFIG_VIDEO_MB *1024)) * 1024);
|
||||
|
||||
/* Report the memory regions. */
|
||||
idx = 10;
|
||||
|
|
|
@ -134,10 +134,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
tolmk = tomk;
|
||||
}
|
||||
|
||||
high_tables_base = ((tolmk - CONFIG_VIDEO_MB * 1024) * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
printk(BIOS_DEBUG, "tom: %lx, high_tables_base: %llx, high_tables_size: %llx\n",
|
||||
tomk*1024, high_tables_base, high_tables_size);
|
||||
set_top_of_ram((tolmk - CONFIG_VIDEO_MB * 1024) * 1024);
|
||||
|
||||
/* Report the memory regions. */
|
||||
idx = 10;
|
||||
|
|
|
@ -68,10 +68,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
tolmk -= 1024; // TOP 1M SM Memory
|
||||
}
|
||||
|
||||
high_tables_base = (tolmk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
printk(BIOS_DEBUG, "tom: %lx, high_tables_base: %llx, high_tables_size: %llx\n",
|
||||
tomk*1024, high_tables_base, high_tables_size);
|
||||
set_top_of_ram(tolmk * 1024);
|
||||
|
||||
/* Report the memory regions */
|
||||
idx = 10;
|
||||
|
|
|
@ -84,10 +84,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
tolmk = tomk;
|
||||
}
|
||||
|
||||
high_tables_base = (tolmk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
printk(BIOS_DEBUG, "tom: %lx, high_tables_base: %llx, high_tables_size: %llx\n",
|
||||
tomk*1024, high_tables_base, high_tables_size);
|
||||
set_top_of_ram(tolmk * 1024);
|
||||
|
||||
/* Report the memory regions */
|
||||
idx = 10;
|
||||
|
|
|
@ -143,10 +143,7 @@ static void pci_domain_set_resources(device_t dev)
|
|||
tolmk = tomk;
|
||||
}
|
||||
|
||||
high_tables_base = (tolmk * 1024) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
printk(BIOS_DEBUG, "tom: %lx, high_tables_base: %llx, high_tables_size: %llx\n",
|
||||
tomk*1024, high_tables_base, high_tables_size);
|
||||
set_top_of_ram(tolmk * 1024);
|
||||
|
||||
/* Report the memory regions */
|
||||
idx = 10;
|
||||
|
|
|
@ -266,11 +266,7 @@ static void vx900_set_resources(device_t dev)
|
|||
u64 tor = vx900_remap_above_4g(mcu, pci_tolm);
|
||||
ram_resource(dev, idx++, RAM_4GB >> 10, (tor - RAM_4GB) >> 10);
|
||||
|
||||
/* Leave some space for ACPI, PIRQ and MP tables */
|
||||
high_tables_base = (tolmk << 10) - HIGH_MEMORY_SIZE;
|
||||
high_tables_size = HIGH_MEMORY_SIZE;
|
||||
printk(BIOS_DEBUG, "high_tables_base: %08llx, size %lld\n",
|
||||
high_tables_base, high_tables_size);
|
||||
set_top_of_ram(tolmk << 10);
|
||||
|
||||
print_debug("======================================================\n");
|
||||
assign_resources(dev->link_list);
|
||||
|
|
Loading…
Reference in New Issue