]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_pxe.c
omap: remove omap5912osk board support
[karo-tx-uboot.git] / common / cmd_pxe.c
index 348332874b0105abc8055bafc84dfd12705dd0ec..c8163392326555ad96e5bcc9b3234e1a407cb82e 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright 2010-2011 Calxeda, Inc.
+ * Copyright (c) 2014, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
@@ -609,6 +610,8 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
        char *bootargs;
        int bootm_argc = 3;
        int len = 0;
+       ulong kernel_addr;
+       void *buf;
 
        label_print(label);
 
@@ -771,11 +774,15 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
        if (bootm_argv[3])
                bootm_argc = 4;
 
-       do_bootm(cmdtp, 0, bootm_argc, bootm_argv);
-
+       kernel_addr = genimg_get_kernel_addr(bootm_argv[1]);
+       buf = map_sysmem(kernel_addr, 0);
+       /* Try bootm for legacy and FIT format image */
+       if (genimg_get_format(buf) != IMAGE_FORMAT_INVALID)
+               do_bootm(cmdtp, 0, bootm_argc, bootm_argv);
 #ifdef CONFIG_CMD_BOOTZ
-       /* Try booting a zImage if do_bootm returns */
-       do_bootz(cmdtp, 0, bootm_argc, bootm_argv);
+       /* Try booting a zImage */
+       else
+               do_bootz(cmdtp, 0, bootm_argc, bootm_argv);
 #endif
        return 1;
 }
@@ -1554,6 +1561,8 @@ do_pxe_boot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
        destroy_pxe_menu(cfg);
 
+       copy_filename(BootFile, "", sizeof(BootFile));
+
        return 0;
 }
 
@@ -1562,7 +1571,7 @@ static cmd_tbl_t cmd_pxe_sub[] = {
        U_BOOT_CMD_MKENT(boot, 2, 1, do_pxe_boot, "", "")
 };
 
-int do_pxe(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_pxe(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        cmd_tbl_t *cp;
 
@@ -1596,7 +1605,7 @@ U_BOOT_CMD(
  *
  * Returns 0 on success, 1 on error.
  */
-int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        unsigned long pxefile_addr_r;
        struct pxe_menu *cfg;