mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-23 05:08:24 +00:00
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>
This commit is contained in:
parent
fc4c380233
commit
c3ab97c1dd
2 changed files with 27 additions and 7 deletions
|
@ -18,8 +18,9 @@
|
||||||
|
|
||||||
static int usb_stor_curr_dev = -1; /* current device */
|
static int usb_stor_curr_dev = -1; /* current device */
|
||||||
|
|
||||||
static int spl_usb_load_image(struct spl_image_info *spl_image,
|
int spl_usb_load(struct spl_image_info *spl_image,
|
||||||
struct spl_boot_device *bootdev)
|
struct spl_boot_device *bootdev, int partition,
|
||||||
|
const char *filename)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
struct blk_desc *stor_dev;
|
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
|
#ifdef CONFIG_SPL_OS_BOOT
|
||||||
if (spl_start_uboot() ||
|
if (spl_start_uboot() ||
|
||||||
spl_load_image_fat_os(spl_image, stor_dev,
|
spl_load_image_fat_os(spl_image, stor_dev, partition))
|
||||||
CONFIG_SYS_USB_FAT_BOOT_PARTITION))
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
err = spl_load_image_fat(spl_image, stor_dev,
|
err = spl_load_image_fat(spl_image, stor_dev, partition, filename);
|
||||||
CONFIG_SYS_USB_FAT_BOOT_PARTITION,
|
|
||||||
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -59,4 +57,12 @@ static int spl_usb_load_image(struct spl_image_info *spl_image,
|
||||||
|
|
||||||
return 0;
|
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);
|
SPL_LOAD_IMAGE_METHOD("USB", 0, BOOT_DEVICE_USB, spl_usb_load_image);
|
||||||
|
|
|
@ -503,6 +503,20 @@ int spl_mmc_load(struct spl_image_info *spl_image,
|
||||||
int raw_part,
|
int raw_part,
|
||||||
unsigned long raw_sect);
|
unsigned long raw_sect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* spl_usb_load() - Load an image file from USB mass storage
|
||||||
|
*
|
||||||
|
* @param spl_image Image data filled in by loading process
|
||||||
|
* @param bootdev Describes which device to load from
|
||||||
|
* @param raw_part Fat partition to load from
|
||||||
|
* @param filename Name of file to load
|
||||||
|
*
|
||||||
|
* @return 0 on success, otherwise error code
|
||||||
|
*/
|
||||||
|
int spl_usb_load(struct spl_image_info *spl_image,
|
||||||
|
struct spl_boot_device *bootdev,
|
||||||
|
int partition, const char *filename);
|
||||||
|
|
||||||
int spl_ymodem_load_image(struct spl_image_info *spl_image,
|
int spl_ymodem_load_image(struct spl_image_info *spl_image,
|
||||||
struct spl_boot_device *bootdev);
|
struct spl_boot_device *bootdev);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue