]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/nand/omap_gpmc.c
sf: ramtron: Add support for separate flash driver
[u-boot] / drivers / mtd / nand / omap_gpmc.c
index bc1bcad3bad6d66576167dfb26add5651f959c7c..ec1787f22492d93322a4014c6acc3d3da9ba2d9f 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2004-2008 Texas Instruments, <www.ti.com>
  * Rohit Choraria <rohitkc@ti.com>
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -590,11 +574,12 @@ static int omap_correct_data_bch(struct mtd_info *mtd, uint8_t *dat,
  * @mtd:       mtd info structure
  * @chip:      nand chip info structure
  * @buf:       buffer to store read data
+ * @oob_required: caller expects OOB data read to chip->oob_poi
  * @page:      page number to read
  *
  */
 static int omap_read_page_bch(struct mtd_info *mtd, struct nand_chip *chip,
-                               uint8_t *buf, int page)
+                               uint8_t *buf, int oob_required, int page)
 {
        int i, eccsize = chip->ecc.size;
        int eccbytes = chip->ecc.bytes;
@@ -804,6 +789,7 @@ void omap_nand_switch_ecc(uint32_t hardware, uint32_t eccstrength)
        nand->ecc.hwctl = NULL;
        nand->ecc.correct = NULL;
        nand->ecc.calculate = NULL;
+       nand->ecc.strength = eccstrength;
 
        /* Setup the ecc configurations again */
        if (hardware) {
@@ -901,7 +887,7 @@ int board_nand_init(struct nand_chip *nand)
        nand->IO_ADDR_W = (void __iomem *)&gpmc_cfg->cs[cs].nand_cmd;
 
        nand->cmd_ctrl = omap_nand_hwcontrol;
-       nand->options = NAND_NO_PADDING | NAND_CACHEPRG | NAND_NO_AUTOINCR;
+       nand->options = NAND_NO_PADDING | NAND_CACHEPRG;
        /* If we are 16 bit dev, our gpmc config tells us that */
        if ((readl(&gpmc_cfg->cs[cs].config1) & 0x3000) == 0x1000)
                nand->options |= NAND_BUSWIDTH_16;
@@ -934,6 +920,7 @@ int board_nand_init(struct nand_chip *nand)
        nand->ecc.layout = &hw_bch8_nand_oob;
        nand->ecc.size = CONFIG_SYS_NAND_ECCSIZE;
        nand->ecc.bytes = CONFIG_SYS_NAND_ECCBYTES;
+       nand->ecc.strength = 8;
        nand->ecc.hwctl = omap_enable_ecc_bch;
        nand->ecc.correct = omap_correct_data_bch;
        nand->ecc.calculate = omap_calculate_ecc_bch;
@@ -952,6 +939,7 @@ int board_nand_init(struct nand_chip *nand)
        nand->ecc.hwctl = omap_enable_hwecc;
        nand->ecc.correct = omap_correct_data;
        nand->ecc.calculate = omap_calculate_ecc;
+       nand->ecc.strength = 1;
        omap_hwecc_init(nand);
 #endif
 #endif