1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

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>
This commit is contained in:
Simon Glass
2012-09-28 08:56:38 +00:00
committed by Anatolij Gustschin
parent 94fd1316b7
commit fcf509b807
2 changed files with 188 additions and 0 deletions

View File

@@ -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