summaryrefslogtreecommitdiff
path: root/src/lib/hardwaremain.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2013-02-12 00:40:30 -0600
committerRonald G. Minnich <rminnich@gmail.com>2013-03-21 22:51:05 +0100
commit25fe2d04d583cfaaf55b8f3861f1fad86885d818 (patch)
tree1754f2d6d2ba668221aceb5703603cf80ca1db85 /src/lib/hardwaremain.c
parentc00457d065a0b57e8e2e8abc9318fc6e1198ee64 (diff)
downloadcoreboot-25fe2d04d583cfaaf55b8f3861f1fad86885d818.tar.xz
ramstage: Add cbmem_get_table_location()
When CONFIG_EARLY_CBMEM_INIT is selected romstage is supposed to have initialized cbmem. Therefore provide a weak function for the chipset to implement named cbmem_get_table_location(). When CONFIG_EARLY_CBMEM_INIT is selected cbmem_get_table_location() will be called to get the cbmem location and size. After that cbmem_initialize() is called. Change-Id: Idc45a95f9d4b1d83eb3c6d4977f7a8c80c1ffe76 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/2797 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/lib/hardwaremain.c')
-rw-r--r--src/lib/hardwaremain.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c
index d2213d2c83..b29cc93e79 100644
--- a/src/lib/hardwaremain.c
+++ b/src/lib/hardwaremain.c
@@ -85,6 +85,16 @@ void hardwaremain(int boot_complete)
/* FIXME: Is there a better way to handle this? */
init_timer();
+ /* CONFIG_EARLY_CBMEM_INIT indicates that romstage initialized
+ * the cbmem area. Therefore the table location can be initialized
+ * early in ramstage if cbmem_get_table_location() is implemented.
+ */
+#if CONFIG_EARLY_CBMEM_INIT
+ if (cbmem_get_table_location != NULL &&
+ !cbmem_get_table_location(&high_tables_base, &high_tables_size))
+ cbmem_initialize();
+#endif
+
timestamp_stash(TS_DEVICE_ENUMERATE);
/* Initialize chips early, they might disable unused devices. */