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/3560
-gerrit
commit f32bf843031c20864f74059460b435fb4f38c0ce Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Sat Jun 22 14:05:28 2013 +0300
google/snow google/pit: Prepare for CBMEM fix
Follow-up will remove globals but there is circular dependency in patches. Patch "Use get_cbmem_toc in ramstage" will recover correct operation for these two boards.
Change-Id: I973f3a84dd9aaa2839959df5dda22909fdb9edeb Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- src/include/cbmem.h | 1 - src/lib/cbmem.c | 4 +++- src/mainboard/google/pit/mainboard.c | 15 +++++++++------ src/mainboard/google/snow/mainboard.c | 15 +++++++++------ 4 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/src/include/cbmem.h b/src/include/cbmem.h index 6c7b85c..8ba1d21 100644 --- a/src/include/cbmem.h +++ b/src/include/cbmem.h @@ -140,7 +140,6 @@ void backup_top_of_ram(uint64_t ramtop); void set_cbmem_table(uint64_t base, uint64_t size); #endif
-void cbmem_init(u64 baseaddr, u64 size); int cbmem_reinit(u64 baseaddr);
unsigned long get_top_of_ram(void); diff --git a/src/lib/cbmem.c b/src/lib/cbmem.c index 3f8f243..eb18725 100644 --- a/src/lib/cbmem.c +++ b/src/lib/cbmem.c @@ -80,7 +80,8 @@ void set_cbmem_table(uint64_t base, uint64_t size) * - suspend/resume backup memory */
-void cbmem_init(u64 baseaddr, u64 size) +#if !defined(__PRE_RAM__) +static void cbmem_init(u64 baseaddr, u64 size) { struct cbmem_entry *cbmem_toc; cbmem_toc = (struct cbmem_entry *)(unsigned long)baseaddr; @@ -102,6 +103,7 @@ void cbmem_init(u64 baseaddr, u64 size) .size = size - CBMEM_TOC_RESERVED }; } +#endif
int cbmem_reinit(u64 baseaddr) { diff --git a/src/mainboard/google/pit/mainboard.c b/src/mainboard/google/pit/mainboard.c index 54ea042..5c88be5 100644 --- a/src/mainboard/google/pit/mainboard.c +++ b/src/mainboard/google/pit/mainboard.c @@ -221,17 +221,20 @@ static void mainboard_init(device_t dev) // gpio_info(); }
+void get_cbmem_table(uint64_t *base, uint64_t *size) +{ + *base = CONFIG_SYS_SDRAM_BASE + + ((unsigned)CONFIG_DRAM_SIZE_MB << 20ULL) - + CONFIG_COREBOOT_TABLES_SIZE; + *size = CONFIG_COREBOOT_TABLES_SIZE; +} + static void mainboard_enable(device_t dev) { dev->ops->init = &mainboard_init;
/* set up coreboot tables */ - /* FIXME: this should happen somewhere else */ - high_tables_size = CONFIG_COREBOOT_TABLES_SIZE; - high_tables_base = CONFIG_SYS_SDRAM_BASE + - ((unsigned)CONFIG_DRAM_SIZE_MB << 20ULL) - - CONFIG_COREBOOT_TABLES_SIZE; - cbmem_init(high_tables_base, high_tables_size); + cbmem_initialize();
/* set up dcache and MMU */ /* FIXME: this should happen via resource allocator */ diff --git a/src/mainboard/google/snow/mainboard.c b/src/mainboard/google/snow/mainboard.c index 5aedac9..8e6b7c8 100644 --- a/src/mainboard/google/snow/mainboard.c +++ b/src/mainboard/google/snow/mainboard.c @@ -262,17 +262,20 @@ static void mainboard_init(device_t dev) // gpio_info(); }
+void get_cbmem_table(uint64_t *base, uint64_t *size) +{ + *base = CONFIG_SYS_SDRAM_BASE + + ((unsigned)CONFIG_DRAM_SIZE_MB << 20ULL) - + CONFIG_COREBOOT_TABLES_SIZE; + *size = CONFIG_COREBOOT_TABLES_SIZE; +} + static void mainboard_enable(device_t dev) { dev->ops->init = &mainboard_init;
/* set up coreboot tables */ - /* FIXME: this should happen somewhere else */ - high_tables_size = CONFIG_COREBOOT_TABLES_SIZE; - high_tables_base = CONFIG_SYS_SDRAM_BASE + - ((unsigned)CONFIG_DRAM_SIZE_MB << 20ULL) - - CONFIG_COREBOOT_TABLES_SIZE; - cbmem_init(high_tables_base, high_tables_size); + cbmem_initialize();
/* set up dcache and MMU */ /* FIXME: this should happen via resource allocator */