3 * Texas Instruments, <www.ti.com>
5 * Dan Murphy <dmurphy@ti.com>
7 * SPDX-License-Identifier: GPL-2.0+
9 * Derived work from spl_usb.c
14 #include <asm/u-boot.h>
21 DECLARE_GLOBAL_DATA_PTR;
23 int spl_sata_load_image(void)
26 block_dev_desc_t *stor_dev;
28 err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE);
30 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
31 printf("spl: sata init failed: err - %d\n", err);
35 /* try to recognize storage devices immediately */
37 stor_dev = scsi_get_dev(0);
42 #ifdef CONFIG_SPL_OS_BOOT
43 if (spl_start_uboot() || spl_load_image_fat_os(stor_dev,
44 CONFIG_SYS_SATA_FAT_BOOT_PARTITION))
46 err = spl_load_image_fat(stor_dev,
47 CONFIG_SYS_SATA_FAT_BOOT_PARTITION,
48 CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
50 puts("Error loading sata device\n");