Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1238
-gerrit
commit 928c20a2708f0492097c2bdf59d6d8fec530ade9 Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Wed Jul 18 09:51:55 2012 +0300
Intel and GFXUMA: drop redundant use of lb_add_memory_range()
Use of uma_resource() in northbridge code creates a memory resource marked as reserved. Such resources are removed from system memory in write_coreboot_table().
Change-Id: I14bfd560140d8d30ec156562f23072bfae747bde Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- src/mainboard/asus/mew-am/mainboard.c | 2 +- src/mainboard/asus/mew-vm/mainboard.c | 2 +- src/mainboard/ecs/p6iwp-fe/mainboard.c | 2 +- src/mainboard/hp/e_vectra_p2706t/mainboard.c | 2 +- src/mainboard/intel/d810e2cb/mainboard.c | 2 +- src/mainboard/mitac/6513wu/mainboard.c | 2 +- src/mainboard/msi/ms6178/mainboard.c | 2 +- src/mainboard/nec/powermate2000/mainboard.c | 2 +- src/mainboard/rca/rm4100/mainboard.c | 2 +- src/mainboard/thomson/ip1000/mainboard.c | 2 +- src/northbridge/intel/i82810/northbridge.c | 10 +--------- src/northbridge/intel/i82830/northbridge.c | 10 +--------- src/northbridge/intel/i945/northbridge.c | 13 +++---------- src/northbridge/intel/sch/northbridge.c | 11 ++--------- 14 files changed, 17 insertions(+), 47 deletions(-)
diff --git a/src/mainboard/asus/mew-am/mainboard.c b/src/mainboard/asus/mew-am/mainboard.c index e5008b9..0909a76 100644 --- a/src/mainboard/asus/mew-am/mainboard.c +++ b/src/mainboard/asus/mew-am/mainboard.c @@ -24,7 +24,7 @@
int add_mainboard_resources(struct lb_memory *mem) { - return add_northbridge_resources(mem); + return 0; }
struct chip_operations mainboard_ops = { diff --git a/src/mainboard/asus/mew-vm/mainboard.c b/src/mainboard/asus/mew-vm/mainboard.c index 831be01..1d1177b 100644 --- a/src/mainboard/asus/mew-vm/mainboard.c +++ b/src/mainboard/asus/mew-vm/mainboard.c @@ -4,7 +4,7 @@
int add_mainboard_resources(struct lb_memory *mem) { - return add_northbridge_resources(mem); + return 0; }
struct chip_operations mainboard_ops = { diff --git a/src/mainboard/ecs/p6iwp-fe/mainboard.c b/src/mainboard/ecs/p6iwp-fe/mainboard.c index aec1250..f4f3dc9 100644 --- a/src/mainboard/ecs/p6iwp-fe/mainboard.c +++ b/src/mainboard/ecs/p6iwp-fe/mainboard.c @@ -24,7 +24,7 @@
int add_mainboard_resources(struct lb_memory *mem) { - return add_northbridge_resources(mem); + return 0; }
struct chip_operations mainboard_ops = { diff --git a/src/mainboard/hp/e_vectra_p2706t/mainboard.c b/src/mainboard/hp/e_vectra_p2706t/mainboard.c index 74339e9..be17705 100644 --- a/src/mainboard/hp/e_vectra_p2706t/mainboard.c +++ b/src/mainboard/hp/e_vectra_p2706t/mainboard.c @@ -24,7 +24,7 @@
int add_mainboard_resources(struct lb_memory *mem) { - return add_northbridge_resources(mem); + return 0; }
struct chip_operations mainboard_ops = { diff --git a/src/mainboard/intel/d810e2cb/mainboard.c b/src/mainboard/intel/d810e2cb/mainboard.c index c55a680..710b51f 100644 --- a/src/mainboard/intel/d810e2cb/mainboard.c +++ b/src/mainboard/intel/d810e2cb/mainboard.c @@ -23,7 +23,7 @@
int add_mainboard_resources(struct lb_memory *mem) { - return add_northbridge_resources(mem); + return 0; }
struct chip_operations mainboard_ops = { diff --git a/src/mainboard/mitac/6513wu/mainboard.c b/src/mainboard/mitac/6513wu/mainboard.c index 9e4ec8d..c6956ce 100644 --- a/src/mainboard/mitac/6513wu/mainboard.c +++ b/src/mainboard/mitac/6513wu/mainboard.c @@ -24,7 +24,7 @@
int add_mainboard_resources(struct lb_memory *mem) { - return add_northbridge_resources(mem); + return 0; }
struct chip_operations mainboard_ops = { diff --git a/src/mainboard/msi/ms6178/mainboard.c b/src/mainboard/msi/ms6178/mainboard.c index e4ba148..478cfc8 100644 --- a/src/mainboard/msi/ms6178/mainboard.c +++ b/src/mainboard/msi/ms6178/mainboard.c @@ -24,7 +24,7 @@
int add_mainboard_resources(struct lb_memory *mem) { - return add_northbridge_resources(mem); + return 0; }
struct chip_operations mainboard_ops = { diff --git a/src/mainboard/nec/powermate2000/mainboard.c b/src/mainboard/nec/powermate2000/mainboard.c index a26e8df..247c1f3 100644 --- a/src/mainboard/nec/powermate2000/mainboard.c +++ b/src/mainboard/nec/powermate2000/mainboard.c @@ -24,7 +24,7 @@
int add_mainboard_resources(struct lb_memory *mem) { - return add_northbridge_resources(mem); + return 0; }
struct chip_operations mainboard_ops = { diff --git a/src/mainboard/rca/rm4100/mainboard.c b/src/mainboard/rca/rm4100/mainboard.c index 653b22a..2ee26fe 100644 --- a/src/mainboard/rca/rm4100/mainboard.c +++ b/src/mainboard/rca/rm4100/mainboard.c @@ -25,7 +25,7 @@
int add_mainboard_resources(struct lb_memory *mem) { - return add_northbridge_resources(mem); + return 0; }
static void mainboard_init(device_t dev) diff --git a/src/mainboard/thomson/ip1000/mainboard.c b/src/mainboard/thomson/ip1000/mainboard.c index f6eee68..d0feb5d 100644 --- a/src/mainboard/thomson/ip1000/mainboard.c +++ b/src/mainboard/thomson/ip1000/mainboard.c @@ -31,7 +31,7 @@
int add_mainboard_resources(struct lb_memory *mem) { - return add_northbridge_resources(mem); + return 0; }
// setting the bit disables the led. diff --git a/src/northbridge/intel/i82810/northbridge.c b/src/northbridge/intel/i82810/northbridge.c index 3337417..6e6c3a3 100644 --- a/src/northbridge/intel/i82810/northbridge.c +++ b/src/northbridge/intel/i82810/northbridge.c @@ -62,15 +62,6 @@ static const struct pci_driver i810e_northbridge_driver __pci_driver = { .device = 0x7124, };
-int add_northbridge_resources(struct lb_memory *mem) -{ - printk(BIOS_DEBUG, "Adding IGD UMA memory area\n"); - lb_add_memory_range(mem, LB_MEM_RESERVED, - uma_memory_base, uma_memory_size); - - return 0; -} - /* Table which returns the RAM size in MB when fed the DRP[7:4] or [3:0] value. * Note that 2 is a value which the DRP should never be programmed to. * Some size values appear twice, due to single-sided vs dual-sided banks. @@ -143,6 +134,7 @@ static void pci_domain_set_resources(device_t dev) idx = 10; ram_resource(dev, idx++, 0, 640); ram_resource(dev, idx++, 768, tolmk - 768); + uma_resource(dev, idx++, uma_memory_base >> 10, uma_memory_size >> 10);
#if CONFIG_WRITE_HIGH_TABLES /* Leave some space for ACPI, PIRQ and MP tables */ diff --git a/src/northbridge/intel/i82830/northbridge.c b/src/northbridge/intel/i82830/northbridge.c index 22f59dc..2a7903d 100644 --- a/src/northbridge/intel/i82830/northbridge.c +++ b/src/northbridge/intel/i82830/northbridge.c @@ -52,15 +52,6 @@ static const struct pci_driver northbridge_driver __pci_driver = { .device = 0x3575, };
-int add_northbridge_resources(struct lb_memory *mem) -{ - printk(BIOS_DEBUG, "Adding IGD UMA memory area\n"); - lb_add_memory_range(mem, LB_MEM_RESERVED, - uma_memory_base, uma_memory_size); - - return 0; -} - #if CONFIG_WRITE_HIGH_TABLES #include <cbmem.h> #endif @@ -110,6 +101,7 @@ static void pci_domain_set_resources(device_t dev) ram_resource(dev, idx++, 0, 640); ram_resource(dev, idx++, 768, 256); ram_resource(dev, idx++, 1024, tolmk - 1024); + uma_resource(dev, idx++, uma_memory_base >> 10, uma_memory_size >> 10);
assign_resources(dev->link_list);
diff --git a/src/northbridge/intel/i945/northbridge.c b/src/northbridge/intel/i945/northbridge.c index 58e70d7..e14f022 100644 --- a/src/northbridge/intel/i945/northbridge.c +++ b/src/northbridge/intel/i945/northbridge.c @@ -73,16 +73,9 @@ static void add_fixed_resources(struct device *dev, int index) struct resource *resource; u32 pcie_config_base, pcie_config_size;
- printk(BIOS_DEBUG, "Adding UMA memory area\n"); - resource = new_resource(dev, index); - resource->base = (resource_t) uma_memory_base; - resource->size = (resource_t) uma_memory_size; - resource->flags = IORESOURCE_MEM | IORESOURCE_RESERVE | - IORESOURCE_FIXED | IORESOURCE_STORED | IORESOURCE_ASSIGNED; - if (get_pcie_bar(&pcie_config_base, &pcie_config_size)) { printk(BIOS_DEBUG, "Adding PCIe config bar\n"); - resource = new_resource(dev, index+1); + resource = new_resource(dev, index); resource->base = (resource_t) pcie_config_base; resource->size = (resource_t) pcie_config_size; resource->flags = IORESOURCE_MEM | IORESOURCE_RESERVE | @@ -173,8 +166,8 @@ static void pci_domain_set_resources(device_t dev) if (tomk > 4 * 1024 * 1024) { ram_resource(dev, 5, 4096 * 1024, tomk - 4 * 1024 * 1024); } - - add_fixed_resources(dev, 6); + uma_resource(dev, 6, uma_memory_base >> 10, uma_memory_size >> 10); + add_fixed_resources(dev, 7);
assign_resources(dev->link_list);
diff --git a/src/northbridge/intel/sch/northbridge.c b/src/northbridge/intel/sch/northbridge.c index 1e1e32c..b11f27f 100644 --- a/src/northbridge/intel/sch/northbridge.c +++ b/src/northbridge/intel/sch/northbridge.c @@ -78,13 +78,6 @@ static void add_fixed_resources(struct device *dev, int index) struct resource *resource; u32 pcie_config_base, pcie_config_size;
- printk(BIOS_DEBUG, "Adding UMA memory area\n"); - resource = new_resource(dev, index); - resource->base = (resource_t) uma_memory_base; - resource->size = (resource_t) uma_memory_size; - resource->flags = IORESOURCE_MEM | IORESOURCE_RESERVE | - IORESOURCE_FIXED | IORESOURCE_STORED | IORESOURCE_ASSIGNED; - if (get_pcie_bar(&pcie_config_base, &pcie_config_size)) { printk(BIOS_DEBUG, "Adding PCIe config bar\n"); resource = new_resource(dev, index++); @@ -184,8 +177,8 @@ static void pci_domain_set_resources(device_t dev) ram_resource(dev, 4, 768, (tomk - 768)); if (tomk > 4 * 1024 * 1024) ram_resource(dev, 5, 4096 * 1024, tomk - 4 * 1024 * 1024); - - add_fixed_resources(dev, 6); + uma_resource(dev, 6, uma_memory_base >> 10, uma_memory_size >> 10); + add_fixed_resources(dev, 7);
assign_resources(dev->link_list);