RELOCATABLE_RAMSTAGE: Fix weak symbols with ramstage_cache

We had NULL reference with cache_loaded_ramstage() if
CACHE_RELOCATED_RAMSTAGE_OUTSIDE_CBMEM was not set so boot never
proceeded to ramstage.

Cache implementation outside CBMEM provides means for platform-specific
location so there is no need of weak attributes here.

Change-Id: I1eb1a713896395c424fde23252c374f9065fe74d
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/7954
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
This commit is contained in:
Kyösti Mälkki 2014-12-26 13:28:35 +02:00
parent d4b1139e28
commit c7c02673e4
3 changed files with 5 additions and 9 deletions

View File

@ -92,13 +92,11 @@ struct cbmem_entry;
* structure to store information, but note that the handoff variable can be * structure to store information, but note that the handoff variable can be
* NULL. The ramstage cbmem_entry represents the region occupied by the loaded * NULL. The ramstage cbmem_entry represents the region occupied by the loaded
* ramstage. */ * ramstage. */
void __attribute__((weak)) void cache_loaded_ramstage(struct romstage_handoff *handoff,
cache_loaded_ramstage(struct romstage_handoff *handoff,
const struct cbmem_entry *ramstage, void *entry_point); const struct cbmem_entry *ramstage, void *entry_point);
/* Return NULL on error or entry point on success. The ramstage cbmem_entry is /* Return NULL on error or entry point on success. The ramstage cbmem_entry is
* the region where to load the cached contents to. */ * the region where to load the cached contents to. */
void * __attribute__((weak)) void * load_cached_ramstage(struct romstage_handoff *handoff,
load_cached_ramstage(struct romstage_handoff *handoff,
const struct cbmem_entry *ramstage); const struct cbmem_entry *ramstage);
#else /* CONFIG_RELOCATABLE_RAMSTAGE */ #else /* CONFIG_RELOCATABLE_RAMSTAGE */

View File

@ -86,7 +86,7 @@ romstage-y += hexdump.c
romstage-$(CONFIG_REG_SCRIPT) += reg_script.c romstage-$(CONFIG_REG_SCRIPT) += reg_script.c
ramstage-$(CONFIG_REG_SCRIPT) += reg_script.c ramstage-$(CONFIG_REG_SCRIPT) += reg_script.c
romstage-$(CONFIG_CACHE_RELOCATED_RAMSTAGE_OUTSIDE_CBMEM) += ramstage_cache.c romstage-$(CONFIG_RELOCATABLE_RAMSTAGE) += ramstage_cache.c
smm-y += cbfs.c cbfs_core.c memcmp.c smm-y += cbfs.c cbfs_core.c memcmp.c
smm-$(CONFIG_COMPILER_GCC) += gcc.c smm-$(CONFIG_COMPILER_GCC) += gcc.c

View File

@ -96,8 +96,7 @@ void *load_cached_ramstage(struct romstage_handoff *handoff,
/* Cache relocated ramstage in CBMEM. */ /* Cache relocated ramstage in CBMEM. */
void __attribute__((weak)) void cache_loaded_ramstage(struct romstage_handoff *handoff,
cache_loaded_ramstage(struct romstage_handoff *handoff,
const struct cbmem_entry *ramstage, void *entry_point) const struct cbmem_entry *ramstage, void *entry_point)
{ {
uint32_t ramstage_size; uint32_t ramstage_size;
@ -120,8 +119,7 @@ cache_loaded_ramstage(struct romstage_handoff *handoff,
ramstage_size); ramstage_size);
} }
void * __attribute__((weak)) void *load_cached_ramstage(struct romstage_handoff *handoff,
load_cached_ramstage(struct romstage_handoff *handoff,
const struct cbmem_entry *ramstage) const struct cbmem_entry *ramstage)
{ {
const struct cbmem_entry *entry_cache; const struct cbmem_entry *entry_cache;