coreboot: dynamic cbmem requirement

Dynamic cbmem is now a requirement for relocatable ramstage.
This patch replaces the reserve_* fields in the romstage_handoff
structure by using the dynamic cbmem library.

The haswell code is not moved over in this commit, but it should be
safe because there is a hard requirement for DYNAMIC_CBMEM when using
a reloctable ramstage.

Change-Id: I59ab4552c3ae8c2c3982df458cd81a4a9b712cc2
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/2849
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Aaron Durbin
2013-02-27 22:50:12 -06:00
committed by Stefan Reinauer
parent 24d1d4b472
commit dd4a6d2357
10 changed files with 94 additions and 133 deletions

View File

@@ -87,21 +87,24 @@ int init_default_cbfs_media(struct cbfs_media *media);
/* The cache_loaded_ramstage() and load_cached_ramstage() functions are defined
* to be weak so that board and chipset code may override them. Their job is to
* cache and load the ramstage for quick S3 resume. By default a copy of the
* relocated ramstage is saved just below the running ramstage region. These
* relocated ramstage is saved using the cbmem infrastructure. These
* functions are only valid during romstage. */
struct romstage_handoff;
struct cbmem_entry;
/* The implementer of cache_loaded_ramstage() needs to ensure that the
* reserve_* fields in in romstage_handoff reflect the memory footprint of the
* ramstage (including cached region). Note that the handoff variable can be
* NULL. */
/* The implementer of cache_loaded_ramstage() may use the romstage_handoff
* structure to store information, but note that the handoff variable can be
* NULL. The ramstage cbmem_entry represents the region occupied by the loaded
* ramstage. */
void __attribute__((weak))
cache_loaded_ramstage(struct romstage_handoff *handoff, void *ramstage_base,
uint32_t ramstage_size, void *entry_point);
/* Return NULL on error or entry point on success. */
cache_loaded_ramstage(struct romstage_handoff *handoff,
const struct cbmem_entry *ramstage, void *entry_point);
/* Return NULL on error or entry point on success. The ramstage cbmem_entry is
* the region where to load the cached contents to. */
void * __attribute__((weak))
load_cached_ramstage(struct romstage_handoff *handoff);
load_cached_ramstage(struct romstage_handoff *handoff,
const struct cbmem_entry *ramstage);
#endif /* CONFIG_RELOCATABLE_RAMSTAGE */
#endif