From fcf509b80760156fe146aeb11510ffb0278b7b74 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 28 Sep 2012 08:56:38 +0000 Subject: 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 --- include/bootstage.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'include') diff --git a/include/bootstage.h b/include/bootstage.h index 9113852..d6b4e7b 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 -- cgit v1.1