Skip to content

Commit 54ee5ae

Browse files
rstam3108trini
authored andcommitted
Add SCSI scan for ENV in EXT4 or FAT
When having environment stored in EXT4 or FAT and using an AHCI or SCSI device / partition the scan would not be performed early enough and hence the device would not be recognized. This change adds the scan when the interface is "scsi" in a similar way to mmc_initialize. Signed-off-by: Rogier Stam <[email protected]> Reviewed-by: Pali Rohár <[email protected]>
1 parent ea92f95 commit 54ee5ae

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

env/ext4.c

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <errno.h>
3232
#include <ext4fs.h>
3333
#include <mmc.h>
34+
#include <scsi.h>
3435
#include <asm/global_data.h>
3536

3637
DECLARE_GLOBAL_DATA_PTR;
@@ -146,6 +147,10 @@ static int env_ext4_load(void)
146147
if (!strcmp(ifname, "mmc"))
147148
mmc_initialize(NULL);
148149
#endif
150+
#if defined(CONFIG_AHCI) || defined(CONFIG_SCSI)
151+
if (!strcmp(ifname, "scsi"))
152+
scsi_scan(true);
153+
#endif
149154

150155
part = blk_get_device_part_str(ifname, dev_and_part,
151156
&dev_desc, &info, 1);

env/fat.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <errno.h>
1818
#include <fat.h>
1919
#include <mmc.h>
20+
#include <scsi.h>
2021
#include <asm/cache.h>
2122
#include <asm/global_data.h>
2223
#include <linux/stddef.h>
@@ -128,7 +129,12 @@ static int env_fat_load(void)
128129
if (!strcmp(ifname, "mmc"))
129130
mmc_initialize(NULL);
130131
#endif
131-
132+
#ifndef CONFIG_SPL_BUILD
133+
#if defined(CONFIG_AHCI) || defined(CONFIG_SCSI)
134+
if (!strcmp(CONFIG_ENV_FAT_INTERFACE, "scsi"))
135+
scsi_scan(true);
136+
#endif
137+
#endif
132138
part = blk_get_device_part_str(ifname, dev_and_part,
133139
&dev_desc, &info, 1);
134140
if (part < 0)

0 commit comments

Comments
 (0)