Commit 76300c0d2d63bb7cb02679bf749f30ae4a1ca969

Authored by Roger Quadros
Committed by Tom Rini
1 parent d59baeb76f

common: spl_sata: perform SCSI scan before getting device

At least on OMAP, init_sata() no longer performs scsi_scan()
so we must do it explicitly here.

Cc: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>

Showing 1 changed file with 1 additions and 0 deletions Inline Diff

common/spl/spl_sata.c
1 /* 1 /*
2 * (C) Copyright 2013 2 * (C) Copyright 2013
3 * Texas Instruments, <www.ti.com> 3 * Texas Instruments, <www.ti.com>
4 * 4 *
5 * Dan Murphy <dmurphy@ti.com> 5 * Dan Murphy <dmurphy@ti.com>
6 * 6 *
7 * SPDX-License-Identifier: GPL-2.0+ 7 * SPDX-License-Identifier: GPL-2.0+
8 * 8 *
9 * Derived work from spl_usb.c 9 * Derived work from spl_usb.c
10 */ 10 */
11 11
12 #include <common.h> 12 #include <common.h>
13 #include <spl.h> 13 #include <spl.h>
14 #include <asm/u-boot.h> 14 #include <asm/u-boot.h>
15 #include <sata.h> 15 #include <sata.h>
16 #include <fat.h> 16 #include <fat.h>
17 #include <version.h> 17 #include <version.h>
18 #include <image.h> 18 #include <image.h>
19 19
20 DECLARE_GLOBAL_DATA_PTR; 20 DECLARE_GLOBAL_DATA_PTR;
21 21
22 void spl_sata_load_image(void) 22 void spl_sata_load_image(void)
23 { 23 {
24 int err; 24 int err;
25 block_dev_desc_t *stor_dev; 25 block_dev_desc_t *stor_dev;
26 26
27 err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE); 27 err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE);
28 if (err) { 28 if (err) {
29 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT 29 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
30 printf("spl: sata init failed: err - %d\n", err); 30 printf("spl: sata init failed: err - %d\n", err);
31 #endif 31 #endif
32 hang(); 32 hang();
33 } else { 33 } else {
34 /* try to recognize storage devices immediately */ 34 /* try to recognize storage devices immediately */
35 scsi_scan(0);
35 stor_dev = scsi_get_dev(0); 36 stor_dev = scsi_get_dev(0);
36 } 37 }
37 38
38 #ifdef CONFIG_SPL_OS_BOOT 39 #ifdef CONFIG_SPL_OS_BOOT
39 if (spl_start_uboot() || spl_load_image_fat_os(stor_dev, 40 if (spl_start_uboot() || spl_load_image_fat_os(stor_dev,
40 CONFIG_SYS_SATA_FAT_BOOT_PARTITION)) 41 CONFIG_SYS_SATA_FAT_BOOT_PARTITION))
41 #endif 42 #endif
42 err = spl_load_image_fat(stor_dev, 43 err = spl_load_image_fat(stor_dev,
43 CONFIG_SYS_SATA_FAT_BOOT_PARTITION, 44 CONFIG_SYS_SATA_FAT_BOOT_PARTITION,
44 CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME); 45 CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME);
45 if (err) { 46 if (err) {
46 puts("Error loading sata device\n"); 47 puts("Error loading sata device\n");
47 hang(); 48 hang();
48 } 49 }
49 } 50 }
50 51