]>
git.ipfire.org Git - people/ms/u-boot.git/blob - board/w7o/fsboot.c
5 * SPDX-License-Identifier: GPL-2.0+
13 * FIXME: Add code to test image and it's header.
15 extern int valid_elf_image (unsigned long addr
);
18 image_check(ulong addr
)
20 return valid_elf_image(addr
);
33 * Get test image address
35 if ((envp
= getenv("testaddr")) != NULL
)
36 testaddr
= simple_strtoul(envp
, NULL
, 16);
41 * Are we going to test boot and image?
43 if ((testaddr
!= -1) && image_check(testaddr
)) {
45 /* Set alt_loadaddr */
46 alt_loadaddr
= testaddr
;
47 sprintf(buf
, "%lX", alt_loadaddr
);
48 setenv("alt_loadaddr", buf
);
51 setenv("testaddr", NULL
);
54 * Save current environment with alt_loadaddr,
55 * and cleared testaddr.
60 * Setup temporary loadaddr to alt_loadaddr
61 * XXX - DO NOT SAVE ENVIRONMENT!
63 loadaddr
= alt_loadaddr
;
64 sprintf(buf
, "%lX", loadaddr
);
65 setenv("loadaddr", buf
);
67 } else { /* Normal boot */
68 setenv("alt_loadaddr", NULL
); /* Clear alt_loadaddr */
69 setenv("testaddr", NULL
); /* Clear testaddr */