Message ID | 1479587152-25065-3-git-send-email-sjg@chromium.org |
---|---|
State | Superseded |
Delegated to: | Bin Meng |
Headers | show |
On Sun, Nov 20, 2016 at 1:54 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> > --- > > Changes in v2: > - Show the error value in spl_spi_load_image() > > common/spl/spl_spi.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c > index a3caafb..255da99 100644 > --- a/common/spl/spl_spi.c > +++ b/common/spl/spl_spi.c > @@ -96,8 +96,11 @@ 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 (err=%d)\n", > + __func__, err); > return err; For more informative and debug, better to add offset as well. thanks!
On Sun, Nov 20, 2016 at 4:24 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> > --- > > Changes in v2: > - Show the error value in spl_spi_load_image() > > common/spl/spl_spi.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index a3caafb..255da99 100644 --- a/common/spl/spl_spi.c +++ b/common/spl/spl_spi.c @@ -96,8 +96,11 @@ 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 (err=%d)\n", + __func__, err); return err; + } if (IS_ENABLED(CONFIG_SPL_LOAD_FIT)) { struct spl_load_info load;
This currently fails silently. Add a debug message to aid debugging. Signed-off-by: Simon Glass <sjg@chromium.org> --- Changes in v2: - Show the error value in spl_spi_load_image() common/spl/spl_spi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)