mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 15:26:03 +09:00
spl: usb: Only init usb once
usb_init() may be called multiple times for fetching multiple images from SPL. Skip reinitializing USB if its already been done Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
This commit is contained in:
parent
c3ab97c1dd
commit
39388aebed
|
@ -22,11 +22,16 @@ int spl_usb_load(struct spl_image_info *spl_image,
|
||||||
struct spl_boot_device *bootdev, int partition,
|
struct spl_boot_device *bootdev, int partition,
|
||||||
const char *filename)
|
const char *filename)
|
||||||
{
|
{
|
||||||
int err;
|
int err = 0;
|
||||||
struct blk_desc *stor_dev;
|
struct blk_desc *stor_dev;
|
||||||
|
static bool usb_init_pending = true;
|
||||||
|
|
||||||
|
if (usb_init_pending) {
|
||||||
|
usb_stop();
|
||||||
|
err = usb_init();
|
||||||
|
usb_init_pending = false;
|
||||||
|
}
|
||||||
|
|
||||||
usb_stop();
|
|
||||||
err = usb_init();
|
|
||||||
if (err) {
|
if (err) {
|
||||||
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
|
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
|
||||||
printf("%s: usb init failed: err - %d\n", __func__, err);
|
printf("%s: usb init failed: err - %d\n", __func__, err);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user