Patchwork [U-Boot,v2,1/2] nand, davinci: add special UBL ecc position

login
register
mail settings
Submitter Heiko Schocher
Date Sept. 6, 2013, 3:21 a.m.
Message ID <1378437684-9273-2-git-send-email-hs@denx.de>
Download mbox | patch
Permalink /patch/273024/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Heiko Schocher - Sept. 6, 2013, 3:21 a.m.
enable the RBL/UBL ECC layout through
CONFIG_NAND_6BYTES_OOB_FREE_10BYTES_ECC define

see for more info:
http://processors.wiki.ti.com/index.php/DM365_Nand_ECC_layout

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Tom Rini <trini@ti.com>
Cc: Scott Wood <scottwood@freescale.com>

---
- changes for v2:
  add comment from Scott Wood:
  - move  if/else/end to a more readable place
---
 drivers/mtd/nand/davinci_nand.c | 12 ++++++++++++
 1 Datei geändert, 12 Zeilen hinzugefügt(+)
Tom Rini - Nov. 4, 2013, 2:17 p.m.
On Fri, Sep 06, 2013 at 05:21:23AM +0200, Heiko Schocher wrote:

> enable the RBL/UBL ECC layout through
> CONFIG_NAND_6BYTES_OOB_FREE_10BYTES_ECC define
> 
> see for more info:
> http://processors.wiki.ti.com/index.php/DM365_Nand_ECC_layout
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Tom Rini <trini@ti.com>
> Cc: Scott Wood <scottwood@freescale.com>

Applied to u-boot-ti/master, thanks!

Patch

diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index d8bb5d3..5b17d7b 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -266,6 +266,17 @@  static int nand_davinci_correct_data(struct mtd_info *mtd, u_char *dat,
 static struct nand_ecclayout nand_davinci_4bit_layout_oobfirst = {
 #if defined(CONFIG_SYS_NAND_PAGE_2K)
 	.eccbytes = 40,
+#ifdef CONFIG_NAND_6BYTES_OOB_FREE_10BYTES_ECC
+	.eccpos = {
+		6,   7,  8,  9, 10,	11, 12, 13, 14, 15,
+		22, 23, 24, 25, 26,	27, 28, 29, 30, 31,
+		38, 39, 40, 41, 42,	43, 44, 45, 46, 47,
+		54, 55, 56, 57, 58,	59, 60, 61, 62, 63,
+	},
+	.oobfree = {
+		{2, 4}, {16, 6}, {32, 6}, {48, 6},
+	},
+#else
 	.eccpos = {
 		24, 25, 26, 27, 28,
 		29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
@@ -276,6 +287,7 @@  static struct nand_ecclayout nand_davinci_4bit_layout_oobfirst = {
 	.oobfree = {
 		{.offset = 2, .length = 22, },
 	},
+#endif	/* #ifdef CONFIG_NAND_6BYTES_OOB_FREE_10BYTES_ECC */
 #elif defined(CONFIG_SYS_NAND_PAGE_4K)
 	.eccbytes = 80,
 	.eccpos = {