From patchwork Thu Oct 21 07:13:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chester Lin X-Patchwork-Id: 12574055 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84F60C433EF for ; Thu, 21 Oct 2021 07:15:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4BE3960F5D for ; Thu, 21 Oct 2021 07:15:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4BE3960F5D Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZTyht9V3F6dbmV+CYacARtNSKlVZPBqE/z/Sr9yuhKQ=; b=0MS5GSr9mtOirz 8Swj/gw/3qCv7If5FuVBHb7zVmxIBD2DHUj7iTsBe3ykzEOV5b7owZAcW5A38YS8TTVc5IuFPje5i Fwd1uBFm0Yj0Jl1aSzd8Qy3MlrRa6bMauO8tdq+i3sy8EuuLaYPU41ruE+T2Q4UAPimikjdZCxz8H MW/fAAn3Op693HVyyF9b/j/4TmHRmw6VdF3pme5RC/f7ExusFE1U1GzAZxcY0G1GkVD7zSYZQJ4Xb szXqkZMPoMr7vCcbHCnqsZr9fNjEWBhbuaOVf4LWvo/zsEjiD+D92uKVpxbi99Ky3k48deqJu1InQ HiFq6BQQ3kMy7WvXXkAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdSHQ-006dHC-So; Thu, 21 Oct 2021 07:14:25 +0000 Received: from de-smtp-delivery-102.mimecast.com ([194.104.109.102]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdSH3-006dCP-Lb for linux-arm-kernel@lists.infradead.org; Thu, 21 Oct 2021 07:14:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1634800439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RCpSqxE8PFlgIC4hvQFTF3vTqdLx5mVUT/kr/moCM2I=; b=R2mW13Uf4NYjcBbHWpykHnYgxbryipeHQyJuc6Vq+BM+M0+Xl3SWbZDTx6THhq+HFrwHqm hyUdeums6+ZwkpVHCeMPxe43v8BRwAjhXAqvz8bNl98/5ffT1kNGCQZHB5Gjatl0vEoUm4 ctxw/ETNLu6zdV6e95DBpKRcPogtHHo= Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04lp2055.outbound.protection.outlook.com [104.47.12.55]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-17-BNp4m4lzOF62jTTaje4O0w-1; Thu, 21 Oct 2021 09:13:58 +0200 X-MC-Unique: BNp4m4lzOF62jTTaje4O0w-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HMqEGme1Bytu90yGnCPpo5qiZtQxn8Xoe2ox/piSvmQf9/vuRy86ryaJJkkWpkocF0cZq3mStqRLbYk/E5o5NUl1JIEXUaHP4djr9bgopRYJCgOf+zbwDeJkxpZ5H9ZFW38S8wqHhKBb32estcMdbWY5RSLE1lbATwX6HWU1HovHZx4K7k+5jafReZrEb/XuOp/zh9r2dou38JzZ9H0Cty8YZv4HmgU4F6qPJf5ttl7HWlz9BRPFdgye443jLEAkilbr5xT++BWI2TdG5yNk1yhqnk9Bh0m4Mde4Y4IAULRTOwmyOZXYJnjt5hZ0+3+a6w3Z84Nl0GwDNLEEafow3Q== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sRR9QQqyyJqEODYW4ZNtz0+kT6NirDlSQFWTK9NesWI=; b=d9gbKBGrQ+5eieyQeyyQUgCqBhO71QRgsHOoKea1CpGs3ho3HxVfkUdsQY9EHHN7UeqfTWjqBgvTaBJlMwmYaHuI76pMTGVVyVbhNqwUkyIwx1hPqKC0oR7vVvi+ufov0w8MIO0btbmbqmPR9RWgLA0hMyVfWmErIfvZXxLGtvWCBZe03UdhANQRyNEt0zkDkCAhPKo5Petz8cNGxTzLSFpSncWrP2ntf998Bnfuj8yMv5g5Vw8TzJjI5BnBTBtzEkqsb0Tbt9tx9FON69YUMvQwa+leBkkUzxfqZVxXWDnYOPyvWZ8cE+wuKSr4F7WJ5svkJizVoLSCwU2/cCm/OQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=suse.com; Received: from VI1PR0402MB3439.eurprd04.prod.outlook.com (2603:10a6:803:4::13) by VE1PR04MB7248.eurprd04.prod.outlook.com (2603:10a6:800:1aa::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Thu, 21 Oct 2021 07:13:56 +0000 Received: from VI1PR0402MB3439.eurprd04.prod.outlook.com ([fe80::88cc:32fc:2cae:3fde]) by VI1PR0402MB3439.eurprd04.prod.outlook.com ([fe80::88cc:32fc:2cae:3fde%7]) with mapi id 15.20.4608.018; Thu, 21 Oct 2021 07:13:56 +0000 From: Chester Lin To: Ulf Hansson , s32@nxp.com, NXP Linux Team , BOUGH CHEN , Dong Aisheng , linux-mmc@vger.kernel.org CC: Rob Herring , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Radu Nicolae Pirea , =?utf-8?q?Andreas_F?= =?utf-8?q?=C3=A4rber?= , Matthias Brugger , "Ivan T . Ivanov" , "Lee, Chun-Yi" , Chester Lin Subject: [RFC PATCH 2/3] mmc: sdhci-esdhc-imx: add NXP S32G2 support Date: Thu, 21 Oct 2021 15:13:32 +0800 Message-ID: <20211021071333.32485-3-clin@suse.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20211021071333.32485-1-clin@suse.com> References: <20211021071333.32485-1-clin@suse.com> X-ClientProxiedBy: AS8PR05CA0025.eurprd05.prod.outlook.com (2603:10a6:20b:311::30) To VI1PR0402MB3439.eurprd04.prod.outlook.com (2603:10a6:803:4::13) MIME-Version: 1.0 Received: from localhost (118.166.56.207) by AS8PR05CA0025.eurprd05.prod.outlook.com (2603:10a6:20b:311::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.18 via Frontend Transport; Thu, 21 Oct 2021 07:13:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 292fbb00-10f6-4102-68c0-08d994625897 X-MS-TrafficTypeDiagnostic: VE1PR04MB7248: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GKi3lFP6P1dHqxXSe2lQUuC+fRz5lC5eFT2a5Tot9HhAmjPdL1qSLAL91ajzLTtM2YqlC29jpP/mgroIgvn8YsOk5EOgMDIA59nPxTVD362vFmb4wWcltMQaeYC8p2T0IpS4Ve3Z16RDcwFfd9eu/ffesuenfMA+bBlUG5JIyMRuS6TIXJqJvsrpWzwA9TY8eTe2gA2w/21J1BVuIHUCbuCTA5oSy8fElO5vUnpYddoUqBuz4+8UpsJYyFGMHZ8BzhQbvIqMOyhrUhjhtW+ONsMVpfRkuLN9TA76J91m9A9eV/NR4A/FVWyvQcKr0lp3N9ytCmdwvRRjAChAPy/j50f0GoqxtDLSaRvkb84AhGe9JFBnd6Xm7r0azS3WN+k5qd/dX1zZBlP2VM91QO6D0c8cibDyGFzk10z0mbAOzNZmihTTPB6XZxQ5ZOA7ytWGAieNpIsbrVpEN4XSx7gaxFA3Tm5QASpc/hLUdkhLVPvl1s4FBgnlUjcnz+O9Qnfu8cSKn6QWjlGt+6Vdvo92f3L6VBJdboD1EnEDaOMefvESHQi2GreS4WGqV9J0Ufykz7elueRiecMJ04Bw4yDZcrBIxntN0MnSCEzhqzhcU/HvFA9AldHQRD8yS4JaCUJmvY5OKDtDIcDiPQucuhIA+Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0402MB3439.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(66556008)(66476007)(2616005)(55236004)(2906002)(956004)(8676002)(7416002)(38100700002)(6486002)(66946007)(36756003)(5660300002)(4326008)(508600001)(83380400001)(8936002)(1076003)(186003)(107886003)(26005)(110136005)(54906003)(6666004)(316002)(6496006)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: epJK+CBnyVapOgXVGtWkCqAddcqa7G8I1tzj6suJn+NtIh0uF3/Mr6Jy64tXeIp/Rv6CMqGNESB2im19Y1g5Ztts6iXxMmlbUkjUuGqhlCXBBaHdoVHIDb5RWALu1QCCYzaPyC28q4SoYemDh+21oN1kdvfarAFMd0QvMT50kIPFtFw/ZpwDfr5C8gm74Whk6e+XmY9kR25l3RvcVg0wiQGTPB+AbYraadRHZ5qk8gZvRKiItXNGL5ZIFh+UpmAJUgRau3lHRkc2945VFslmjGFhfcBeia3gu2wPPGbedfHbQcL/Q9bbqzBEvV/JZNjOMCzNEqnDboSeikf4KubGW34eUuR0+pXx7oorpqx5dZ651+gJkHaDiIk47PuZ2NQCbzjQWjd6XQxlYk/8hKVtrnHzQPAtU7RqH/u6PHaV4ns+ujztoAsEKLPVXVBNUrB7c7NCOS8VqYBkKyp0BJbrpPcxVDhsASOTM3EajRamFmyiMExAShpDVdf5TfAWDvJbyxr/YJS6t7O19ZK7WWYRWJ/3fStPnrXbse9hcQPlfdE4/8Gj/qZdkkE32OjnLDlOfSheUZADjjAGzYGKdtTFktN6FcIYZcr+0Oog7OlOmCovXxY73uhm+EzhWpnB9gYqPETGTSiwY6URU+g+I56nFwXsfO8OVxCnNzX6IZ2gLQELplPe+7CbXD3A6lTONUE971HD8KmbAj0I24A77QGzSRd8iMlCU4IuPIGEbgULkkCxwi69o5+0zMcZc7suux5mtclFoexjPd/SWWytgjLxct7spVtCPqubQcx4OOdwhusBnQ85eP4vFFxTOjO1QhDIVyxA1ByemUbpJ0NDMFwj+PdSVl8o17n4405u9Ai53AvoO1ybTto6dt9o4+BwrslLUfwLJVoir17vAnULY63wtEBXvF7Ai2oPdLilSgBtBChVicaA8E7VkTx+zKqaR9jX/ume2nQ0kfTpnIG480o2yVMOG8c6OQLQffRdIC74Gce7XYcemyWSKERq33lAF1YZOF7nJgxemxxtul71yUM6seUpH0GxqHXIGGEy/s6ncy9LKrJMRng86c4EjVklfT/GBZ2U2qXOteTXpqxlXweU0EfO6OOejsnGIeqGBpZKwE/8nwCJMdlDTRNXjh91Nlpn4noLnI16LjfFL18Sn2H6TPITyGO3DvodNr7STbf08IChiSEh4cyS1FWyXqxNx+bF1G281WkqnGDH8CG+m0mc3xFHz3k8NhNBt5DPaB5ZQFbW+183pekgraYqx0N+IyA2XMavYYVOmGfOpGHS8aDcywZ54jS6ADXGe7Urte5BxUp0uYHlriGAd/4OwG7CyKSz X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 292fbb00-10f6-4102-68c0-08d994625897 X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3439.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2021 07:13:56.7617 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: clin@suse.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7248 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211021_001401_891583_AA2A26F6 X-CRM114-Status: GOOD ( 16.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- drivers/mmc/host/sdhci-esdhc-imx.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index f18d169bc8ff..d0f7d46a0354 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -196,6 +196,9 @@ */ #define ESDHC_FLAG_BROKEN_AUTO_CMD23 BIT(16) +/* ERR004536 is not applicable for the IP */ +#define ESDHC_FLAG_SKIP_ERR004536 BIT(17) + enum wp_types { ESDHC_WP_NONE, /* no WP, neither controller nor gpio */ ESDHC_WP_CONTROLLER, /* mmc controller internal WP */ @@ -289,6 +292,13 @@ static const struct esdhc_soc_data usdhc_imx7d_data = { | ESDHC_FLAG_BROKEN_AUTO_CMD23, }; +static struct esdhc_soc_data usdhc_s32g2_data = { + .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING + | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200 + | ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES + | ESDHC_FLAG_SKIP_ERR004536, +}; + static struct esdhc_soc_data usdhc_imx7ulp_data = { .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200 @@ -347,6 +357,7 @@ static const struct of_device_id imx_esdhc_dt_ids[] = { { .compatible = "fsl,imx7ulp-usdhc", .data = &usdhc_imx7ulp_data, }, { .compatible = "fsl,imx8qxp-usdhc", .data = &usdhc_imx8qxp_data, }, { .compatible = "fsl,imx8mm-usdhc", .data = &usdhc_imx8mm_data, }, + { .compatible = "nxp,s32g2-usdhc", .data = &usdhc_s32g2_data, }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, imx_esdhc_dt_ids); @@ -1359,8 +1370,10 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host *host) * erratum ESDHC_FLAG_ERR004536 fix for MX6Q TO1.2 and MX6DL * TO1.1, it's harmless for MX6SL */ - writel(readl(host->ioaddr + 0x6c) & ~BIT(7), - host->ioaddr + 0x6c); + if (!(imx_data->socdata->flags & ESDHC_FLAG_SKIP_ERR004536)) { + writel(readl(host->ioaddr + 0x6c) & ~BIT(7), + host->ioaddr + 0x6c); + } /* disable DLL_CTRL delay line settings */ writel(0x0, host->ioaddr + ESDHC_DLL_CTRL);