diff options
author | Magnus Lilja <lilja.magnus@gmail.com> | 2010-01-17 16:46:10 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2010-01-19 23:08:13 (GMT) |
commit | c4832dffff20519e72879a8da010174ac0526141 (patch) | |
tree | 38b2d8672d650a70af43cff45f5e4224ff631f32 /drivers/mtd/nand/mxc_nand.c | |
parent | f6a9748e3261fdccdeb78a2b58e6ad538ba54496 (diff) | |
download | u-boot-fsl-qoriq-c4832dffff20519e72879a8da010174ac0526141.tar.xz |
MXC: Add large page oob layout for i.MX31 NAND controller.
Import the large page oob layout from Linux mxc_nand.c driver.
The CONFIG_SYS_NAND_LARGEPAGE option is used to activate
the large page oob layout. Run time detection is not supported
as this moment.
This has been tested on the i.MX31 PDK board with a large
page NAND device.
Signed-off-by: Magnus Lilja <lilja.magnus@gmail.com>
Diffstat (limited to 'drivers/mtd/nand/mxc_nand.c')
-rw-r--r-- | drivers/mtd/nand/mxc_nand.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index fc111b5..b2b612e 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c @@ -149,6 +149,13 @@ static struct nand_ecclayout nand_soft_eccoob = { }; #endif +static struct nand_ecclayout nand_hw_eccoob_largepage = { + .eccbytes = 20, + .eccpos = {6, 7, 8, 9, 10, 22, 23, 24, 25, 26, + 38, 39, 40, 41, 42, 54, 55, 56, 57, 58}, + .oobfree = {{2, 4}, {11, 10}, {27, 10}, {43, 10}, {59, 5}, } +}; + #ifdef CONFIG_MX27 static int is_16bit_nand(void) { @@ -902,7 +909,12 @@ int board_nand_init(struct nand_chip *this) if (is_16bit_nand()) this->options |= NAND_BUSWIDTH_16; +#ifdef CONFIG_SYS_NAND_LARGEPAGE + host->pagesize_2k = 1; + this->ecc.layout = &nand_hw_eccoob_largepage; +#else host->pagesize_2k = 0; +#endif return err; } |