spl_net.c 742 B

12345678910111213141516171819202122232425262728293031323334353637
  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. *
  8. * SPDX-License-Identifier: GPL-2.0+
  9. */
  10. #include <common.h>
  11. #include <spl.h>
  12. #include <net.h>
  13. DECLARE_GLOBAL_DATA_PTR;
  14. void spl_net_load_image(const char *device)
  15. {
  16. int rv;
  17. env_init();
  18. env_relocate();
  19. setenv("autoload", "yes");
  20. load_addr = CONFIG_SYS_TEXT_BASE - sizeof(struct image_header);
  21. rv = eth_initialize();
  22. if (rv == 0) {
  23. printf("No Ethernet devices found\n");
  24. hang();
  25. }
  26. if (device)
  27. setenv("ethact", device);
  28. rv = net_loop(BOOTP);
  29. if (rv < 0) {
  30. printf("Problem booting with BOOTP\n");
  31. hang();
  32. }
  33. spl_parse_image_header((struct image_header *)load_addr);
  34. }