2 * (C) Copyright 2000-2004
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 * Ilya Yanok <ilya.yanok@gmail.com>
8 * SPDX-License-Identifier: GPL-2.0+
15 DECLARE_GLOBAL_DATA_PTR;
17 #if defined(CONFIG_SPL_ETH_SUPPORT) || defined(CONFIG_SPL_USBETH_SUPPORT)
18 static int spl_net_load_image(struct spl_boot_device *bootdev)
24 setenv("autoload", "yes");
25 load_addr = CONFIG_SYS_TEXT_BASE - sizeof(struct image_header);
26 rv = eth_initialize();
28 printf("No Ethernet devices found\n");
31 if (bootdev->boot_device_name)
32 setenv("ethact", bootdev->boot_device_name);
35 printf("Problem booting with BOOTP\n");
38 return spl_parse_image_header(&spl_image,
39 (struct image_header *)load_addr);
43 #ifdef CONFIG_SPL_ETH_SUPPORT
44 int spl_net_load_image_cpgmac(struct spl_boot_device *bootdev)
46 #ifdef CONFIG_SPL_ETH_DEVICE
47 bootdev->boot_device_name = CONFIG_SPL_ETH_DEVICE;
50 return spl_net_load_image(bootdev);
52 SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_CPGMAC, spl_net_load_image_cpgmac);
55 #ifdef CONFIG_SPL_USBETH_SUPPORT
56 int spl_net_load_image_usb(struct spl_boot_device *bootdev)
58 bootdev->boot_device_name = "usb_ether";
60 return spl_net_load_image(bootdev);
62 SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_USBETH, spl_net_load_image_usb);