]>
git.ipfire.org Git - people/ms/u-boot.git/blob - board/w7o/fsboot.c
5 * SPDX-License-Identifier: GPL-2.0+
14 * FIXME: Add code to test image and it's header.
17 image_check(ulong addr
)
19 return valid_elf_image(addr
);
32 * Get test image address
34 if ((envp
= getenv("testaddr")) != NULL
)
35 testaddr
= simple_strtoul(envp
, NULL
, 16);
40 * Are we going to test boot and image?
42 if ((testaddr
!= -1) && image_check(testaddr
)) {
44 /* Set alt_loadaddr */
45 alt_loadaddr
= testaddr
;
46 sprintf(buf
, "%lX", alt_loadaddr
);
47 setenv("alt_loadaddr", buf
);
50 setenv("testaddr", NULL
);
53 * Save current environment with alt_loadaddr,
54 * and cleared testaddr.
59 * Setup temporary loadaddr to alt_loadaddr
60 * XXX - DO NOT SAVE ENVIRONMENT!
62 loadaddr
= alt_loadaddr
;
63 sprintf(buf
, "%lX", loadaddr
);
64 setenv("loadaddr", buf
);
66 } else { /* Normal boot */
67 setenv("alt_loadaddr", NULL
); /* Clear alt_loadaddr */
68 setenv("testaddr", NULL
); /* Clear testaddr */