diff options
author | Simon Glass <sjg@chromium.org> | 2016-07-04 11:57:45 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-07-14 20:40:24 -0600 |
commit | d4e33f5a72accc891e3600cb2d2bc579004de9e1 (patch) | |
tree | 7b3cbcbe5f88bb1e3e9699373cef23a0e5dd431f /include/os.h | |
parent | 72a7e0760447ed46ca50174cb8798a2e84dedf85 (diff) | |
download | u-boot-d4e33f5a72accc891e3600cb2d2bc579004de9e1.zip u-boot-d4e33f5a72accc891e3600cb2d2bc579004de9e1.tar.gz u-boot-d4e33f5a72accc891e3600cb2d2bc579004de9e1.tar.bz2 |
sandbox: Allow chaining from SPL to U-Boot proper
SPL is expected to load and run U-Boot. This needs to work with sandbox also.
Provide a function to locate the U-Boot image, and another to start it. This
allows SPL to function on sandbox as it does on other archs.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/os.h')
-rw-r--r-- | include/os.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/os.h b/include/os.h index 954a48c..1782e50 100644 --- a/include/os.h +++ b/include/os.h @@ -287,6 +287,31 @@ int os_read_ram_buf(const char *fname); int os_jump_to_image(const void *dest, int size); /** + * os_find_u_boot() - Determine the path to U-Boot proper + * + * This function is intended to be called from within sandbox SPL. It uses + * a few heuristics to find U-Boot proper. Normally it is either in the same + * directory, or the directory above (since u-boot-spl is normally in an + * spl/ subdirectory when built). + * + * @fname: Place to put full path to U-Boot + * @maxlen: Maximum size of @fname + * @return 0 if OK, -NOSPC if the filename is too large, -ENOENT if not found + */ +int os_find_u_boot(char *fname, int maxlen); + +/** + * os_spl_to_uboot() - Run U-Boot proper + * + * When called from SPL, this runs U-Boot proper. The filename is obtained by + * calling os_find_u_boot(). + * + * @fname: Full pathname to U-Boot executable + * @return 0 if OK, -ve on error + */ +int os_spl_to_uboot(const char *fname); + +/** * Read the current system time * * This reads the current Local Time and places it into the provided |