From: Simon Glass Date: Mon, 16 Jan 2017 07:03:27 -0700 Subject: [U-Boot] [PATCH v3 02/62] spl: spi: Add a debug message if loading fails In-Reply-To: <20170116140427.29283-1-sjg@chromium.org> References: <20170116140427.29283-1-sjg@chromium.org> Message-ID: <20170116140427.29283-3-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This currently fails silently. Add a debug message to aid debugging. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- Changes in v3: None 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 cd1d6b285ef..925a1b14915 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) { -- 2.11.0.483.g087da7b7c-goog