From: Marek Vasut Date: Sun, 20 Dec 2015 03:58:53 +0100 Subject: [U-Boot] [PATCH] mtd: nand: denali_spl: Program spare area skip bytes Message-ID: <1450580333-6198-1-git-send-email-marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This register is not configured on Altera SoCFPGA incarnation of the Denali NAND flash block. Unless this register is initialized, the IP will return corrupted data upon any read attempt from the NAND. Initialize the register to the same value is the one used in full U-Boot to fix this issue. Signed-off-by: Marek Vasut Cc: Masahiro Yamada Cc: Scott Wood --- drivers/mtd/nand/denali_spl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/nand/denali_spl.c b/drivers/mtd/nand/denali_spl.c index 1587413..8c707d2 100644 --- a/drivers/mtd/nand/denali_spl.c +++ b/drivers/mtd/nand/denali_spl.c @@ -168,6 +168,10 @@ void nand_init(void) page_size = readl(denali_flash_reg + DEVICE_MAIN_AREA_SIZE); oob_size = readl(denali_flash_reg + DEVICE_SPARE_AREA_SIZE); pages_per_block = readl(denali_flash_reg + PAGES_PER_BLOCK); + + /* Spare area skip bytes is NOT programmed by hardware %^( */ + writel(CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES, + denali_flash_reg + SPARE_AREA_SKIP_BYTES); } int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst) -- 2.1.4