diff mbox

[U-Boot,09/82] spl: spi: Add a debug message if loading fails

Message ID 1474860866-16406-10-git-send-email-sjg@chromium.org
State Superseded
Delegated to: Bin Meng
Headers show

Commit Message

Simon Glass Sept. 26, 2016, 3:33 a.m. UTC
This currently fails silently. Add a debug message to aid debugging.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 common/spl/spl_spi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Bin Meng Oct. 11, 2016, 3:15 a.m. UTC | #1
Hi Simon,

On Mon, Sep 26, 2016 at 11:33 AM, Simon Glass <sjg@chromium.org> wrote:
> This currently fails silently. Add a debug message to aid debugging.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  common/spl/spl_spi.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c
> index a3caafb..3f400eb 100644
> --- a/common/spl/spl_spi.c
> +++ b/common/spl/spl_spi.c
> @@ -96,8 +96,10 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,
>                 /* Load u-boot, mkimage header is 64 bytes. */
>                 err = spi_flash_read(flash, CONFIG_SYS_SPI_U_BOOT_OFFS, 0x40,
>                                      (void *)header);
> -               if (err)
> +               if (err) {
> +                       debug("%s: Failed to read from SPI flash\n", __func__);

How about output the err num as well?

>                         return err;
> +               }
>
>                 if (IS_ENABLED(CONFIG_SPL_LOAD_FIT)) {
>                         struct spl_load_info load;
> --

Regards,
Bin
diff mbox

Patch

diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c
index a3caafb..3f400eb 100644
--- a/common/spl/spl_spi.c
+++ b/common/spl/spl_spi.c
@@ -96,8 +96,10 @@  static int spl_spi_load_image(struct spl_image_info *spl_image,
 		/* Load u-boot, mkimage header is 64 bytes. */
 		err = spi_flash_read(flash, CONFIG_SYS_SPI_U_BOOT_OFFS, 0x40,
 				     (void *)header);
-		if (err)
+		if (err) {
+			debug("%s: Failed to read from SPI flash\n", __func__);
 			return err;
+		}
 
 		if (IS_ENABLED(CONFIG_SPL_LOAD_FIT)) {
 			struct spl_load_info load;