From patchwork Sat Aug 7 08:00:46 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: 493376 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp1029425jap; Sat, 7 Aug 2021 00:30:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyUxXgYPOMS0VjGlamhTZTQkWYoRa+ry6ZgfhlmNZsBwROgebW6flMkoF9FJGsXiC8wonC X-Received: by 2002:aa7:c6d0:: with SMTP id b16mr17565933eds.257.1628321425207; Sat, 07 Aug 2021 00:30:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1628321425; cv=pass; d=google.com; s=arc-20160816; b=laIk6Gq7TkmsAQBN5JzJhtRcVSRSssWS79UbTCTg4Eu3Q01H0f3aWgLh+KjdgBD5Jp AgY4UM3a+rQxGD1NSSfQdVKXm0ffNh8kRDWuUR6EozexSC3kw58ozMCS4dm4Q+6PXU2Q 6t7wHBguM7N1QQbEy1YB9i9Xkbv7lvOKG8dC78dbA5bKkbymckC/yYV+rff5C6AXHqWQ aY8Y4AV1QnfEn+u8MA4RXMO+1uNjR7TPtLfhm2yXDTGq8+fN5pESl5R5ISLbB0mj1DZR iG7PGSXewlTvuA6N7eUCh9i2Hr4eR2xkkeq4eRIYOcwSWE7hH+FFuwCR/xR+DX4kFZWT 3aug== 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=jvD9N8TuI3Yp0abMRAWtopb7a9wB9QfKKzc2EEh3boc7A57qaTT6WTmv9P4xCFV+KJ cSQM/m42p7+BoheqPbSQWfsB7zz+vjfwDNYoq4Y2nxQ5KTVqAkkwplXgf0VnSQYImtPz 1lr/CfAqGiMBDxcvO3klZEsVlynN7x0O4Y2CMrxNQ/kOF5dq8gwOHzdVyq0Iuxe6EalV W5RN/vI8atoeR2Uv8nHpP+RTWyfCZNR8lC36JThuaI4KDTgF01Whk1Z0Eae9Y6f/fvCk JHhuojrAJBq1nWKqkU8iMCGsd/Qv1oVTemRceantAOdW4HBTXyLCqW8rX4mOPP9uFqsP kiFQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=a7CFdJS3; 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 f17si10555283ejx.595.2021.08.07.00.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Aug 2021 00:30:25 -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=a7CFdJS3; 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 946A383281; Sat, 7 Aug 2021 09:28:36 +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="a7CFdJS3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 59F3283248; Sat, 7 Aug 2021 09:27:50 +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.9 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 EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on062b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0d::62b]) (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 A60F983221 for ; Sat, 7 Aug 2021 09:27:26 +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=kASets2c0VjFdOyZz/af2S6NH1ddpjVZvC5y+T8E6LwNdGgA8JIlooqrnRamS6NZUwxHDDlYyqlAHWdNIrE5w8X33t3wlBYCMW2+gwgLkrbamHEWYxcDhoTW4EGE1aTP/Gsc/os4fIgzLvPWlYjtOX39rjjKyP6Sij+e/43f/J6aKZRgX3CNtzjHLwxu8HX7qhkDtuORvoL4D2AAnzTeSp6XUCQn20SaCZ2XcqbHXT0IMLu3pf9OpwLErDfu8l6CPkCklYL5S1IPs1FeYOUyucCQ2JCMyeXIbBy35l+HFaFuBJBbxPCTfmP/pgnqZK9Sqa1LOsQo3+GzmX7QXfTJhQ== 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=ZC1jwtmXCBUrXxbBrBweXeHgSAA9A/MU/SOwQLLsAnEv22Wn8CmZJBUBMuUL7gqeGp2snNA5axFWARQUyANEnkG+IAEA2G02fLhSNqRQxBMQeTiNyjjfOvAREJ+9zidnAuYEKksc40rXzYwDoyB9blySWVjSylZK00jtmaKGPypd/6ZRs2vMQ/Rx8rgOQb7sGQYQEy3EXNF5BsHu4nL5gS56NbiUhPypkfxblhJNng+yhPNmkXNDv3Hlc4BKnHSBOaFn+AbnKRSwtl4CHRguu744meYp4HScZxw7BbrryVPTOoTJs3RK7Ep9Sji9LFCmB6PaQAQaONnBsBaFnzDkmA== 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=a7CFdJS3rVwZ9AHf43P4vyF+hy9edIpCSHZSkOAILIyX5NvO/ywJ2EagFT/c6hY0mvxAUZHsZlKuZF3qqGGj44A4PYzllZqk7AWJpNK002/TCEs6BKylM68m+Un2v6Ku0EJkSy+0fDCAtgUyKquyeSW7/cLJX6WLD44pbS0sAs8= 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 DB6PR0402MB2758.eurprd04.prod.outlook.com (2603:10a6:4:96::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.16; Sat, 7 Aug 2021 07:27:25 +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.4394.019; Sat, 7 Aug 2021 07:27:24 +0000 From: "Peng Fan (OSS)" To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de, uboot-imx@nxp.com, Peng Fan Subject: [PATCH V5 17/44] drivers: mmc: fsl_esdhc_imx: support i.MX8ULP Date: Sat, 7 Aug 2021 16:00:46 +0800 Message-Id: <20210807080113.16020-18-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210807080113.16020-1-peng.fan@oss.nxp.com> References: <20210807080113.16020-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR01CA0133.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::13) 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 SG2PR01CA0133.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15 via Frontend Transport; Sat, 7 Aug 2021 07:27:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19744fa6-321c-472e-abab-08d95974cd5b X-MS-TrafficTypeDiagnostic: DB6PR0402MB2758: 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: I7nbivF5V+F45QQjLEz0ZGcJlnVhUVQlpsAmuvinb1sB51CslWZyITEEUuGd+NzPf2CZtfKpmU0ADPk4BLzjDmeTv1y3ldYhC6p/v0T6Dn6CFw2EcV2yI9EaIQ76aZHZ2ru1xyzzhYS5GeBrfEe5HmTI0TfB1KRkCB2OCZt7/70qL5Ak94zMKz5BvJDxKnnoOr7ExawY6j/xOWPO4X10lkj5nv1muaFflplUKT0mBtISvuXYtbt2DdiLCYr5bO70gj33J48WiQq6llsRqgGhbxzlCeILPKaB8Z+bUtHhtMKacEqksxx5nAVmxjQdHpmPX5W6evqfTE2WB/2Hhejk0CWbgMmEben54lu68BNtqKratsqzppxSwYy5jK4FO3YDJNU+oM9H4XIGXqFwYOaoFFAWP5CSUONiyelv7zVCWB8dgrHW18lCV/XZpJjFOsIbP9wFvUpebirmA4/zYTtDf4VF5GLxFv77H4QkkFSDucxwGK8T6mPT16ecadZA0Oqu56Lpwse85smY36FsM+PCPwqQ7Q7mNt4Mccj53ZR9etwUvu09HGZUgWtALFUCUO8HOt3Kzy388FzClHpffEiXRStBxZPxQNZe0LSpPmVDlXpAgXWWVPMypBDJaNX4TSNQGqCRRPdO5u1qs4RO72M1bmyAzdzUzVn32GkHk4fVvkdbPOsIJhV0vJ8kPW/320B98/XFg9OPdM20Y/MAX2hp2Q== 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)(136003)(396003)(39860400002)(346002)(376002)(66946007)(66556008)(66476007)(8936002)(52116002)(5660300002)(6506007)(4326008)(6512007)(6666004)(38100700002)(2906002)(38350700002)(2616005)(8676002)(478600001)(956004)(1076003)(83380400001)(186003)(26005)(86362001)(6486002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CRLmIqBstcwz6cD17sIvPajJIgzoRFmsk0BS+zaPJWG1OPJNZuLeJwpLs1jfEsq5hM+N7D239o7AUOLci6ph5KHnJrcLwTTqt4YxMfVP7qjtuh77Ah3w0e0t2OKZIegVML2bN5Ey7I+eNHUVKc8b3OrBh6+EmG5yG4atNMWuM9AwcYXjn+DTx1/BeCrPOFFj7XeXxV0k2veyuKLBluR6ITnlD5mjUgcYRHo3IWk60FI/PiPTbpOhgHCrPp6Sfm/rOnu4VoNcaJUlsvan/SLf7hE97GqZ2gAFF0u+9yl/RR+weB5DkUAZX5bJH9rPo+MEBG+E4Lf2nECZKE4Ucms/K7G3SLJZRMD5fJJldu5OR1UFhRXrqWLoyQhlWh7H+MAGrwd6pwzTD0LcwSsQaGpz0kT6k07qEd6rqE1zlxbya8b5NbpIfOkI5WvugGTnS/avu8JVPirkb0X4iuvMYmRtHMyrJA0pVaGrMPl5E1TuPyB+whLQyBKLRz1bSmoc0J3h2bHpGBzhHDZ5EjmJaZcz+EMXgWDr26aN6zwRNnhuQtdh5fiSd3YaCaiLMN8S7Kwagm1QxV1Yu5YPP/4m/4F71cWlldVPDBP17L6YVFEmd0VlV5MIjkuwlroi1Qm7E9QS9SBLnJDLnO5VtH4pcY0nq553s99AruxA/jVqtFUu4Z0tUxK9xvsrfX50wROm8dDcfsljUjlIReNzrJOSmaX6Pyjciwab+xE4LOZDDk13d4WoJtT6El5TkPkWZrTdr5H/w/bgkAP82twHPGNRPgj67KPxJu/tyfew1OEILE34Jp1K0JnttFvnVWbQFhXS9G6LSjf6aRUuWU5cwVy3KAYDKGB+nOTCciYQby5tCxOh/+k98hKQGA1iVyf0+Q6sbZMDWEUY/o/cgx03wFx7kGv22/Q7QL7A8LlFm4uS2aWZvLaCfY+zS5yagGfAb8GnHRGFIFKJUtuor7TSWC8ZTxwunqTPdBYaod2VfeAN0cDeKazCAL/H+eLjaAsh7ltaanLBHHebPVtkF4XormMi8SHRr8VsR+owsDoxYyZkhu2vxfvgztmEIa72qMmkx29jUQsJT3MkFTdqIf58dCuxWi9fFJtUiA/oqUCzVjtgvSxwDSPYo+uGwnyN5H85sF0UUrRRH7otuvXxRnFEvV36pZntGSL3ZPtkwOWZnyhhETW/F282Fwmgop+I0wq0wXPjCt0NoclCW0/gsF0u8EO+bTNJH1C4DFBYnOzp6l1lHpzLxI8Z8KVlfUs22swBwg2FmElo2R654UDvJaKwu0GrBA9udyIXuQ/KyEjfb42NcSTCDHOA4iz7uOR8G7T9kJOz92Vb X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19744fa6-321c-472e-abab-08d95974cd5b X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2021 07:27:24.8270 (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: AnX97IQ2iE/a6PvmAv0oMWPmblqe3NlNGD1fkivqsJD4sF3Cqyzi2a5RdsyJ4cv0YlRnUeJmTa9Beh+4QGnkbA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2758 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));