| * SPDX-License-Identifier: GPL-2.0+ |
| * FIXME: Add code to test image and it's header. |
| extern int valid_elf_image (unsigned long addr); |
| return valid_elf_image(addr); |
| if ((envp = getenv("testaddr")) != NULL) |
| testaddr = simple_strtoul(envp, NULL, 16); |
| * Are we going to test boot and image? |
| if ((testaddr != -1) && image_check(testaddr)) { |
| sprintf(buf, "%lX", alt_loadaddr); |
| setenv("alt_loadaddr", buf); |
| setenv("testaddr", NULL); |
| * Save current environment with alt_loadaddr, |
| * Setup temporary loadaddr to alt_loadaddr |
| * XXX - DO NOT SAVE ENVIRONMENT! |
| sprintf(buf, "%lX", loadaddr); |
| } else { /* Normal boot */ |
| setenv("alt_loadaddr", NULL); /* Clear alt_loadaddr */ |
| setenv("testaddr", NULL); /* Clear testaddr */ |