coreboot: infrastructure for different ramstage loaders

There are 2 methods currently available in coreboot to load
ramstage from romstage: cbfs and vboot. The vboot path had
to be explicitly enabled and code needed to be added to
each chipset to support both. Additionally, many of the paths
were duplicated between the two. An additional complication
is the presence of having a relocatable ramstage which creates
another path with duplication.

To rectify this situation provide a common API through the
use of a callback to load the ramstage. The rest of the
existing logic to handle all the various cases is put in
a common place.

Change-Id: I5268ce70686cc0d121161a775c3a86ea38a4d8ae
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/5087
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
diff --git a/src/include/romstage_handoff.h b/src/include/romstage_handoff.h
index 699838a..307babd 100644
--- a/src/include/romstage_handoff.h
+++ b/src/include/romstage_handoff.h
@@ -41,6 +41,7 @@
 };
 
 #if defined(__PRE_RAM__)
+#if CONFIG_EARLY_CBMEM_INIT
 /* The romstage_handoff_find_or_add() function provides the necessary logic
  * for initializing the romstage_handoff structure in cbmem. Different components
  * of the romstage may be responsible for setting up different fields. Therefore
@@ -63,7 +64,14 @@
 
 	return handoff;
 }
-#endif
+#else /* CONFIG_EARLY_CBMEM_INIT */
+static inline struct romstage_handoff *romstage_handoff_find_or_add(void)
+{
+	return NULL;
+}
+#endif /* CONFIG_EARLY_CBMEM_INIT */
+
+#endif /* defined(__PRE_RAM__) */
 
 #endif /* ROMSTAGE_HANDOFF_H */