Skip to content

Commit 3552358

Browse files
nxpfranklimiquelraynal
authored andcommitted
mtd: rawnand: gpmi: add 'support_edo_timing' in gpmi_devdata
Introduce a boolean flag, 'support_edo_timing', within gpmi_devdata to simplify the logic check in gpmi_setup_interface(). This is made in preparation for adding support for imx8qxp gpmi. Signed-off-by: Frank Li <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 70cdc14 commit 3552358

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ static int gpmi_setup_interface(struct nand_chip *chip, int chipnr,
983983
return PTR_ERR(sdr);
984984

985985
/* Only MX28/MX6 GPMI controller can reach EDO timings */
986-
if (sdr->tRC_min <= 25000 && !GPMI_IS_MX28(this) && !GPMI_IS_MX6(this))
986+
if (sdr->tRC_min <= 25000 && !this->devdata->support_edo_timing)
987987
return -ENOTSUPP;
988988

989989
/* Stop here if this call was just a check */
@@ -1142,6 +1142,7 @@ static const struct gpmi_devdata gpmi_devdata_imx28 = {
11421142
.type = IS_MX28,
11431143
.bch_max_ecc_strength = 20,
11441144
.max_chain_delay = 16000,
1145+
.support_edo_timing = true,
11451146
.clks = gpmi_clks_for_mx2x,
11461147
.clks_count = ARRAY_SIZE(gpmi_clks_for_mx2x),
11471148
};
@@ -1154,6 +1155,7 @@ static const struct gpmi_devdata gpmi_devdata_imx6q = {
11541155
.type = IS_MX6Q,
11551156
.bch_max_ecc_strength = 40,
11561157
.max_chain_delay = 12000,
1158+
.support_edo_timing = true,
11571159
.clks = gpmi_clks_for_mx6,
11581160
.clks_count = ARRAY_SIZE(gpmi_clks_for_mx6),
11591161
};
@@ -1162,6 +1164,7 @@ static const struct gpmi_devdata gpmi_devdata_imx6sx = {
11621164
.type = IS_MX6SX,
11631165
.bch_max_ecc_strength = 62,
11641166
.max_chain_delay = 12000,
1167+
.support_edo_timing = true,
11651168
.clks = gpmi_clks_for_mx6,
11661169
.clks_count = ARRAY_SIZE(gpmi_clks_for_mx6),
11671170
};
@@ -1174,6 +1177,7 @@ static const struct gpmi_devdata gpmi_devdata_imx7d = {
11741177
.type = IS_MX7D,
11751178
.bch_max_ecc_strength = 62,
11761179
.max_chain_delay = 12000,
1180+
.support_edo_timing = true,
11771181
.clks = gpmi_clks_for_mx7d,
11781182
.clks_count = ARRAY_SIZE(gpmi_clks_for_mx7d),
11791183
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ struct gpmi_devdata {
8686
int max_chain_delay; /* See the SDR EDO mode */
8787
const char * const *clks;
8888
const int clks_count;
89+
bool support_edo_timing;
8990
};
9091

9192
/**

0 commit comments

Comments
 (0)