public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ash Charles <ashcharles@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/6] omap3: overo: Use software BCH8 ECC for NAND
Date: Tue, 28 Apr 2015 16:17:53 -0700	[thread overview]
Message-ID: <1430263075-27682-5-git-send-email-ashcharles@gmail.com> (raw)
In-Reply-To: <1430263075-27682-1-git-send-email-ashcharles@gmail.com>

Overo COMs have NAND flash that requires 4-bit ECC or better except for
the first sector which can use 1-bit ECC.  The boot ROM expects to load
a payload from NAND written using 1-bit hardware-based ECC.  In short,
write SPL to NAND something like this (4 times for redundancy):
 #> nandecc hw
 #> nand write ${loadaddr} 0x0 ${filesize}
 #> nand write ${loadaddr} 0x20000 ${filesize}
 #> nand write ${loadaddr} 0x40000 ${filesize}
 #> nand write ${loadaddr} 0x60000 ${filesize}

Then, switch back to software-based BCH8 for everything else:
 #> nandecc sw bch8

After [1], enlarge the max size of the SPL so the BCH code can fit.

[1] https://www.mail-archive.com/u-boot at lists.denx.de/msg163912.html

Signed-off-by: Ash Charles <ashcharles@gmail.com>
---
 include/configs/omap3_overo.h | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
index c58636a..61213df 100644
--- a/include/configs/omap3_overo.h
+++ b/include/configs/omap3_overo.h
@@ -11,6 +11,12 @@
 #define CONFIG_NAND
 
 #include <configs/ti_omap3_common.h>
+#undef CONFIG_SPL_MAX_SIZE
+#define CONFIG_SPL_MAX_SIZE	(64*1024)
+#undef CONFIG_SPL_TEXT_BASE
+#define CONFIG_SPL_TEXT_BASE	0x40200000
+
+#define CONFIG_BCH
 
 /* Display CPU and Board information */
 #define CONFIG_DISPLAY_CPUINFO
@@ -212,17 +218,22 @@
 
 /* NAND boot config */
 #define CONFIG_SYS_NAND_BUSWIDTH_16BIT	16
+#define CONFIG_SYS_NAND_MAX_ECCPOS  56
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_PAGE_COUNT	64
 #define CONFIG_SYS_NAND_PAGE_SIZE	2048
 #define CONFIG_SYS_NAND_OOBSIZE		64
 #define CONFIG_SYS_NAND_BLOCK_SIZE	(128*1024)
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
-#define CONFIG_SYS_NAND_ECCPOS		{2, 3, 4, 5, 6, 7, 8, 9,\
-						10, 11, 12, 13}
+#define CONFIG_SYS_NAND_ECCPOS      {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
+					13, 14, 16, 17, 18, 19, 20, 21, 22, \
+					23, 24, 25, 26, 27, 28, 30, 31, 32, \
+					33, 34, 35, 36, 37, 38, 39, 40, 41, \
+					42, 44, 45, 46, 47, 48, 49, 50, 51, \
+					52, 53, 54, 55, 56}
 #define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	3
-#define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_HAM1_CODE_HW
+#define CONFIG_SYS_NAND_ECCBYTES	13
+#define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x80000
 /* NAND: SPL falcon mode configs */
-- 
2.1.4

  parent reply	other threads:[~2015-04-28 23:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28 23:17 [U-Boot] [PATCH 0/6] omap3: overo: collected fixes Ash Charles
2015-04-28 23:17 ` [U-Boot] [PATCH 1/6] omap3: overo: Set the Arbor43C 'expansionname' Ash Charles
2015-05-10 14:09   ` [U-Boot] [U-Boot, " Tom Rini
2015-04-28 23:17 ` [U-Boot] [PATCH 2/6] omap3: overo: Add DTS support for TobiDuo expansion Ash Charles
2015-05-10 14:09   ` [U-Boot] [U-Boot, " Tom Rini
2015-04-28 23:17 ` [U-Boot] [PATCH 3/6] overo: Add support for Palo35 expansion board Ash Charles
2015-05-10 14:09   ` [U-Boot] [U-Boot, " Tom Rini
2015-04-28 23:17 ` Ash Charles [this message]
2015-05-10 14:09   ` [U-Boot] [U-Boot, 4/6] omap3: overo: Use software BCH8 ECC for NAND Tom Rini
2015-04-28 23:17 ` [U-Boot] [PATCH 5/6] omap3: overo: Allow boot with kernel in UBI rootfs Ash Charles
2015-05-10 14:09   ` [U-Boot] [U-Boot, " Tom Rini
2015-04-28 23:17 ` [U-Boot] [PATCH 6/6] overo: Override RAM setup for rev. 0 boards Ash Charles
2015-05-10 14:07   ` [U-Boot] [U-Boot, " Tom Rini
2015-05-11 15:23     ` Ash Charles

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1430263075-27682-5-git-send-email-ashcharles@gmail.com \
    --to=ashcharles@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox