MLK-22580-1: nand: mxs_nand: make imx8mm-evk can use hardware BCH and
authorAlice Guo <alice.guo@nxp.com>
Fri, 11 Oct 2019 14:30:21 +0000 (22:30 +0800)
committerYe Li <ye.li@nxp.com>
Tue, 15 Oct 2019 09:37:35 +0000 (02:37 -0700)
randomizer

imx8mm-evk needs to BCH encode and set NAND page number needed to be
randomized

modify conditional compilation

Should use CONFIG_IMX8M, it should apply to imx8mq/mm/mn

Signed-off-by: Alice Guo <alice.guo@nxp.com>
(cherry picked from commit da40cd99e4b3a78d2609ee777d60d651d6dbc313)

drivers/mtd/nand/raw/mxs_nand.c

index 3be14c8..4b0af37 100644 (file)
@@ -858,7 +858,7 @@ static int mxs_nand_ecc_write_page(struct mtd_info *mtd,
        d->cmd.pio_words[4] = (dma_addr_t)nand_info->data_buf;
        d->cmd.pio_words[5] = (dma_addr_t)nand_info->oob_buf;
 
-       if (is_mx7() && nand_info->en_randomizer) {
+       if ((is_mx7() && nand_info->en_randomizer) || (is_imx8m() && nand_info->en_randomizer)) {
                d->cmd.pio_words[2] |= GPMI_ECCCTRL_RANDOMIZER_ENABLE |
                                       GPMI_ECCCTRL_RANDOMIZER_TYPE2;
                /*
@@ -1457,7 +1457,7 @@ err:
 }
 #endif
 
-#if CONFIG_IS_ENABLED(MX7) || CONFIG_IS_ENABLED(MX6)
+#if defined(CONFIG_MX6) || defined(CONFIG_MX7) || defined(CONFIG_IMX8M)
 /*
  * Read NAND layout for FCB block generation.
  */