Received: by 10.192.165.148 with SMTP id m20csp1926263imm; Thu, 3 May 2018 07:36:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrRYvD0Njx0Xx54VVzIkUJIMHtgViYdY8nG4wBbqZ0ZkmBAh1Wst7EV9o4+Ady0SgxNWswm X-Received: by 2002:a17:902:bf08:: with SMTP id bi8-v6mr23989029plb.353.1525358211945; Thu, 03 May 2018 07:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525358211; cv=none; d=google.com; s=arc-20160816; b=DHtUDk8zFeAn0RNzPRo2MTHTEZmetaJGLpwUHiPY/ct6440hieHWeClVCyzx7Pv9os VYtntBgjhNc/nNdzx+tB9Yj/QOFUM1jGlFOEW5R0ptmfGonCAB31MldUbvnULDPbXI9p vbAcfGiu6qN0VD08tzynsQNXqZkkwm62q0GUAoX0sT5Cj3bRHOZsmBOH0laPhsCKi/nh 90zv4jEDS9EDR+V6hlOPOn4eHtD1a2e7qX1o1M5qK9T881LUTkdmVZe1/Y0jf7ToX1S1 f4lLkpN0bbHmtZdJXJp1MgDxwd2cgKxBDjgo655VL3B9OK4QJKH3D9l35WB6L5xKwFfP dAJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=NdhHQHuSCDHkaJTReK0BViYqXIKrRofE46NApLr4V0M=; b=muwCI4m9vqQbYcq7jYSgPJOjAkJDd95/gNiNhQMIJ8PR4136nc5FmcEF6MU/mKc2K3 oS+Bh2RZp9GhF/G/Om75ZKgPy2LIQJbagphx2t98P6WPjCUxMhnWu2jj0KefQS1dDcBL f9vChn/xk7ms4G2NA1h/dhZZ+NIU/Amg7O2qC0Qe2myfk/YWCYRCAr52hOpLw8+dMbGz VO2QqhqjxOf4rxjNBsrD5Zfr/athOFTIfJzk91I0EJqCDuA7pycxuG6l4/YN1Db70hi7 X4lDIFmP9wnDXli/bxjPKWgupkqolv8d3HPWcBZ75IF95ZMrMOsWXxKvS09XhywHYI5F zYtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=VGRU/8Dv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14-v6si11367545pgq.512.2018.05.03.07.36.36; Thu, 03 May 2018 07:36:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=VGRU/8Dv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751214AbeECOgH (ORCPT + 99 others); Thu, 3 May 2018 10:36:07 -0400 Received: from mail-db5eur01on0054.outbound.protection.outlook.com ([104.47.2.54]:12927 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751027AbeECOgD (ORCPT ); Thu, 3 May 2018 10:36:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=NdhHQHuSCDHkaJTReK0BViYqXIKrRofE46NApLr4V0M=; b=VGRU/8Dvtvqi0Fxs/v72rHu8U7/ln36anl068pgdusmLVOWrggbt78vDAsBaqFinKVam3rbVMEPh0WBxql+Bh17cGOKwHFkKpK9A3h93i9Vppk7faZsRLltPYZCB8/eQb+OKqfU0ha0Fs5XyuCgWhaKvdyCaNr9rJsE8hyTw5Ss= Received: from DB4PR05MB0768.eurprd05.prod.outlook.com (10.161.16.140) by DB4PR05MB0909.eurprd05.prod.outlook.com (10.161.249.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.20; Thu, 3 May 2018 14:35:59 +0000 Received: from DB4PR05MB0768.eurprd05.prod.outlook.com ([fe80::817b:a376:391a:8f9a]) by DB4PR05MB0768.eurprd05.prod.outlook.com ([fe80::817b:a376:391a:8f9a%13]) with mapi id 15.20.0715.024; Thu, 3 May 2018 14:35:59 +0000 From: Liming Sun To: Shawn Lin , Mark Rutland , Jaehoon Chung , Catalin Marinas , Will Deacon CC: Ulf Hansson , Rob Herring , "linux-mmc@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v5 1/3] mmc: dw_mmc-bluefield: Add driver extension Thread-Topic: [PATCH v5 1/3] mmc: dw_mmc-bluefield: Add driver extension Thread-Index: AQHT4XpUJVX32tueBkqffC2RbR2Y+KQbn2iAgADDW1CAAToDgIAAdzAg Date: Thu, 3 May 2018 14:35:59 +0000 Message-ID: References: <026fa942828c54fda5bad225981e56abc808b949.1524497286.git.lsun@mellanox.com> <1525198787-46403-1-git-send-email-lsun@mellanox.com> <485d5c78-e16f-5034-9314-9e17e48d3570@rock-chips.com> In-Reply-To: <485d5c78-e16f-5034-9314-9e17e48d3570@rock-chips.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=lsun@mellanox.com; x-originating-ip: [216.156.69.42] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DB4PR05MB0909;7:25F76jkqvSpq+raJMHV79iLRfAT9K+IR9HG4NI3w8DuOferhqcLs7d1fEd4b5xNYHHCSrRmiR3kidlXg8MOGlaoHZN5bdW+sHiICqO27E90rP/wNIdIvNGeT9iKIOCrFPtK3aAU1YNjdu58hGyBzYIx98sd1TOBydyS789iF+JxjSYHiC/vkf8/FTlOm4LZ5VEzGpT+SqfyCLWL7hG5MK2Lz8RHNJaGjy80GwEb/EAZ9zgXVrdQdRAk4tBO0YZFH x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:DB4PR05MB0909; x-ms-traffictypediagnostic: DB4PR05MB0909: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(9452136761055)(7411616537696); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DB4PR05MB0909;BCL:0;PCL:0;RULEID:;SRVR:DB4PR05MB0909; x-forefront-prvs: 066153096A x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(376002)(39380400002)(346002)(396003)(366004)(199004)(13464003)(189003)(54906003)(6436002)(86362001)(93886005)(1720100001)(476003)(7416002)(446003)(478600001)(11346002)(186003)(68736007)(486006)(3846002)(55016002)(25786009)(305945005)(3660700001)(110136005)(7736002)(105586002)(26005)(53936002)(5660300001)(76176011)(6506007)(74316002)(5250100002)(7696005)(59450400001)(3280700002)(102836004)(6116002)(53376002)(14454004)(229853002)(966005)(6306002)(33656002)(8936002)(6246003)(66066001)(2900100001)(81166006)(316002)(99286004)(8676002)(81156014)(9686003)(97736004)(106356001)(53546011)(2906002)(4326008)(2004002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB4PR05MB0909;H:DB4PR05MB0768.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: DXIgvz5D3NS2lvz3UxEZw3DUgJeGTvtYiqmSXzikRPO5yKyyCe7u23cDNt++NyW14R/hmRuwGCjMhyXAxMgAJNU+wLPqR73QRqYAiQNNglHHO4I8Q1PmyfHBW49kAbCYgOGxVgMO0/tu00Wky6D5fBcSx1rXDDOpthTzMFxy3/KivbZ0lghKxoxRYocmrM3N spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: c8fc29f6-0044-4e36-8ea0-08d5b103302d X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8fc29f6-0044-4e36-8ea0-08d5b103302d X-MS-Exchange-CrossTenant-originalarrivaltime: 03 May 2018 14:35:59.2228 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR05MB0909 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel- > owner@vger.kernel.org] On Behalf Of Shawn Lin > Sent: Thursday, May 3, 2018 3:25 AM > To: Liming Sun ; Mark Rutland > ; Jaehoon Chung ; > Catalin Marinas ; Will Deacon > > Cc: shawn.lin@rock-chips.com; Ulf Hansson ; Rob > Herring ; linux-mmc@vger.kernel.org; > devicetree@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH v5 1/3] mmc: dw_mmc-bluefield: Add driver extension >=20 >=20 > On 2018/5/2 20:45, Liming Sun wrote: > > Please see response inline. > > > > Thanks, > > Liming > > > >> -----Original Message----- > >> From: Shawn Lin [mailto:shawn.lin@rock-chips.com] > >> Sent: Tuesday, May 1, 2018 9:02 PM > >> To: Liming Sun ; Mark Rutland > >> ; Jaehoon Chung ; > >> Catalin Marinas ; Will Deacon > >> > >> Cc: Ulf Hansson ; Rob Herring > >> ; shawn.lin@rock-chips.com; linux- > >> mmc@vger.kernel.org; devicetree@vger.kernel.org; linux- > >> kernel@vger.kernel.org; stable@kernel.org > >> Subject: Re: [PATCH v5 1/3] mmc: dw_mmc-bluefield: Add driver > extension > >> > >> On 2018/5/2 2:19, Liming Sun wrote: > >>> This commit adds extension to the dw_mmc driver for Mellanox > BlueField > >>> SoC. It updates the UHS_REG_EXT register to bring up the eMMC card > on > >>> this SoC. > >>> > >>> Cc: stable@kernel.org > >> > >> Why? > > > > [Liming] This is recommended value from HW team. Without this setting, > the eMMC > > controller and cards can be found in Linux, but not stable. Writing to = it could > caused > > CRC error. >=20 > Well, I refered to the "Cc: stable@kernel.org" in the commit msg. [Liming] Sorry, a typo. I meant "stable@vger.kernel.org". Will update it i= n v6. Thanks! >=20 > > > >> > >>> Signed-off-by: Liming Sun > >>> Reviewed-by: David Woods > >>> --- > >>> drivers/mmc/host/Kconfig | 9 +++++ > >>> drivers/mmc/host/Makefile | 1 + > >>> drivers/mmc/host/dw_mmc-bluefield.c | 72 > >> +++++++++++++++++++++++++++++++++++++ > >>> 3 files changed, 82 insertions(+) > >>> create mode 100644 drivers/mmc/host/dw_mmc-bluefield.c > >>> > >>> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig > >>> index 9589f9c..26ac6b5 100644 > >>> --- a/drivers/mmc/host/Kconfig > >>> +++ b/drivers/mmc/host/Kconfig > >>> @@ -717,6 +717,15 @@ config MMC_DW_K3 > >>> Synopsys DesignWare Memory Card Interface driver. Select this > >> option > >>> for platforms based on Hisilicon K3 SoC's. > >>> > >>> +config MMC_DW_BLUEFIELD > >> > >> And did you have feedback of my comment in V2=1B$B!)=1B(B > >> http://lists-archives.com/linux-kernel/29104830-mmc-dw_mmc- > bluefield- > >> add-driver-extension.html > >> > >>> + tristate "BlueField specific extensions for Synopsys DW Memory Card > >> Interface" > >>> + depends on MMC_DW > >>> + select MMC_DW_PLTFM > >>> + help > >>> + This selects support for Mellanox BlueField SoC specific extensio= ns > >> to > >>> + the Synopsys DesignWare Memory Card Interface driver. Select this > >>> + option for platforms based on Mellanox BlueField SoC's. > >>> + > >>> config MMC_DW_PCI > >>> tristate "Synopsys Designware MCI support on PCI bus" > >>> depends on MMC_DW && PCI > >>> diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile > >>> index 6aead24..267b3f1 100644 > >>> --- a/drivers/mmc/host/Makefile > >>> +++ b/drivers/mmc/host/Makefile > >>> @@ -55,6 +55,7 @@ obj-$(CONFIG_MMC_DW_K3) +=3D > dw_mmc- > >> k3.o > >>> obj-$(CONFIG_MMC_DW_PCI) +=3D dw_mmc-pci.o > >>> obj-$(CONFIG_MMC_DW_ROCKCHIP) +=3D dw_mmc-rockchip.o > >>> obj-$(CONFIG_MMC_DW_ZX) +=3D dw_mmc-zx.o > >>> +obj-$(CONFIG_MMC_DW_BLUEFIELD) +=3D dw_mmc-bluefield.o > >>> obj-$(CONFIG_MMC_SH_MMCIF) +=3D sh_mmcif.o > >>> obj-$(CONFIG_MMC_JZ4740) +=3D jz4740_mmc.o > >>> obj-$(CONFIG_MMC_VUB300) +=3D vub300.o > >>> diff --git a/drivers/mmc/host/dw_mmc-bluefield.c > >> b/drivers/mmc/host/dw_mmc-bluefield.c > >>> new file mode 100644 > >>> index 0000000..12067b1 > >>> --- /dev/null > >>> +++ b/drivers/mmc/host/dw_mmc-bluefield.c > >>> @@ -0,0 +1,72 @@ > >>> +// SPDX-License-Identifier: GPL-2.0 > >>> +/* > >>> + * Copyright (C) 2018 Mellanox Technologies. > >>> + * > >>> + * This program is free software; you can redistribute it and/or mod= ify > >>> + * it under the terms of the GNU General Public License as published= by > >>> + * the Free Software Foundation; either version 2 of the License, or > >>> + * (at your option) any later version. > >>> + */ > >>> + > >>> +#include > >>> +#include > >>> +#include > >>> +#include > >>> +#include > >>> +#include > >>> +#include > >>> +#include > >>> + > >>> +#include "dw_mmc.h" > >>> +#include "dw_mmc-pltfm.h" > >>> + > >>> +static void dw_mci_bluefield_set_ios(struct dw_mci *host, struct > >> mmc_ios *ios) > >>> +{ > >>> + u32 regs; > >>> + > >>> + /* Set drive=3D4 (bit 29:23) and sample=3D2 (bit 22:16) in UHS_REG_= EXT. > >> */ > >>> + regs =3D mci_readl(host, UHS_REG_EXT); > >>> + regs =3D (regs & ~0x3F100000 & ~0x7F0000) | (4 << 23) | (2 << 16); > >>> + mci_writel(host, UHS_REG_EXT, regs); > >>> +} > >>> + > >>> +static const struct dw_mci_drv_data bluefield_drv_data =3D { > >>> + .set_ios =3D dw_mci_bluefield_set_ios > >>> +}; > >>> + > >>> +static const struct of_device_id dw_mci_bluefield_match[] =3D { > >>> + { .compatible =3D "mellanox,bluefield-dw-mshc", > >>> + .data =3D &bluefield_drv_data }, > >>> + {}, > >>> +}; > >>> +MODULE_DEVICE_TABLE(of, dw_mci_bluefield_match); > >>> + > >>> +static int dw_mci_bluefield_probe(struct platform_device *pdev) > >>> +{ > >>> + const struct dw_mci_drv_data *drv_data =3D NULL; > >>> + const struct of_device_id *match; > >>> + > >>> + if (pdev->dev.of_node) { > >>> + match =3D of_match_node(dw_mci_bluefield_match, > >>> + pdev->dev.of_node); > >>> + drv_data =3D match->data; > >>> + } > >>> + > >>> + return dw_mci_pltfm_register(pdev, drv_data); > >>> +} > >>> + > >>> +static struct platform_driver dw_mci_bluefield_pltfm_driver =3D { > >>> + .probe =3D dw_mci_bluefield_probe, > >>> + .remove =3D dw_mci_pltfm_remove, > >>> + .driver =3D { > >>> + .name =3D "dwmmc_bluefield", > >>> + .of_match_table =3D dw_mci_bluefield_match, > >>> + .pm =3D &dw_mci_pltfm_pmops, > >>> + }, > >>> +}; > >>> + > >>> +module_platform_driver(dw_mci_bluefield_pltfm_driver); > >>> + > >>> +MODULE_DESCRIPTION("BlueField DW Multimedia Card driver"); > >>> +MODULE_AUTHOR("Mellanox Technologies"); > >>> +MODULE_LICENSE("GPL v2"); > >>> > > > > > > > >