u-boot-brain/common/spl/spl_net.c
Simon Glass ecdfd69a4b spl: Convert boot_device into a struct
At present some spl_xxx_load_image() functions take a parameter and some
don't. Of those that do, most take an integer but one takes a string.

Convert this parameter into a struct so that we can pass all functions the
same thing. This will allow us to use a common function signature.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06 14:53:36 -04:00

40 lines
851 B
C

/*
* (C) Copyright 2000-2004
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* (C) Copyright 2012
* Ilya Yanok <ilya.yanok@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <errno.h>
#include <spl.h>
#include <net.h>
DECLARE_GLOBAL_DATA_PTR;
int spl_net_load_image(struct spl_boot_device *bootdev)
{
int rv;
env_init();
env_relocate();
setenv("autoload", "yes");
load_addr = CONFIG_SYS_TEXT_BASE - sizeof(struct image_header);
rv = eth_initialize();
if (rv == 0) {
printf("No Ethernet devices found\n");
return -ENODEV;
}
if (bootdev->boot_device_name)
setenv("ethact", bootdev->boot_device_name);
rv = net_loop(BOOTP);
if (rv < 0) {
printf("Problem booting with BOOTP\n");
return rv;
}
return spl_parse_image_header(&spl_image,
(struct image_header *)load_addr);
}