summaryrefslogtreecommitdiff
path: root/common/spl/spl_fat.c
diff options
context:
space:
mode:
authorDan Murphy <dmurphy@ti.com>2014-01-16 11:23:30 -0600
committerTom Rini <trini@ti.com>2014-01-24 16:59:22 -0500
commit8cffe5bd0d601f64eca78d28b8a710ad6ca8edd2 (patch)
tree17c1cec019810ffc5dcb4a59ab0522cec4c5fdf5 /common/spl/spl_fat.c
parent773b5940b5f2fb5d1041c6f4db5796121ccd29c5 (diff)
downloadu-boot-imx-8cffe5bd0d601f64eca78d28b8a710ad6ca8edd2.zip
u-boot-imx-8cffe5bd0d601f64eca78d28b8a710ad6ca8edd2.tar.gz
u-boot-imx-8cffe5bd0d601f64eca78d28b8a710ad6ca8edd2.tar.bz2
spl: common: Support for USB MSD FAT image loading
Add SPL support to be able to detect a USB Mass Storage device connected to a USB host. Once a USB Mass storage device is detected the SPL will load the u-boot.img from a FAT partition to target address. Signed-off-by: Dan Murphy <dmurphy@ti.com>
Diffstat (limited to 'common/spl/spl_fat.c')
-rw-r--r--common/spl/spl_fat.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index 9b40584..1e532d5 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -28,7 +28,7 @@ static int spl_register_fat_device(block_dev_desc_t *block_dev, int partition)
err = fat_register_device(block_dev, partition);
if (err) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
- printf("spl: fat register err - %d\n", err);
+ printf("%s: fat register err - %d\n", __func__, err);
#endif
hang();
}
@@ -46,7 +46,7 @@ int spl_load_image_fat(block_dev_desc_t *block_dev,
struct image_header *header;
err = spl_register_fat_device(block_dev, partition);
- if (err <= 0)
+ if (err)
goto end;
header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
@@ -63,8 +63,8 @@ int spl_load_image_fat(block_dev_desc_t *block_dev,
end:
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
if (err <= 0)
- printf("spl: error reading image %s, err - %d\n",
- filename, err);
+ printf("%s: error reading image %s, err - %d\n",
+ __func__, filename, err);
#endif
return (err <= 0);
@@ -76,15 +76,15 @@ int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition)
int err;
err = spl_register_fat_device(block_dev, partition);
- if (err <= 0)
- return -1;
+ if (err)
+ return err;
err = file_fat_read(CONFIG_SPL_FAT_LOAD_ARGS_NAME,
(void *)CONFIG_SYS_SPL_ARGS_ADDR, 0);
if (err <= 0) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
- printf("spl: error reading image %s, err - %d\n",
- CONFIG_SPL_FAT_LOAD_ARGS_NAME, err);
+ printf("%s: error reading image %s, err - %d\n",
+ __func__, CONFIG_SPL_FAT_LOAD_ARGS_NAME, err);
#endif
return -1;
}