Skip to contentSkip to conversation

mtd: nand: denali_spl: Program spare area skip bytes

PATCH New Marek Vasut 2 participants 3 messages Dec 20, 2015 – Dec 21, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: nand: denali_spl: Program spare area skip bytes

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.

Cc Masahiro Yamada <[email protected]>
Cc Scott Wood <[email protected]>
---
 drivers/mtd/nand/denali_spl.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/nand/denali_spl.c +4 -0
index 1587413..8c707d2 100644
@@ -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)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 mtd: nand: denali_spl: Program spare area skip bytes

Hi Marek,

2015-12-20 11:58 GMT+09:00 Marek Vasut <[email protected]>:

Quoted 10 lines

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.

Cc Masahiro Yamada <[email protected]>
Cc Scott Wood <[email protected]>

As for UniPhier SoCs, this register has been set to 8 by the boot ROM when booting from a NAND device.

So, my SoCs work with/without this patch
because CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES is defined 8 in my defconfigs.

Anyway, I am OK with this patch.

Quoted 9 lines
---
 drivers/mtd/nand/denali_spl.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/nand/denali_spl.c +0 -0
index 1587413..8c707d2 100644

drivers/mtd/nand/denali_spl.c void nand_init(void) · line 172

Quoted 5 lines
drivers/mtd/nand/denali_spl.c +2 -0
@@ -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 %^( */

What is "%^(" ?
Do you need this comment?

Otherwise,

Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw

PATCH 1/1 mtd: nand: denali_spl: Program spare area skip bytes

Quoted 1 line · Masahiro Yamada

Hi Marek,

Hi Masahiro!

Quoted 8 lines

2015-12-20 11:58 GMT+09:00 Marek Vasut <[email protected]>:

Quoted 7 lines

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.

Quoted 6 lines
Quoted 3 lines
Cc Masahiro Yamada <[email protected]>
Cc Scott Wood <[email protected]>

As for UniPhier SoCs, this register has been set to 8 by the boot ROM when booting from a NAND device.

Mine left the register at 0x0 %^(

Quoted 21 lines

So, my SoCs work with/without this patch
because CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES is defined 8 in my defconfigs.

Anyway, I am OK with this patch.

Quoted 15 lines

---

 drivers/mtd/nand/denali_spl.c | 4 ++++
 1 file changed, 4 insertions(+)
(quoted diff) +0 -0

b/drivers/mtd/nand/denali_spl.c index 1587413..8c707d2 100644

drivers/mtd/nand/denali_spl.c +0 -0
@@ -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);
 
Quoted 5 lines

drivers/mtd/nand/denali_spl.c void nand_init(void) · line 172

Quoted 2 lines
drivers/mtd/nand/denali_spl.c +2 -0
+
+       /* Spare area skip bytes is NOT programmed by hardware %^( */

What is "%^(" ?
Do you need this comment?

It clarifies why the register needs to be inited, that's all %^)

Quoted 3 lines

Otherwise,

Best regards,
Marek Vasut