Ilya Yanok | 7ac2fe2 | 2012-09-18 00:22:50 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2000-2004 |
| 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | * |
| 5 | * (C) Copyright 2012 |
| 6 | * Ilya Yanok <ilya.yanok@gmail.com> |
| 7 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 8 | * SPDX-License-Identifier: GPL-2.0+ |
Ilya Yanok | 7ac2fe2 | 2012-09-18 00:22:50 +0000 | [diff] [blame] | 9 | */ |
| 10 | #include <common.h> |
| 11 | #include <spl.h> |
| 12 | #include <net.h> |
| 13 | |
| 14 | DECLARE_GLOBAL_DATA_PTR; |
| 15 | |
| 16 | void spl_net_load_image(const char *device) |
| 17 | { |
| 18 | int rv; |
| 19 | |
| 20 | env_init(); |
| 21 | env_relocate(); |
| 22 | setenv("autoload", "yes"); |
| 23 | load_addr = CONFIG_SYS_TEXT_BASE - sizeof(struct image_header); |
Joe Hershberger | d2eaec6 | 2015-03-22 17:09:06 -0500 | [diff] [blame] | 24 | rv = eth_initialize(); |
Ilya Yanok | 7ac2fe2 | 2012-09-18 00:22:50 +0000 | [diff] [blame] | 25 | if (rv == 0) { |
| 26 | printf("No Ethernet devices found\n"); |
| 27 | hang(); |
| 28 | } |
| 29 | if (device) |
| 30 | setenv("ethact", device); |
Joe Hershberger | bc0571f | 2015-04-08 01:41:21 -0500 | [diff] [blame] | 31 | rv = net_loop(BOOTP); |
Ilya Yanok | 7ac2fe2 | 2012-09-18 00:22:50 +0000 | [diff] [blame] | 32 | if (rv < 0) { |
| 33 | printf("Problem booting with BOOTP\n"); |
| 34 | hang(); |
| 35 | } |
| 36 | spl_parse_image_header((struct image_header *)load_addr); |
| 37 | } |