[U-Boot] [PATCH v7 25/87] mtd: spi-nor: fsl_espi_spl: Use writebufsize instead of page_size

Jagan Teki jteki at openedev.com
Tue Mar 22 08:37:37 CET 2016


Replace spi_flash{} with mtd_info{}

Cc: Simon Glass <sjg at chromium.org>
Cc: Bin Meng <bmeng.cn at gmail.com>
Cc: York Sun <york.sun at nxp.com>
Signed-off-by: Jagan Teki <jteki at openedev.com>
---
 drivers/mtd/spi-nor/fsl_espi_spl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/spi-nor/fsl_espi_spl.c b/drivers/mtd/spi-nor/fsl_espi_spl.c
index 93b0b2e..581c346 100644
--- a/drivers/mtd/spi-nor/fsl_espi_spl.c
+++ b/drivers/mtd/spi-nor/fsl_espi_spl.c
@@ -54,15 +54,15 @@ void spi_boot(void)
 	/*
 	* Load U-Boot image from SPI flash into RAM
 	*/
-	buf = malloc(flash->page_size);
+	buf = malloc(flash->writebufsize);
 	if (buf == NULL) {
 		puts("\nmalloc failed");
 		hang();
 	}
-	memset(buf, 0, flash->page_size);
+	memset(buf, 0, flash->writebufsize);
 
 	spi_flash_read(flash, CONFIG_CFG_DATA_SECTOR,
-		       flash->page_size, (void *)buf);
+		       flash->writebufsize, (void *)buf);
 	offset = *(u32 *)(buf + ESPI_BOOT_IMAGE_ADDR);
 	/* Skip spl code */
 	offset += CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS;
-- 
1.9.1



More information about the U-Boot mailing list