summaryrefslogtreecommitdiffstats
path: root/include/bootstage.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-09-28 08:56:38 +0000
committerAnatolij Gustschin <agust@denx.de>2012-10-03 00:52:40 +0200
commitfcf509b80760156fe146aeb11510ffb0278b7b74 (patch)
tree4f84a1a64b40859d58f1a47755e2e69339f94790 /include/bootstage.h
parent94fd1316b75896b668d22ce846785d92c0340100 (diff)
downloadtalos-obmc-uboot-fcf509b80760156fe146aeb11510ffb0278b7b74.tar.gz
talos-obmc-uboot-fcf509b80760156fe146aeb11510ffb0278b7b74.zip
bootstage: Add feature to stash/unstash bootstage info
It is useful to be able to write the bootstage information to memory for use by a later utility, or the Linux kernel. Provide a function to do this as well as a function to read bootstage information back and incorporate it into the current table. This also makes it possible for U-Boot to chain to another U-Boot and pass on its bootstage information. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/bootstage.h')
-rw-r--r--include/bootstage.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/bootstage.h b/include/bootstage.h
index 9113852ca2..d6b4e7b0d0 100644
--- a/include/bootstage.h
+++ b/include/bootstage.h
@@ -284,6 +284,27 @@ void bootstage_report(void);
*/
int bootstage_fdt_add_report(void);
+/*
+ * Stash bootstage data into memory
+ *
+ * @param base Base address of memory buffer
+ * @param size Size of memory buffer
+ * @return 0 if stashed ok, -1 if out of space
+ */
+int bootstage_stash(void *base, int size);
+
+/**
+ * Read bootstage data from memory
+ *
+ * Bootstage data is read from memory and placed in the bootstage table
+ * in the user records.
+ *
+ * @param base Base address of memory buffer
+ * @param size Size of memory buffer (-1 if unknown)
+ * @return 0 if unstashed ok, -1 if bootstage info not found, or out of space
+ */
+int bootstage_unstash(void *base, int size);
+
#else
/*
* This is a dummy implementation which just calls show_boot_progress(),
@@ -307,7 +328,15 @@ static inline ulong bootstage_mark_name(enum bootstage_id id, const char *name)
return 0;
}
+static inline int bootstage_stash(void *base, int size)
+{
+ return 0; /* Pretend to succeed */
+}
+static inline int bootstage_unstash(void *base, int size)
+{
+ return 0; /* Pretend to succeed */
+}
#endif /* CONFIG_BOOTSTAGE */
#endif
OpenPOWER on IntegriCloud