Merge git://git.denx.de/u-boot-x86
[oweals/u-boot.git] / net / tftp.c
index a5ed8c5d0a3507b5f8dc270aae53194db4c0deb7..68ffd814146c8ded1ec8c613980f4c2d45ba8f2c 100644 (file)
@@ -735,7 +735,7 @@ void tftp_start(enum proto_t protocol)
              tftp_block_size_option, timeout_ms);
 
        tftp_remote_ip = net_server_ip;
-       if (net_boot_file_name[0] == '\0') {
+       if (!net_parse_bootfile(&tftp_remote_ip, tftp_filename, MAX_LEN)) {
                sprintf(default_filename, "%02X%02X%02X%02X.img",
                        net_ip.s_addr & 0xFF,
                        (net_ip.s_addr >>  8) & 0xFF,
@@ -747,17 +747,6 @@ void tftp_start(enum proto_t protocol)
 
                printf("*** Warning: no boot file name; using '%s'\n",
                       tftp_filename);
-       } else {
-               char *p = strchr(net_boot_file_name, ':');
-
-               if (p == NULL) {
-                       strncpy(tftp_filename, net_boot_file_name, MAX_LEN);
-                       tftp_filename[MAX_LEN - 1] = 0;
-               } else {
-                       tftp_remote_ip = string_to_ip(net_boot_file_name);
-                       strncpy(tftp_filename, p + 1, MAX_LEN);
-                       tftp_filename[MAX_LEN - 1] = 0;
-               }
        }
 
        printf("Using %s device\n", eth_get_name());
@@ -805,7 +794,9 @@ void tftp_start(enum proto_t protocol)
                printf("Load address: 0x%lx\n", load_addr);
                puts("Loading: *\b");
                tftp_state = STATE_SEND_RRQ;
+#ifdef CONFIG_CMD_BOOTEFI
                efi_set_bootdev("Net", "", tftp_filename);
+#endif
        }
 
        time_start = get_timer(0);