X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=common%2Fcmd_bootm.c;h=046e22ff48f57efd4e9957d311b64377c2e048dd;hb=0c9e2dc612e8b970ea2d13712b0e0f3f1282be4f;hp=a783cea5d39a4dc1fb318db8b8d253e3c60cad1c;hpb=225fd8c5d4556547896a5d32ee092a258f3df638;p=karo-tx-uboot.git diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index a783cea5d3..046e22ff48 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -2,23 +2,7 @@ * (C) Copyright 2000-2009 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ @@ -396,7 +380,6 @@ static int bootm_load_os(bootm_headers_t *images, unsigned long *load_end, memmove_wd(load_buf, image_buf, image_len, CHUNKSZ); } *load_end = load + image_len; - puts("OK\n"); break; #ifdef CONFIG_GZIP case IH_COMP_GZIP: @@ -543,10 +526,6 @@ static int boot_selected_os(int argc, char * const argv[], int state, bootm_start_standalone(argc, argv); return 0; } -#ifdef CONFIG_SILENT_CONSOLE - if (images->os.os == IH_OS_LINUX) - fixup_silent_linux(); -#endif arch_preboot_os(); boot_fn(state, argc, argv, images); if (state == BOOTM_STATE_OS_FAKE_GO) /* We expect to return */ @@ -650,14 +629,17 @@ static int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, iflag = bootm_disable_interrupts(); ret = bootm_load_os(images, &load_end, 0); - if (ret && ret != BOOTM_ERR_OVERLAP) - goto err; - if (ret == 0) lmb_reserve(&images->lmb, images->os.load, (load_end - images->os.load)); + else if (ret && ret != BOOTM_ERR_OVERLAP) + goto err; else if (ret == BOOTM_ERR_OVERLAP) ret = 0; +#ifdef CONFIG_SILENT_CONSOLE + if (images->os.os == IH_OS_LINUX) + fixup_silent_linux(); +#endif } /* Relocate the ramdisk */ @@ -705,13 +687,6 @@ static int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, if (!ret && (states & BOOTM_STATE_OS_PREP)) ret = boot_fn(BOOTM_STATE_OS_PREP, argc, argv, images); - /* Check for unsupported subcommand. */ - if (ret) { - puts("subcommand not supported\n"); - return ret; - } - - #ifdef CONFIG_TRACE /* Pretend to run the OS, then run a user command */ if (!ret && (states & BOOTM_STATE_OS_FAKE_GO)) { @@ -723,15 +698,17 @@ static int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, ret = run_command_list(cmd_list, -1, flag); } #endif + + /* Check for unsupported subcommand. */ + if (ret) { + puts("subcommand not supported\n"); + return ret; + } + /* Now run the OS! We hope this doesn't return */ - if (!ret && (states & BOOTM_STATE_OS_GO)) { + if (!ret && (states & BOOTM_STATE_OS_GO)) ret = boot_selected_os(argc, argv, BOOTM_STATE_OS_GO, images, boot_fn); - if (ret) - goto err; - } - - return ret; /* Deal with any fallout */ err: @@ -990,7 +967,7 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc, case IMAGE_FORMAT_FIT: os_noffset = fit_image_load(images, FIT_KERNEL_PROP, img_addr, - &fit_uname_kernel, fit_uname_config, + &fit_uname_kernel, &fit_uname_config, IH_ARCH_DEFAULT, IH_TYPE_KERNEL, BOOTSTAGE_ID_FIT_KERNEL_START, FIT_LOAD_IGNORED, os_data, os_len); @@ -999,6 +976,7 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc, images->fit_hdr_os = map_sysmem(img_addr, 0); images->fit_uname_os = fit_uname_kernel; + images->fit_uname_cfg = fit_uname_config; images->fit_noffset_os = os_noffset; break; #endif @@ -1474,6 +1452,8 @@ static int do_bootm_netbsd(int flag, int argc, char * const argv[], char *consdev; char *cmdline; + if (flag & BOOTM_STATE_OS_PREP) + return 0; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; @@ -1553,6 +1533,8 @@ static int do_bootm_lynxkdi(int flag, int argc, char * const argv[], { image_header_t *hdr = &images->legacy_hdr_os_copy; + if (flag & BOOTM_STATE_OS_PREP) + return 0; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; @@ -1575,6 +1557,8 @@ static int do_bootm_rtems(int flag, int argc, char * const argv[], { void (*entry_point)(bd_t *); + if (flag & BOOTM_STATE_OS_PREP) + return 0; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; @@ -1608,6 +1592,8 @@ static int do_bootm_ose(int flag, int argc, char * const argv[], { void (*entry_point)(void); + if (flag & BOOTM_STATE_OS_PREP) + return 0; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; @@ -1642,6 +1628,8 @@ static int do_bootm_plan9(int flag, int argc, char * const argv[], void (*entry_point)(void); char *s; + if (flag & BOOTM_STATE_OS_PREP) + return 0; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; @@ -1689,6 +1677,8 @@ static int do_bootm_vxworks(int flag, int argc, char * const argv[], { char str[80]; + if (flag & BOOTM_STATE_OS_PREP) + return 0; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; @@ -1712,6 +1702,8 @@ static int do_bootm_qnxelf(int flag, int argc, char * const argv[], char *local_args[2]; char str[16]; + if (flag & BOOTM_STATE_OS_PREP) + return 0; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; @@ -1737,6 +1729,8 @@ static int do_bootm_integrity(int flag, int argc, char * const argv[], { void (*entry_point)(void); + if (flag & BOOTM_STATE_OS_PREP) + return 0; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1;