]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/nand/davinci_nand.c
Merge branch 'master' of git://www.denx.de/git/u-boot-imx
[u-boot] / drivers / mtd / nand / davinci_nand.c
index d8bb5d3519c615cd4faa2a2fae45be02b7937cde..5d425092f43a1eb2eb84a956db56faa5fce1f7f6 100644 (file)
@@ -32,8 +32,7 @@
 #include <common.h>
 #include <asm/io.h>
 #include <nand.h>
-#include <asm/arch/nand_defs.h>
-#include <asm/arch/emif_defs.h>
+#include <asm/ti-common/davinci_nand.h>
 
 /* Definitions for 4-bit hardware ECC */
 #define NAND_TIMEOUT                   10240
@@ -266,6 +265,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 +286,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 = {
@@ -597,6 +608,9 @@ void davinci_nand_init(struct nand_chip *nand)
 #ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
        nand->bbt_options         |= NAND_BBT_USE_FLASH;
 #endif
+#ifdef CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
+       nand->options     |= NAND_NO_SUBPAGE_WRITE;
+#endif
 #ifdef CONFIG_SYS_NAND_HW_ECC
        nand->ecc.mode = NAND_ECC_HW;
        nand->ecc.size = 512;