]> git.ipfire.org Git - people/ms/u-boot.git/blame - common/spl/spl_net.c
Merge git://git.denx.de/u-boot-marvell
[people/ms/u-boot.git] / common / spl / spl_net.c
CommitLineData
7ac2fe2d
IY
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 *
1a459660 8 * SPDX-License-Identifier: GPL-2.0+
7ac2fe2d
IY
9 */
10#include <common.h>
36afd451 11#include <errno.h>
7ac2fe2d
IY
12#include <spl.h>
13#include <net.h>
14
15DECLARE_GLOBAL_DATA_PTR;
16
36afd451 17int spl_net_load_image(const char *device)
7ac2fe2d
IY
18{
19 int rv;
20
21 env_init();
22 env_relocate();
23 setenv("autoload", "yes");
24 load_addr = CONFIG_SYS_TEXT_BASE - sizeof(struct image_header);
d2eaec60 25 rv = eth_initialize();
7ac2fe2d
IY
26 if (rv == 0) {
27 printf("No Ethernet devices found\n");
36afd451 28 return -ENODEV;
7ac2fe2d
IY
29 }
30 if (device)
31 setenv("ethact", device);
bc0571fc 32 rv = net_loop(BOOTP);
7ac2fe2d
IY
33 if (rv < 0) {
34 printf("Problem booting with BOOTP\n");
36afd451 35 return rv;
7ac2fe2d
IY
36 }
37 spl_parse_image_header((struct image_header *)load_addr);
36afd451
NK
38
39 return 0;
7ac2fe2d 40}