MLK-22723-1: mtd: mxs_nand: fix the gf_13/14 definition issue
authorHan Xu <han.xu@nxp.com>
Wed, 9 Oct 2019 15:30:21 +0000 (10:30 -0500)
committerYe Li <ye.li@nxp.com>
Fri, 11 Oct 2019 06:33:51 +0000 (23:33 -0700)
gf_13/14 mask was not set correctly in register definition.

Signed-off-by: Han Xu <han.xu@nxp.com>
(cherry picked from commit b8aed98b2ecfb0def64c474e1ae171930da4c9fc)

arch/arm/include/asm/mach-imx/regs-bch.h
drivers/mtd/nand/raw/mxs_nand.c
include/mxs_nand.h

index 0063073..a2f820d 100644 (file)
@@ -152,9 +152,9 @@ struct mxs_bch_regs {
 #define        BCH_FLASHLAYOUT0_ECC0_ECC28                     (0xe << 12)
 #define        BCH_FLASHLAYOUT0_ECC0_ECC30                     (0xf << 12)
 #define        BCH_FLASHLAYOUT0_ECC0_ECC32                     (0x10 << 12)
-#define        BCH_FLASHLAYOUT0_GF13_0_GF14_1                  (1 << 10)
+#define        BCH_FLASHLAYOUT0_GF13_0_GF14_1_MASK             (1 << 10)
 #define        BCH_FLASHLAYOUT0_GF13_0_GF14_1_OFFSET           10
-#define        BCH_FLASHLAYOUT0_DATA0_SIZE_MASK                0xfff
+#define        BCH_FLASHLAYOUT0_DATA0_SIZE_MASK                0x3ff
 #define        BCH_FLASHLAYOUT0_DATA0_SIZE_OFFSET              0
 
 #define        BCH_FLASHLAYOUT1_PAGE_SIZE_MASK                 (0xffff << 16)
@@ -183,9 +183,9 @@ struct mxs_bch_regs {
 #define        BCH_FLASHLAYOUT1_ECCN_ECC28                     (0xe << 12)
 #define        BCH_FLASHLAYOUT1_ECCN_ECC30                     (0xf << 12)
 #define        BCH_FLASHLAYOUT1_ECCN_ECC32                     (0x10 << 12)
-#define        BCH_FLASHLAYOUT1_GF13_0_GF14_1                  (1 << 10)
+#define        BCH_FLASHLAYOUT1_GF13_0_GF14_1_MASK             (1 << 10)
 #define        BCH_FLASHLAYOUT1_GF13_0_GF14_1_OFFSET           10
-#define        BCH_FLASHLAYOUT1_DATAN_SIZE_MASK                0xfff
+#define        BCH_FLASHLAYOUT1_DATAN_SIZE_MASK                0x3ff
 #define        BCH_FLASHLAYOUT1_DATAN_SIZE_OFFSET              0
 
 #define        BCH_DEBUG0_RSVD1_MASK                           (0x1f << 27)
index 699294c..3be14c8 100644 (file)
@@ -1481,6 +1481,8 @@ void mxs_nand_get_layout(struct mtd_info *mtd, struct mxs_nand_layout *l)
                        BCH_FLASHLAYOUT1_DATAN_SIZE_OFFSET);
        l->eccn = (tmp & BCH_FLASHLAYOUT1_ECCN_MASK) >>
                        BCH_FLASHLAYOUT1_ECCN_OFFSET;
+       l->gf_len = (tmp & BCH_FLASHLAYOUT1_GF13_0_GF14_1_MASK) >>
+                       BCH_FLASHLAYOUT1_GF13_0_GF14_1_OFFSET;
 }
 
 /*
index 6182214..38eba06 100644 (file)
@@ -87,6 +87,7 @@ struct mxs_nand_layout {
        u32 ecc0;
        u32 datan_size;
        u32 eccn;
+       u32 gf_len;
 };
 
 int mxs_nand_init_ctrl(struct mxs_nand_info *nand_info);