summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-01-16 07:03:27 -0700
committerBin Meng <bmeng.cn@gmail.com>2017-02-06 11:38:46 +0800
commita704490034c94b87bfe3fa992cc50b9a017b9d2b (patch)
treea2ab97aa2b32850e336ea16792b02feb58540374 /common
parentb0265429469dde300e3dc2a2c1dce789014c7208 (diff)
downloadu-boot-a704490034c94b87bfe3fa992cc50b9a017b9d2b.tar.gz
u-boot-a704490034c94b87bfe3fa992cc50b9a017b9d2b.tar.xz
u-boot-a704490034c94b87bfe3fa992cc50b9a017b9d2b.zip
spl: spi: Add a debug message if loading fails
This currently fails silently. Add a debug message to aid debugging. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl_spi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c
index cd1d6b285e..925a1b1491 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) &&
image_get_magic(header) == FDT_MAGIC) {