Skip to content

Commit 5c4f006

Browse files
chesterlintwstorulf
authored andcommitted
mmc: sdhci-esdhc-imx: add NXP S32G2 support
Support the SDHCI controller found on NXP S32G2 platform. The new flag ESDHC_FLAG_SKIP_ERR004536 is used because the hardware erratum bit is not applicable for S32G2. Signed-off-by: Chester Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 12753e6 commit 5c4f006

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

drivers/mmc/host/sdhci-esdhc-imx.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@
196196
*/
197197
#define ESDHC_FLAG_BROKEN_AUTO_CMD23 BIT(16)
198198

199+
/* ERR004536 is not applicable for the IP */
200+
#define ESDHC_FLAG_SKIP_ERR004536 BIT(17)
201+
199202
enum wp_types {
200203
ESDHC_WP_NONE, /* no WP, neither controller nor gpio */
201204
ESDHC_WP_CONTROLLER, /* mmc controller internal WP */
@@ -289,6 +292,13 @@ static const struct esdhc_soc_data usdhc_imx7d_data = {
289292
| ESDHC_FLAG_BROKEN_AUTO_CMD23,
290293
};
291294

295+
static struct esdhc_soc_data usdhc_s32g2_data = {
296+
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING
297+
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
298+
| ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES
299+
| ESDHC_FLAG_SKIP_ERR004536,
300+
};
301+
292302
static struct esdhc_soc_data usdhc_imx7ulp_data = {
293303
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
294304
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
@@ -347,6 +357,7 @@ static const struct of_device_id imx_esdhc_dt_ids[] = {
347357
{ .compatible = "fsl,imx7ulp-usdhc", .data = &usdhc_imx7ulp_data, },
348358
{ .compatible = "fsl,imx8qxp-usdhc", .data = &usdhc_imx8qxp_data, },
349359
{ .compatible = "fsl,imx8mm-usdhc", .data = &usdhc_imx8mm_data, },
360+
{ .compatible = "nxp,s32g2-usdhc", .data = &usdhc_s32g2_data, },
350361
{ /* sentinel */ }
351362
};
352363
MODULE_DEVICE_TABLE(of, imx_esdhc_dt_ids);
@@ -1375,8 +1386,10 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host *host)
13751386
* erratum ESDHC_FLAG_ERR004536 fix for MX6Q TO1.2 and MX6DL
13761387
* TO1.1, it's harmless for MX6SL
13771388
*/
1378-
writel(readl(host->ioaddr + 0x6c) & ~BIT(7),
1379-
host->ioaddr + 0x6c);
1389+
if (!(imx_data->socdata->flags & ESDHC_FLAG_SKIP_ERR004536)) {
1390+
writel(readl(host->ioaddr + 0x6c) & ~BIT(7),
1391+
host->ioaddr + 0x6c);
1392+
}
13801393

13811394
/* disable DLL_CTRL delay line settings */
13821395
writel(0x0, host->ioaddr + ESDHC_DLL_CTRL);

0 commit comments

Comments
 (0)