| * Texas Instruments, <www.ti.com> |
| * Dan Murphy <dmurphy@ti.com> |
| * SPDX-License-Identifier: GPL-2.0+ |
| * Derived work from spl_mmc.c |
| #ifdef CONFIG_USB_STORAGE |
| static int usb_stor_curr_dev = -1; /* current device */ |
| void spl_usb_load_image(void) |
| block_dev_desc_t *stor_dev; |
| #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT |
| printf("%s: usb init failed: err - %d\n", __func__, err); |
| #ifdef CONFIG_USB_STORAGE |
| /* try to recognize storage devices immediately */ |
| usb_stor_curr_dev = usb_stor_scan(1); |
| stor_dev = usb_stor_get_dev(usb_stor_curr_dev); |
| debug("boot mode - FAT\n"); |
| #ifdef CONFIG_SPL_OS_BOOT |
| if (spl_start_uboot() || spl_load_image_fat_os(stor_dev, |
| CONFIG_SYS_USB_FAT_BOOT_PARTITION)) |
| err = spl_load_image_fat(stor_dev, |
| CONFIG_SYS_USB_FAT_BOOT_PARTITION, |
| CONFIG_SPL_FS_LOAD_PAYLOAD_NAME); |
| puts("Error loading USB device\n"); |