aboutsummaryrefslogtreecommitdiff
path: root/arch/sandbox/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sandbox/cpu')
-rw-r--r--arch/sandbox/cpu/os.c8
-rw-r--r--arch/sandbox/cpu/spl.c9
-rw-r--r--arch/sandbox/cpu/start.c1
3 files changed, 11 insertions, 7 deletions
diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index f5000e6496..2d9583c17c 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -777,7 +777,7 @@ int os_jump_to_image(const void *dest, int size)
return os_jump_to_file(fname);
}
-int os_find_u_boot(char *fname, int maxlen)
+int os_find_u_boot(char *fname, int maxlen, bool use_img)
{
struct sandbox_state *state = state_get_current();
const char *progname = state->argv[0];
@@ -801,8 +801,8 @@ int os_find_u_boot(char *fname, int maxlen)
return 0;
}
- /* Look for 'u-boot-tpl' in the tpl/ directory */
- p = strstr(fname, "/tpl/");
+ /* Look for 'u-boot-spl' in the spl/ directory */
+ p = strstr(fname, "/spl/");
if (p) {
p[1] = 's';
fd = os_open(fname, O_RDONLY);
@@ -829,6 +829,8 @@ int os_find_u_boot(char *fname, int maxlen)
if (p) {
/* Remove the "spl" characters */
memmove(p, p + 4, strlen(p + 4) + 1);
+ if (use_img)
+ strcat(p, ".img");
fd = os_open(fname, O_RDONLY);
if (fd >= 0) {
close(fd);
diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c
index 6926e244ca..f82b0d3de1 100644
--- a/arch/sandbox/cpu/spl.c
+++ b/arch/sandbox/cpu/spl.c
@@ -13,7 +13,7 @@
#include <asm/global_data.h>
#include <asm/spl.h>
#include <asm/state.h>
-#include <test/test.h>
+#include <test/ut.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -37,7 +37,7 @@ static int spl_board_load_image(struct spl_image_info *spl_image,
char fname[256];
int ret;
- ret = os_find_u_boot(fname, sizeof(fname));
+ ret = os_find_u_boot(fname, sizeof(fname), false);
if (ret) {
printf("(%s not found, error %d)\n", fname, ret);
return ret;
@@ -63,9 +63,12 @@ void spl_board_init(void)
preloader_console_init();
if (state->run_unittests) {
+ struct unit_test *tests = UNIT_TEST_ALL_START();
+ const int count = UNIT_TEST_ALL_COUNT();
int ret;
- ret = dm_test_main(state->select_unittests);
+ ret = ut_run_list("spl", NULL, tests, count,
+ state->select_unittests);
/* continue execution into U-Boot */
}
}
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index c4c4128d46..e87365e800 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -491,7 +491,6 @@ int main(int argc, char *argv[])
gd->reloc_off = (ulong)gd->arch.text_base;
/* sandbox test: log functions called before log_init in board_init_f */
- log_info("sandbox: starting...\n");
log_debug("debug: %s\n", __func__);
/* Do pre- and post-relocation init */