All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] mtd: nand: denali_spl: Program spare area skip bytes
@ 2015-12-20  2:58 Marek Vasut
  2015-12-21  8:29 ` Masahiro Yamada
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2015-12-20  2:58 UTC (permalink / raw)
  To: u-boot

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 <marex@denx.de>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Scott Wood <scottwood@freescale.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] mtd: nand: denali_spl: Program spare area skip bytes
  2015-12-20  2:58 [U-Boot] [PATCH] mtd: nand: denali_spl: Program spare area skip bytes Marek Vasut
@ 2015-12-21  8:29 ` Masahiro Yamada
  2015-12-21 10:08   ` Marek Vasut
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2015-12-21  8:29 UTC (permalink / raw)
  To: u-boot

Hi Marek,


2015-12-20 11:58 GMT+09:00 Marek Vasut <marex@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 <marex@denx.de>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Cc: Scott Wood <scottwood@freescale.com>


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.

> ---
>  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 %^( */

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


Otherwise,

Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] mtd: nand: denali_spl: Program spare area skip bytes
  2015-12-21  8:29 ` Masahiro Yamada
@ 2015-12-21 10:08   ` Marek Vasut
  0 siblings, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2015-12-21 10:08 UTC (permalink / raw)
  To: u-boot

On Monday, December 21, 2015 at 09:29:27 AM, Masahiro Yamada wrote:
> Hi Marek,

Hi Masahiro!

> 2015-12-20 11:58 GMT+09:00 Marek Vasut <marex@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 <marex@denx.de>
> > Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> > Cc: Scott Wood <scottwood@freescale.com>
> 
> 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 %^(

> 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.
> 
> > ---
> > 
> >  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 %^( */
> 
> What is "%^(" ?
> Do you need this comment?

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

> Otherwise,
> 
> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-21 10:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-20  2:58 [U-Boot] [PATCH] mtd: nand: denali_spl: Program spare area skip bytes Marek Vasut
2015-12-21  8:29 ` Masahiro Yamada
2015-12-21 10:08   ` Marek Vasut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.