]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/nand/mxs_nand.c
Merge branch 'fpga' of git://www.denx.de/git/u-boot-microblaze
[u-boot] / drivers / mtd / nand / mxs_nand.c
index 866cabd2765764ff29dbd84b9e2f9e58f6855ec0..7a064ab1bf945a2e5724ce9a9bf4e6ad403e1c81 100644 (file)
  * Copyright (C) 2010 Freescale Semiconductor, Inc.
  * Copyright (C) 2008 Embedded Alley Solutions, Inc.
  *
- * 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.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -158,8 +146,13 @@ static uint32_t mxs_nand_aux_status_offset(void)
 static inline uint32_t mxs_nand_get_ecc_strength(uint32_t page_data_size,
                                                uint32_t page_oob_size)
 {
-       if (page_data_size == 2048)
-               return 8;
+       if (page_data_size == 2048) {
+               if (page_oob_size == 64)
+                       return 8;
+
+               if (page_oob_size == 112)
+                       return 14;
+       }
 
        if (page_data_size == 4096) {
                if (page_oob_size == 128)
@@ -167,6 +160,9 @@ static inline uint32_t mxs_nand_get_ecc_strength(uint32_t page_data_size,
 
                if (page_oob_size == 218)
                        return 16;
+
+               if (page_oob_size == 224)
+                       return 16;
        }
 
        return 0;