habv4: tools: Avoid hardcoded CSF size for SPL targets
[oweals/u-boot.git] / common / spl / spl_net.c
index 33f3b74a970970e36b8d039985280aee2f1af117..803303249c72c623a886ee3425e95b6c26de330c 100644 (file)
@@ -1,13 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (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 <env.h>
 #include <errno.h>
 #include <spl.h>
 #include <net.h>
@@ -86,7 +86,9 @@ int spl_net_load_image_usb(struct spl_image_info *spl_image,
                           struct spl_boot_device *bootdev)
 {
        bootdev->boot_device_name = "usb_ether";
-
+#if CONFIG_IS_ENABLED(DM_USB_GADGET)
+       usb_ether_init();
+#endif
        return spl_net_load_image(spl_image, bootdev);
 }
 SPL_LOAD_IMAGE_METHOD("USB eth", 0, BOOT_DEVICE_USBETH, spl_net_load_image_usb);