diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2011-09-20 17:07:14 -0700 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2012-03-28 20:38:41 +0200 |
commit | e1860604e46780d08ee2dab568cf80bf2d349c16 (patch) | |
tree | 75f7223382bbe90586e232e3bef1a3519adf6b6b /src/include | |
parent | e6b6aff28ab26d5b2e6fbd76138561765dc58a76 (diff) |
Initialize CBMEM early.
We want to be able to share data between different phases of firmware
(rom stage/ram stage/payload). Coreboot CBMEM seems an appropriate
location for this data, but normally it is not initialized
until coreboot reaches the ram stage.
This change initializes the CBMEM while still in rom stage in
case CONFIG_EARLY_CBMEM_INIT is set.
Note that there is a discrepancy in how coreboot determines the
size of DRAM at rom and ram stages, get_top_of_ram() is used at
rom stage and is not defined for all platforms. Those platforms
will have to define this function should they enable the
CONFIG_EARLY_CBMEM_INIT flag.
Change-Id: I81691d45e28de59496fb227f2cca4e8c15ece717
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/711
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/cbmem.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/include/cbmem.h b/src/include/cbmem.h index 98068543f2..a681c36ea8 100644 --- a/src/include/cbmem.h +++ b/src/include/cbmem.h @@ -22,7 +22,9 @@ /* Reserve 128k for ACPI and other tables */ #define HIGH_MEMORY_DEF_SIZE ( 128 * 1024 ) +#ifndef __PRE_RAM__ extern uint64_t high_tables_base, high_tables_size; +#endif #if CONFIG_HAVE_ACPI_RESUME #define HIGH_MEMORY_SIZE ((CONFIG_RAMTOP - CONFIG_RAMBASE) + HIGH_MEMORY_DEF_SIZE) @@ -41,7 +43,7 @@ extern uint64_t high_tables_base, high_tables_size; #define CBMEM_ID_SMBIOS 0x534d4254 #define CBMEM_ID_NONE 0x00000000 -void cbmem_initialize(void); +int cbmem_initialize(void); void cbmem_init(u64 baseaddr, u64 size); int cbmem_reinit(u64 baseaddr); |