diff options
author | Aaron Durbin <adurbin@chromium.org> | 2013-04-24 16:39:08 -0500 |
---|---|---|
committer | Ronald G. Minnich <rminnich@gmail.com> | 2013-05-01 07:10:03 +0200 |
commit | 40131cfa46bc195ad3bdf2ce9b9af67dcbfd71ca (patch) | |
tree | e48ddc795747af5e9e6ed2c11c8ecffb5f8542db /src/lib/dynamic_cbmem.c | |
parent | 4dd87fb2d852a61fd1677dd81e0a5573e9023eb1 (diff) |
cbmem: use boot state machine
There were previously 2 functions, init_cbmem_pre_device() and
init_cbmem_post_device(), where the 2 cbmem implementations
implemented one or the other. These 2 functions are no longer
needed to be called in the boot flow once the boot state callbacks
are utilized.
Change-Id: Ida71f1187bdcc640ae600705ddb3517e1410a80d
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/3136
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/lib/dynamic_cbmem.c')
-rw-r--r-- | src/lib/dynamic_cbmem.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/dynamic_cbmem.c b/src/lib/dynamic_cbmem.c index ae6c87ac87..5c269a0282 100644 --- a/src/lib/dynamic_cbmem.c +++ b/src/lib/dynamic_cbmem.c @@ -17,6 +17,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <bootstate.h> #include <boot/tables.h> #include <console/console.h> #include <cbmem.h> @@ -411,7 +412,7 @@ void *cbmem_entry_start(const struct cbmem_entry *entry) /* selected cbmem can be initialized early in ramstage. Additionally, that * means cbmem console can be reinitialized early as well. The post_device * function is empty since cbmem was initialized early in ramstage. */ -void init_cbmem_pre_device(void) +static void init_cbmem_pre_device(void *unused) { cbmem_initialize(); #if CONFIG_CONSOLE_CBMEM @@ -419,7 +420,10 @@ void init_cbmem_pre_device(void) #endif /* CONFIG_CONSOLE_CBMEM */ } -void init_cbmem_post_device(void) {} +BOOT_STATE_INIT_ENTRIES(cbmem_bscb) = { + BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_ENTRY, + init_cbmem_pre_device, NULL), +}; void cbmem_add_lb_mem(struct lb_memory *mem) { |