summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
diff options
context:
space:
mode:
authorHan Xu <han.xu@nxp.com>2019-11-13 22:09:04 -0600
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:44:06 +0800
commit9795bce29cbd40c85aae62beee9aaa4591375679 (patch)
tree264250d0b37d950672ae251ec7470ef214ad5f12 /drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
parentf528bbd0a937df31ad38033f57a1449c1346c966 (diff)
mtd: nand: raw: gpmi-nand: add all supported platform info
add all supported platform info Signed-off-by: Han Xu <han.xu@nxp.com>
Diffstat (limited to 'drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c')
-rw-r--r--drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c55
1 files changed, 51 insertions, 4 deletions
diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
index 503e1a60abf4..42dda6e0a3e3 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
@@ -750,7 +750,7 @@ static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
return PTR_ERR(sdr);
/* Only MX6 GPMI controller can reach EDO timings */
- if (sdr->tRC_min <= 25000 && !GPMI_IS_MX6(this))
+ if (sdr->tRC_min <= 25000 && !(GPMI_IS_MX6(this) || GPMI_IS_MX8(this)))
return -ENOTSUPP;
/* Stop here if this call was just a check */
@@ -1075,6 +1075,14 @@ static const struct gpmi_devdata gpmi_devdata_imx6q = {
.clks_count = ARRAY_SIZE(gpmi_clks_for_mx6),
};
+static const struct gpmi_devdata gpmi_devdata_imx6qp = {
+ .type = IS_MX6QP,
+ .bch_max_ecc_strength = 40,
+ .max_chain_delay = 12000,
+ .clks = gpmi_clks_for_mx6,
+ .clks_count = ARRAY_SIZE(gpmi_clks_for_mx6),
+};
+
static const struct gpmi_devdata gpmi_devdata_imx6sx = {
.type = IS_MX6SX,
.bch_max_ecc_strength = 62,
@@ -1083,6 +1091,22 @@ static const struct gpmi_devdata gpmi_devdata_imx6sx = {
.clks_count = ARRAY_SIZE(gpmi_clks_for_mx6),
};
+static const struct gpmi_devdata gpmi_devdata_imx6ul = {
+ .type = IS_MX6UL,
+ .bch_max_ecc_strength = 40,
+ .max_chain_delay = 12000,
+ .clks = gpmi_clks_for_mx6,
+ .clks_count = ARRAY_SIZE(gpmi_clks_for_mx6),
+};
+
+static const struct gpmi_devdata gpmi_devdata_imx6ull = {
+ .type = IS_MX6ULL,
+ .bch_max_ecc_strength = 40,
+ .max_chain_delay = 12000,
+ .clks = gpmi_clks_for_mx6,
+ .clks_count = ARRAY_SIZE(gpmi_clks_for_mx6),
+};
+
static const char * const gpmi_clks_for_mx7d[] = {
"gpmi_io", "gpmi_bch_apb",
};
@@ -1094,6 +1118,17 @@ static const struct gpmi_devdata gpmi_devdata_imx7d = {
.clks = gpmi_clks_for_mx7d,
.clks_count = ARRAY_SIZE(gpmi_clks_for_mx7d),
};
+static const char * gpmi_clks_for_mx8qxp[GPMI_CLK_MAX] = {
+ "gpmi_io_clk", "gpmi_apb_clk", "bch_clk", "bch_apb_clk",
+};
+
+static const struct gpmi_devdata gpmi_devdata_imx8qxp = {
+ .type = IS_MX8QXP,
+ .bch_max_ecc_strength = 62,
+ .max_chain_delay = 12000,
+ .clks = gpmi_clks_for_mx8qxp,
+ .clks_count = ARRAY_SIZE(gpmi_clks_for_mx8qxp),
+};
static int acquire_register_block(struct gpmi_nand_data *this,
const char *res_name)
@@ -1184,7 +1219,7 @@ static int gpmi_get_clks(struct gpmi_nand_data *this)
r->clock[i] = clk;
}
- if (GPMI_IS_MX6(this))
+ if (GPMI_IS_MX6(this) || GPMI_IS_MX8(this))
/*
* Set the default value for the gpmi clock.
*
@@ -2197,7 +2232,7 @@ static int gpmi_init_last(struct gpmi_nand_data *this)
* (1) the chip is imx6, and
* (2) the size of the ECC parity is byte aligned.
*/
- if (GPMI_IS_MX6(this) &&
+ if ((GPMI_IS_MX6(this) || GPMI_IS_MX8(this)) &&
((bch_geo->gf_len * bch_geo->ecc_strength) % 8) == 0) {
ecc->read_subpage = gpmi_ecc_read_subpage;
chip->options |= NAND_SUBPAGE_READ;
@@ -2590,7 +2625,7 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
this->base.ops = &gpmi_nand_controller_ops;
chip->controller = &this->base;
- ret = nand_scan(chip, GPMI_IS_MX6(this) ? 2 : 1);
+ ret = nand_scan(chip, (GPMI_IS_MX6(this) || GPMI_IS_MX8(this)) ? 2 : 1);
if (ret)
goto err_out;
@@ -2624,11 +2659,23 @@ static const struct of_device_id gpmi_nand_id_table[] = {
.compatible = "fsl,imx6q-gpmi-nand",
.data = &gpmi_devdata_imx6q,
}, {
+ .compatible = "fsl,imx6qp-gpmi-nand",
+ .data = &gpmi_devdata_imx6qp,
+ }, {
.compatible = "fsl,imx6sx-gpmi-nand",
.data = &gpmi_devdata_imx6sx,
}, {
.compatible = "fsl,imx7d-gpmi-nand",
.data = &gpmi_devdata_imx7d,
+ }, {
+ .compatible = "fsl,imx6ul-gpmi-nand",
+ .data = &gpmi_devdata_imx6ul,
+ }, {
+ .compatible = "fsl,imx6ull-gpmi-nand",
+ .data = &gpmi_devdata_imx6ull,
+ }, {
+ .compatible = "fsl,imx8qxp-gpmi-nand",
+ .data = &gpmi_devdata_imx8qxp,
}, {}
};
MODULE_DEVICE_TABLE(of, gpmi_nand_id_table);