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/3902
-gerrit
commit 3e718d21107f3b5e450f0df229c0fd7ac6cfbee2 Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Wed Sep 4 13:05:01 2013 +0300
Add set_cbmem_table
Change-Id: I17eee30635a0368b2ada06e0698425c5ef0ecc53 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- src/arch/x86/boot/ramtop.c | 5 +---- src/include/cbmem.h | 1 + src/lib/cbmem.c | 11 +++++++++++ 3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/arch/x86/boot/ramtop.c b/src/arch/x86/boot/ramtop.c index cbd43dc..7ac2ee2 100644 --- a/src/arch/x86/boot/ramtop.c +++ b/src/arch/x86/boot/ramtop.c @@ -21,9 +21,6 @@ #if !CONFIG_DYNAMIC_CBMEM void set_top_of_ram(uint64_t ramtop) { - high_tables_base = ramtop - 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_cbmem_table(ramtop - HIGH_MEMORY_SIZE, HIGH_MEMORY_SIZE); } #endif diff --git a/src/include/cbmem.h b/src/include/cbmem.h index 815c249..46739de 100644 --- a/src/include/cbmem.h +++ b/src/include/cbmem.h @@ -136,6 +136,7 @@ void cbmem_add_lb_mem(struct lb_memory *mem); #ifndef __PRE_RAM__ extern uint64_t high_tables_base, high_tables_size; void set_top_of_ram(uint64_t ramtop); +void set_cbmem_table(uint64_t base, uint64_t size); void set_cbmem_toc(struct cbmem_entry *); #endif
diff --git a/src/lib/cbmem.c b/src/lib/cbmem.c index 9e2ce0d..1a7a4e5 100644 --- a/src/lib/cbmem.c +++ b/src/lib/cbmem.c @@ -60,7 +60,18 @@ struct cbmem_entry *__attribute__((weak)) get_cbmem_toc(void) printk(BIOS_WARNING, "WARNING: you need to define get_cbmem_toc() for your chipset\n"); return NULL; } +#endif
+#if !defined(__PRE_RAM__) +void set_cbmem_table(uint64_t base, uint64_t size) +{ + if (base == high_tables_base && size == high_tables_size) + return; + + printk(BIOS_DEBUG, "CBMEM region %llx-%llx\n", base, base+size-1); + high_tables_base = base; + high_tables_size = size; +} #endif
/**