Skip to content

Commit cbbfb0b

Browse files
hanxu-nxpmiquelraynal
authored andcommitted
mtd: rawnand: gpmi: add iMX8QXP support.
Add "fsl,imx8qxp-gpmi-nand" compatible string. iMX8QXP gpmi nand is similar to iMX7D. But it is using 4 clocks: "gpmi_io", "gpmi_apb", "gpmi_bch" and "gpmi_bch_apb". Signed-off-by: Han Xu <[email protected]> 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 3552358 commit cbbfb0b

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,19 @@ static const struct gpmi_devdata gpmi_devdata_imx7d = {
11821182
.clks_count = ARRAY_SIZE(gpmi_clks_for_mx7d),
11831183
};
11841184

1185+
static const char *gpmi_clks_for_mx8qxp[GPMI_CLK_MAX] = {
1186+
"gpmi_io", "gpmi_apb", "gpmi_bch", "gpmi_bch_apb",
1187+
};
1188+
1189+
static const struct gpmi_devdata gpmi_devdata_imx8qxp = {
1190+
.type = IS_MX8QXP,
1191+
.bch_max_ecc_strength = 62,
1192+
.max_chain_delay = 12000,
1193+
.support_edo_timing = true,
1194+
.clks = gpmi_clks_for_mx8qxp,
1195+
.clks_count = ARRAY_SIZE(gpmi_clks_for_mx8qxp),
1196+
};
1197+
11851198
static int acquire_register_block(struct gpmi_nand_data *this,
11861199
const char *res_name)
11871200
{
@@ -2725,6 +2738,7 @@ static const struct of_device_id gpmi_nand_id_table[] = {
27252738
{ .compatible = "fsl,imx6q-gpmi-nand", .data = &gpmi_devdata_imx6q, },
27262739
{ .compatible = "fsl,imx6sx-gpmi-nand", .data = &gpmi_devdata_imx6sx, },
27272740
{ .compatible = "fsl,imx7d-gpmi-nand", .data = &gpmi_devdata_imx7d,},
2741+
{ .compatible = "fsl,imx8qxp-gpmi-nand", .data = &gpmi_devdata_imx8qxp, },
27282742
{}
27292743
};
27302744
MODULE_DEVICE_TABLE(of, gpmi_nand_id_table);

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ enum gpmi_type {
7878
IS_MX6Q,
7979
IS_MX6SX,
8080
IS_MX7D,
81+
IS_MX8QXP,
8182
};
8283

8384
struct gpmi_devdata {
@@ -173,8 +174,10 @@ struct gpmi_nand_data {
173174
#define GPMI_IS_MX6Q(x) ((x)->devdata->type == IS_MX6Q)
174175
#define GPMI_IS_MX6SX(x) ((x)->devdata->type == IS_MX6SX)
175176
#define GPMI_IS_MX7D(x) ((x)->devdata->type == IS_MX7D)
177+
#define GPMI_IS_MX8QXP(x) ((x)->devdata->type == IS_MX8QXP)
176178

177179
#define GPMI_IS_MX6(x) (GPMI_IS_MX6Q(x) || GPMI_IS_MX6SX(x) || \
178-
GPMI_IS_MX7D(x))
180+
GPMI_IS_MX7D(x) || GPMI_IS_MX8QXP(x))
181+
179182
#define GPMI_IS_MXS(x) (GPMI_IS_MX23(x) || GPMI_IS_MX28(x))
180183
#endif

0 commit comments

Comments
 (0)