MLK-10985: mtd: nand: support NAND on i.MX6UL
authorHan Xu <b45815@freescale.com>
Thu, 28 May 2015 21:49:18 +0000 (16:49 -0500)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:47:31 +0000 (14:47 -0500)
support i.MX6UL GPMI NAND driver and removed the unecessary clock
per1_bch.

Signed-off-by: Han Xu <b45815@freescale.com>
(cherry picked from commit: 9aa0fb0a606a583e2b6e19892ac2cab1b0e726c4)

drivers/mtd/nand/gpmi-nand/gpmi-nand.c
drivers/mtd/nand/gpmi-nand/gpmi-nand.h

index 0985090..b8347fe 100644 (file)
@@ -122,6 +122,12 @@ static const struct gpmi_devdata gpmi_devdata_imx7d = {
        .max_chain_delay = 12,
 };
 
+static const struct gpmi_devdata gpmi_devdata_imx6ul = {
+       .type = IS_MX6UL,
+       .bch_max_ecc_strength = 40,
+       .max_chain_delay = 12,
+};
+
 static irqreturn_t bch_irq(int irq, void *cookie)
 {
        struct gpmi_nand_data *this = cookie;
@@ -616,7 +622,7 @@ acquire_err:
 }
 
 static char *extra_clks_for_mx6q[GPMI_CLK_MAX] = {
-       "gpmi_apb", "gpmi_bch", "gpmi_bch_apb", "per1_bch",
+       "gpmi_apb", "gpmi_bch", "gpmi_bch_apb",
 };
 
 static char *extra_clks_for_mx7d[GPMI_CLK_MAX] = {
@@ -2115,6 +2121,9 @@ static const struct of_device_id gpmi_nand_id_table[] = {
        }, {
                .compatible = "fsl,imx6sx-gpmi-nand",
                .data = &gpmi_devdata_imx6sx,
+       }, {
+               .compatible = "fsl,imx6ul-gpmi-nand",
+               .data = (void *)&gpmi_devdata_imx6ul,
        }, {
                .compatible = "fsl,imx7d-gpmi-nand",
                .data = &gpmi_devdata_imx7d,
index b571a7b..245c96a 100644 (file)
@@ -22,7 +22,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/dmaengine.h>
 
-#define GPMI_CLK_MAX 5 /* MX6Q needs five clocks */
+#define GPMI_CLK_MAX 4 /* MX6Q needs four clocks */
 struct resources {
        void __iomem  *gpmi_regs;
        void __iomem  *bch_regs;
@@ -125,7 +125,8 @@ enum gpmi_type {
        IS_MX6Q,
        IS_MX6QP,
        IS_MX6SX,
-       IS_MX7D
+       IS_MX7D,
+       IS_MX6UL
 };
 
 struct gpmi_devdata {
@@ -309,8 +310,9 @@ void gpmi_copy_bits(u8 *dst, size_t dst_bit_off,
 #define GPMI_IS_MX6QP(x)       ((x)->devdata->type == IS_MX6QP)
 #define GPMI_IS_MX6SX(x)       ((x)->devdata->type == IS_MX6SX)
 #define GPMI_IS_MX7D(x)                ((x)->devdata->type == IS_MX7D)
+#define GPMI_IS_MX6UL(x)       ((x)->devdata->type == IS_MX6UL)
 
 #define GPMI_IS_MX6(x)         (GPMI_IS_MX6Q(x) || GPMI_IS_MX6QP(x)\
-          || GPMI_IS_MX6SX(x))
+          || GPMI_IS_MX6SX(x) || GPMI_IS_MX6UL(x))
 #define GPMI_IS_MX7(x)         (GPMI_IS_MX7D(x))
 #endif