If the loader->load_image returns -EAGAIN, it is an indication
the loading process should restart the loading, possible due to
DTO being applied on the U-Boot's DT. Restart the loading until
the loader stops returning -EAGAIN.

Signed-off-by: Marek Vasut <ma...@denx.de>
Cc: Pantelis Antoniou <pantelis.anton...@konsulko.com>
Cc: Simon Glass <s...@chromium.org>
---
 common/spl/spl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 2444abbb08..27f44c27b0 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -413,11 +413,16 @@ static int spl_load_image(struct spl_image_info 
*spl_image,
                          struct spl_image_loader *loader)
 {
        struct spl_boot_device bootdev;
+       int ret;
 
        bootdev.boot_device = loader->boot_device;
        bootdev.boot_device_name = NULL;
 
-       return loader->load_image(spl_image, &bootdev);
+       do {
+               ret = loader->load_image(spl_image, &bootdev);
+       } while (ret == -EAGAIN);
+
+       return ret;
 }
 
 /**
-- 
2.15.0

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to