summaryrefslogtreecommitdiff
path: root/common/spl/spl_usb.c
diff options
context:
space:
mode:
authorFaiz Abbas <faiz_abbas@ti.com>2020-08-03 11:35:04 +0530
committerLokesh Vutla <lokeshvutla@ti.com>2020-08-11 20:34:46 +0530
commitc3ab97c1dd48ef8f4f737f1e83b3e39ccf13a532 (patch)
treed95931e97b97fab811d1afdf17916ef35dbe9e4b /common/spl/spl_usb.c
parentfc4c380233962ff658a1e23c3455282dcd58a075 (diff)
downloadu-boot-c3ab97c1dd48ef8f4f737f1e83b3e39ccf13a532.tar.gz
u-boot-c3ab97c1dd48ef8f4f737f1e83b3e39ccf13a532.tar.bz2
u-boot-c3ab97c1dd48ef8f4f737f1e83b3e39ccf13a532.zip
spl: usb: Create an API spl_usb_load()
Create a new API spl_usb_load() that takes the filename as a parameter instead of taking the default U-boot PAYLOAD_NAME Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Diffstat (limited to 'common/spl/spl_usb.c')
-rw-r--r--common/spl/spl_usb.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/common/spl/spl_usb.c b/common/spl/spl_usb.c
index 08837b38fc..92ae96f66e 100644
--- a/common/spl/spl_usb.c
+++ b/common/spl/spl_usb.c
@@ -18,8 +18,9 @@
static int usb_stor_curr_dev = -1; /* current device */
-static int spl_usb_load_image(struct spl_image_info *spl_image,
- struct spl_boot_device *bootdev)
+int spl_usb_load(struct spl_image_info *spl_image,
+ struct spl_boot_device *bootdev, int partition,
+ const char *filename)
{
int err;
struct blk_desc *stor_dev;
@@ -43,13 +44,10 @@ static int spl_usb_load_image(struct spl_image_info *spl_image,
#ifdef CONFIG_SPL_OS_BOOT
if (spl_start_uboot() ||
- spl_load_image_fat_os(spl_image, stor_dev,
- CONFIG_SYS_USB_FAT_BOOT_PARTITION))
+ spl_load_image_fat_os(spl_image, stor_dev, partition))
#endif
{
- err = spl_load_image_fat(spl_image, stor_dev,
- CONFIG_SYS_USB_FAT_BOOT_PARTITION,
- CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
+ err = spl_load_image_fat(spl_image, stor_dev, partition, filename);
}
if (err) {
@@ -59,4 +57,12 @@ static int spl_usb_load_image(struct spl_image_info *spl_image,
return 0;
}
+
+static int spl_usb_load_image(struct spl_image_info *spl_image,
+ struct spl_boot_device *bootdev)
+{
+ return spl_usb_load(spl_image, bootdev,
+ CONFIG_SYS_USB_FAT_BOOT_PARTITION,
+ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
+}
SPL_LOAD_IMAGE_METHOD("USB", 0, BOOT_DEVICE_USB, spl_usb_load_image);