From patchwork Mon Jul 19 07:47:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 479816 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3868452jao; Mon, 19 Jul 2021 00:17:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+JPYkRofRD5fx8l3E2OV05fx4jjxVWuhDldp3ffJZHnYS98sHRkAk++stpXW0eEt7JjLa X-Received: by 2002:a17:906:6011:: with SMTP id o17mr25194018ejj.157.1626679020269; Mon, 19 Jul 2021 00:17:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1626679020; cv=pass; d=google.com; s=arc-20160816; b=GZz8tBEWV3JmaOUktUtSDi2x652BHLcBijC5FhR6o21Q0SGSy8kOuNRdwyV2V7VzwD /1VZe0BbH5EmmWp40Kdg+486KwADlkfWgSWNlj/78cOy1ywou8OlCNXCD+hfDQsYQH4L kr1u9MPC4YfLuzmqiQFNGfVFWIiqBGrMuAYr4NXJR6c+zknl6ISObW8NUFG4Dm62ox7N 475TvpAy6cPSDvXpwCPz/OncypssGWvlPXhii9FkJVpBiuXvBFJngmUuZzQ0ZR2/X+aK scGFO6pPYVYK0WEcma2X057RG+gBBV3fYzFMzipP/isw4wJjH0IxBmwVPVjgrrw9K80k ciBg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=7UX1aoiHiu+fuRkn3fxL0fgZ4UJtVYwlgN5ZIZvVIAU=; b=gy3IjX2t+8BSXO9+imYu+w7BobTce7W9a7oap2jq2XF86LLydwBE8BMk/7lPK3Nz8g Ypi8p/oNRXraLD4fVlBHZFDbxnu74L0Ok7pEC/J2fxH8tR7KbHmqk+OoPs4iuDJqpzEh oWXFI7EzgPqmbiQ4rTOi7QHIzPSbThyCfXfMwNaOtrhZaKW4jYHpg5zFfKrjshA8z5px PNmhQWrv4Mzmy6oI0jC0hpquum+b2UFqHNTAW41yjuT2SRMpAvfydOLcznk/O1Od36BH 1/uvHfNX4bQl4goEjFjxcVpUYm2D4iPW2pcH11wV7/2M/ksJKoimMcOBNk6ogDuFYptm v3+w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=A6x04vQZ; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id y4si21014490edi.355.2021.07.19.00.16.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 00:17:00 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=A6x04vQZ; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 276C182C6E; Mon, 19 Jul 2021 09:14:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=oss.nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="A6x04vQZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1EA2082C49; Mon, 19 Jul 2021 09:14:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20607.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::607]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A69BF82C29 for ; Mon, 19 Jul 2021 09:14:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=oss.nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@oss.nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R56plMwPdZlCX5A6vCCsjC9U3H1eDq6yPtD5r8wl7fbzJYdj4IjDMxnFct4E9i4EmNidF4KrM9aJjBpmYmiFpz9f3UKv2PEYVS6Z257JlfoiAgAgE4DVtsP37b9A4DXZ6C7uxpMSnQf1SmtrYdojjrNKfbeZp2cj28pGPPf147r3maZt8OdpBfL57At5B3Pq28VCjLmBTgP0rkxSlBZKXydPmKj/8vLlvQsKtAqnSy1MaYf+TTQzrawuDwuN7mHGOBGGUjgVXdSRg024EWAF7WRMQ7rlF9S9TbBstkAmcxtja4optK6tYM6H9AQWvfpjKlk+V7htemtYO0WyeZgByQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7UX1aoiHiu+fuRkn3fxL0fgZ4UJtVYwlgN5ZIZvVIAU=; b=PF/0enoZoll6JJY/o/oCRNPxJy9RlH3J/H55O4FMB5jNxSrxUSvvRaPf8sj5RuY5EUaX+rvd0EcSPnjhsOeYLK7P6Qo2k2R6ixr/jfbcKYKOkj6dMD40BResqsPsWofbym24Jx10USl15cLJKOF3i5UUlzrwkv3kDJb0DjSo/0QkPjUis1X/GS+KaK5hprO/LudVRI36o3CXOj5/uV45lwRU0GpD1f0z60wZxlnevv81+WEQ+cGvTe5pLti3iaTwjJ5KhDOJIKtLNeheNIZyKU0wS+sXxAsh+eg9t3/Av46HihJ2aci4cWTsglv5jY8PYf7t0Rw9MtEN0RyuMGmgxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7UX1aoiHiu+fuRkn3fxL0fgZ4UJtVYwlgN5ZIZvVIAU=; b=A6x04vQZeWJCENw0lyLhw5aJqk/GCIII9xvTcJcwsstACVhUPEBJH4woG6VLGa8Mx0W3f9ecW4nKla2ne6+OXk9e1TZnp2T//OYygwgDO9svsYHXTmObNJBs0G+F+4e8MKMY2R0tGZnYUYHZfAzZ0TMWcbyQBs70f8HtoE+V3Dc= Authentication-Results: denx.de; dkim=none (message not signed) header.d=none; denx.de; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2933.eurprd04.prod.outlook.com (2603:10a6:4:9c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21; Mon, 19 Jul 2021 07:14:16 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c445:d742:eb76:86dd]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c445:d742:eb76:86dd%9]) with mapi id 15.20.4331.032; Mon, 19 Jul 2021 07:14:16 +0000 From: "Peng Fan (OSS)" To: sbabic@denx.de, festevam@gmail.com Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, Peng Fan Subject: [Patch V3 17/44] drivers: mmc: fsl_esdhc_imx: support i.MX8ULP Date: Mon, 19 Jul 2021 15:47:07 +0800 Message-Id: <20210719074734.29170-18-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210719074734.29170-1-peng.fan@oss.nxp.com> References: <20210719074734.29170-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SGAP274CA0006.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::18) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SGAP274CA0006.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Mon, 19 Jul 2021 07:14:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3e70eece-db91-48b7-4054-08d94a84d16c X-MS-TrafficTypeDiagnostic: DB6PR0402MB2933: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DQIozcUXIEjQUGyRca4NHiu+n6iXlM7TP9Florvar4J/dk1/yHpkpKarK14tgwRmOrg8DVOvHYPMgIxGBeOQ5Ot0uLrvhVxxkBBmav+Pbdo5ZWm/fioSRuLSA7Zzl4NBZCwz3aQ6lQVKYiyrCLYHN01LwCxB+jm76sTTy22afR4rwhMLt/L55Cnyvv/M9PRNk9S+MqV7gc2gRIXf4nNEg1shnSkKFzIQaqR1sA7/YAJEDTB4O4EFMRQG23fMhBXdtoQPR4jFrXChqiU18BH02qBqcxPM1HvPR0HSAVx+7Qf3SFg8Ah7+1njplB/qUJFwlxmy76CwilHFtnWcO7L2hIIrMOJ28Uh8zq+nYJbSy1JMrcRAXAtoVnOlf5tjHKrUy1TcJm1dgK6aZ8DWHJCx4C9nekG/KeOGm/vFoXzVYUd7n41B3QkuCElEWlJxlQL9KQZHlLmX+9SfLq006Shn0WXKmuPSvbMIMji0IE8uC4eB9Uxih6I+7swKm/PoB/CM80yv/e2CQtVgQppLCU0ojb9eGug/6v9fe0XVN6gygyC+4KOE47p759qORBmE6Bo7tWzXKs4d9kn3w/8Ncq3OIxQpKEpSz7xRTV7HjgyFj3WhGXOE5FFEPWcYXKMDBB21ddA+yOIgR1FxQ3hYsJurL7GawtfBZ1ZnNX40JEM1Hal4fUFXKrA5IweX4q3SGD8AdWREin5RqT8vN8Awpq/qwQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(5660300002)(508600001)(6666004)(316002)(956004)(83380400001)(8676002)(66946007)(6486002)(6512007)(66476007)(66556008)(8936002)(2616005)(1076003)(26005)(52116002)(4326008)(186003)(86362001)(38100700002)(6506007)(38350700002)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RveX4Z8CAz4/St0CrIsvkvM9LxfaNac/B8ixnEK2PA52bKwIEPn9STdZyOMbyfZ4cEcdvwcvKWyS6u5ApCd8cKbIM4m2EPCEPzmMft2LIgOD+XYEOS2uq6Q/ATdfrjD+kQQkSCL2Cc6k7pT1cngNxIJWh8ptAlrLH1uF/c54cTecVyyoM1kIvo3Wnayw8CDhUabm4avKhStKpVRAEJt9WFBWjBbd49sdK7TnPUjNs5D3vMH8Zr50+jFlWfwYot/2Mr6dZdcGScmnUPeRDWr5lI85UeJFssRubHOvg4olVQn9mYz7IvEvpc9VVGJKOKurc28Idw0vGCrjayQeUpT3B8+/VzSjr/LKf4nQrOgxhwJhCzH+iPb9rT/me8qybZcbCo6+FS8KXzY+ikUQrsh0DXwdQMCfY1UkELzdG0rMvfCUBSQLeI8MzfXLNoBrJDVsxwcd9n+VkDCm1kyl55FL4K39c7I/DIHHqDps7OQhkeTS+Vo1NVdxmVbVYQA67aDLtYLnuKLQYCDFhRQQmgTn1fnwsaIahHx9ZtANXRJadjkq+jeVIE3E7tXUHy9vlQl1vQPWsG6kLFAo6UQVez26mBBcy9IxAglOAPcWRD5oSucmqwbbpHenBq/uV3ErnBGPrzW6MsfOVpzypqreVQzcbRbN+Y7DzWXVBE55tQS8NaBd1csfYU8E46j2/RpsuJc6b+EaT5j7AS8Xo+X//KJs/C4y8ytRRUSywgBBqhLwqvfvkeRH3LN6ezMV87sFfnmFb59RGKwap0N2ZejTh2Lv+Gu1TrigtHh7waYbjP87vXkVEHs1D5sIaX4gH8FxuBrdD0ybd560yL1U+PWuzsTIUs5F19ug8NG5hCnP3CE4DsRxn6zs6kBc6iqBD7DAfsP49Am7jNx5igJeBQ3NVQVKTkKKcgg7liwDJQYpB9vShg8wH3u5l92OJinA54IK4G11wqkToT27mMPpnpNs0AyEwCHm9rp+lMnSH2x26AYin32xgZMXck5nA+WLb8CAmeYYiMu8VDybRVOOBKdJzE9RWOpJI3KWAxxV+tJa2suShVKWxlIW709oKxGOaPqfZqNmReH0Br1ZjOc9cq5El2Lnv898YOiq03OEMJAjN7t81TweYpnI186Sy++Iz/N7Pcbp1wd2TbGSqa3zsSGgzo5p8AoFkCVu9r4vmPfxz8wH15deyqL+xPpjR+yHQsEOoNSlnkr48DRqW1a+D67RI3mMA+aZK739FfcfcX0aaP8Npm5gD0auv2ryZFYEvq4AP/kgNrcFhhgD2kdsGtImKC7WSt5Q3Mt14mQ87ytORn3F8Yof3PfiYGZLzujAdV7s5WVe X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e70eece-db91-48b7-4054-08d94a84d16c X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2021 07:14:16.1675 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: m6vkSCFbonVZavE+Ic+fnT01R7aFx+gVEEHVyzTYrUhnrWDWGwKuNU3xNSWjh7uoJ4FX8znGI3SBmQ+P6x1vOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2933 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean From: Peng Fan i.MX8ULP reuse same SDHC IP as i.MX8M, so follow i.MX8M code logic. Signed-off-by: Peng Fan --- drivers/mmc/Kconfig | 2 +- drivers/mmc/fsl_esdhc_imx.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) -- 2.30.0 diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index 717ce5a62f..1569e8c44a 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -832,7 +832,7 @@ config FSL_ESDHC_IMX config FSL_USDHC bool "Freescale/NXP i.MX uSDHC controller support" - depends on MX6 || MX7 ||ARCH_MX7ULP || IMX8 || IMX8M || IMXRT + depends on MX6 || MX7 ||ARCH_MX7ULP || IMX8 || IMX8M || IMX8ULP || IMXRT select FSL_ESDHC_IMX help This enables the Ultra Secured Digital Host Controller enhancements diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c index 465d935daf..aabf39535f 100644 --- a/drivers/mmc/fsl_esdhc_imx.c +++ b/drivers/mmc/fsl_esdhc_imx.c @@ -291,7 +291,8 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, { int timeout; struct fsl_esdhc *regs = priv->esdhc_regs; -#if defined(CONFIG_S32V234) || defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) +#if defined(CONFIG_S32V234) || defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) || \ + defined(CONFIG_IMX8ULP) dma_addr_t addr; #endif uint wml_value; @@ -304,7 +305,8 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, esdhc_clrsetbits32(®s->wml, WML_RD_WML_MASK, wml_value); #ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_S32V234) || defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) +#if defined(CONFIG_S32V234) || defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) || \ + defined(CONFIG_IMX8ULP) addr = virt_to_phys((void *)(data->dest)); if (upper_32_bits(addr)) printf("Error found for upper 32 bits\n"); @@ -341,7 +343,8 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, esdhc_clrsetbits32(®s->wml, WML_WR_WML_MASK, wml_value << 16); #ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_S32V234) || defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) +#if defined(CONFIG_S32V234) || defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) || \ + defined(CONFIG_IMX8ULP) addr = virt_to_phys((void *)(data->src)); if (upper_32_bits(addr)) printf("Error found for upper 32 bits\n"); @@ -406,7 +409,8 @@ static void check_and_invalidate_dcache_range unsigned end = 0; unsigned size = roundup(ARCH_DMA_MINALIGN, data->blocks*data->blocksize); -#if defined(CONFIG_S32V234) || defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) +#if defined(CONFIG_S32V234) || defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) || \ + defined(CONFIG_IMX8ULP) dma_addr_t addr; addr = virt_to_phys((void *)(data->dest));