From patchwork Wed Nov 20 06:47:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11253275 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 359856C1 for ; Wed, 20 Nov 2019 06:48:33 +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 EA48C2245D for ; Wed, 20 Nov 2019 06:48:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mDSCyGfh"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="kib9FP4H" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA48C2245D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PHJuqqdsX2yW2TZLn4ocfpeh4+s4GfHd8FJwWnZQD2A=; b=mDSCyGfhnBHxxx YkBGUvvR9cLzYWzpNgYnPH2jYycYJK5OfJ3UBeT+xiiuXDg90O4kmPqujb58kdj4ZCseTLmrxxLp/ BOFAZXZZhHvEEj6dKHL4vsT9RK0YSJQ5oRYiBbm+PUSTMvFOwAkQApuMlSU1JlMOmkQfmLAkvljFC o5RJRD98xj57ssMwLEj8mhS0bGSlzW3rC+61rvw0vD9hYNQ6zxz+LzqBICxGiNB4kcJHxTbMxysbw dGKE/zF6nlrKNPAAKLkSkwt8m9vIi+cNSwNdRyvdDKqNOpWa6RzbtYjG66pu/udByoFjGIRbciX0n jyCHt9l63gu8DAWPFDgQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJmv-0006mj-7m; Wed, 20 Nov 2019 06:48:29 +0000 Received: from mail-eopbgr690083.outbound.protection.outlook.com ([40.107.69.83] helo=NAM04-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJmK-0006I5-PN for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2019 06:47:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TAF/HPE+aiEbmW5EKVBjjPuaxmmYFRDXcHebpX4Qzn1fdJAF+HtVwpYFJCZYbpZN7mmXdUTAeot4XVP3NDtnHaRHHO80tdJiJJ+PXAIdF6mM76Y6rSMZ4VCBMLrrAxO3nGSsSGnqh7+t4H1eMFfHM6yfpNUPpUVjA/cWKRcBiXk2W+7cXIn+6dIdHnoP9uJPuP/58ZR+Rev7u/KScFGAfCWRl44tu4IkvFuU2an0t59F3XGDVTAzVfC0ZJZab8e0XyDkI7C/tg3MlzxGvNaGvwt95UZjbZz1aa0B0FiH6v1yR4IKMo5p8mAXpn7xdhP+BBj5Uhpdpemy8FZhfY0nCg== 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=0eQy9sbl57qj64wcfahgY/DCazAuE05WULs7Rq44dFw=; b=ftTcn/LyuhveHaWSNDHEkmyTAVZ5YVD0jq552vw15CsZsbSLiXuztynZoodsSMB+wvzQuiAGYiLo320o1yHlYvAu7dlQGfDuMXo+N7YBdiM9DqfoK30/kxlSmpP9+TU6aLwZHwVF0thMDg33Kw6SPa1a4OEJYc7t4wOHnZJip/BKPBany2VApAeAoFmYkSedlHXMvRCtZPL272NEY3mY5pked808lPuyEjDqhDmDf0Ea8p9AvrRTl46cvh/uKJ3WvYe+WechTtI71+ycLnPNFMED7Qu3KDrjM4f7Rgm/0Ygd2yQ+guZqcz2jD6JzeNCeTpW0w4exIoUZ3wel7GHBbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0eQy9sbl57qj64wcfahgY/DCazAuE05WULs7Rq44dFw=; b=kib9FP4Hz7ANvvyVctxvH6f8Z88II2t1VnONfFEJqIwq8Kgk2fSd4sMjah4VXvZfZ0kFOsNUwhXiMe+v16TF5J4H2lVS0jESH7AFK0ANrmk6F3HnrPihjt9IhMupPxz+QCWku7bJp8uewWsyuCkg8CUJUKK1k3m50aq9qK/2nUE= Received: from MWHPR02CA0018.namprd02.prod.outlook.com (2603:10b6:300:4b::28) by SN1PR02MB3870.namprd02.prod.outlook.com (2603:10b6:802:2c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23; Wed, 20 Nov 2019 06:47:49 +0000 Received: from SN1NAM02FT014.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::202) by MWHPR02CA0018.outlook.office365.com (2603:10b6:300:4b::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17 via Frontend Transport; Wed, 20 Nov 2019 06:47:48 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT014.mail.protection.outlook.com (10.152.72.106) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2474.17 via Frontend Transport; Wed, 20 Nov 2019 06:47:48 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJmF-00061C-SO; Tue, 19 Nov 2019 22:47:47 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1iXJmA-00049o-Oh; Tue, 19 Nov 2019 22:47:42 -0800 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id xAK6lbPd027291; Tue, 19 Nov 2019 22:47:37 -0800 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJm4-000490-KJ; Tue, 19 Nov 2019 22:47:37 -0800 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id D7EEB120EF0; Wed, 20 Nov 2019 12:17:35 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, adrian.hunter@intel.com, michal.simek@xilinx.com, jolly.shah@xilinx.com, rajan.vaja@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com Subject: [PATCH v6 1/8] mmc: sdhci-of-arasan: Separate out clk related data to another structure Date: Wed, 20 Nov 2019 12:17:22 +0530 Message-Id: <1574232449-13570-2-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> References: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(376002)(136003)(346002)(396003)(39860400002)(199004)(189003)(446003)(76176011)(2616005)(14444005)(106002)(11346002)(478600001)(486006)(81166006)(48376002)(476003)(81156014)(50466002)(70206006)(2906002)(4326008)(51416003)(126002)(70586007)(186003)(36386004)(50226002)(8936002)(305945005)(47776003)(36756003)(44832011)(5660300002)(336012)(103686004)(6666004)(8676002)(16586007)(42186006)(356004)(316002)(6266002)(107886003)(426003)(26005)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR02MB3870; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 51bf20dc-b694-49c5-163a-08d76d858ea5 X-MS-TrafficTypeDiagnostic: SN1PR02MB3870: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-Forefront-PRVS: 02272225C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eRfUqDHXUpaP3JM7s8My846+7jfjMc7bEOLSvKfSBjqY7wgwN2FGlI2lBIwO7u8D/5hDRok6m2HX5F6awox7FJdq7V6bSQ2Yin14wZmxf8NoELWpBUqKmZfYsxvSf38EElO2fCf/kzLs1tyCxOa0oN1g3afhrJZi3qgdbYjsEtuVPneeKIlHlj7KD3yNisKpUCR6a1r7arnVV8Qdl041BdCVHH/1fL1WSgpehpcztuVGWv6HR5gLFtEOndOXTRouAO3/npJb3WUzQR1v0phUEVbuEJXbg8Dep0n9u6Vv+eYLVUHrY8Vx1axrUr+MPZ4Jftp5K414AV3OH36dTK8iFR4M+5XkKdT8SrjSCvmDLmcpHC0Jyz1gbGjkbN4DTCVVRL6Lbz18bPfn7hkZkXdGBM+ECSQsdVqoL2RkvOrGuZCyOn69OuumqnBzsLj8TS1q X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2019 06:47:48.5744 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 51bf20dc-b694-49c5-163a-08d76d858ea5 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR02MB3870 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191119_224752_824181_2485D335 X-CRM114-Status: GOOD ( 13.43 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.69.83 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, git@xilinx.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org To improve the code readability, use two different structs, one for clock provider data and one for mmc platform data. Signed-off-by: Manish Narani --- drivers/mmc/host/sdhci-of-arasan.c | 31 ++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index 7023cbec4017..701b6cc0f9a3 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -71,14 +71,23 @@ struct sdhci_arasan_soc_ctl_map { bool hiword_update; }; +/** + * struct sdhci_arasan_clk_data + * @sdcardclk_hw: Struct for the clock we might provide to a PHY. + * @sdcardclk: Pointer to normal 'struct clock' for sdcardclk_hw. + */ +struct sdhci_arasan_clk_data { + struct clk_hw sdcardclk_hw; + struct clk *sdcardclk; +}; + /** * struct sdhci_arasan_data * @host: Pointer to the main SDHCI host structure. * @clk_ahb: Pointer to the AHB clock * @phy: Pointer to the generic phy * @is_phy_on: True if the PHY is on; false if not. - * @sdcardclk_hw: Struct for the clock we might provide to a PHY. - * @sdcardclk: Pointer to normal 'struct clock' for sdcardclk_hw. + * @clk_data: Struct for the Arasan Controller Clock Data. * @soc_ctl_base: Pointer to regmap for syscon for soc_ctl registers. * @soc_ctl_map: Map to get offsets into soc_ctl registers. */ @@ -89,8 +98,7 @@ struct sdhci_arasan_data { bool is_phy_on; bool has_cqe; - struct clk_hw sdcardclk_hw; - struct clk *sdcardclk; + struct sdhci_arasan_clk_data clk_data; struct regmap *soc_ctl_base; const struct sdhci_arasan_soc_ctl_map *soc_ctl_map; @@ -520,8 +528,10 @@ static unsigned long sdhci_arasan_sdcardclk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { + struct sdhci_arasan_clk_data *clk_data = + container_of(hw, struct sdhci_arasan_clk_data, sdcardclk_hw); struct sdhci_arasan_data *sdhci_arasan = - container_of(hw, struct sdhci_arasan_data, sdcardclk_hw); + container_of(clk_data, struct sdhci_arasan_data, clk_data); struct sdhci_host *host = sdhci_arasan->host; return host->mmc->actual_clock; @@ -633,6 +643,7 @@ static int sdhci_arasan_register_sdclk(struct sdhci_arasan_data *sdhci_arasan, struct clk *clk_xin, struct device *dev) { + struct sdhci_arasan_clk_data *clk_data = &sdhci_arasan->clk_data; struct device_node *np = dev->of_node; struct clk_init_data sdcardclk_init; const char *parent_clk_name; @@ -655,13 +666,13 @@ static int sdhci_arasan_register_sdclk(struct sdhci_arasan_data *sdhci_arasan, sdcardclk_init.flags = CLK_GET_RATE_NOCACHE; sdcardclk_init.ops = &arasan_sdcardclk_ops; - sdhci_arasan->sdcardclk_hw.init = &sdcardclk_init; - sdhci_arasan->sdcardclk = - devm_clk_register(dev, &sdhci_arasan->sdcardclk_hw); - sdhci_arasan->sdcardclk_hw.init = NULL; + clk_data->sdcardclk_hw.init = &sdcardclk_init; + clk_data->sdcardclk = + devm_clk_register(dev, &clk_data->sdcardclk_hw); + clk_data->sdcardclk_hw.init = NULL; ret = of_clk_add_provider(np, of_clk_src_simple_get, - sdhci_arasan->sdcardclk); + clk_data->sdcardclk); if (ret) dev_err(dev, "Failed to add clock provider\n"); From patchwork Wed Nov 20 06:47:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11253285 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3879914ED for ; Wed, 20 Nov 2019 06:49:02 +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 99BC0206F4 for ; Wed, 20 Nov 2019 06:49:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iZ2plpYz"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="FUSNdYsc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99BC0206F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/K9EVwUxpRTav+uuOJbrxWGjzeTH7scw0rGgixXzX5E=; b=iZ2plpYzFDKCmw pXkNiUzSXAdFa4NpKEnwl6MsZqGaCSYsLxiy35ktJ5Bog7dte5hP7zruIZWE8lZPlOzKKOTG7FuST TImdpc2RDWJQ+UED6uxdIdfUKdrKTBifIU4Z3RREJYyQRZwOMTv2F83BkihGiLQ/hV2eNH4urUI/y UGcRUOdLIFPP49yR1vzcBRycn95i/+HDpMfdjSKIYwTBNU9uWLrjB3XEuiKnb3zkIWTpEtE8snMCa GJEP9oQEzGutxIpbfMz/JaydHoxT/DJJxK0HnXnhwRZ1zawnkOs6dEpvAxhlJo3U+ZXF3J87z/t73 BsJRKMB3nRHynAT+5mXA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJnO-0007GJ-Ee; Wed, 20 Nov 2019 06:48:58 +0000 Received: from mail-eopbgr690088.outbound.protection.outlook.com ([40.107.69.88] helo=NAM04-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJmK-0006Hd-Fj for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2019 06:47:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QH4X2ORUf3OPGkNVTW5dF/85np1QlXxJtJWSAnPFo/A5XxNRsDomrGwAjGN9vqBgZ0OCXESxP2eXvlyh86DBM8+rFLyIJpGqfXttbGdLkw8QZf7O/Cdwf+ehSpxCaJ29GLK7tecmAAAo7l2Fahy9JNJw15JpADAPte6HyBgBnXT5cqpRLwaTyxxReZln/0b87YGdXEiHA6IL0mXTGJDgZbp2Cy/2WecLI6lumlL+hZgy8z7Bu15bg31WiH/9U5Io8NBpdACWPH+VKDLNQcy+DNN8cqcOcKt0Vy4/EQAqD/YmN4Qmf4i5Q5taOfAvi5Sq2vEdERg4jHWRiLgV6dH+DA== 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=qzXvD+IcJGqNn9EqJ780uC5HVrfKOntSd7rWjYG8Csg=; b=T+U4chYTIsLvueoYBFWm2Q7SDUNC2T2ALoaoINtERyXlYYjtVbheradR8Uj+r7xzJyt8zStCyRtjlEPWGo4aQJNg0JdSHj/eFGbxaxYmuQsyi2IMgqdUO1HaZHQNGP9XbpqksTl84khe7+NdjZFnVHt7UL0kLakybbHDjFy2MwgK+OYltGlfiupVeBxZKVvdMGqlf9nBubTgYU2u6B7S/WYZiCtnG8WX/ebwD/eZoqsC24XWswe8F0fTkVpySEIqCAa330diEB7qh82su5etOxi8/qB++OqvQBAYP1IJ2VX/2lwLWtGEldsAIpGSGqqCJCOApV2wL6GJ1KfvTzRAuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qzXvD+IcJGqNn9EqJ780uC5HVrfKOntSd7rWjYG8Csg=; b=FUSNdYscgdtD9jIV2xYsR4UvPjuH5xoMKkjBrNoPzWLMP5A3UKTWZ7DfSkePu6qe+nbUgJCUaJGURGaMPWwqmLjsu/ZvFKEIInU3Ianj/d3FLgMYI90greEfH+dmzaG0MZkCWPF7cKWBV5nwkdj5yh0KRpT27gXzop69NZiI+Y4= Received: from BL0PR02CA0083.namprd02.prod.outlook.com (2603:10b6:208:51::24) by BYAPR02MB5879.namprd02.prod.outlook.com (2603:10b6:a03:121::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.30; Wed, 20 Nov 2019 06:47:49 +0000 Received: from SN1NAM02FT032.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::207) by BL0PR02CA0083.outlook.office365.com (2603:10b6:208:51::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16 via Frontend Transport; Wed, 20 Nov 2019 06:47:48 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT032.mail.protection.outlook.com (10.152.72.126) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2474.17 via Frontend Transport; Wed, 20 Nov 2019 06:47:48 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJmF-00061D-Vg; Tue, 19 Nov 2019 22:47:47 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1iXJmA-00049o-S4; Tue, 19 Nov 2019 22:47:42 -0800 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id xAK6lapv027287; Tue, 19 Nov 2019 22:47:37 -0800 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJm4-000491-KZ; Tue, 19 Nov 2019 22:47:36 -0800 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id D8E4512136F; Wed, 20 Nov 2019 12:17:35 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, adrian.hunter@intel.com, michal.simek@xilinx.com, jolly.shah@xilinx.com, rajan.vaja@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com Subject: [PATCH v6 2/8] dt-bindings: mmc: arasan: Update Documentation for the input clock Date: Wed, 20 Nov 2019 12:17:23 +0530 Message-Id: <1574232449-13570-3-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> References: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(39860400002)(396003)(136003)(189003)(199004)(6666004)(126002)(70586007)(70206006)(476003)(486006)(11346002)(446003)(2616005)(26005)(186003)(107886003)(478600001)(44832011)(106002)(6266002)(316002)(42186006)(16586007)(51416003)(47776003)(8676002)(103686004)(50466002)(36386004)(50226002)(81156014)(81166006)(2906002)(36756003)(426003)(4326008)(5660300002)(336012)(8936002)(356004)(305945005)(48376002)(76176011)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR02MB5879; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8d09fe77-a13f-4218-d4b6-08d76d858e89 X-MS-TrafficTypeDiagnostic: BYAPR02MB5879: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 02272225C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OVEl2p+SkjNppL63sHYH+mMupUubiKV+PkJNQzeWcs8+JEuolf+CAEt3j6RSvMNrb/VrnnC0fOwxJewxynfRiqJ1QsMEodJDH86hsWWKY8bzttiyoFFQ9sb3MvRq1smpu2vRAcrcPBm/LiHWT+dut9xcHLwhK77qwrvTFyfoHbRkBPfzEH6Nu3HNkODFvAHUNzR1HVboLEgZEbiIfZEq8l1wBq5xZWLUvmZhdKv736zlKSxgJXOqdciPjHLuCEFjJjDIvCzrW48n/VmwJ/fGKMzCyy1jdcmZDKeaP0sXhPqHUXZ8Tq1wFsmr676lhVxT3aEDvxoYheDKyT+2W2HzSquvcAY7l+/k+xSxId5HfrFLXKFPK7FSPsyXU0fCKj+O9raPXbznJyntYz+cz2miIonhlq6ZjH389mYPIeVTB2p6cGc/BJUv5sYMPdnvvXKg X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2019 06:47:48.4398 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8d09fe77-a13f-4218-d4b6-08d76d858e89 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB5879 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191119_224752_533169_823E163E X-CRM114-Status: GOOD ( 13.53 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.69.88 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, git@xilinx.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add documentation for an optional input clock which is essentially used in sampling the input data coming from the card. Signed-off-by: Manish Narani Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/mmc/arasan,sdhci.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt index 7ca0aa7ccc0b..b51e40b2e0c5 100644 --- a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt +++ b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt @@ -38,9 +38,9 @@ Optional Properties: - clock-output-names: If specified, this will be the name of the card clock which will be exposed by this device. Required if #clock-cells is specified. - - #clock-cells: If specified this should be the value <0>. With this property - in place we will export a clock representing the Card Clock. This clock - is expected to be consumed by our PHY. You must also specify + - #clock-cells: If specified this should be the value <0> or <1>. With this + property in place we will export one or two clocks representing the Card + Clock. These clocks are expected to be consumed by our PHY. - xlnx,fails-without-test-cd: when present, the controller doesn't work when the CD line is not connected properly, and the line is not connected properly. Test mode can be used to force the controller to function. From patchwork Wed Nov 20 06:47:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11253287 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7C1746C1 for ; Wed, 20 Nov 2019 06:49:17 +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 3BB26218BA for ; Wed, 20 Nov 2019 06:49:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="H9WxSKtv"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="N5xVdlBj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BB26218BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DTMnL18vQprMdu316EnX8b62yzm9BU5nG93kNTYGDuo=; b=H9WxSKtvw7X2yy c0CLAK0rJ+vHW9tdCFvpVX0Dr/+Iz23k6wPBJCiVM6Ovv3sJOVE70cZ7Xs8k8i0SCDNEjUn5Kd4Xg 1eQ0zZkngyBXfYdFOygmU8AM3g9fcXapi0e+GPy4vCS5Yz6k3i1MqcJZugscRGuZExRJ53IVClJqQ 08OJ7K8v/UUOABa6FcgA9RWSGXbeDsR+UMVbuWmO3vtQPzxf5yuV3OXaY4PJDkNN6W4wwUfBejLqM y0ArjbQikx13Qh4n7X+QsrEVKf7nbiak5R5lasV5bAiyzBt8LD5v6PkeRe/DfKav5Em2XFRwYkT9P axXtqbDAlcc3QaCkTi+Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJna-0007Uy-MQ; Wed, 20 Nov 2019 06:49:10 +0000 Received: from mail-eopbgr740071.outbound.protection.outlook.com ([40.107.74.71] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJmK-0006I1-QU for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2019 06:47:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eo+l686V/Mjc013BpMxGFz+A6rZ4FdFm9MLXGozAPAQegpsUdwQ7Szscu40UjfORPiJXgfLzChTuGUjVyqx/6x2P9IbTg0xIK3BfIP9JoKpRbizLFWoBM9idICDdufw9iZgWgjSKPlZLXcjrxhHuL6iL2eyEj+ybB2efAh16wEZq7fwxEdvwfS9lVU9I22c3cI+BcF2IILA1Wqm/tIVgFekSqLp653vSXAKpIq/RvX6kIRcndq5DcTLambsDu5nnnprNq6nB7AhzkFV788mcPljKlMJkXFDazrO7Uo+1giEwfqeb1Y7WYPQeFWQaHYeg9jP/YE1lbFQzFW66yG/ezg== 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=k7qbsUFt6gIDpj2dYmDYOFz7It+gjHYfXKxGp9daL6Q=; b=Dh90V5rrQJJ0/ijR4xl+BLRmvf4gnNtluJ8J7X8zMrJkh3puzbSHz26atBDm8YUIs8UjvoC1vdDPBiMOrq2/Wu14AoIS0FAXoig5NYSrqaLE8ZNgkADBBjYhX3RXIsW4cA1BsF+1q0iQEB7H2PQwoxB7OmC2ah8VapANh3HjcsO6doi5ap8APGyiGHWO5FKrLDIbwVjxFluQvhMgUY2U7ePxyTJ5tP30ZU5BJln5kfFFsc1KK9tXkIvJ4dGey+/MLDVHzJ7C7hoOJa4xp8S/VovV0pdaj8RPoZZATF2pAd1d4X61jHl8+MoJwbfZJax8ztsWgtAzq+HlthJ/CsgBtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k7qbsUFt6gIDpj2dYmDYOFz7It+gjHYfXKxGp9daL6Q=; b=N5xVdlBjVLbDyab9jQwuzBpaEhXX8CgA57V4nH1S7qy9O1Lsg/5yvkhtNLpbCMWgRyYkNtiXkAvEJ3PGWlYXb8Qrzjsnvf0kSAdZCPL6Q8y8cvWhiOU9CIW//DbXA7l/gnfV9RQbEMkwquVF9OC8kmQpZqUy/HQBoMB1WLd42Y8= Received: from CH2PR02CA0022.namprd02.prod.outlook.com (2603:10b6:610:4e::32) by DM6PR02MB4188.namprd02.prod.outlook.com (2603:10b6:5:97::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16; Wed, 20 Nov 2019 06:47:48 +0000 Received: from BL2NAM02FT053.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::209) by CH2PR02CA0022.outlook.office365.com (2603:10b6:610:4e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.30 via Frontend Transport; Wed, 20 Nov 2019 06:47:48 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT053.mail.protection.outlook.com (10.152.76.225) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2474.17 via Frontend Transport; Wed, 20 Nov 2019 06:47:48 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJmF-00061A-NY; Tue, 19 Nov 2019 22:47:47 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1iXJmA-00049o-Jg; Tue, 19 Nov 2019 22:47:42 -0800 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id xAK6lb9Q001803; Tue, 19 Nov 2019 22:47:37 -0800 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJm4-000492-LU; Tue, 19 Nov 2019 22:47:37 -0800 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id DF133121389; Wed, 20 Nov 2019 12:17:35 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, adrian.hunter@intel.com, michal.simek@xilinx.com, jolly.shah@xilinx.com, rajan.vaja@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com Subject: [PATCH v6 3/8] mmc: sdhci-of-arasan: Add sampling clock for a phy to use Date: Wed, 20 Nov 2019 12:17:24 +0530 Message-Id: <1574232449-13570-4-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> References: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(396003)(346002)(136003)(376002)(199004)(189003)(16586007)(316002)(2906002)(6666004)(42186006)(356004)(70586007)(44832011)(36756003)(186003)(48376002)(106002)(36386004)(26005)(76176011)(6266002)(4326008)(336012)(50466002)(486006)(107886003)(51416003)(305945005)(70206006)(476003)(50226002)(8936002)(14444005)(126002)(2616005)(81166006)(81156014)(478600001)(5660300002)(47776003)(8676002)(426003)(103686004)(446003)(11346002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB4188; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 06333818-2ff8-4a80-d6ab-08d76d858e98 X-MS-TrafficTypeDiagnostic: DM6PR02MB4188: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-Forefront-PRVS: 02272225C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YF4Sc0SYNcTwNoVVds82uES3aAVhmAzU4AuF6kDIh5dqlZ3MBzHCay7xnsg7tOoPbX/ptU8ff/RTiViGMEUj1fmtb19r2BMR0FKhe/Oq3HbTR/2mWnxdLrkXIrvteeG8xr3tgVPBb7mxDxva7Rz2Q1CvfEdfjwny5A1AH9Cx8PN5GV47WOnyRvHJT1bMBGKu//6uk5Cg6T1oLmSAXZ4UDmNeZIEBHYwl7WxvI9QN8mC8+1SzOgHglFjU2ZRGiN4zT0xWEL70N3W8AVvRpwNTHw4cXCMs8u/WkAmqzJUe2P6tNi2ala13CDaPINv93rKWDb7cSGNPVEyLyXbTjT2K0xkne/QPd4W21lW/8lQqHe7n66pgmuv+WTy0UFNQWty2C/OaX5wOpekgTBQjNLi7KKllxHCk02Sx1j40H/reQ/kP4m/+LMhVX1k8jCsQMcph X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2019 06:47:48.3841 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 06333818-2ff8-4a80-d6ab-08d76d858e98 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4188 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191119_224752_925218_75677DED X-CRM114-Status: GOOD ( 21.20 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.74.71 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, git@xilinx.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org There are some operations like setting the clock delays may need to have two clocks, one for output path and one for input path. Adding input path clock for some phys to use. Signed-off-by: Manish Narani --- drivers/mmc/host/sdhci-of-arasan.c | 151 +++++++++++++++++++++++++---- 1 file changed, 134 insertions(+), 17 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index 701b6cc0f9a3..b75ba780f902 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -75,10 +75,14 @@ struct sdhci_arasan_soc_ctl_map { * struct sdhci_arasan_clk_data * @sdcardclk_hw: Struct for the clock we might provide to a PHY. * @sdcardclk: Pointer to normal 'struct clock' for sdcardclk_hw. + * @sampleclk_hw: Struct for the clock we might provide to a PHY. + * @sampleclk: Pointer to normal 'struct clock' for sampleclk_hw. */ struct sdhci_arasan_clk_data { struct clk_hw sdcardclk_hw; struct clk *sdcardclk; + struct clk_hw sampleclk_hw; + struct clk *sampleclk; }; /** @@ -541,6 +545,33 @@ static const struct clk_ops arasan_sdcardclk_ops = { .recalc_rate = sdhci_arasan_sdcardclk_recalc_rate, }; +/** + * sdhci_arasan_sampleclk_recalc_rate - Return the sampling clock rate + * + * Return the current actual rate of the sampling clock. This can be used + * to communicate with out PHY. + * + * @hw: Pointer to the hardware clock structure. + * @parent_rate The parent rate (should be rate of clk_xin). + * Returns the sample clock rate. + */ +static unsigned long sdhci_arasan_sampleclk_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) + +{ + struct sdhci_arasan_clk_data *clk_data = + container_of(hw, struct sdhci_arasan_clk_data, sampleclk_hw); + struct sdhci_arasan_data *sdhci_arasan = + container_of(clk_data, struct sdhci_arasan_data, clk_data); + struct sdhci_host *host = sdhci_arasan->host; + + return host->mmc->actual_clock; +} + +static const struct clk_ops arasan_sampleclk_ops = { + .recalc_rate = sdhci_arasan_sampleclk_recalc_rate, +}; + /** * sdhci_arasan_update_clockmultiplier - Set corecfg_clockmultiplier * @@ -620,28 +651,21 @@ static void sdhci_arasan_update_baseclkfreq(struct sdhci_host *host) } /** - * sdhci_arasan_register_sdclk - Register the sdclk for a PHY to use + * sdhci_arasan_register_sdcardclk - Register the sdcardclk for a PHY to use * * Some PHY devices need to know what the actual card clock is. In order for * them to find out, we'll provide a clock through the common clock framework * for them to query. * - * Note: without seriously re-architecting SDHCI's clock code and testing on - * all platforms, there's no way to create a totally beautiful clock here - * with all clock ops implemented. Instead, we'll just create a clock that can - * be queried and set the CLK_GET_RATE_NOCACHE attribute to tell common clock - * framework that we're doing things behind its back. This should be sufficient - * to create nice clean device tree bindings and later (if needed) we can try - * re-architecting SDHCI if we see some benefit to it. - * * @sdhci_arasan: Our private data structure. * @clk_xin: Pointer to the functional clock * @dev: Pointer to our struct device. * Returns 0 on success and error value on error */ -static int sdhci_arasan_register_sdclk(struct sdhci_arasan_data *sdhci_arasan, - struct clk *clk_xin, - struct device *dev) +static int +sdhci_arasan_register_sdcardclk(struct sdhci_arasan_data *sdhci_arasan, + struct clk *clk_xin, + struct device *dev) { struct sdhci_arasan_clk_data *clk_data = &sdhci_arasan->clk_data; struct device_node *np = dev->of_node; @@ -649,10 +673,6 @@ static int sdhci_arasan_register_sdclk(struct sdhci_arasan_data *sdhci_arasan, const char *parent_clk_name; int ret; - /* Providing a clock to the PHY is optional; no error if missing */ - if (!of_find_property(np, "#clock-cells", NULL)) - return 0; - ret = of_property_read_string_index(np, "clock-output-names", 0, &sdcardclk_init.name); if (ret) { @@ -674,7 +694,56 @@ static int sdhci_arasan_register_sdclk(struct sdhci_arasan_data *sdhci_arasan, ret = of_clk_add_provider(np, of_clk_src_simple_get, clk_data->sdcardclk); if (ret) - dev_err(dev, "Failed to add clock provider\n"); + dev_err(dev, "Failed to add sdcard clock provider\n"); + + return ret; +} + +/** + * sdhci_arasan_register_sampleclk - Register the sampleclk for a PHY to use + * + * Some PHY devices need to know what the actual card clock is. In order for + * them to find out, we'll provide a clock through the common clock framework + * for them to query. + * + * @sdhci_arasan: Our private data structure. + * @clk_xin: Pointer to the functional clock + * @dev: Pointer to our struct device. + * Returns 0 on success and error value on error + */ +static int +sdhci_arasan_register_sampleclk(struct sdhci_arasan_data *sdhci_arasan, + struct clk *clk_xin, + struct device *dev) +{ + struct sdhci_arasan_clk_data *clk_data = &sdhci_arasan->clk_data; + struct device_node *np = dev->of_node; + struct clk_init_data sampleclk_init; + const char *parent_clk_name; + int ret; + + ret = of_property_read_string_index(np, "clock-output-names", 1, + &sampleclk_init.name); + if (ret) { + dev_err(dev, "DT has #clock-cells but no clock-output-names\n"); + return ret; + } + + parent_clk_name = __clk_get_name(clk_xin); + sampleclk_init.parent_names = &parent_clk_name; + sampleclk_init.num_parents = 1; + sampleclk_init.flags = CLK_GET_RATE_NOCACHE; + sampleclk_init.ops = &arasan_sampleclk_ops; + + clk_data->sampleclk_hw.init = &sampleclk_init; + clk_data->sampleclk = + devm_clk_register(dev, &clk_data->sampleclk_hw); + clk_data->sampleclk_hw.init = NULL; + + ret = of_clk_add_provider(np, of_clk_src_simple_get, + clk_data->sampleclk); + if (ret) + dev_err(dev, "Failed to add sample clock provider\n"); return ret; } @@ -697,6 +766,54 @@ static void sdhci_arasan_unregister_sdclk(struct device *dev) of_clk_del_provider(dev->of_node); } +/** + * sdhci_arasan_register_sdclk - Register the sdcardclk for a PHY to use + * + * Some PHY devices need to know what the actual card clock is. In order for + * them to find out, we'll provide a clock through the common clock framework + * for them to query. + * + * Note: without seriously re-architecting SDHCI's clock code and testing on + * all platforms, there's no way to create a totally beautiful clock here + * with all clock ops implemented. Instead, we'll just create a clock that can + * be queried and set the CLK_GET_RATE_NOCACHE attribute to tell common clock + * framework that we're doing things behind its back. This should be sufficient + * to create nice clean device tree bindings and later (if needed) we can try + * re-architecting SDHCI if we see some benefit to it. + * + * @sdhci_arasan: Our private data structure. + * @clk_xin: Pointer to the functional clock + * @dev: Pointer to our struct device. + * Returns 0 on success and error value on error + */ +static int sdhci_arasan_register_sdclk(struct sdhci_arasan_data *sdhci_arasan, + struct clk *clk_xin, + struct device *dev) +{ + struct device_node *np = dev->of_node; + u32 num_clks = 0; + int ret; + + /* Providing a clock to the PHY is optional; no error if missing */ + if (of_property_read_u32(np, "#clock-cells", &num_clks) < 0) + return 0; + + ret = sdhci_arasan_register_sdcardclk(sdhci_arasan, clk_xin, dev); + if (ret) + return ret; + + if (num_clks) { + ret = sdhci_arasan_register_sampleclk(sdhci_arasan, clk_xin, + dev); + if (ret) { + sdhci_arasan_unregister_sdclk(dev); + return ret; + } + } + + return 0; +} + static int sdhci_arasan_add_host(struct sdhci_arasan_data *sdhci_arasan) { struct sdhci_host *host = sdhci_arasan->host; From patchwork Wed Nov 20 06:47:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11253289 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3F6F96C1 for ; Wed, 20 Nov 2019 06:49:32 +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 D62B3214D9 for ; Wed, 20 Nov 2019 06:49:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ehXSnNRf"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="GCfFT2i9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D62B3214D9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yWXrKvvNSGngOtN6Kf/wAeDl9QJrWqwptSQGKvj0C/E=; b=ehXSnNRfTvkh8J c15iNCKbeG5swljMmR6j9cITRW6FQdcI7Aes8eftHljyzvxaFgmMp/5yM7Pr8bjMg4PPIC7q0jR4H 2txucAvP8uZE+vuJoCZq697Kl+TASy1ZuWzbsWbl7UM8FRixV6mUrqDgq61fGppW/dC9Sw0m0HHlH kWc1trh3CS5ys2ha3ggCzq2yu7KoP/zMAtk33AufCwQo15dYLsCGR+/p6ArwpmCZk6LpVRBtbM10z rXkQ91rDRp94dHgIqYtGlLpVp/MZlGv7FAFds+pQZ9gFDctTDvgitDWY1HhT0OPh6QliQVEBsVF9c 8HxJvJvL7fOUdf/1MktQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJns-0007oC-V3; Wed, 20 Nov 2019 06:49:28 +0000 Received: from mail-bn3nam01on060d.outbound.protection.outlook.com ([2a01:111:f400:fe41::60d] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJmL-0006He-CC for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2019 06:47:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hceKUzHYFvHIivrERsv81lQYx1zmsAlb1YXKjLUyzWz4NDYFY9Hd0LGV0IUI7PQPKFMJbgEMqYGlu8ExhR8A1RnLwt47b5TVId+QY3Yy9ULF99EQXsJI6D9RnTDd0rz9DYNoUlIr5KfRP3g+MhkEZqPapQLrUAuuPviPMoLFOl8cCz9EycZWPQBSwFX5V6KDnXD26/hD0XHVQQra9d51xz+fps20lkpl0s1iV8NcUaXFh03FmvFBrIzQphKUUkaHShFnFbrQ6z3WWsk0yDn1m7AvrZkhX3WwReM0LeV5Odbql3jxyimrMabX7GY+MUdWYP2sxp5VeL5gE0B/w4ahAw== 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=pjNlJsEg54SQNLOqjfVJfm6MTxVpU+Ns2k424JSQS18=; b=dd5G7IMY4soeGoq80i43RKP9X65npEl/A+fJnv0sq3Deyd+C58/n20haRuF2kTmnjSttj2brcuzhePEtYDp5Fu24OwfbO1jLMZeBR+6a5oyEVzXM2aB+hUHSDFV7I0OAgpqrONkoCNJVyF9Ffw15pfNHODzt6dT/iwIaUP1GOT0Pr3YRBfzofYStZ6Pz5F25fKjLjJXRx1JnpMZnuR6ePQCITvvF9CUPKp1dOBobLStRPgxvG9RBnU3zhOkk2Xrby6nsny7POy+7A2YXZ0ef+YV4M4XOuz9Q9ClY7fnqqTpDMVQqTRwgUNgLYvsxoN3E0CMFthWA4jaVQ1mQclPi3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pjNlJsEg54SQNLOqjfVJfm6MTxVpU+Ns2k424JSQS18=; b=GCfFT2i9BpELzSppedzRH2x8MPspiDg5HrDX/+vl929sji1Y3e/N6pWxvbUI1cFJJdzC+EyqLeHo1fq/DnrZsj5ecPjEyFg4Fka/rD5RjAMmBwLDk18INS5+YPg/9acB13hGe3wcZEjz4YffTtQOeYoBWwllKVwvBl16bQGIV94= Received: from BN7PR02CA0030.namprd02.prod.outlook.com (2603:10b6:408:20::43) by MN2PR02MB6591.namprd02.prod.outlook.com (2603:10b6:208:15f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.27; Wed, 20 Nov 2019 06:47:49 +0000 Received: from CY1NAM02FT057.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::201) by BN7PR02CA0030.outlook.office365.com (2603:10b6:408:20::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.27 via Frontend Transport; Wed, 20 Nov 2019 06:47:49 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT057.mail.protection.outlook.com (10.152.75.110) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2451.23 via Frontend Transport; Wed, 20 Nov 2019 06:47:48 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJmG-00061E-1M; Tue, 19 Nov 2019 22:47:48 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1iXJmA-00049o-Tk; Tue, 19 Nov 2019 22:47:42 -0800 Received: from xsj-pvapsmtp01 (smtp-fallback.xilinx.com [149.199.38.66] (may be forged)) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id xAK6laqw027289; Tue, 19 Nov 2019 22:47:37 -0800 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJm4-000493-Lx; Tue, 19 Nov 2019 22:47:36 -0800 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id E50A212138C; Wed, 20 Nov 2019 12:17:35 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, adrian.hunter@intel.com, michal.simek@xilinx.com, jolly.shah@xilinx.com, rajan.vaja@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com Subject: [PATCH v6 4/8] dt-bindings: mmc: Add optional generic properties for mmc Date: Wed, 20 Nov 2019 12:17:25 +0530 Message-Id: <1574232449-13570-5-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> References: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(136003)(346002)(376002)(396003)(199004)(189003)(5660300002)(50466002)(70206006)(70586007)(336012)(42186006)(47776003)(446003)(11346002)(8676002)(316002)(81166006)(81156014)(44832011)(126002)(2616005)(476003)(486006)(36756003)(6266002)(103686004)(107886003)(36386004)(2906002)(478600001)(48376002)(16586007)(4326008)(426003)(50226002)(186003)(8936002)(305945005)(356004)(106002)(26005)(14444005)(51416003)(76176011)(6666004)(41533002)(42866002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR02MB6591; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1b4a6714-dc45-44be-a587-08d76d858f15 X-MS-TrafficTypeDiagnostic: MN2PR02MB6591: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-Forefront-PRVS: 02272225C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /RVfBYBEh/H8aLckc2j8QG7lN5B4t/zn+5c531tW9wTbFdKoSeCBU+lnJWPy10I7zf2SLqrUowf4QgKG/8Up1UUYcaTV+oEbpLCn9VTzPBuniFQM+xQ8D5NFREQ7XTwytn3TUU/FdD2NwhOwozT29VFkg+CjlpDt7XpX7id1Ch3+0w/D3vyC/1G9aaYHBfepx5VxXlPZwX18c+mSQALo2O66MN8lnExUG8usjOV8RZKaeh5TtIFtJhBEPs+J7zTDgPIgjdcFLSV74pfocMP4OBvTpNUf4eXFw4X3ZZ/awZbx2XjXgNt5K95CLBMqzuQ4sb8ZsklJ9UuDKaOzpvabykE2Y0xBgX9jZNDVqhOQEgGftRnPOQIz7s0Neatfn+1c54hEM0yFiwWD7fOqtnUb57F5rTXyJbmgsy3ZQGckF5BJHsiDT8qQFjWSm4/puwQS X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2019 06:47:48.4804 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1b4a6714-dc45-44be-a587-08d76d858f15 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6591 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191119_224753_425005_AD238FA2 X-CRM114-Status: UNSURE ( 9.46 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a01:111:f400:fe41:0:0:0:60d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, git@xilinx.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add optional properties for mmc hosts which are used to set clk delays for different speed modes in the controller. Signed-off-by: Manish Narani --- .../devicetree/bindings/mmc/mmc-controller.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml index 080754e0ef35..305b2016bc17 100644 --- a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml +++ b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml @@ -333,6 +333,18 @@ patternProperties: required: - reg + "^clk-phase-(legacy|sd-hs|mmc-(hs|hs[24]00|ddr52)|uhs-(sdr(12|25|50|104)|ddr50))$": + minItems: 2 + maxItems: 2 + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - minimum: 0 + maximum: 359 + description: + Set the clock (phase) delays which are to be configured in the + controller while switching to particular speed mode. These values + are in pair of degrees. + dependencies: cd-debounce-delay-ms: [ cd-gpios ] fixed-emmc-driver-type: [ non-removable ] @@ -351,6 +363,7 @@ examples: keep-power-in-suspend; wakeup-source; mmc-pwrseq = <&sdhci0_pwrseq>; + clk-phase-sd-hs = <63>, <72>; }; - | From patchwork Wed Nov 20 06:47:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11253293 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 391F36C1 for ; Wed, 20 Nov 2019 06:50:14 +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 0D3F1206CB for ; Wed, 20 Nov 2019 06:50:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pQQZjeWG"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="CXO5IdzM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D3F1206CB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=juUkjxa1L3qA50nm73R9jEIoKYsH0KIagLIfB1vIxvo=; b=pQQZjeWGgQ18Ni 3B07ufgImN9oxPo9zBnUvg/U5vkKF4ouEpo8YcQlT6Rm0wg9vgZjSL5mWmrGM2oYqZDTS5L4EoZeI B0+2FIUIkAFCLZv3K1D8vf2mT9k+FATrLoCo2xpsoFk4FiGl1+MlUAFXhuJGrgvYN78WvOeyJxhB0 lbHkQYQ/E4f5vwCp+5pivaBCauAkzwc4Rtm3x1hrTS3BGwYYWA3Jrr3yCE/Mk3F9qOzw8wm/uyMWF 6A64a8H+Z8V0RdVZ/RnwC3Z54fOx8iG2/rj88hj+vgOOaV+Q81+r9IAzeZ8owwI/nVa7SJ0MpuLVn fLqPLSvp/H8BX0Fe7flQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJoZ-0008QA-Oz; Wed, 20 Nov 2019 06:50:11 +0000 Received: from mail-eopbgr770072.outbound.protection.outlook.com ([40.107.77.72] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJmL-0006I7-AH for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2019 06:47:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mv0ND3iplT7Agjj7ZPN/2dtdF1Gd+dlPsEFd70Uj4NW9+9OC4yQS/sjjgFm6bC1mZvSSl/8ku5siILCtqyOy7iRB2WF7cgHP/6FfK0lgPgIMmZnzLCPNZu3q5DuF6/4OKI1IKAeD9B27Cqx37T74yajyprzHZV2w8OShYmupGDNSiblobvb3U5wcXE7/Nd7Qy2Ko6Ljr5pfesrrJdRxMRIyH9O+4+JREM7EiK7xU4o5L/00AxIIAMg8bnAfr8EgyB4cCZsmfHlbXqFfNnOHd9/7g3VmwtHj+MqStzh4urufOVmVPcu4ibK00lLsh5mtOQMJZJkuOFRMyEsKMseHALg== 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=m5S1KA31oH+mkM7DanXAs+YE4sBunEXs4vCCSxmISw8=; b=UxmNnc1da6OxFbNy9JWoPwSCMjLUaWo6HOr1wuh0JqhsgoqkTywUd2nbXT9qy4ocObHo+0nWn2QDIqgfQbOmfR0/nCTqAMCIbaVJWd5mm9GNtCKOMPFl7EPZV8fQxehGxckLkL4e8OVakpb01WkqLS9nzXuUH/C/Gh2aKRtUrizGdRMGEGQFk9tydVjFmg/xHIWTrmST8azGSVKFpYp7oc7NGBRKUM/ZQkg8PSByr7rDz502GXxZn5eBEKbmEnm8i6QXrgIhkY8JXO0Nof0eJ7VwQd3i1JPc7J5SdWMJ91FO3WgKGX+0smxS0GX0fIs/JQKv+FYi7ktSaau6z0gbVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m5S1KA31oH+mkM7DanXAs+YE4sBunEXs4vCCSxmISw8=; b=CXO5IdzMwC/EBOB5LTJiWSiDtjUi6BU8AhmDg1h5g0K0sOa3NHqCOezhKW+qw3fDFxkjMoBUGSSh3it7vDY3677z8yWAKzZmwcWcGVYrbdPiu3w19y4CVpgHEzr8AMe9uE7AN7LvATdnORCG/dTcj3uiLjwnqpUrHsoxlXbOLB0= Received: from BYAPR02CA0034.namprd02.prod.outlook.com (2603:10b6:a02:ee::47) by BN7PR02MB4113.namprd02.prod.outlook.com (2603:10b6:406:ff::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23; Wed, 20 Nov 2019 06:47:49 +0000 Received: from SN1NAM02FT051.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::208) by BYAPR02CA0034.outlook.office365.com (2603:10b6:a02:ee::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.29 via Frontend Transport; Wed, 20 Nov 2019 06:47:48 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT051.mail.protection.outlook.com (10.152.73.103) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2474.17 via Frontend Transport; Wed, 20 Nov 2019 06:47:48 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJmF-000618-KM; Tue, 19 Nov 2019 22:47:47 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1iXJmA-00049o-GS; Tue, 19 Nov 2019 22:47:42 -0800 Received: from xsj-pvapsmtp01 (mail.xilinx.com [149.199.38.66] (may be forged)) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id xAK6lcbT001813; Tue, 19 Nov 2019 22:47:38 -0800 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJm5-00049F-Mr; Tue, 19 Nov 2019 22:47:38 -0800 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id EA7DA12138F; Wed, 20 Nov 2019 12:17:35 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, adrian.hunter@intel.com, michal.simek@xilinx.com, jolly.shah@xilinx.com, rajan.vaja@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com Subject: [PATCH v6 5/8] mmc: sdhci-of-arasan: Add support to set clock phase delays for SD Date: Wed, 20 Nov 2019 12:17:26 +0530 Message-Id: <1574232449-13570-6-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> References: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(376002)(136003)(39860400002)(396003)(346002)(199004)(189003)(6266002)(70206006)(16586007)(42186006)(106002)(356004)(48376002)(50226002)(47776003)(36386004)(26005)(316002)(8676002)(51416003)(81156014)(81166006)(2906002)(8936002)(4326008)(50466002)(70586007)(6666004)(2616005)(476003)(486006)(426003)(11346002)(446003)(126002)(186003)(336012)(103686004)(44832011)(5660300002)(14444005)(305945005)(107886003)(76176011)(36756003)(478600001)(42866002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR02MB4113; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9a86418e-b2a8-4d8e-720c-08d76d858e5b X-MS-TrafficTypeDiagnostic: BN7PR02MB4113: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-Forefront-PRVS: 02272225C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B8AGlPq9Nh+rd9SwNEinMPx7iyZvXe4ZLuT9F92Cm9+0+YDTSgvwXbhPjQA0wW0JwUAXMx0mE4oFicV7byjHncCntuaDHvUzubz17z+HIgvpZKX1zL8dHRuSu/skKAGhVJ0i0x1qMX4YUIqTLqi9JgytoqXDenCk16GWjZgyY2N964FJdWA86IIWOx4yP8JPGLI73zCy3T/xm8pZqkOTWtxR7neSUwgQ0AKbM/N8Jsy6bRyt4XPA54FpaZKVz+IM5Qa/MbGPrpVgwe/B25k8nLELarC4nEUzP0dibZA6Qu3UX/DsHtrkMxR3qawYEVvH8Z4fu+Bqv+MGesSSlrhNUtSPLCpDGDx4WGDqpXC/OV2UxTuig0AIiI26WEk2s+oSg8h7PX2UB8XLrHlYSdJ1ZqDR66f8dTjE20QKkxUBmWDWxuvdY3hoB39muK0Ptkl5 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2019 06:47:48.0918 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9a86418e-b2a8-4d8e-720c-08d76d858e5b X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR02MB4113 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191119_224753_375999_8F6D51F1 X-CRM114-Status: GOOD ( 15.25 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.77.72 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, git@xilinx.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add support to read Clock Phase Delays from the DT and set it via clk_set_phase() API from clock framework. Some of the controllers might have their own handling of setting clock delays, for this keep the set_clk_delays as function pointer which can be assigned controller specific handling of the same. Signed-off-by: Manish Narani --- drivers/mmc/host/sdhci-of-arasan.c | 92 ++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index b75ba780f902..9452ae01f6fa 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -77,12 +77,18 @@ struct sdhci_arasan_soc_ctl_map { * @sdcardclk: Pointer to normal 'struct clock' for sdcardclk_hw. * @sampleclk_hw: Struct for the clock we might provide to a PHY. * @sampleclk: Pointer to normal 'struct clock' for sampleclk_hw. + * @clk_phase_in: Array of Input Clock Phase Delays for all speed modes + * @clk_phase_out: Array of Output Clock Phase Delays for all speed modes + * @set_clk_delays: Function pointer for setting Clock Delays */ struct sdhci_arasan_clk_data { struct clk_hw sdcardclk_hw; struct clk *sdcardclk; struct clk_hw sampleclk_hw; struct clk *sampleclk; + int clk_phase_in[MMC_TIMING_MMC_HS400 + 1]; + int clk_phase_out[MMC_TIMING_MMC_HS400 + 1]; + void (*set_clk_delays)(struct sdhci_host *host); }; /** @@ -186,6 +192,7 @@ static void sdhci_arasan_set_clock(struct sdhci_host *host, unsigned int clock) { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host); + struct sdhci_arasan_clk_data *clk_data = &sdhci_arasan->clk_data; bool ctrl_phy = false; if (!IS_ERR(sdhci_arasan->phy)) { @@ -227,6 +234,10 @@ static void sdhci_arasan_set_clock(struct sdhci_host *host, unsigned int clock) sdhci_arasan->is_phy_on = false; } + /* Set the Input and Output Clock Phase Delays */ + if (clk_data->set_clk_delays) + clk_data->set_clk_delays(host); + sdhci_set_clock(host, clock); if (sdhci_arasan->quirks & SDHCI_ARASAN_QUIRK_CLOCK_UNSTABLE) @@ -650,6 +661,85 @@ static void sdhci_arasan_update_baseclkfreq(struct sdhci_host *host) sdhci_arasan_syscon_write(host, &soc_ctl_map->baseclkfreq, mhz); } +static void sdhci_arasan_set_clk_delays(struct sdhci_host *host) +{ + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host); + struct sdhci_arasan_clk_data *clk_data = &sdhci_arasan->clk_data; + + clk_set_phase(clk_data->sampleclk, + clk_data->clk_phase_in[host->timing]); + clk_set_phase(clk_data->sdcardclk, + clk_data->clk_phase_out[host->timing]); +} + +static void arasan_dt_read_clk_phase(struct device *dev, + struct sdhci_arasan_clk_data *clk_data, + unsigned int timing, const char *prop) +{ + struct device_node *np = dev->of_node; + + int clk_phase[2] = {0}; + + /* + * Read Tap Delay values from DT, if the DT does not contain the + * Tap Values then use the pre-defined values. + */ + if (of_property_read_variable_u32_array(np, prop, &clk_phase[0], + 2, 0)) { + dev_dbg(dev, "Using predefined clock phase for %s = %d %d\n", + prop, clk_data->clk_phase_in[timing], + clk_data->clk_phase_out[timing]); + return; + } + + /* The values read are Input and Output Clock Delays in order */ + clk_data->clk_phase_in[timing] = clk_phase[0]; + clk_data->clk_phase_out[timing] = clk_phase[1]; +} + +/** + * arasan_dt_parse_clk_phases - Read Clock Delay values from DT + * + * Called at initialization to parse the values of Clock Delays. + * + * @dev: Pointer to our struct device. + * @clk_data: Pointer to the Clock Data structure + */ +static void arasan_dt_parse_clk_phases(struct device *dev, + struct sdhci_arasan_clk_data *clk_data) +{ + /* + * This has been kept as a pointer and is assigned a function here. + * So that different controller variants can assign their own handling + * function. + */ + clk_data->set_clk_delays = sdhci_arasan_set_clk_delays; + + arasan_dt_read_clk_phase(dev, clk_data, MMC_TIMING_LEGACY, + "clk-phase-legacy"); + arasan_dt_read_clk_phase(dev, clk_data, MMC_TIMING_MMC_HS, + "clk-phase-mmc-hs"); + arasan_dt_read_clk_phase(dev, clk_data, MMC_TIMING_SD_HS, + "clk-phase-sd-hs"); + arasan_dt_read_clk_phase(dev, clk_data, MMC_TIMING_UHS_SDR12, + "clk-phase-uhs-sdr12"); + arasan_dt_read_clk_phase(dev, clk_data, MMC_TIMING_UHS_SDR25, + "clk-phase-uhs-sdr25"); + arasan_dt_read_clk_phase(dev, clk_data, MMC_TIMING_UHS_SDR50, + "clk-phase-uhs-sdr50"); + arasan_dt_read_clk_phase(dev, clk_data, MMC_TIMING_UHS_SDR104, + "clk-phase-uhs-sdr104"); + arasan_dt_read_clk_phase(dev, clk_data, MMC_TIMING_UHS_DDR50, + "clk-phase-uhs-ddr50"); + arasan_dt_read_clk_phase(dev, clk_data, MMC_TIMING_MMC_DDR52, + "clk-phase-mmc-ddr52"); + arasan_dt_read_clk_phase(dev, clk_data, MMC_TIMING_MMC_HS200, + "clk-phase-mmc-hs200"); + arasan_dt_read_clk_phase(dev, clk_data, MMC_TIMING_MMC_HS400, + "clk-phase-mmc-hs400"); +} + /** * sdhci_arasan_register_sdcardclk - Register the sdcardclk for a PHY to use * @@ -942,6 +1032,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev) if (ret) goto clk_disable_all; + arasan_dt_parse_clk_phases(&pdev->dev, &sdhci_arasan->clk_data); + ret = mmc_of_parse(host->mmc); if (ret) { if (ret != -EPROBE_DEFER) From patchwork Wed Nov 20 06:47:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11253283 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E650A13A4 for ; Wed, 20 Nov 2019 06:48:51 +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 BD07920885 for ; Wed, 20 Nov 2019 06:48:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pMOnlLdc"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="XUBkPkum" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD07920885 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YgF4PrfcYDjiPY7Ayn4RZOuT2iGv8qLTGDAUraEVm68=; b=pMOnlLdcTTlzu5 zoyLuea5EZRbbhND0YvkHyYB9xUuZGalxwMZhlj50KRhV9OQRO75jdu++ArCx+/oT/a0lAhuyhld/ GfipeuZa3VwxjodFC6b9EaUHOzSs/SWxEQlUQ75Krt4WOW3tLcr/sJnnK1Ms7ITGjsEvyqZpOjHjH xOF1+mRdY/nYrNF73XvaNX1wvNai10YyuUyukeEeAxx2IxZjwLfFk36BAbHZajbNyDNFfhJqTQdAU 2xjQfoR8CeYhB4qlJGRlzLXiYCqCm/3BuiTedJsOIZk/47/U0ckgOc8CsVDIoqlRAzyocKAtACuu2 lLKbMuVK/Fra1QxgSkkA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJnF-000756-AV; Wed, 20 Nov 2019 06:48:49 +0000 Received: from mail-eopbgr740040.outbound.protection.outlook.com ([40.107.74.40] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJmK-0006Hb-HH for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2019 06:47:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W/9rEhswiD9zoJJkrjVmD5IpQan4w+zEatNLQg5EQYYvlye6fzoRPlsa7WF8TRqiW0QUaEyIKalp+iTaWfjeLP3jB5UbiDU9Kcrw+2WljRtgtncO+UqNMM9Ixow+0VKnw5yu+MqkSmPhbC4v5ITH/SEHUG9mY7Sls6iqTH3dqDi+A5or748QcedTCRTz3ocSGQsqmHE0l6kFodtECGKDfB9fyy+XuXlcFKiQ7PfoNbeI+n5Qh8QbFMbTSmfvLLmOM0dQ6v9XBC2F51gER1IOypWdTikSEl3R/ikpmJfIsBExhWF0Nrwzu4PeefkDdF6PpEcHIjyFfgXrVJeNzX0AfA== 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=Elx1S6x5O1qEFyNTFHBUXfMn9vSEuSXCQ8O8cIrSquA=; b=MqUbaEwQLajm2DXpv+0tmkx+jQJTbW3XjlkNtlS9rgeE2LX8yA3btvZfoaZUHpjjtxNj5WxW3z4lXhmjoZ3KOfBF8lGn2jBvj/tC6XCZ4CP7FmYC1IQ7vItME4N8HGmun0EKVBLeNAMkc7GqhiZmC418EIBd6hTVoXwN7dAe3EZnpMzMuJG3QA7kMVBxdiMoAqH/bP0vyzVQ1ShVg8Usy+O/MtKEywa2/GFJdeKBAvE4pDfRsIiqDC6FaKNRNYLtaiHnAGFCGrUJk8z/WwDePWDIPyUc7gg1slOTuf2wdgVRdcfDTP21RO+ZyVqxWOCcQR0c1g0euYwi/0y3ALPTmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Elx1S6x5O1qEFyNTFHBUXfMn9vSEuSXCQ8O8cIrSquA=; b=XUBkPkumJU7JikuAtYQTujlYUmusn/8TAc6S4XwVQ1RLEdZNsBt99yKIIAS/VSnovyL6nYWQ5/iTUaWzlQLWMWSeOsDyc6vKxdpUM/Gt4kQwV8klwg2Dy7V64K/nqGgHimFB8S9nSiPpg2LL9ICfUt7bB6WI6o1avpZJy9lrbQU= Received: from DM6PR02CA0137.namprd02.prod.outlook.com (2603:10b6:5:1b4::39) by DM6PR02MB5019.namprd02.prod.outlook.com (2603:10b6:5:4b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23; Wed, 20 Nov 2019 06:47:48 +0000 Received: from BL2NAM02FT028.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::208) by DM6PR02CA0137.outlook.office365.com (2603:10b6:5:1b4::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16 via Frontend Transport; Wed, 20 Nov 2019 06:47:48 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT028.mail.protection.outlook.com (10.152.77.165) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2474.17 via Frontend Transport; Wed, 20 Nov 2019 06:47:48 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJmF-00061B-P6; Tue, 19 Nov 2019 22:47:47 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1iXJmA-00049o-LQ; Tue, 19 Nov 2019 22:47:42 -0800 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id xAK6lbph001809; Tue, 19 Nov 2019 22:47:38 -0800 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJm5-00049E-Mp; Tue, 19 Nov 2019 22:47:37 -0800 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id F01B7121390; Wed, 20 Nov 2019 12:17:35 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, adrian.hunter@intel.com, michal.simek@xilinx.com, jolly.shah@xilinx.com, rajan.vaja@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com Subject: [PATCH v6 6/8] firmware: xilinx: Add SDIO Tap Delay nodes Date: Wed, 20 Nov 2019 12:17:27 +0530 Message-Id: <1574232449-13570-7-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> References: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(346002)(396003)(39860400002)(376002)(189003)(199004)(106002)(316002)(16586007)(42186006)(4326008)(47776003)(103686004)(478600001)(36756003)(36386004)(48376002)(50466002)(107886003)(6266002)(305945005)(4744005)(2906002)(50226002)(8936002)(8676002)(81166006)(81156014)(26005)(51416003)(356004)(6666004)(2616005)(486006)(126002)(476003)(44832011)(186003)(11346002)(446003)(426003)(336012)(70206006)(76176011)(70586007)(5660300002)(14444005)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB5019; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 43470f5e-08cc-4f1b-b1f0-08d76d858e88 X-MS-TrafficTypeDiagnostic: DM6PR02MB5019: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:580; X-Forefront-PRVS: 02272225C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0kaHxiVXQnX/iJ3BQf8bvg4wW1fp3zIWGRLcIVUq84l8tMs4PtTrkw2Ui95xg1e+1Goy4VUDX5gP5XnwKsS4CFSzSEU/hSL8ugWXrxx7CL+efSxeWXK3I4SO8Qpj0M0tqjltOSPp8hVBgavRyPy+baLSosNDetvvJ8bhrHTT8WBQTGvY1s3rL7EcX2AZ0moIdtcoqPoXBfcqGdJ8UD5K5MBaTzXWNGFZ7sPXDdEJjO3AG5izK115ahpg/xpYnVyqCQwZtHpafkHRzHo/ls0/mmrTQ4/zH13uoKsi/gEX7fFmieHlat+FzTkRRvx3a6oN5/z5a555by7M6B4keByUYn4S7SeCoMzGW7pxBLI432K0BWbTb5tIY2Yybgr48PF8GeUCr83LIjnZnwyjHsjk13S7/X89bpYsrl34QwfQZvW49at0KjKtH5DZg/gZ3roR X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2019 06:47:48.3854 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 43470f5e-08cc-4f1b-b1f0-08d76d858e88 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB5019 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191119_224752_571443_C88C315E X-CRM114-Status: UNSURE ( 9.87 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.74.40 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, git@xilinx.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add tap delay nodes for setting SDIO Tap Delays on ZynqMP platform. Signed-off-by: Manish Narani --- include/linux/firmware/xlnx-zynqmp.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 778abbbc7d94..df366f1a4cb4 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -91,7 +91,8 @@ enum pm_ret_status { }; enum pm_ioctl_id { - IOCTL_SET_PLL_FRAC_MODE = 8, + IOCTL_SET_SD_TAPDELAY = 7, + IOCTL_SET_PLL_FRAC_MODE, IOCTL_GET_PLL_FRAC_MODE, IOCTL_SET_PLL_FRAC_DATA, IOCTL_GET_PLL_FRAC_DATA, @@ -250,6 +251,16 @@ enum zynqmp_pm_request_ack { ZYNQMP_PM_REQUEST_ACK_NON_BLOCKING, }; +enum pm_node_id { + NODE_SD_0 = 39, + NODE_SD_1, +}; + +enum tap_delay_type { + PM_TAPDELAY_INPUT = 0, + PM_TAPDELAY_OUTPUT, +}; + /** * struct zynqmp_pm_query_data - PM query data * @qid: query ID From patchwork Wed Nov 20 06:47:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11253265 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C13876C1 for ; Wed, 20 Nov 2019 06:48:15 +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 411EA21850 for ; Wed, 20 Nov 2019 06:48:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FzD0UTWO"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="Pnxi1hMS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 411EA21850 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UuQE92HylkRsV/5yVHetgiHdQytNSavJptBGK0CfZnU=; b=FzD0UTWOplABnD Pxgq/D4NqaZHdHMH7e5dyR0FJ0k3WERmL8IDf+QKhh+SNXQK8IgrmsG6vCXSnF4ENp2R5kn0yGvqm XE2H4pnrmBVPmHEBCOptxYdfAaFsz75lHVbb6X1Veg8MklBLvDKRHAC/3i3Zl+eiVQT9z7S2pEa11 GZsXjuHzBshIACobST5mVplr2aAqsoOlrDFqagYtHqGqVRE5ffXW9yzQ8CLN9dk+So6zBaEJDI7ZR T/Z6oCMv0f+lU4gxxyjsVSkQAcXKpDLwv/5drRFZMR7NDJRxJUN1LvOQ5ByXhfnL/MMZyNzSNAISz irmAUySzBFYnmWi2sPWg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJma-0006TK-F6; Wed, 20 Nov 2019 06:48:08 +0000 Received: from mail-eopbgr790047.outbound.protection.outlook.com ([40.107.79.47] helo=NAM03-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJmK-0006Ha-92 for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2019 06:47:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XKzlk3ccR/peHoLz6gW2gfC7yqBErm/lp5jZh0BM27AWq72weAyiuOAp1yajbYLGct+hqzeDuAzZt+j5T0n6beUo+tbM05trYcb69r7fFWZI4DN3oVzaIt+NMFhmnubms3HoAeGXC7MEr80oOUfb3LPsxzsQatPoLPy3cC053Un1QX6PBjH8fmgV+PFXJNnjlPdc31R6HTjDVWy5yv2bFRJvAkxpLm0VaCYb5QgYrF5iI083g43ua238uTiD5MyY+7gNldKCDsccOHj/WACJMCyj1b6eFs/lTuB+kZ8J2aNEQwA1Z5xLXQbYnDDAhRx9XNJVZuSYSMseYH+vucQysw== 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=GDLegMrhDggUgyFbZeHP6TBfYFHxtOMb3XgoN+5eRL0=; b=HTRGdQELXnJm+kbuhQcfOGsKRP+0kObuOy/jDzTLH4LcwbHkY3mlaQBQXlZ3x+VpIVhUWRg2VF/0Bk54IWVeVRpMfB/GkshX4nXR2o6hjcF4QMOzMdOxmv9/+S9l5To+rMhCHPN6pLE8myAmD48JViL5LB0v3WLKmATKSNL8RBpS7Ov1q5kcx4f6EI6+dgrHRLdzIZtho2XoVylCMHHGgGLzdEd+MNdTkb7n9jXAbIJp0jkydhw5SqGq3lLp8oxOM0Q7K48D0ous6sKiFGnEfY87DGTdOC2ZeZcYTl1iIaVdXHVgFqaRHZeNYaEcdNxvTFhuxDtaE2o95sKd7PWfHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GDLegMrhDggUgyFbZeHP6TBfYFHxtOMb3XgoN+5eRL0=; b=Pnxi1hMSvCajZoYlWzgS2Xa0lLkSOA3qy9b0Pi2xQDKvK/BdKr00HKCHrQFnPNCTvkMt8NjQao6mA5rk5cS/hH/sWJFK+/NoNwr/6huFmcObVrkzGf8z5IXa/SU/E1grHayUGRLR9GIJi2/3pP9hF6NOMX+Gj23N9K7ofxGG3N8= Received: from BL0PR02CA0074.namprd02.prod.outlook.com (2603:10b6:208:51::15) by BN6PR02MB2802.namprd02.prod.outlook.com (2603:10b6:404:fd::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.28; Wed, 20 Nov 2019 06:47:48 +0000 Received: from CY1NAM02FT028.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::205) by BL0PR02CA0074.outlook.office365.com (2603:10b6:208:51::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16 via Frontend Transport; Wed, 20 Nov 2019 06:47:48 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT028.mail.protection.outlook.com (10.152.75.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2474.17 via Frontend Transport; Wed, 20 Nov 2019 06:47:48 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJmF-000619-Lb; Tue, 19 Nov 2019 22:47:47 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1iXJmA-00049o-I9; Tue, 19 Nov 2019 22:47:42 -0800 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id xAK6lbBg001807; Tue, 19 Nov 2019 22:47:38 -0800 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJm5-00049G-Mr; Tue, 19 Nov 2019 22:47:37 -0800 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 0170D12139A; Wed, 20 Nov 2019 12:17:35 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, adrian.hunter@intel.com, michal.simek@xilinx.com, jolly.shah@xilinx.com, rajan.vaja@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com Subject: [PATCH v6 7/8] dt-bindings: mmc: arasan: Document 'xlnx, zynqmp-8.9a' controller Date: Wed, 20 Nov 2019 12:17:28 +0530 Message-Id: <1574232449-13570-8-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> References: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(376002)(39860400002)(136003)(346002)(396003)(189003)(199004)(36386004)(48376002)(47776003)(476003)(50466002)(6266002)(107886003)(2616005)(6666004)(356004)(446003)(426003)(11346002)(336012)(106002)(70206006)(26005)(8676002)(50226002)(186003)(70586007)(51416003)(81156014)(81166006)(76176011)(8936002)(2906002)(478600001)(305945005)(5660300002)(126002)(316002)(4326008)(44832011)(486006)(16586007)(103686004)(36756003)(42186006)(921003)(142933001)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR02MB2802; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9224fe54-a85d-4d7e-6444-08d76d858e5f X-MS-TrafficTypeDiagnostic: BN6PR02MB2802: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 02272225C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jSESfp3vp4nwXOBXS4w1zRkWtsJFVUGmEV67VioL8BnowVufoRP/8/KmuH2TG2bS6n10pCGJP2KopHVNLUXfIlQOzWz9RSvXL+g6PJVNV+WlgIgaBBh04RitdVworiLC0rHstwaT6yS88hU1ip4Y8czxVlsVPe4b870CZN3SdMkfOJREThuEscKZ640rJmn7oIw2kGZg0b+O7LLeVknD0DfpRqUABXYWR82B7KVifzDmPfOKLzscz8feaYqDOBfNuDjBX/bkcciQFJnjBrcdJoGl2BbbG7j2cwfI3l9YjP5g42TrkEvV3UweDVSleQfQdsFqfGE9l2Ipwwg1ThLo7eHDz6P68FFxQYdUi0zVZNPUCW6gvhx9nFBesXsEpq6So16hvEHUH3l7YQJf8UkguRFFsQjGl7vTuTNrkg2JHMoxPDb5haCDM4cO+Ep1hgcz X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2019 06:47:48.1617 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9224fe54-a85d-4d7e-6444-08d76d858e5f X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB2802 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191119_224752_314598_F7C30F5A X-CRM114-Status: GOOD ( 10.80 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.79.47 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, git@xilinx.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add documentation for 'xlnx,zynqmp-8.9a' SDHCI controller and optional properties followed by example. Signed-off-by: Manish Narani Reviewed-by: Rob Herring --- .../devicetree/bindings/mmc/arasan,sdhci.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt index b51e40b2e0c5..5ad804a870e4 100644 --- a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt +++ b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt @@ -15,6 +15,9 @@ Required Properties: - "arasan,sdhci-5.1": generic Arasan SDHCI 5.1 PHY - "rockchip,rk3399-sdhci-5.1", "arasan,sdhci-5.1": rk3399 eMMC PHY For this device it is strongly suggested to include arasan,soc-ctl-syscon. + - "xlnx,zynqmp-8.9a": ZynqMP SDHCI 8.9a PHY + For this device it is strongly suggested to include clock-output-names and + #clock-cells. - "ti,am654-sdhci-5.1", "arasan,sdhci-5.1": TI AM654 MMC PHY Note: This binding has been deprecated and moved to [5]. - "intel,lgm-sdhci-5.1-emmc", "arasan,sdhci-5.1": Intel LGM eMMC PHY @@ -47,6 +50,10 @@ Optional Properties: - xlnx,int-clock-stable-broken: when present, the controller always reports that the internal clock is stable even when it is not. + - xlnx,mio-bank: When specified, this will indicate the MIO bank number in + which the command and data lines are configured. If not specified, driver + will assume this as 0. + Example: sdhci@e0100000 { compatible = "arasan,sdhci-8.9a"; @@ -83,6 +90,18 @@ Example: #clock-cells = <0>; }; + sdhci: mmc@ff160000 { + compatible = "xlnx,zynqmp-8.9a", "arasan,sdhci-8.9a"; + interrupt-parent = <&gic>; + interrupts = <0 48 4>; + reg = <0x0 0xff160000 0x0 0x1000>; + clocks = <&clk200>, <&clk200>; + clock-names = "clk_xin", "clk_ahb"; + clock-output-names = "clk_out_sd0", "clk_in_sd0"; + #clock-cells = <1>; + clk-phase-sd-hs = <63>, <72>; + }; + emmc: sdhci@ec700000 { compatible = "intel,lgm-sdhci-5.1-emmc", "arasan,sdhci-5.1"; reg = <0xec700000 0x300>; From patchwork Wed Nov 20 06:47:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11253291 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EBEF313A4 for ; Wed, 20 Nov 2019 06:49:54 +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 BB3E5206CB for ; Wed, 20 Nov 2019 06:49:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NMYQxJWl"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="mfqXkWFU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB3E5206CB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lcDfgFayfwiRQ+OXf+olK4BEudWXfrHnEdQIPsWEIew=; b=NMYQxJWl4bw8hI Qgtq1/LoPK/1cWfiyomAx2xNrsWch4d+S5gCtVTBoBknHSj4GOVH+4AZa40PKgibLyedpGQ1/6QlY mErHX9FXhnUoUPF/q1fApw1UwfPVKjgW7hWnMQ/eL++Hdk6o7OEPO4PMEM5A6gNhnm95Yg9KCWWVl 4T6b/90L8T8RFkZ6vT+G5hg2sS1zjr5YQ9Brs8N+wCCpMkCcZpsKUhxiUluFDOsfFPDAb8J/tutH/ cY5VhgXwpstIWQtdVltLV/s82lG6gydv1mDNAbRh8L7d1AuAenUbRNSxQIlbai4A2+QXwofPJ62rb xRLFqJxwXs0voCOwDRCA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJo9-00083R-VY; Wed, 20 Nov 2019 06:49:46 +0000 Received: from mail-eopbgr690063.outbound.protection.outlook.com ([40.107.69.63] helo=NAM04-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXJmK-0006I6-V6 for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2019 06:47:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i+AHyAF+ATlFqtREe7BE4TZgdt/9ZydD6AfZUgE75OIIDlblI60VWrMBmTpAkaL5o/KpRuGjOQ2IrI7a/neqA6wpusflAewW449twQXLj7Wm9bcwt+P4C8Eqdc67kNrIAnLefwRB8HQDI5B7nvl6+VjsL6hJ0bOvpr2cL/yhnyR3c+lSX+m7l3yxuN608vtbjYus64LGkT1wzAR8zZ1hfdpGV6x+DVaIbFCU26fOBQUo7Z79t7S9K1OVCJJLWHrK8OvvbTYOaIHKFb+1vWXqAT2erVNWqbCkWNCUItWESkG7+ulLrsgeKl+dnSativh84U6yHa8Nn61Hi19j6yuK3Q== 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=QyNuoP16Z/YOfgx2/n//zWRR2NSkAP2xIdiXXSSl73g=; b=UK8Her28SLPqdHukYAOOc7T/G1GefFuclmlTiaG3Gaff8552Jaq+Jpt0O8DbSeU0lsl+ch7t3bsxklAEto1cV3wg+GVoZqXw/iBpTOjzpF3zYI3Qmlba49DoMzj7Koa5EheYjrH2mvjaqDUZ50hyFBFGSE6c95ZOCwIXybBMBGZKlejZHFG2LaJA++CGyKy+HEOmRUGQVyJfWRX4g3JC4OFZ7z0287LXJVeMF0m6yWV2Zwni0ig5DzQrNDBIyy8oNStFqUkdjOW1NrWv68Ag92rmdvU83XR6ElW/SmkxyBbpU55iY7NtxO3WetoVtoiqEiXGn36Tgv2rLWX+Psdn8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QyNuoP16Z/YOfgx2/n//zWRR2NSkAP2xIdiXXSSl73g=; b=mfqXkWFUWrYjPwGxHvSXM3J1xJALNJWd63dug2Gy0Zqwo1/BzFpPphke2JIu9AXh8AmbsXP59wPTpSz63bd294NpkF8RAFmjAjg/CPgyLuInpS3HxNmI7FQKULmCAmYsfBOWFalWDmGUrc4PPhvNdsy4J/ycfmD8pTA4IIg4+18= Received: from MWHPR02CA0020.namprd02.prod.outlook.com (2603:10b6:300:4b::30) by SN1PR02MB3728.namprd02.prod.outlook.com (2603:10b6:802:31::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17; Wed, 20 Nov 2019 06:47:49 +0000 Received: from BL2NAM02FT023.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::206) by MWHPR02CA0020.outlook.office365.com (2603:10b6:300:4b::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16 via Frontend Transport; Wed, 20 Nov 2019 06:47:48 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT023.mail.protection.outlook.com (10.152.77.72) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2474.17 via Frontend Transport; Wed, 20 Nov 2019 06:47:48 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJmF-000617-Gl; Tue, 19 Nov 2019 22:47:47 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1iXJmA-00049o-Cz; Tue, 19 Nov 2019 22:47:42 -0800 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id xAK6lcI3027301; Tue, 19 Nov 2019 22:47:38 -0800 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1iXJm5-00049H-Ms; Tue, 19 Nov 2019 22:47:38 -0800 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 07A871213B9; Wed, 20 Nov 2019 12:17:36 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, adrian.hunter@intel.com, michal.simek@xilinx.com, jolly.shah@xilinx.com, rajan.vaja@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com Subject: [PATCH v6 8/8] mmc: sdhci-of-arasan: Add support for ZynqMP Platform Tap Delays Setup Date: Wed, 20 Nov 2019 12:17:29 +0530 Message-Id: <1574232449-13570-9-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> References: <1574232449-13570-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(376002)(39860400002)(346002)(189003)(199004)(4326008)(305945005)(47776003)(186003)(2906002)(16586007)(50466002)(356004)(6666004)(103686004)(36756003)(107886003)(26005)(76176011)(106002)(36386004)(51416003)(478600001)(5660300002)(6266002)(2616005)(70586007)(44832011)(316002)(8936002)(48376002)(126002)(8676002)(426003)(336012)(81166006)(81156014)(476003)(446003)(14444005)(50226002)(42186006)(70206006)(11346002)(486006)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR02MB3728; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 579d7846-83f9-408b-7736-08d76d858e6e X-MS-TrafficTypeDiagnostic: SN1PR02MB3728: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-Forefront-PRVS: 02272225C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: otfsrFK/BabQFj8Ne5TqOB0hedgWzJGmSirxquQPqMLg78gQ5bG4yxzeSiTKeVrT5mndPgCoUsz/RmaB5g7jGj23sXqZ3OJZ8DuigD8Ea/ropW7mB+pKlRXOIfElaCfYkVD32Yu/WLrvIhlDEwqgQrQ4YpVT10QjozpoqDXRkprpJ65JXAvY2IXfqb9j7oq4ans+7zWeUylrzLtZUbyFzVujBOoTtZFCNorAS6jHHyA4z9xEkUrQNndLj1Ty8fkmjt29/le+aXnLrQSTs+UqfahOvpuiPiLSqAkY4lZ6CElmgFtNe0Xp8FcAoD/Xkjr8U/rSRmaTN/ot3fIMA0I77YLvj7/T58Onpqz88gykSvgyFwExUVldpAyGRYdZ6otmfHkq/MRt/WOIqWhHh2u5UWabMA7a9G102nJhvXT0mxh5DfOJZA2aLvBuVkewKCMZ X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2019 06:47:48.0794 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 579d7846-83f9-408b-7736-08d76d858e6e X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR02MB3728 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191119_224753_065274_32C8EB20 X-CRM114-Status: GOOD ( 19.84 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.69.63 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, git@xilinx.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Apart from taps set by auto tuning, ZynqMP platform has feature to set the tap values manually. Add support to set tap delay values in HW via ZynqMP SoC framework. Signed-off-by: Manish Narani --- drivers/mmc/host/sdhci-of-arasan.c | 206 ++++++++++++++++++++++++++++- 1 file changed, 204 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index 9452ae01f6fa..228dbeef74a8 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "cqhci.h" #include "sdhci-pltfm.h" @@ -32,6 +33,10 @@ #define PHY_CLK_TOO_SLOW_HZ 400000 +/* Default settings for ZynqMP Clock Phases */ +#define ZYNQMP_ICLK_PHASE {0, 63, 63, 0, 63, 0, 0, 183, 54, 0, 0} +#define ZYNQMP_OCLK_PHASE {0, 72, 60, 0, 60, 72, 135, 48, 72, 135, 0} + /* * On some SoCs the syscon area has a feature where the upper 16-bits of * each 32-bit register act as a write mask for the lower 16-bits. This allows @@ -80,6 +85,7 @@ struct sdhci_arasan_soc_ctl_map { * @clk_phase_in: Array of Input Clock Phase Delays for all speed modes * @clk_phase_out: Array of Output Clock Phase Delays for all speed modes * @set_clk_delays: Function pointer for setting Clock Delays + * @clk_of_data: Platform specific runtime clock data storage pointer */ struct sdhci_arasan_clk_data { struct clk_hw sdcardclk_hw; @@ -89,6 +95,11 @@ struct sdhci_arasan_clk_data { int clk_phase_in[MMC_TIMING_MMC_HS400 + 1]; int clk_phase_out[MMC_TIMING_MMC_HS400 + 1]; void (*set_clk_delays)(struct sdhci_host *host); + void *clk_of_data; +}; + +struct sdhci_arasan_zynqmp_clk_data { + const struct zynqmp_eemi_ops *eemi_ops; }; /** @@ -525,6 +536,10 @@ static const struct of_device_id sdhci_arasan_of_match[] = { .compatible = "arasan,sdhci-4.9a", .data = &sdhci_arasan_data, }, + { + .compatible = "xlnx,zynqmp-8.9a", + .data = &sdhci_arasan_data, + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, sdhci_arasan_of_match); @@ -583,6 +598,150 @@ static const struct clk_ops arasan_sampleclk_ops = { .recalc_rate = sdhci_arasan_sampleclk_recalc_rate, }; +/** + * sdhci_zynqmp_sdcardclk_set_phase - Set the SD Output Clock Tap Delays + * + * Set the SD Output Clock Tap Delays for Output path + * + * @hw: Pointer to the hardware clock structure. + * @degrees The clock phase shift between 0 - 359. + * Return: 0 on success and error value on error + */ +static int sdhci_zynqmp_sdcardclk_set_phase(struct clk_hw *hw, int degrees) + +{ + struct sdhci_arasan_clk_data *clk_data = + container_of(hw, struct sdhci_arasan_clk_data, sdcardclk_hw); + struct sdhci_arasan_data *sdhci_arasan = + container_of(clk_data, struct sdhci_arasan_data, clk_data); + struct sdhci_host *host = sdhci_arasan->host; + struct sdhci_arasan_zynqmp_clk_data *zynqmp_clk_data = + clk_data->clk_of_data; + const struct zynqmp_eemi_ops *eemi_ops = zynqmp_clk_data->eemi_ops; + const char *clk_name = clk_hw_get_name(hw); + u32 node_id = !strcmp(clk_name, "clk_out_sd0") ? NODE_SD_0 : NODE_SD_1; + u8 tap_delay, tap_max = 0; + int ret; + + /* + * This is applicable for SDHCI_SPEC_300 and above + * ZynqMP does not set phase for <=25MHz clock. + * If degrees is zero, no need to do anything. + */ + if (host->version < SDHCI_SPEC_300 || + host->timing == MMC_TIMING_LEGACY || + host->timing == MMC_TIMING_UHS_SDR12 || !degrees) + return 0; + + switch (host->timing) { + case MMC_TIMING_MMC_HS: + case MMC_TIMING_SD_HS: + case MMC_TIMING_UHS_SDR25: + case MMC_TIMING_UHS_DDR50: + case MMC_TIMING_MMC_DDR52: + /* For 50MHz clock, 30 Taps are available */ + tap_max = 30; + break; + case MMC_TIMING_UHS_SDR50: + /* For 100MHz clock, 15 Taps are available */ + tap_max = 15; + break; + case MMC_TIMING_UHS_SDR104: + case MMC_TIMING_MMC_HS200: + /* For 200MHz clock, 8 Taps are available */ + tap_max = 8; + default: + break; + } + + tap_delay = (degrees * tap_max) / 360; + + /* Set the Clock Phase */ + ret = eemi_ops->ioctl(node_id, IOCTL_SET_SD_TAPDELAY, + PM_TAPDELAY_OUTPUT, tap_delay, NULL); + if (ret) + pr_err("Error setting Output Tap Delay\n"); + + return ret; +} + +static const struct clk_ops zynqmp_sdcardclk_ops = { + .recalc_rate = sdhci_arasan_sdcardclk_recalc_rate, + .set_phase = sdhci_zynqmp_sdcardclk_set_phase, +}; + +/** + * sdhci_zynqmp_sampleclk_set_phase - Set the SD Input Clock Tap Delays + * + * Set the SD Input Clock Tap Delays for Input path + * + * @hw: Pointer to the hardware clock structure. + * @degrees The clock phase shift between 0 - 359. + * Return: 0 on success and error value on error + */ +static int sdhci_zynqmp_sampleclk_set_phase(struct clk_hw *hw, int degrees) + +{ + struct sdhci_arasan_clk_data *clk_data = + container_of(hw, struct sdhci_arasan_clk_data, sampleclk_hw); + struct sdhci_arasan_data *sdhci_arasan = + container_of(clk_data, struct sdhci_arasan_data, clk_data); + struct sdhci_host *host = sdhci_arasan->host; + struct sdhci_arasan_zynqmp_clk_data *zynqmp_clk_data = + clk_data->clk_of_data; + const struct zynqmp_eemi_ops *eemi_ops = zynqmp_clk_data->eemi_ops; + const char *clk_name = clk_hw_get_name(hw); + u32 node_id = !strcmp(clk_name, "clk_in_sd0") ? NODE_SD_0 : NODE_SD_1; + u8 tap_delay, tap_max = 0; + int ret; + + /* + * This is applicable for SDHCI_SPEC_300 and above + * ZynqMP does not set phase for <=25MHz clock. + * If degrees is zero, no need to do anything. + */ + if (host->version < SDHCI_SPEC_300 || + host->timing == MMC_TIMING_LEGACY || + host->timing == MMC_TIMING_UHS_SDR12 || !degrees) + return 0; + + switch (host->timing) { + case MMC_TIMING_MMC_HS: + case MMC_TIMING_SD_HS: + case MMC_TIMING_UHS_SDR25: + case MMC_TIMING_UHS_DDR50: + case MMC_TIMING_MMC_DDR52: + /* For 50MHz clock, 120 Taps are available */ + tap_max = 120; + break; + case MMC_TIMING_UHS_SDR50: + /* For 100MHz clock, 60 Taps are available */ + tap_max = 60; + break; + case MMC_TIMING_UHS_SDR104: + case MMC_TIMING_MMC_HS200: + /* For 200MHz clock, 30 Taps are available */ + tap_max = 30; + default: + break; + } + + tap_delay = (degrees * tap_max) / 360; + + /* Set the Clock Phase */ + ret = eemi_ops->ioctl(node_id, IOCTL_SET_SD_TAPDELAY, + PM_TAPDELAY_INPUT, tap_delay, NULL); + if (ret) + pr_err("Error setting Input Tap Delay\n"); + + return ret; +} + +static const struct clk_ops zynqmp_sampleclk_ops = { + .recalc_rate = sdhci_arasan_sampleclk_recalc_rate, + .set_phase = sdhci_zynqmp_sampleclk_set_phase, +}; + /** * sdhci_arasan_update_clockmultiplier - Set corecfg_clockmultiplier * @@ -709,6 +868,10 @@ static void arasan_dt_read_clk_phase(struct device *dev, static void arasan_dt_parse_clk_phases(struct device *dev, struct sdhci_arasan_clk_data *clk_data) { + int *iclk_phase, *oclk_phase; + u32 mio_bank = 0; + int i; + /* * This has been kept as a pointer and is assigned a function here. * So that different controller variants can assign their own handling @@ -716,6 +879,22 @@ static void arasan_dt_parse_clk_phases(struct device *dev, */ clk_data->set_clk_delays = sdhci_arasan_set_clk_delays; + if (of_device_is_compatible(dev->of_node, "xlnx,zynqmp-8.9a")) { + iclk_phase = (int [MMC_TIMING_MMC_HS400 + 1]) ZYNQMP_ICLK_PHASE; + oclk_phase = (int [MMC_TIMING_MMC_HS400 + 1]) ZYNQMP_OCLK_PHASE; + + of_property_read_u32(dev->of_node, "xlnx,mio-bank", &mio_bank); + if (mio_bank == 2) { + oclk_phase[MMC_TIMING_UHS_SDR104] = 90; + oclk_phase[MMC_TIMING_MMC_HS200] = 90; + } + + for (i = 0; i <= MMC_TIMING_MMC_HS400; i++) { + clk_data->clk_phase_in[i] = iclk_phase[i]; + clk_data->clk_phase_out[i] = oclk_phase[i]; + } + } + arasan_dt_read_clk_phase(dev, clk_data, MMC_TIMING_LEGACY, "clk-phase-legacy"); arasan_dt_read_clk_phase(dev, clk_data, MMC_TIMING_MMC_HS, @@ -774,7 +953,10 @@ sdhci_arasan_register_sdcardclk(struct sdhci_arasan_data *sdhci_arasan, sdcardclk_init.parent_names = &parent_clk_name; sdcardclk_init.num_parents = 1; sdcardclk_init.flags = CLK_GET_RATE_NOCACHE; - sdcardclk_init.ops = &arasan_sdcardclk_ops; + if (of_device_is_compatible(np, "xlnx,zynqmp-8.9a")) + sdcardclk_init.ops = &zynqmp_sdcardclk_ops; + else + sdcardclk_init.ops = &arasan_sdcardclk_ops; clk_data->sdcardclk_hw.init = &sdcardclk_init; clk_data->sdcardclk = @@ -823,7 +1005,10 @@ sdhci_arasan_register_sampleclk(struct sdhci_arasan_data *sdhci_arasan, sampleclk_init.parent_names = &parent_clk_name; sampleclk_init.num_parents = 1; sampleclk_init.flags = CLK_GET_RATE_NOCACHE; - sampleclk_init.ops = &arasan_sampleclk_ops; + if (of_device_is_compatible(np, "xlnx,zynqmp-8.9a")) + sampleclk_init.ops = &zynqmp_sampleclk_ops; + else + sampleclk_init.ops = &arasan_sampleclk_ops; clk_data->sampleclk_hw.init = &sampleclk_init; clk_data->sampleclk = @@ -1032,6 +1217,23 @@ static int sdhci_arasan_probe(struct platform_device *pdev) if (ret) goto clk_disable_all; + if (of_device_is_compatible(np, "xlnx,zynqmp-8.9a")) { + struct sdhci_arasan_zynqmp_clk_data *zynqmp_clk_data; + const struct zynqmp_eemi_ops *eemi_ops; + + zynqmp_clk_data = devm_kzalloc(&pdev->dev, + sizeof(*zynqmp_clk_data), + GFP_KERNEL); + eemi_ops = zynqmp_pm_get_eemi_ops(); + if (IS_ERR(eemi_ops)) { + ret = PTR_ERR(eemi_ops); + goto unreg_clk; + } + + zynqmp_clk_data->eemi_ops = eemi_ops; + sdhci_arasan->clk_data.clk_of_data = zynqmp_clk_data; + } + arasan_dt_parse_clk_phases(&pdev->dev, &sdhci_arasan->clk_data); ret = mmc_of_parse(host->mmc);