summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAbel Vesa <abel.vesa@nxp.com>2018-11-07 18:12:22 +0200
committerAbel Vesa <abel.vesa@nxp.com>2018-11-09 11:44:45 +0200
commit32adc4aed8864fe274de13f14f4e29759062ee1d (patch)
treea0b671774473c188e0d4c13d0bc88a4fb93d7613 /arch
parenta37a72c84f1e4d92b6de609cf25903e6a28f8d07 (diff)
MLK-20233 imx8: Fix QSPI read in container parser
The check for CONFIG_SPL_SPI_LOAD is fixed, get rid of ret local variable (that's actually a bug) and fix the length for the spi_flash_read call. Signed-off-by: Abel Vesa <abel.vesa@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/imx8/parser.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm/mach-imx/imx8/parser.c b/arch/arm/mach-imx/imx8/parser.c
index 6a3b01f755..5186b1c83c 100644
--- a/arch/arm/mach-imx/imx8/parser.c
+++ b/arch/arm/mach-imx/imx8/parser.c
@@ -55,12 +55,13 @@ static int read(int start, int len, void *load_addr)
return -EIO;
}
}
-#elif CONFIG_SPL_SPI_LOAD
+#endif
+#ifdef CONFIG_SPL_SPI_LOAD
if (current_dev_type == QSPI_DEV) {
struct spi_flash *flash = (struct spi_flash *)device;
- int ret = spi_flash_read(flash, start,
- CONTAINER_HDR_ALIGNMENT, load_addr);
+ ret = spi_flash_read(flash, start,
+ len, load_addr);
if (ret != 0) {
debug("Read container image from QSPI failed\n");
return -EIO;