From patchwork Mon Jul 1 05:29:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11024915 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 711C0138B for ; Mon, 1 Jul 2019 05:34:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58E2F27B2F for ; Mon, 1 Jul 2019 05:34:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C459284ED; Mon, 1 Jul 2019 05:34:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EB9AB27B2F for ; Mon, 1 Jul 2019 05:34:46 +0000 (UTC) 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=EF0VdnfAeVR5EN6yVzaYFqYJpjF3VfKf+10Ekp8nbS0=; b=PgBM7M0NZ70No0 6US89sk09Ofke2GnvzMUBfNDi51fy/ThOVTtPub9ANZUmbnZc1kBYiyQQej9hfVm80YAPxF6LkVkF +57Eq6mbPbkOfl6hvrDuQ8PwKLkqVmMpQXj6W3De7OeNiMnuZnvqa/VohpEOPrepZVEqyGWfwZK5a O3YDkRfV7biMkbimlicRtGlyqtxrtnNzD/feNyGc4ygR6baEcio2Wix4cHlLzhLLkC65gt/SmCaa6 WEUNVGp1c7eBWFl9hdL3/wVk4fh+k4ynpVoST9TNmndkvdwzeZAIF8PwO3NsS7dEQHJl+ts6tQ2M5 dWwOzQRCmlYzOe5aFhUw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hhoxf-0002cI-Oz; Mon, 01 Jul 2019 05:34:43 +0000 Received: from mail-eopbgr750082.outbound.protection.outlook.com ([40.107.75.82] helo=NAM02-BL2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hhotH-0007LI-QI; Mon, 01 Jul 2019 05:30:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zzct6bKh5mu5ko5l0RipudqTl9PS5JVBajCtMm5Phyo=; b=wb/gacZMP83r/ei1gXLlwJCimiDRYlF/p5dGMv5uptBHyHsmR6in7nT4m2YdRA6GJ8X09Es4aPSd+LT+Kr5h61nqOotQQIbAhTaKbLuhJuTSkBzz2+eSa/x+BeeUG/ApX2YeoPXSHB2QIscKylmIsnM28yzJBM580rqoBgKqdBM= Received: from BN6PR02CA0087.namprd02.prod.outlook.com (10.161.158.28) by DM6PR02MB5242.namprd02.prod.outlook.com (20.176.116.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Mon, 1 Jul 2019 05:30:08 +0000 Received: from SN1NAM02FT061.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::202) by BN6PR02CA0087.outlook.office365.com (2603:10b6:405:60::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2032.17 via Frontend Transport; Mon, 1 Jul 2019 05:30:08 +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 SN1NAM02FT061.mail.protection.outlook.com (10.152.72.196) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2032.15 via Frontend Transport; Mon, 1 Jul 2019 05:30:07 +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 1hhotC-0002rw-OJ; Sun, 30 Jun 2019 22:30:06 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1hhot7-0003EO-J3; Sun, 30 Jun 2019 22:30:01 -0700 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 x615TtA8008169; Sun, 30 Jun 2019 22:29:55 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1hhot0-0003CN-Vf; Sun, 30 Jun 2019 22:29:55 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 2A452121063; Mon, 1 Jul 2019 10:59:54 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, heiko@sntech.de, michal.simek@xilinx.com, adrian.hunter@intel.com, christoph.muellner@theobroma-systems.com, philipp.tomsich@theobroma-systems.com, viresh.kumar@linaro.org, scott.branden@broadcom.com, ayaka@soulik.info, kernel@esmil.dk, tony.xie@rock-chips.com, rajan.vaja@xilinx.com, jolly.shah@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com, olof@lixom.net Subject: [PATCH v2 01/11] dt-bindings: mmc: arasan: Update documentation for SD Card Clock Date: Mon, 1 Jul 2019 10:59:41 +0530 Message-Id: <1561958991-21935-2-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1561958991-21935-1-git-send-email-manish.narani@xilinx.com> References: <1561958991-21935-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)(376002)(346002)(136003)(2980300002)(199004)(189003)(63266004)(50466002)(478600001)(76176011)(6266002)(26005)(42186006)(36386004)(5660300002)(2616005)(36756003)(446003)(476003)(103686004)(7416002)(186003)(336012)(44832011)(16586007)(11346002)(126002)(356004)(70586007)(4326008)(70206006)(316002)(305945005)(15650500001)(106002)(50226002)(48376002)(51416003)(8936002)(81156014)(72206003)(81166006)(486006)(8676002)(47776003)(426003)(2906002)(6666004)(52956003)(921003)(42866002)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB5242; 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: 57f52d5f-620e-4deb-d46c-08d6fde52de8 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328); SRVR:DM6PR02MB5242; X-MS-TrafficTypeDiagnostic: DM6PR02MB5242: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 00851CA28B X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: I3AOl3OhYMrMAwHzDn3Y5VCgXJA8vmtAYMzXLApLsvv8LRWJ/A0glzrLIslJlB4nsw8BAluv50nK6iwGogwEt+AuOZTUEJqXSnG6HvqiYePF25Zfk31DegP8/ima8zZDzBQI2/ByTTA3f8JzQ61EazJmL5bBKSDi+DVHHitfs6UixmUyAWYvuMwkTHP/0bE9GKwLookpZtkEgJLuqM2D4UiDcFUrMXzAVjujQUYs6YjP3iZzRV1HrK3t5ZkgmKv1J54r6olvd0kIppxP4gnmUpIHP3i0bPfyLJpvk/Z3iMHB12KOCzRf4WynnarvNsCjmVR2aubcEWclib8GDVO01XvNtdTR5TBKfxCyalVpQ1H5gWQRhEvSG2xU8fRiyOTIpPbkD98JnzvvMWhYgh1SBXaXTdSQhb+uFmFZKVP8Zpg= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2019 05:30:07.1849 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57f52d5f-620e-4deb-d46c-08d6fde52de8 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: DM6PR02MB5242 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190630_223011_855745_743A1605 X-CRM114-Status: GOOD ( 13.66 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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, linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The clock handling is to be updated in the Arasan SDHCI. As the 'devm_clk_register' is deprecated in the clock framework, this needs to specify one more clock named 'clk_sdcard' to get the clock in the driver via 'devm_clk_get()'. This clock represents the clock from controller to the card. Signed-off-by: Manish Narani --- Documentation/devicetree/bindings/mmc/arasan,sdhci.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt index 1edbb04..15c6397 100644 --- a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt +++ b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt @@ -23,6 +23,10 @@ Required Properties: - reg: From mmc bindings: Register location and length. - clocks: From clock bindings: Handles to clock inputs. - clock-names: From clock bindings: Tuple including "clk_xin" and "clk_ahb" + Apart from these two there is one more optional clock which + is "clk_sdcard". This clock represents output clock from + controller and card. This must be specified when #clock-cells + is specified. - interrupts: Interrupt specifier Required Properties for "arasan,sdhci-5.1": @@ -36,9 +40,10 @@ 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>. With this + property in place we will export one clock representing the Card + Clock. This clock is expected to be consumed by our PHY. You must also + specify - 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. @@ -70,8 +75,8 @@ Example: compatible = "rockchip,rk3399-sdhci-5.1", "arasan,sdhci-5.1"; reg = <0x0 0xfe330000 0x0 0x10000>; interrupts = ; - clocks = <&cru SCLK_EMMC>, <&cru ACLK_EMMC>; - clock-names = "clk_xin", "clk_ahb"; + clocks = <&cru SCLK_EMMC>, <&cru ACLK_EMMC>, <&sdhci 0>; + clock-names = "clk_xin", "clk_ahb", "clk_sdcard"; arasan,soc-ctl-syscon = <&grf>; assigned-clocks = <&cru SCLK_EMMC>; assigned-clock-rates = <200000000>; From patchwork Mon Jul 1 05:29:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11024895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5441F138B for ; Mon, 1 Jul 2019 05:32:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FFEE27B2F for ; Mon, 1 Jul 2019 05:32:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3410C284ED; Mon, 1 Jul 2019 05:32:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D91B627B2F for ; Mon, 1 Jul 2019 05:32:52 +0000 (UTC) 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=qEeNQezu92l6ey3U7BhftmN7D5sS+r/6cFGvTXK1PWY=; b=grKMPPY6Thz8B+ D+m1fTX6U0KRz/gcNYt5yNnDA8k6a2pJg1vP5AO9UQaljX1DtTG1710hTI0RssrueOTZ28GX/Z366 jZnFridf/dHjV+kdaA/yU+UW+JuuUyIvvwwKi2JFMMTYgcwY5GZnAn5aUzQeXFaBlo7w50EtS6seU Z4ppnhf6E50RNgGs2kxAh6uID93kpj1BkFj2qZzZTGnX389CNZkPZpJ45yvhfYeEwZijduY5kEO+m iATbJJZZHtEe/02GJsjxBF+Tj7RWRK9raS7Z68FtKQ54puJconAAg1b6hsuN4FPeYjxzfiTkTNPpq zLRxMQLhnl2cJHgPTqkQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hhovp-00010V-Ty; Mon, 01 Jul 2019 05:32:50 +0000 Received: from mail-eopbgr750084.outbound.protection.outlook.com ([40.107.75.84] helo=NAM02-BL2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hhotH-0007LF-No; Mon, 01 Jul 2019 05:30:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IPuSrpjFwjwCRLvG3YCI1Awxw37xpC8/q4b6kiC0qm4=; b=TIxudtTUckyouA0ZBjzN1GQNSjYL2yCtu50jA9YruPMyA8mETvcIGvkh7MZDVKWKWBf1+vBjqKdhIPDCBDhAviq2JsOKKpTsOgRoPWmM37NPntrwXM4InQJ51KChGa8t3QI4BbfRWqqPWl6XSKDRjMF+E8tGhutHfIPKGSlZX+g= Received: from SN4PR0201CA0060.namprd02.prod.outlook.com (2603:10b6:803:20::22) by BN7PR02MB5234.namprd02.prod.outlook.com (2603:10b6:408:2a::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Mon, 1 Jul 2019 05:30:07 +0000 Received: from BL2NAM02FT018.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::204) by SN4PR0201CA0060.outlook.office365.com (2603:10b6:803:20::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2032.18 via Frontend Transport; Mon, 1 Jul 2019 05:30:07 +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 BL2NAM02FT018.mail.protection.outlook.com (10.152.77.170) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2032.15 via Frontend Transport; Mon, 1 Jul 2019 05:30:06 +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 1hhotC-0002rl-Ar; Sun, 30 Jun 2019 22:30:06 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1hhot7-0003EO-55; Sun, 30 Jun 2019 22:30:01 -0700 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 x615Ttmn023624; Sun, 30 Jun 2019 22:29:55 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1hhot1-0003CO-0F; Sun, 30 Jun 2019 22:29:55 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 2BCAA121726; Mon, 1 Jul 2019 10:59:54 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, heiko@sntech.de, michal.simek@xilinx.com, adrian.hunter@intel.com, christoph.muellner@theobroma-systems.com, philipp.tomsich@theobroma-systems.com, viresh.kumar@linaro.org, scott.branden@broadcom.com, ayaka@soulik.info, kernel@esmil.dk, tony.xie@rock-chips.com, rajan.vaja@xilinx.com, jolly.shah@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com, olof@lixom.net Subject: [PATCH v2 02/11] arm64: dts: rockchip: Add optional clock property indicating sdcard clock Date: Mon, 1 Jul 2019 10:59:42 +0530 Message-Id: <1561958991-21935-3-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1561958991-21935-1-git-send-email-manish.narani@xilinx.com> References: <1561958991-21935-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)(376002)(39860400002)(346002)(136003)(2980300002)(189003)(199004)(63266004)(50226002)(70586007)(2906002)(70206006)(126002)(72206003)(4744005)(50466002)(26005)(476003)(11346002)(2616005)(36386004)(7416002)(305945005)(44832011)(426003)(446003)(5660300002)(42186006)(316002)(486006)(16586007)(8936002)(106002)(6666004)(478600001)(356004)(186003)(336012)(51416003)(103686004)(6266002)(76176011)(8676002)(52956003)(81166006)(48376002)(4326008)(36756003)(47776003)(81156014)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR02MB5234; 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: c25dc71d-3d3f-4d3b-2aa5-08d6fde52d6c X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328); SRVR:BN7PR02MB5234; X-MS-TrafficTypeDiagnostic: BN7PR02MB5234: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-Forefront-PRVS: 00851CA28B X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: KjkgBDZNdLS4AEEIXZbD8qG3zO/HCVr4KkNbUZiP7nILC8BGCrd18WhfwpELoxA9IE5cPpT82DfLfYQkCw7r18b1XD9eEAy9FZ4kasTSSBIEpfMuq5BSca6XILfvPXMftb2cSs9+jrKgP6n9OV+SeLm0R2MtgMMXXo1Oi2irD0wR6ZI+Wyu3TXvb4gHUXmqB22LrOkn+bbb0JDDt8GfbHsKJHN2iuYOkbr36ZN5pddIXkYi01Fip+yRb63XqdTBd7Nqqldm1hjksx29aciIBLXVzIVGEy4qx7gV7U6akIPo4H/GhIXMxHtFdjKzO1Q0Mq/BsuWwvGiTNEwhHkPqa1xW3cd/IjuGKHkDatY+Hcc33If9mHfV1MbW1yi0pnfQMa97wHc1wXP4XN9ItXsyOdzQNk10xhFQdAxvvFFx/GHg= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2019 05:30:06.9194 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c25dc71d-3d3f-4d3b-2aa5-08d6fde52d6c 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: BN7PR02MB5234 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190630_223011_824289_543E7D49 X-CRM114-Status: GOOD ( 11.26 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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, linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP As devm_clk_register() is deprecated in the clock framework, it is mandatory to use devm_clk_get() for getting the clock. This patch adds sdcard clock which will be used for the same. Signed-off-by: Manish Narani --- arch/arm64/boot/dts/rockchip/rk3399.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi index 196ac9b..0b512f3 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi @@ -332,8 +332,8 @@ arasan,soc-ctl-syscon = <&grf>; assigned-clocks = <&cru SCLK_EMMC>; assigned-clock-rates = <200000000>; - clocks = <&cru SCLK_EMMC>, <&cru ACLK_EMMC>; - clock-names = "clk_xin", "clk_ahb"; + clocks = <&cru SCLK_EMMC>, <&cru ACLK_EMMC>, <&sdhci 0>; + clock-names = "clk_xin", "clk_ahb", "clk_sdcard"; clock-output-names = "emmc_cardclock"; #clock-cells = <0>; phys = <&emmc_phy>; From patchwork Mon Jul 1 05:29:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11024871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5ACD31510 for ; Mon, 1 Jul 2019 05:30:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0343327E71 for ; Mon, 1 Jul 2019 05:30:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA1CB2832D; Mon, 1 Jul 2019 05:30:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9400C27E71 for ; Mon, 1 Jul 2019 05:30:58 +0000 (UTC) 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=RaDnczjY6yVErYLhRu9GWAP5JLC55c+oaf9ElUN2xOo=; b=eXvxy0oQ+r3AZ4 HC+ITRanaUsUThvDS4xUj2im05PgNRspP8wmlaAqDJdCl3WJ4IUVMCaqAKkJwucogWOhrPJLSxToE Smv/hCUOPvMfZsT3W2XvDUNEIVSzKWy9cFsmQ7aIReVuAsIGPop32sPaKBUWzxAcGyHnQaSJ+TupB 7y5Fl/Cv5kNHD/NLxo4/+kyYnnEgsyf3KJswFliq24OACM//g2NbOHD0sQqGFZkVygFxyVVQE88mD 44UaBHjPnCit9Ac6cOESv4UK4UefvPoe6CF08OYUtq9i8xKz2cC2Zv6UTWhr9dXw//VDbRF4+hmnI ZDAzbXvDttO/OFdX49Hg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hhotw-0007ss-Nv; Mon, 01 Jul 2019 05:30:52 +0000 Received: from mail-co1nam03on0622.outbound.protection.outlook.com ([2a01:111:f400:fe48::622] helo=NAM03-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hhotH-0007LM-EF; Mon, 01 Jul 2019 05:30:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=44lPQNBv4Qss0Y/664dDb1zlXgS1vXv8HytEmDen4uI=; b=o1QdZZXos0hAY1/Uq8QJKmwGBieSVs/6GJ6K/oZWAOlm0e7zsJWv0L0boXRF1ACO9kWU/RuG8RPxwA/ZgRHLB813jrmUVhy4gh5EVKZ//hYGqW/F6DWAkzq4zLA035b8JJAHlbsfU1/IA+ve1lnEj+FPLacFQCIZiIU+jnhTVdE= Received: from SN4PR0201CA0004.namprd02.prod.outlook.com (2603:10b6:803:2b::14) by MN2PR02MB6334.namprd02.prod.outlook.com (2603:10b6:208:182::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.18; Mon, 1 Jul 2019 05:30:08 +0000 Received: from SN1NAM02FT042.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::201) by SN4PR0201CA0004.outlook.office365.com (2603:10b6:803:2b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2032.18 via Frontend Transport; Mon, 1 Jul 2019 05:30:07 +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 SN1NAM02FT042.mail.protection.outlook.com (10.152.73.149) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2032.15 via Frontend Transport; Mon, 1 Jul 2019 05:30:06 +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 1hhotC-0002rm-CY; Sun, 30 Jun 2019 22:30:06 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1hhot7-0003EO-6j; Sun, 30 Jun 2019 22:30:01 -0700 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x615Tt9A008173; Sun, 30 Jun 2019 22:29:55 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1hhot1-0003CP-0Y; Sun, 30 Jun 2019 22:29:55 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 3318012172B; Mon, 1 Jul 2019 10:59:54 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, heiko@sntech.de, michal.simek@xilinx.com, adrian.hunter@intel.com, christoph.muellner@theobroma-systems.com, philipp.tomsich@theobroma-systems.com, viresh.kumar@linaro.org, scott.branden@broadcom.com, ayaka@soulik.info, kernel@esmil.dk, tony.xie@rock-chips.com, rajan.vaja@xilinx.com, jolly.shah@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com, olof@lixom.net Subject: [PATCH v2 03/11] mmc: sdhci-of-arasan: Replace deprecated clk API calls Date: Mon, 1 Jul 2019 10:59:43 +0530 Message-Id: <1561958991-21935-4-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1561958991-21935-1-git-send-email-manish.narani@xilinx.com> References: <1561958991-21935-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)(396003)(376002)(346002)(2980300002)(189003)(199004)(5660300002)(336012)(50466002)(478600001)(6266002)(76176011)(106002)(48376002)(36386004)(81156014)(52956003)(4326008)(8676002)(426003)(2906002)(50226002)(70206006)(70586007)(8936002)(103686004)(356004)(6666004)(81166006)(446003)(486006)(47776003)(63266004)(305945005)(11346002)(476003)(51416003)(2616005)(44832011)(42186006)(72206003)(316002)(7416002)(16586007)(36756003)(186003)(26005)(126002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR02MB6334; 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: 5a739239-ed2b-473c-56c2-08d6fde52da7 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328); SRVR:MN2PR02MB6334; X-MS-TrafficTypeDiagnostic: MN2PR02MB6334: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1186; X-Forefront-PRVS: 00851CA28B X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: ZVZu/RTgJ+dark0bD+GsU/ZLfnmJzwa69OnJKwM1ZLxK3H69qoyFJLNa05oED4As5spZbagpvwax2V94SolJYhoW0NURV1jIbL3xTf9SNJATUyomNynetZgInTjfWC58VWjhQVz9f1XZmOXQzTLuVnQPBicSB/7gkHqiEQvF6OfBR/602zzamqn1IVs3sqwmOlFpaKC/pSJbQFRblporxegu17pUhJX0RVVCEDymZkn5Mdnp/gRpfG7YS66wRyS8IZiR3Kzb4za43A/1q4L2SlzUVRNFPVHJAItxPsRMK6pSNwQWvy/ycfwiMgOER8BSRCWdWdWjbf+sNAkt0U1UZT1wOfpnHzqjKJZ3vzkLgZzFDOjYdLYXIbkqlqMkd20KEFsiBkCEB9O28MVFSO48JXx+s0qKAf/EltYKEncemGc= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2019 05:30:06.7958 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5a739239-ed2b-473c-56c2-08d6fde52da7 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: MN2PR02MB6334 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190630_223011_492795_36E835D5 X-CRM114-Status: GOOD ( 10.88 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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, linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The clk framework APIs devm_clk_register and of_clk_add_provider, which are used here, are deprecated. Replace the calls with the new API calls. Also add an API call devm_clk_get() to get the clock from DT. Signed-off-by: Manish Narani --- drivers/mmc/host/sdhci-of-arasan.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index b12abf9..d60a2e8 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -641,14 +641,25 @@ static int sdhci_arasan_register_sdclk(struct sdhci_arasan_data *sdhci_arasan, sdcardclk_init.ops = &arasan_sdcardclk_ops; sdhci_arasan->sdcardclk_hw.init = &sdcardclk_init; - sdhci_arasan->sdcardclk = - devm_clk_register(dev, &sdhci_arasan->sdcardclk_hw); + ret = devm_clk_hw_register(dev, &sdhci_arasan->sdcardclk_hw); + if (ret) { + dev_err(dev, "Failed to register SD clk_hw\n"); + return ret; + } sdhci_arasan->sdcardclk_hw.init = NULL; - ret = of_clk_add_provider(np, of_clk_src_simple_get, - sdhci_arasan->sdcardclk); - if (ret) + ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, + &sdhci_arasan->sdcardclk_hw); + if (ret) { dev_err(dev, "Failed to add clock provider\n"); + return ret; + } + + sdhci_arasan->sdcardclk = devm_clk_get(dev, "clk_sdcard"); + if (IS_ERR(sdhci_arasan->sdcardclk)) { + dev_err(dev, "sdcardclk clock not found.\n"); + ret = PTR_ERR(sdhci_arasan->sdcardclk); + } return ret; } From patchwork Mon Jul 1 05:29:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11024885 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F3C5E138B for ; Mon, 1 Jul 2019 05:32:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEA3127B2F for ; Mon, 1 Jul 2019 05:32:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D29AD284ED; Mon, 1 Jul 2019 05:32:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 71A9627B2F for ; Mon, 1 Jul 2019 05:32:40 +0000 (UTC) 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=r+xcpofbIw5DcIVVw/J4zDQd993uTZ26uyhoXQyzrx8=; b=ayBFuHR/uMIHuw imUoGNef8GcTkO9ZSW5lYXR1QVT2RHjQ6JIH1xeCmLXWuMqNhpsaw8Lunb3r8FZQjhxqw9rWdTiQL GyQh5Elfa0SW7jqEoNXDMUCbkXlLakATJd/x+uAbIn4WAj3EAkdf45CcovuJEnZlt5WJJTmbB+qtS PW12kAA+E/SIsVCDTJ5l2zzSwYTmmjjw9IaQJD8Njh0k8S0/2iGymOeFdfl5QRQnXlPwf423W/H/E pp6RKrwP+jGjQ3AtDbn7+doo9Q9zZ4rkIg+6bRE6KDJX+hgq3QSaI8krl+wgurguizM5BfAsrhK9D U8JryrW5Xyv7+Oruz8Vg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hhovc-0000pA-FQ; Mon, 01 Jul 2019 05:32:36 +0000 Received: from mail-dm3nam05on061d.outbound.protection.outlook.com ([2a01:111:f400:fe51::61d] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hhotH-0007LG-DH; Mon, 01 Jul 2019 05:30:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=testarcselector01; d=microsoft.com; cv=none; b=WllLa9hrLN+NLO3RT4Z/odiYLQw3FejHBRzbOh011zJTDEcFx7b35tKfSDjHOWMpIwmxsDnq6gXps+V/5neY6DRxu2d1969aBbfuAbheIhdOVH5lhlKn9jgxCn8QTREWyMetOSFRKlAArnLjQ2cTnRKdrl83zFNivSWlDC7wRr4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=testarcselector01; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RHHG1YEKgeYnIJRIm2Uh0GedaxcByLgz2b1LqOlg8XM=; b=GFQIOKXs4Jx/lfJAEq36QQfty3wlGU5ZH6YNehsa1/Dhaf48PW+rpVR4uEZ4A/YiHKQaqIls+Yq506iKxP9Lxz5d+VxQpM+4s2FjZ2woINY87tcqFyEZPN5g9dp2f6LG9Pr9or9ModwdM3SfAWTjM6nqQF/OepAj9iUgoE9lwZI= ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass (sender ip is 149.199.60.100) 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=selector1-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RHHG1YEKgeYnIJRIm2Uh0GedaxcByLgz2b1LqOlg8XM=; b=FvKJmWIU0vRf68eiGW/JCukY5p0Ry4VZR4n61QTGTsgDIWHIyN2BWPmE/HIjVBEz2qV2qO62widErleqkq2gLx5KHXvqMJonjsMOJbdx8HbGFL3+32Y+n6MISZTlRKkdIPypbZ/C0EnKvhNMtx+IQvqmya/OyL98rhYS8IKXrrU= Received: from DM6PR02CA0036.namprd02.prod.outlook.com (2603:10b6:5:1c::49) by SN4PR0201MB3407.namprd02.prod.outlook.com (2603:10b6:803:4f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16; Mon, 1 Jul 2019 05:30:07 +0000 Received: from SN1NAM02FT014.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::208) by DM6PR02CA0036.outlook.office365.com (2603:10b6:5:1c::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2032.20 via Frontend Transport; Mon, 1 Jul 2019 05:30:07 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) 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.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) 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.2032.15 via Frontend Transport; Mon, 1 Jul 2019 05:30:06 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:35962 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1hhotC-0006To-4t; Sun, 30 Jun 2019 22:30:06 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1hhot7-0003EO-15; Sun, 30 Jun 2019 22:30:01 -0700 Received: from xsj-pvapsmtp01 (mailhost.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x615TtWn023626; Sun, 30 Jun 2019 22:29:55 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1hhot1-0003CQ-1t; Sun, 30 Jun 2019 22:29:55 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 398CD121735; Mon, 1 Jul 2019 10:59:54 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, heiko@sntech.de, michal.simek@xilinx.com, adrian.hunter@intel.com, christoph.muellner@theobroma-systems.com, philipp.tomsich@theobroma-systems.com, viresh.kumar@linaro.org, scott.branden@broadcom.com, ayaka@soulik.info, kernel@esmil.dk, tony.xie@rock-chips.com, rajan.vaja@xilinx.com, jolly.shah@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com, olof@lixom.net Subject: [PATCH v2 04/11] mmc: sdhci-of-arasan: Separate out clk related data to another structure Date: Mon, 1 Jul 2019 10:59:44 +0530 Message-Id: <1561958991-21935-5-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1561958991-21935-1-git-send-email-manish.narani@xilinx.com> References: <1561958991-21935-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.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(39860400002)(346002)(136003)(376002)(2980300002)(189003)(199004)(63266004)(2906002)(4326008)(70586007)(70206006)(72206003)(26005)(5660300002)(76176011)(103686004)(305945005)(6266002)(51416003)(81156014)(8676002)(81166006)(8936002)(36386004)(7416002)(186003)(50226002)(6666004)(356004)(50466002)(52956003)(426003)(336012)(47776003)(446003)(48376002)(44832011)(486006)(476003)(126002)(478600001)(2616005)(11346002)(16586007)(36756003)(42186006)(316002)(106002)(921003)(1121003)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN4PR0201MB3407; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2fd5b626-a667-4d5f-68a9-08d6fde52d8b X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328); SRVR:SN4PR0201MB3407; X-MS-TrafficTypeDiagnostic: SN4PR0201MB3407: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-Forefront-PRVS: 00851CA28B X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: jy/kJuDbKPbfdGajJkpOGx72bZwsS7xqF15uLBaNNhpwerQxqujQTZmX6vOjGFlfiKy0ftWn+gRCc/xDQkzHEbv4fevVBaGf2pru6sVdis3Irp3eNBgTDtd7yQIYMkCEjzyL6iXO08Xx2TTAT72gvuSbIvdTLpp49xPdax2W6wVCKJuAhhmbbomYkqpwfgkVzJFlHfvVcDNwFZW7h8Mv6+FUEvo5Y6KafICz6mPXfZ+OzoIdPIMtOujWr3r9skzVMQ1t+OnUCK1+QrEl+7TtmZWZUJWGYOgrmQth8JApAcKkk9Q+n1+vzm0jBpXwgPUBENHp00ttGawLhfhkrzAIKQyHfEHwMO5uwMBtT1SBCGbPAXr9vWtFnMRpjNdk8PxQAMVH1n9MNYSwd8FenNIql4gSbE4a78bPOLSPuZTDJ4c= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2019 05:30:06.5867 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2fd5b626-a667-4d5f-68a9-08d6fde52d8b 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.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0201MB3407 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190630_223011_491431_3162E118 X-CRM114-Status: GOOD ( 13.10 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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, linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index d60a2e8..c7586f5 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -72,13 +72,22 @@ 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. + */ +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 + * @clk_data: Struct for the Arasan Controller Clock Data. * @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. * @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; @@ -505,8 +513,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; @@ -618,6 +628,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; @@ -640,25 +651,25 @@ 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; - ret = devm_clk_hw_register(dev, &sdhci_arasan->sdcardclk_hw); + clk_data->sdcardclk_hw.init = &sdcardclk_init; + ret = devm_clk_hw_register(dev, &clk_data->sdcardclk_hw); if (ret) { dev_err(dev, "Failed to register SD clk_hw\n"); return ret; } - sdhci_arasan->sdcardclk_hw.init = NULL; + clk_data->sdcardclk_hw.init = NULL; ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, - &sdhci_arasan->sdcardclk_hw); + &clk_data->sdcardclk_hw); if (ret) { dev_err(dev, "Failed to add clock provider\n"); return ret; } - sdhci_arasan->sdcardclk = devm_clk_get(dev, "clk_sdcard"); - if (IS_ERR(sdhci_arasan->sdcardclk)) { + clk_data->sdcardclk = devm_clk_get(dev, "clk_sdcard"); + if (IS_ERR(clk_data->sdcardclk)) { dev_err(dev, "sdcardclk clock not found.\n"); - ret = PTR_ERR(sdhci_arasan->sdcardclk); + ret = PTR_ERR(clk_data->sdcardclk); } return ret; From patchwork Mon Jul 1 05:29:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11024911 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6F3C746 for ; Mon, 1 Jul 2019 05:34:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9213327B2F for ; Mon, 1 Jul 2019 05:34:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83E14284ED; Mon, 1 Jul 2019 05:34:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2272B27B2F for ; Mon, 1 Jul 2019 05:34:40 +0000 (UTC) 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=lfyStlCZoP/X1zWR399rQfbBHKyQXPZkNzwEALDtyq0=; b=qSTkbThbwG+4Ig 5EGnkF8PbQGsuydvnAI/1X0J9+sDFf6nUub1XJqHNYtQo5Z8lEIB271lNKX7BrPsB2zG5xRWOJzVZ 5UP39Z4p8L3AJs1dkXwSui9SINePPcSNifwQAMYQpDZFUzIdfufjE1qVeMGQdsKyJJsF7maQG50pA YRNLP28aN9qxjMCfdiorBi1VClQbH/2WkCcQKMG9d7doecfJX1YTxHPjWVwhn8FGCa/FZAtOqXCPr CmQKY31VtJ9pguAItutsxvaeadyzWBTL9FKQocqxuJF9CQKJewC80nr8MdBrL2A+A/C3G9YMaQfb5 x44S8KlDfrSIYqYl1bIg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hhoxY-0002W0-Sd; Mon, 01 Jul 2019 05:34:36 +0000 Received: from mail-eopbgr770088.outbound.protection.outlook.com ([40.107.77.88] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hhotI-0007LD-8A; Mon, 01 Jul 2019 05:30:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Mh8moDmxhscDhdZ3F7pwsajNjmmbjlfPi4dMpnwWPYw=; b=EOm1x1ZCJN8eIwBh5HCPQbyhAx+JjOwk4JfrDrqvQBoFBwtZQ6Xi8xY92VNJ00KUe0RSHltHENdsJ2NQ/0OFQxAzv0yrzC7WTpwf1ysAxa4xMlWu2gxjXWshlbe/Vx2RiOWnXeZS8VWFcxGL2HXol6KnvOiqi4F45SMV6NSYnmA= Received: from SN4PR0201CA0034.namprd02.prod.outlook.com (2603:10b6:803:2e::20) by DM5PR0201MB3397.namprd02.prod.outlook.com (2603:10b6:4:76::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.18; Mon, 1 Jul 2019 05:30:07 +0000 Received: from BL2NAM02FT021.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::205) by SN4PR0201CA0034.outlook.office365.com (2603:10b6:803:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2032.17 via Frontend Transport; Mon, 1 Jul 2019 05:30:06 +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 BL2NAM02FT021.mail.protection.outlook.com (10.152.77.158) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2032.15 via Frontend Transport; Mon, 1 Jul 2019 05:30:06 +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 1hhotB-0002ri-QP; Sun, 30 Jun 2019 22:30:05 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1hhot6-0003EO-NS; Sun, 30 Jun 2019 22:30:00 -0700 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 x615TuNh023628; Sun, 30 Jun 2019 22:29:56 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1hhot2-0003Cc-4Q; Sun, 30 Jun 2019 22:29:56 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 41049121745; Mon, 1 Jul 2019 10:59:54 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, heiko@sntech.de, michal.simek@xilinx.com, adrian.hunter@intel.com, christoph.muellner@theobroma-systems.com, philipp.tomsich@theobroma-systems.com, viresh.kumar@linaro.org, scott.branden@broadcom.com, ayaka@soulik.info, kernel@esmil.dk, tony.xie@rock-chips.com, rajan.vaja@xilinx.com, jolly.shah@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com, olof@lixom.net Subject: [PATCH v2 05/11] dt-bindings: mmc: arasan: Update Documentation for the input clock Date: Mon, 1 Jul 2019 10:59:45 +0530 Message-Id: <1561958991-21935-6-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1561958991-21935-1-git-send-email-manish.narani@xilinx.com> References: <1561958991-21935-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)(396003)(376002)(2980300002)(189003)(199004)(7416002)(47776003)(2906002)(72206003)(356004)(50226002)(16586007)(316002)(126002)(446003)(26005)(476003)(426003)(336012)(81156014)(76176011)(44832011)(106002)(2616005)(42186006)(186003)(486006)(11346002)(52956003)(50466002)(70586007)(63266004)(8936002)(5660300002)(51416003)(36386004)(70206006)(8676002)(36756003)(6666004)(305945005)(6266002)(48376002)(81166006)(4326008)(478600001)(103686004)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR0201MB3397; 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: 197f42b9-dd46-49b3-8bbe-08d6fde52d26 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328); SRVR:DM5PR0201MB3397; X-MS-TrafficTypeDiagnostic: DM5PR0201MB3397: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 00851CA28B X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 6k2OgKUKUJy5VENvUxQ1mVzg0giz5ZBgTubgRVX3wWr5zg/m4H+3N0dkKBR+9eEv1IKBj4sf0aKyyDlHhpWwGuHyZHvFCcxYPEB0YzlHSEFJJoydiS+94GuTKcczOLOsGXkiAE/bJdVSOgHM81YU6NFIbdNsB29FxsRWaKHPZq8EjJ2xUDLoxb5I69aoughIrCcKsr1y//ZfQu/G3PY1FFluqXQ4LznsBwRYBRbxQIkX20c7jpHPVrFrmWrZOBo0MFnRG+E+DAbDA1flAQ7FsZeX46ozfVb6+B+/qeOwGQT0DYXqWiCwDxXpcHqjmXGtGvJVj7LDea/Ly0ldY8vjn23nszLIaufaZWqVRJQWh8rR83JjvEwhLqiysGT6Qwz2nIGuzd2byEPVsgh3esRCY2O09Zuf4P5Kr3k9nE4iH+w= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2019 05:30:06.3980 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 197f42b9-dd46-49b3-8bbe-08d6fde52d26 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: DM5PR0201MB3397 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190630_223012_290512_695BF860 X-CRM114-Status: GOOD ( 12.03 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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, linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- Documentation/devicetree/bindings/mmc/arasan,sdhci.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt index 15c6397..7c79496 100644 --- a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt +++ b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt @@ -23,10 +23,10 @@ Required Properties: - reg: From mmc bindings: Register location and length. - clocks: From clock bindings: Handles to clock inputs. - clock-names: From clock bindings: Tuple including "clk_xin" and "clk_ahb" - Apart from these two there is one more optional clock which - is "clk_sdcard". This clock represents output clock from - controller and card. This must be specified when #clock-cells - is specified. + Apart from these two there are two more optional clocks which + are "clk_sdcard" and "clk_sample". These two clocks represent + output and input clocks between controller and card. These + must be specified when #clock-cells is specified. - interrupts: Interrupt specifier Required Properties for "arasan,sdhci-5.1": @@ -40,9 +40,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 one clock representing the Card - Clock. This clock is expected to be consumed by our PHY. You must also + - #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. You must also specify - 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 From patchwork Mon Jul 1 05:29:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11024873 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A01FB138B for ; Mon, 1 Jul 2019 05:31:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89F5827B2F for ; Mon, 1 Jul 2019 05:31:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DBFF284ED; Mon, 1 Jul 2019 05:31:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DDF1127B2F for ; Mon, 1 Jul 2019 05:31:01 +0000 (UTC) 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=4sJ4UYEZfFwhRygkQJNI8g1Mg0+Dy9PdIOzPxbcFot8=; b=Jt6L2vKTvpmSfj QZgQFjlYxMEsQzsoA9w5UgxOhrdQRAE5bGF+iqmHg78F989w0xjyKCHmjF75cKhUv6iomkui12KMt 7H8kXPG/7utKbUXxMWEqm1K4T3nUaXZovCg1v8sbDhYAhxi11ODX+Ei89qUSjZKDkzQEI/8qgIocs s4yVTnXijYG6DbsezPN8iEGvVFxDZfVBpkotWPDiUW2lvBBqvg8GTvpHkF4toie1IBT6kiIbToYSl xS6xm5VPR7kipWxRA0rv8P8jh5t+lla1c3Fi3zzF2d53GRfTC3yyRUhSH/AHxTeF96/nNmETOpRhF tkE/h0S0Fc+0gKB0IpJQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hhou2-0007wH-MI; Mon, 01 Jul 2019 05:30:58 +0000 Received: from mail-eopbgr760043.outbound.protection.outlook.com ([40.107.76.43] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hhotH-0007LH-Cy; Mon, 01 Jul 2019 05:30:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=testarcselector01; d=microsoft.com; cv=none; b=shBLhE3eIpcaTEKfQy2SqYTMN4YQdOQLeqoCE9atkYY3EFqnBaOSBqoq8ghQGI/7FswlvnXHoq00+nOb3rTNl8AId2D4QPfBGbj+2UZdp3qs6im21LqLqkbHqLObEgU1mT8qH59Yf7pyZ+nl7a+jlsxuNobf4xt3vBuNfPl3UpQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=testarcselector01; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eZBFTUHu+eJzY9qyBHqSJbSiQ9jS0+nBS9LM/5+dARw=; b=tXRtZQ/OK0/xOj5aakoyoW7bv2i6Rvb9SWFnGaND2hXKVXF0q9WPGYfIbIKv7o405EtHo6bNw2crY/PHiDh/thCJVeCX7XpcsG7lRRNoveVMilF+A3O0OzCnam5LbeKChbwPtQj0HyCWlzrgjuQ6oPiTLVPyaalpYRWw9cxrksg= 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=selector1-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eZBFTUHu+eJzY9qyBHqSJbSiQ9jS0+nBS9LM/5+dARw=; b=rI2WhUQNq9QOpOo0EQ70pd2ZQt0U5ckAF57FvkMP+ojNyCc/umm6gkRUoM+0unn5foDaodJrfUqpxDx8Vf8ZDJUnY5FRQ59NJX7w2PTumhcPOG/ir3+DemHJ8oDVQapgOamD5q9Lz+GsVyCISMSylxgszQCIahFqJ7k3QPI6ar8= Received: from BYAPR02CA0006.namprd02.prod.outlook.com (2603:10b6:a02:ee::19) by CH2PR02MB6326.namprd02.prod.outlook.com (2603:10b6:610:10::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16; Mon, 1 Jul 2019 05:30:08 +0000 Received: from SN1NAM02FT032.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::203) by BYAPR02CA0006.outlook.office365.com (2603:10b6:a02:ee::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20 via Frontend Transport; Mon, 1 Jul 2019 05:30:07 +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.2032.15 via Frontend Transport; Mon, 1 Jul 2019 05:30:06 +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 1hhotB-0002rj-TZ; Sun, 30 Jun 2019 22:30:05 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1hhot6-0003EO-Qc; Sun, 30 Jun 2019 22:30:00 -0700 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 x615Tul2008191; Sun, 30 Jun 2019 22:29:56 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1hhot2-0003Cf-4S; Sun, 30 Jun 2019 22:29:56 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 47271121746; Mon, 1 Jul 2019 10:59:54 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, heiko@sntech.de, michal.simek@xilinx.com, adrian.hunter@intel.com, christoph.muellner@theobroma-systems.com, philipp.tomsich@theobroma-systems.com, viresh.kumar@linaro.org, scott.branden@broadcom.com, ayaka@soulik.info, kernel@esmil.dk, tony.xie@rock-chips.com, rajan.vaja@xilinx.com, jolly.shah@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com, olof@lixom.net Subject: [PATCH v2 06/11] mmc: sdhci-of-arasan: Add sampling clock for a phy to use Date: Mon, 1 Jul 2019 10:59:46 +0530 Message-Id: <1561958991-21935-7-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1561958991-21935-1-git-send-email-manish.narani@xilinx.com> References: <1561958991-21935-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)(39860400002)(376002)(136003)(346002)(2980300002)(189003)(199004)(8676002)(446003)(2906002)(51416003)(72206003)(81166006)(81156014)(26005)(16586007)(48376002)(316002)(5660300002)(76176011)(36386004)(11346002)(336012)(36756003)(103686004)(50226002)(426003)(8936002)(52956003)(44832011)(2616005)(7416002)(106002)(476003)(14444005)(126002)(4326008)(47776003)(478600001)(6666004)(356004)(42186006)(6266002)(70206006)(305945005)(70586007)(50466002)(186003)(63266004)(486006)(921003)(42866002)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:CH2PR02MB6326; 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: 0cf47994-d542-47e9-92e6-08d6fde52d6d X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328); SRVR:CH2PR02MB6326; X-MS-TrafficTypeDiagnostic: CH2PR02MB6326: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 00851CA28B X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: mN2kIH1lJKbt9MFOHicH/hBDPBnlIa8L/EVttPdKrwSZ7Mqy0XRndC2tp8LLfTDIAoBTEUAhMg/RZevc/cKZj0aqVoifoibEI0SzdygTvhCtDZLjasLGk5eAsRFGLoImNMkDedQjz6Xvfwg7HxH+/nL4abgszofNc70I8wrO0mgeY1w/qhCMVY4wI9Ei/xiz3swAU0qxWMrEHG6XyBKj7Qsm/09y2ua2tcgh9AzA57sYCiNxix0cFjcLzOOe2ifBXoUMga+My1oFoYiFg4q3MaAuDGwJsZG5JDcsTQEDGoAG8+3eOwM1ev/+BDl+qkr6E+LlFR7ovBIwWQApIkKMd6WxIexRzFLSs11UyeZgwRAsY8Uf9IdXROyvWBg4AuZ/wr+w/9Tlvle/a942sFZaqG8gJbgBDBPHy8QqKpLBmt8= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2019 05:30:06.3261 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0cf47994-d542-47e9-92e6-08d6fde52d6d 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: CH2PR02MB6326 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190630_223011_491884_A5C8F6B6 X-CRM114-Status: GOOD ( 18.97 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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, linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 | 118 ++++++++++++++++++++++++++++++++++--- 1 file changed, 110 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index c7586f5..9513813 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; }; /** @@ -527,6 +531,33 @@ static const struct clk_ops arasan_sdcardclk_ops = { }; /** + * 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 * * The corecfg_clockmultiplier is supposed to contain clock multiplier @@ -605,7 +636,7 @@ 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 @@ -624,9 +655,10 @@ static void sdhci_arasan_update_baseclkfreq(struct sdhci_host *host) * @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; @@ -662,7 +694,7 @@ static int sdhci_arasan_register_sdclk(struct sdhci_arasan_data *sdhci_arasan, ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, &clk_data->sdcardclk_hw); if (ret) { - dev_err(dev, "Failed to add clock provider\n"); + dev_err(dev, "Failed to add sdcard clock provider\n"); return ret; } @@ -676,10 +708,74 @@ static int sdhci_arasan_register_sdclk(struct sdhci_arasan_data *sdhci_arasan, } /** + * 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; + + /* 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", 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; + ret = devm_clk_hw_register(dev, &clk_data->sampleclk_hw); + if (ret) { + dev_err(dev, "Failed to register SD clk_hw\n"); + return ret; + } + clk_data->sampleclk_hw.init = NULL; + + ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, + &clk_data->sampleclk_hw); + if (ret) { + dev_err(dev, "Failed to add sample clock provider\n"); + return ret; + } + + clk_data->sampleclk = devm_clk_get(dev, "clk_sample"); + if (IS_ERR(clk_data->sampleclk)) { + dev_err(dev, "sampleclk clock not found.\n"); + ret = PTR_ERR(clk_data->sampleclk); + } + + return ret; +} + +/** * sdhci_arasan_unregister_sdclk - Undoes sdhci_arasan_register_sdclk() * - * Should be called any time we're exiting and sdhci_arasan_register_sdclk() - * returned success. + * Should be called any time we're exiting and sdhci_arasan_register_sdcardclk() + * /sampleclk() returned success. * * @dev: Pointer to our struct device. */ @@ -817,10 +913,16 @@ static int sdhci_arasan_probe(struct platform_device *pdev) sdhci_arasan_update_baseclkfreq(host); - ret = sdhci_arasan_register_sdclk(sdhci_arasan, clk_xin, &pdev->dev); + ret = sdhci_arasan_register_sdcardclk(sdhci_arasan, clk_xin, + &pdev->dev); if (ret) goto clk_disable_all; + ret = sdhci_arasan_register_sampleclk(sdhci_arasan, clk_xin, + &pdev->dev); + if (ret) + goto unreg_clk; + ret = mmc_of_parse(host->mmc); if (ret) { if (ret != -EPROBE_DEFER) From patchwork Mon Jul 1 05:29:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11024887 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4771A138B for ; Mon, 1 Jul 2019 05:32:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 328AE27B2F for ; Mon, 1 Jul 2019 05:32:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2663F284ED; Mon, 1 Jul 2019 05:32:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C94F427B2F for ; Mon, 1 Jul 2019 05:32:43 +0000 (UTC) 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=Zvf52LG6qaZST6aRP9Cd5tHR2DdwaUC0HdOJSIAasCQ=; b=t3VaP38Ceb4vY0 9z/AcOb4dUslQwwkGZKqC0knu/VZaBNK9zVcOtQk4TMuJtUI8LdNbeTz2KKfzdeTUbJsA77ipZy6x 5pSOmhX0EHTqFmIFM90K2ARjxTbLWz1XKFBhYyte7nglIAKupe4Zp9HuSrzCgHfp7UjX1N7s7RZaO 0NAamcXYT4z2nX5clgQvHlcKciiftve34iQaLpI5t1qSlUkv6WS9fb40CD448tgNhlbhfFNCVVzjx dounOvze8pcpLazJqzUdfJNsCtuUTYa/u6KPHVnmWU5xV5JfvvtGUHSX139uTeOqwmWkGcX1yDYvn 8BXxGy91kg/08bTrIofA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hhovg-0000sS-M6; Mon, 01 Jul 2019 05:32:40 +0000 Received: from mail-eopbgr790089.outbound.protection.outlook.com ([40.107.79.89] helo=NAM03-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hhotH-0007LC-KS; Mon, 01 Jul 2019 05:30:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ie1+wGn0PES2/NEMdUXGVrt+v4AbRb2I3CXm2bJOTvs=; b=OjNy+9GK8xHX59kjNnUb2jYUDnR7XGbQtdg0LNlszX1/XqgAu1PCF527+bZJh7p7OBS+fqOYI0KyEUW94hDzVBd2jyLdNT2RGgTSlwRE2RRc0I5fhDti4MuOwA90HD7+/9/Kmbu8r8hjKWm4ARbWvvKLZkLzUxWLGR2SI0+RdT0= Received: from BL0PR02CA0056.namprd02.prod.outlook.com (2603:10b6:207:3d::33) by DM6PR02MB5241.namprd02.prod.outlook.com (2603:10b6:5:48::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Mon, 1 Jul 2019 05:30:07 +0000 Received: from SN1NAM02FT006.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::209) by BL0PR02CA0056.outlook.office365.com (2603:10b6:207:3d::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2032.20 via Frontend Transport; Mon, 1 Jul 2019 05:30:06 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) 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.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT006.mail.protection.outlook.com (10.152.72.68) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2032.15 via Frontend Transport; Mon, 1 Jul 2019 05:30:06 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:35852 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1hhotB-0006Te-M4; Sun, 30 Jun 2019 22:30:05 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1hhot6-0003EO-Ie; Sun, 30 Jun 2019 22:30:00 -0700 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x615Tuah023632; Sun, 30 Jun 2019 22:29:56 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1hhot2-0003Cd-4S; Sun, 30 Jun 2019 22:29:56 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 4D3BC12174A; Mon, 1 Jul 2019 10:59:54 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, heiko@sntech.de, michal.simek@xilinx.com, adrian.hunter@intel.com, christoph.muellner@theobroma-systems.com, philipp.tomsich@theobroma-systems.com, viresh.kumar@linaro.org, scott.branden@broadcom.com, ayaka@soulik.info, kernel@esmil.dk, tony.xie@rock-chips.com, rajan.vaja@xilinx.com, jolly.shah@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com, olof@lixom.net Subject: [PATCH v2 07/11] dt-bindings: mmc: arasan: Add optional properties for Arasan SDHCI Date: Mon, 1 Jul 2019 10:59:47 +0530 Message-Id: <1561958991-21935-8-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1561958991-21935-1-git-send-email-manish.narani@xilinx.com> References: <1561958991-21935-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.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(346002)(376002)(39860400002)(396003)(2980300002)(199004)(189003)(47776003)(8936002)(76176011)(26005)(336012)(5660300002)(51416003)(36756003)(70586007)(70206006)(186003)(356004)(6666004)(106002)(6266002)(7416002)(42186006)(16586007)(316002)(72206003)(44832011)(478600001)(48376002)(63266004)(36386004)(52956003)(2906002)(50466002)(103686004)(50226002)(305945005)(81166006)(81156014)(8676002)(4326008)(426003)(446003)(11346002)(2616005)(476003)(126002)(486006)(921003)(1121003)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB5241; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7612f162-5e4b-46ae-37f9-08d6fde52d36 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328); SRVR:DM6PR02MB5241; X-MS-TrafficTypeDiagnostic: DM6PR02MB5241: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 00851CA28B X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: iWTgQ5tZmByGckLlXyZ6JXq46iC/ZUxOtCJd6MCUggSaQZ6rALXY6qrhkQdWOi4Mya2F3dpEhhgcFls4E5FmoJ5nEUDPtUAusO1Yfbl7hPPkiUDW0bp4A0n0y4+8Tkp2zW0I8CoBj4QmPnSOSw9Xi9toSesusn04H4fksUTrsHDdz5FFJ9kqLBK5rmiRVCynvvui8akrqmcaGXAGCJwWJwy2Hw2M3qo0ENi4jXcO2j8sADN77zrr68OlyAhn4bb3Z1ohYXhmaefqTx3ffWwuXRj7HGCEiAbUuHmxtlo9WVpuwEPp8yB0FUEMwAV0rs34hdtfk7nyqwxLRcBsigbnJMhz4TnGjasxUapLGvki1URWbWxE35QpYAryU1CRegm1iUEMsNBpHcX747t2wZjb2tbwnz6vEYpvwXGEzZihihg= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2019 05:30:06.0877 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7612f162-5e4b-46ae-37f9-08d6fde52d36 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.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB5241 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190630_223011_718952_4C8CE402 X-CRM114-Status: UNSURE ( 9.24 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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, linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add optional propeties for Arasan SDHCI which are used to set clk delays for different speed modes in the controller. Signed-off-by: Manish Narani --- Documentation/devicetree/bindings/mmc/arasan,sdhci.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt index 7c79496..7425d52 100644 --- a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt +++ b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt @@ -49,6 +49,21 @@ Optional Properties: properly. Test mode can be used to force the controller to function. - xlnx,int-clock-stable-broken: when present, the controller always reports that the internal clock is stable even when it is not. + - clk-phase-legacy: Input/Output Clock Delay pair in degrees for Legacy Mode. + - clk-phase-mmc-hs: Input/Output Clock Delay pair degrees for MMC HS. + - clk-phase-sd-hs: Input/Output Clock Delay pair in degrees for SD HS. + - clk-phase-uhs-sdr12: Input/Output Clock Delay pair in degrees for SDR12. + - clk-phase-uhs-sdr25: Input/Output Clock Delay pair in degrees for SDR25. + - clk-phase-uhs-sdr50: Input/Output Clock Delay pair in degrees for SDR50. + - clk-phase-uhs-sdr104: Input/Output Clock Delay pair in degrees for SDR104. + - clk-phase-uhs-ddr50: Input/Output Clock Delay pair in degrees for SD DDR50. + - clk-phase-mmc-ddr52: Input/Output Clock Delay pair in degrees for MMC DDR52. + - clk-phase-mmc-hs200: Input/Output Clock Delay pair in degrees for MMC HS200. + - clk-phase-mmc-hs400: Input/Output Clock Delay pair in degrees for MMC HS400. + + Above mentioned are the clock (phase) delays which are to be configured in the + controller while switching to particular speed mode. If not specified, driver + will configure the default value defined for particular mode in it. Example: sdhci@e0100000 { From patchwork Mon Jul 1 05:29:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11024917 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 223C0746 for ; Mon, 1 Jul 2019 05:34:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BC1D27E71 for ; Mon, 1 Jul 2019 05:34:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F283327B2F; Mon, 1 Jul 2019 05:34:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7745727B2F for ; Mon, 1 Jul 2019 05:34:50 +0000 (UTC) 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=3dADd/WeSze8iqMUtVcQnJc+LmVWlAcg3UxYHi+gGRY=; b=FsQIFlQBk+NqEU wql3HCo0olpe15m5i9LPThnPKZQLPTb/PLydANbTcL11fUnoCRbNQ0yT5JnMde7ZCqg4k7SIHQyAq 11ly9uOyTBiHm3LWQDysm7H9mpTBZSNJqBk63Pny/PlWCKc1DP+Nyio/q3ehImLSHGePVVBLJtsJZ tt/uE93bWdnuCNHRN45owTmDlhmyiWB79FCuS7yE1WYJ/a08Zg8W1N3161RFTy4Ug1j8WyiymGd4h FwUovCwh8eBZ5jTunOWQrm17t6WlCWZp+HDMZ80pfWstb+DwIF2zl15C4OrAwy1D82EDls5+AxEOQ 9MMI1nCeCcc2KJzYu+qg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hhoxj-0002fO-EB; Mon, 01 Jul 2019 05:34:47 +0000 Received: from mail-eopbgr810088.outbound.protection.outlook.com ([40.107.81.88] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hhotL-0007LJ-85; Mon, 01 Jul 2019 05:30:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SFHTLeHuK318EaTUgjBJUU/s3/x/ymnBh8YX7NBuHlc=; b=n8aVhIPoxdaiBWKDTabPY6as6Q9O1RxwnlZ48ie+mVvlDr0MfRVaztuYNuyQm9FqtM9rdyYFFr1IKZA1LYDH9EKZwnpIO0LlzwSQ7ZtO633jabzyvpcYr4NmglhnPrunww1pMxFbzfYfpvKdUU25ytHd077RmbW+5KnkIPfAMhA= Received: from SN4PR0201CA0015.namprd02.prod.outlook.com (2603:10b6:803:2b::25) by BYAPR02MB5238.namprd02.prod.outlook.com (2603:10b6:a03:68::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Mon, 1 Jul 2019 05:30:07 +0000 Received: from BL2NAM02FT055.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::206) by SN4PR0201CA0015.outlook.office365.com (2603:10b6:803:2b::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2032.20 via Frontend Transport; Mon, 1 Jul 2019 05:30:07 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) 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.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT055.mail.protection.outlook.com (10.152.77.126) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2032.15 via Frontend Transport; Mon, 1 Jul 2019 05:30:06 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:35925 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1hhotC-0006Tf-1G; Sun, 30 Jun 2019 22:30:06 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1hhot6-0003EO-To; Sun, 30 Jun 2019 22:30:00 -0700 Received: from xsj-pvapsmtp01 (smtp3.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x615Tu2M008188; Sun, 30 Jun 2019 22:29:56 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1hhot2-0003Cb-4O; Sun, 30 Jun 2019 22:29:56 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 53D1D12174C; Mon, 1 Jul 2019 10:59:54 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, heiko@sntech.de, michal.simek@xilinx.com, adrian.hunter@intel.com, christoph.muellner@theobroma-systems.com, philipp.tomsich@theobroma-systems.com, viresh.kumar@linaro.org, scott.branden@broadcom.com, ayaka@soulik.info, kernel@esmil.dk, tony.xie@rock-chips.com, rajan.vaja@xilinx.com, jolly.shah@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com, olof@lixom.net Subject: [PATCH v2 08/11] mmc: sdhci-of-arasan: Add support to set clock phase delays for SD Date: Mon, 1 Jul 2019 10:59:48 +0530 Message-Id: <1561958991-21935-9-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1561958991-21935-1-git-send-email-manish.narani@xilinx.com> References: <1561958991-21935-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.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(376002)(346002)(39860400002)(136003)(396003)(2980300002)(189003)(199004)(8676002)(186003)(2906002)(14444005)(336012)(70586007)(356004)(52956003)(70206006)(44832011)(50466002)(36386004)(486006)(48376002)(81156014)(11346002)(47776003)(305945005)(4326008)(16586007)(81166006)(446003)(103686004)(6266002)(26005)(6666004)(2616005)(36756003)(7416002)(63266004)(426003)(476003)(5660300002)(126002)(478600001)(8936002)(72206003)(42186006)(316002)(50226002)(106002)(76176011)(51416003)(921003)(1121003)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR02MB5238; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 556ee824-2d45-44f8-e92e-08d6fde52d49 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328); SRVR:BYAPR02MB5238; X-MS-TrafficTypeDiagnostic: BYAPR02MB5238: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-Forefront-PRVS: 00851CA28B X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 3ownFba+ATxmANaOZ1BIg51Z9KnyWqxyv77/HUWXaqD8zvmtyXZvlcMSX74WKVgD4cRv8uhF6xFqI2s8w/5EKIWVDyUJhbzSCuvDPWNH5FkTUjH1V5sM8kdHxpklGrqzaKyF3C1AShcSVCqweudex8idho5y1rLgxN6le8QGno/Ts7tqSUERcDHmz+nVRMVg803KHxL33U3Yve2BJbHKG8CXb1jbuOGsbNG88HJaINq/3P7BjYmhZplyooC9E8OozWUQlKdZAqO3JYD/7yKF4sNuo00jOsd311TcfUgUosed9cCk0EkLXcUIS6PgcM6Qp1n1wiP95Nw28G2u6k8VNTTzAm+4UPQiGAwbhF/EtzDmlnmFePzkZKVZ4VXECK4bL+KSJmnJN1PASv1II9jGJalWtnAt6B1SzLBcUjkdVWQ= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2019 05:30:06.6288 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 556ee824-2d45-44f8-e92e-08d6fde52d49 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.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB5238 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190630_223015_328819_29DDDAD1 X-CRM114-Status: GOOD ( 14.26 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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, linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 | 91 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index 9513813..a545221 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); }; /** @@ -180,6 +186,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)) { @@ -221,6 +228,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) @@ -635,6 +646,84 @@ 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. + */ +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 * @@ -923,6 +1012,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev) if (ret) goto unreg_clk; + 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 Mon Jul 1 05:29:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11024889 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 39EEF746 for ; Mon, 1 Jul 2019 05:32:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23E0727B2F for ; Mon, 1 Jul 2019 05:32:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1645E284ED; Mon, 1 Jul 2019 05:32:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 915B227B2F for ; Mon, 1 Jul 2019 05:32:47 +0000 (UTC) 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=s3R/fUmR4bdFElTlKi4NNj+gzp5Ico2OxpPaw5sCl0Q=; b=pEVehKah0+q7ck f7s2wqyiRG5/Ud1alPAXVsF3eNIY+1WlHE0QEoVupN/Bx6OSHhwFgHuYQ9qLE757p3lkZzIPuVPUH jEgpxX/SZhwfJeCwrB+b617N7PVmTi4/H2RxTFs+xlrDY372pMa4zt2w5Ix4D6LcWYwGU2UZWFzpY uMLIvyDexXExPT4YbN6gU2r/ENEOp/jFG42OcbFuCrCumFGCkYO09tALTShIuK1lKOOItxlK4pycu CszBQhCOoxik0Io3FEWrbiTwxcVuTdNmZvK9+qP95Ff7VYv2wAvLdNHkexLFrrW/UmIeg0iwlp2ts bpYxsh9MqNG2jxulImWw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hhovk-0000vo-E6; Mon, 01 Jul 2019 05:32:44 +0000 Received: from mail-eopbgr810081.outbound.protection.outlook.com ([40.107.81.81] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hhotH-0007LN-H1; Mon, 01 Jul 2019 05:30:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SgDItzVZ3yu8TkV+8TULcYmqkZicXfC342KqM0bl+TM=; b=aFRAiVqYlB9jtQgrWBazUdh1oAezb8ktIefPjruK1C5O7ZPuzTTfaofFl5YcpIHyFcNx7vnUmK3Px8QINRc1OFpT9sc5VYLFHRnMUG8Y+y4S5X5lDq8pe2Xzkh7bcHE3E1pTJ66CfTYI6+ofDXrpr0X+t2B3s+0XrVuadJ/MVXk= Received: from DM6PR02CA0051.namprd02.prod.outlook.com (2603:10b6:5:177::28) by DM5PR0201MB3400.namprd02.prod.outlook.com (2603:10b6:4:76::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Mon, 1 Jul 2019 05:30:09 +0000 Received: from BL2NAM02FT015.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::202) by DM6PR02CA0051.outlook.office365.com (2603:10b6:5:177::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2032.18 via Frontend Transport; Mon, 1 Jul 2019 05:30:09 +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 BL2NAM02FT015.mail.protection.outlook.com (10.152.77.167) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2032.15 via Frontend Transport; Mon, 1 Jul 2019 05:30:08 +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 1hhotE-0002ry-1j; Sun, 30 Jun 2019 22:30:08 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1hhot8-0003EO-SB; Sun, 30 Jun 2019 22:30:02 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x615Tuq5023636; Sun, 30 Jun 2019 22:29:56 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1hhot2-0003Ce-4R; Sun, 30 Jun 2019 22:29:56 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 5A01612174D; Mon, 1 Jul 2019 10:59:54 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, heiko@sntech.de, michal.simek@xilinx.com, adrian.hunter@intel.com, christoph.muellner@theobroma-systems.com, philipp.tomsich@theobroma-systems.com, viresh.kumar@linaro.org, scott.branden@broadcom.com, ayaka@soulik.info, kernel@esmil.dk, tony.xie@rock-chips.com, rajan.vaja@xilinx.com, jolly.shah@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com, olof@lixom.net Subject: [PATCH v2 09/11] firmware: xilinx: Add SDIO Tap Delay APIs Date: Mon, 1 Jul 2019 10:59:49 +0530 Message-Id: <1561958991-21935-10-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1561958991-21935-1-git-send-email-manish.narani@xilinx.com> References: <1561958991-21935-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)(136003)(396003)(39860400002)(2980300002)(189003)(199004)(336012)(4326008)(6266002)(5660300002)(426003)(52956003)(106002)(103686004)(42186006)(478600001)(72206003)(50226002)(2906002)(63266004)(51416003)(36756003)(476003)(81166006)(70206006)(126002)(8936002)(50466002)(26005)(356004)(76176011)(186003)(6666004)(7416002)(47776003)(81156014)(446003)(2616005)(8676002)(36386004)(11346002)(305945005)(14444005)(316002)(486006)(48376002)(44832011)(16586007)(70586007)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR0201MB3400; 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: 196119bb-2e0d-4dc7-24cf-08d6fde52e82 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328); SRVR:DM5PR0201MB3400; X-MS-TrafficTypeDiagnostic: DM5PR0201MB3400: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-Forefront-PRVS: 00851CA28B X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: pzuOqnQULFbbPuV/goUsg1X6v4+Ex4YCTbT3JycYBDlQ1s4hI2PNsJIeZR3WxzmZBe/t31hF9CMZNAlCmQ4FP3v4khH0slfH4NkVtJNpo3ST9zIVh5jegftNUBhrTF5lq4h5W+CW62LBSg208AgaUK6O+rLOy59gQINSR5joS1lRuM+4MYx/Sm9sf/VTVBcgwyu6EATMEI4BpdPLPcxApnqe8uyaqpn5QGB1j1kUFvwH6hqs1Qroyo4guP7n1CwJBjeNqqMIx/+4hxs7rG+IHLJdDo/ZP8LMT+fOIoxTmNQzhPZJIqG8DfEQMvEBjHm1lKumQ3H3t5+WtR6EDXy7Ya6CjghcMBesyUSpXL0s6fAjCOxRMaStfIyu4YcfiNjPzqqJyiBXdI2pv3CbKiKntLqa8Sj93VsLqLM6l7Vr+kQ= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2019 05:30:08.6750 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 196119bb-2e0d-4dc7-24cf-08d6fde52e82 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: DM5PR0201MB3400 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190630_223011_612513_3FFFE9FD X-CRM114-Status: GOOD ( 12.13 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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, linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add APIs for setting SDIO Tap Delays on ZynqMP platform. Signed-off-by: Manish Narani --- drivers/firmware/xilinx/zynqmp.c | 48 ++++++++++++++++++++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 15 ++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index fd3d837..b81f1be 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -664,6 +664,52 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, qos, ack, NULL); } +/** + * zynqmp_pm_sdio_out_setphase() - PM call to set clock output delays for SD + * @device_id: Device ID of the SD controller + * @tap_delay: Tap Delay value for output clock + * + * This API function is to be used for setting the clock output delays for SD + * clock. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_sdio_out_setphase(u32 device_id, u8 tap_delay) +{ + u32 node_id = (!device_id) ? NODE_SD_0 : NODE_SD_1; + int ret; + + ret = zynqmp_pm_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; +} + +/** + * zynqmp_pm_sdio_in_setphase() - PM call to set clock input delays for SD + * @device_id: Device ID of the SD controller + * @tap_delay: Tap Delay value for input clock + * + * This API function is to be used for setting the clock input delays for SD + * clock. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_sdio_in_setphase(u32 device_id, u8 tap_delay) +{ + u32 node_id = (!device_id) ? NODE_SD_0 : NODE_SD_1; + int ret; + + ret = zynqmp_pm_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 zynqmp_eemi_ops eemi_ops = { .get_api_version = zynqmp_pm_get_api_version, .get_chipid = zynqmp_pm_get_chipid, @@ -687,6 +733,8 @@ static const struct zynqmp_eemi_ops eemi_ops = { .set_requirement = zynqmp_pm_set_requirement, .fpga_load = zynqmp_pm_fpga_load, .fpga_get_status = zynqmp_pm_fpga_get_status, + .sdio_out_setphase = zynqmp_pm_sdio_out_setphase, + .sdio_in_setphase = zynqmp_pm_sdio_in_setphase, }; /** diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 1262ea6..d9b53e5 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -92,7 +92,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, @@ -251,6 +252,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 @@ -295,6 +306,8 @@ struct zynqmp_eemi_ops { const u32 capabilities, const u32 qos, const enum zynqmp_pm_request_ack ack); + int (*sdio_out_setphase)(u32 device_id, u8 tap_delay); + int (*sdio_in_setphase)(u32 device_id, u8 tap_delay); }; int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, From patchwork Mon Jul 1 05:29:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11024913 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 44A17746 for ; Mon, 1 Jul 2019 05:34:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EEA027B2F for ; Mon, 1 Jul 2019 05:34:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21DAB284ED; Mon, 1 Jul 2019 05:34:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C8F0527B2F for ; Mon, 1 Jul 2019 05:34:42 +0000 (UTC) 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=161qrD2PFdEsAeutjr20bpDGpXn8vjVwztfEdF22PqQ=; b=fgp/iNefDfbYDb g4W+Q2jSmR3rI14NTPPWe0sCaBL63NgNrHf8WAUYQ3InWHbm7znqsYO/07c8C87GCadI2v6WetklM Q0lb6JS1zyqHCcSDdP1b6O881yFzDQTt1dVYYC4EH5bZFerwT2WJKWyNe+Bwrxxjkr9LQXpZazOhQ ZKrTxPU4XifusprAXv+1u5OMHgXikhtrJMgKeYjOT7A5iAv3utM+4enU9X5Mg1SllKYAefn4dyfbH QGF1kukOiXJF+f7bkTZhE/9C+3qDRk5oaRxzOPW88FZSXwrCp7t6qwHdk/krUvOfR5PgyqitrTVFT q3KqvUlcbjEw5arSDIbQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hhoxc-0002ZA-7a; Mon, 01 Jul 2019 05:34:40 +0000 Received: from mail-eopbgr700072.outbound.protection.outlook.com ([40.107.70.72] helo=NAM04-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hhotJ-0007NK-9n; Mon, 01 Jul 2019 05:30:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H+8MbKdv/urDiUXPMU5VRQGsspDB9YemXx5HGwKn5Zk=; b=zNTLuAcGvTTsDukAZRQxOpPJAO5GSued8ZHHtRFK965qK1pfhL3vPG1Yw+2OZT0Vz60kFKuJ0Idg7FA+cfMaUbHLtAVaUEM69FXea5W3ZQ+VoEwUk06w3PgVlUWNZaK/Wj6/tF0OgYL+CzRRryVPvAzzDAY06ZdoXBCiKPltRTo= Received: from BL0PR02CA0137.namprd02.prod.outlook.com (20.177.207.106) by SN6PR02MB5247.namprd02.prod.outlook.com (52.135.103.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.18; Mon, 1 Jul 2019 05:30:09 +0000 Received: from BL2NAM02FT042.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::206) by BL0PR02CA0137.outlook.office365.com (2603:10b6:208:35::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2032.18 via Frontend Transport; Mon, 1 Jul 2019 05:30:08 +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 BL2NAM02FT042.mail.protection.outlook.com (10.152.76.193) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2032.15 via Frontend Transport; Mon, 1 Jul 2019 05:30:08 +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 1hhotE-0002rx-0o; Sun, 30 Jun 2019 22:30:08 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1hhot8-0003EO-LM; Sun, 30 Jun 2019 22:30:02 -0700 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 x615TuFB023630; Sun, 30 Jun 2019 22:29:56 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1hhot2-0003Ch-4m; Sun, 30 Jun 2019 22:29:56 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 6046E121756; Mon, 1 Jul 2019 10:59:54 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, heiko@sntech.de, michal.simek@xilinx.com, adrian.hunter@intel.com, christoph.muellner@theobroma-systems.com, philipp.tomsich@theobroma-systems.com, viresh.kumar@linaro.org, scott.branden@broadcom.com, ayaka@soulik.info, kernel@esmil.dk, tony.xie@rock-chips.com, rajan.vaja@xilinx.com, jolly.shah@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com, olof@lixom.net Subject: [PATCH v2 10/11] dt-bindings: mmc: arasan: Document 'xlnx, zynqmp-8.9a' controller Date: Mon, 1 Jul 2019 10:59:50 +0530 Message-Id: <1561958991-21935-11-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1561958991-21935-1-git-send-email-manish.narani@xilinx.com> References: <1561958991-21935-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)(396003)(39860400002)(136003)(2980300002)(199004)(189003)(16586007)(50226002)(76176011)(336012)(2616005)(316002)(42186006)(51416003)(7416002)(72206003)(2906002)(476003)(186003)(106002)(47776003)(305945005)(26005)(4326008)(36756003)(356004)(6666004)(36386004)(52956003)(81156014)(8676002)(50466002)(63266004)(126002)(486006)(70586007)(70206006)(81166006)(5660300002)(103686004)(44832011)(48376002)(11346002)(6266002)(478600001)(426003)(446003)(8936002)(142933001)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR02MB5247; 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: 09ededdd-3bed-49ab-90d8-08d6fde52e72 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328); SRVR:SN6PR02MB5247; X-MS-TrafficTypeDiagnostic: SN6PR02MB5247: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-Forefront-PRVS: 00851CA28B X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: ABitW+AB6Qt1J8swLUC04IWvycGShZVF7p5AszSz7rsPc47ISs4bZ7JvKvI1Fouv7qKBg6UVSNrC6gCPMZ/wzUFOUUMgnOxT8oP+5t1nQkHK6dOqkTlOPzYPzJmJvYVmZRgF9ghqzeOqE7z8g3vv3bGkEnKpQY7BdtHO2F6rogX7HlxkvLqvm6ggvhDXjeYzdtaZ9JVQcnjK27IP4EKnylj2z/U2KNzlE/6yOlQFQMt26C5vTJqiPa9hrHVVIIW+VD5VwJMWFCp5MTIOJvElgvX9XH1I+FkkQ6Y8XSM44KnrYH25fpls48uQymcJAKUF7169Dy+BSGKI+F5ZxbTcxPKKKHhF7lR9F8Gs00fBoP1mlhcNTsTPidDqn2gfZCNN3OXcki6+YT5dy2//OtFTU3nLe2P0fV1OliFgMy4Y3JA= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2019 05:30:08.6380 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09ededdd-3bed-49ab-90d8-08d6fde52e72 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: SN6PR02MB5247 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190630_223013_372442_422FBBB0 X-CRM114-Status: GOOD ( 10.04 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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, linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 7425d52..d2058ee 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]. @@ -65,6 +68,10 @@ Optional Properties: controller while switching to particular speed mode. If not specified, driver will configure the default value defined for particular mode in it. + - 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"; @@ -100,3 +107,15 @@ Example: phy-names = "phy_arasan"; #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>, <&sdhci 0>, <&sdhci 1>; + clock-names = "clk_xin", "clk_ahb", "clk_sdcard", "clk_sample"; + clock-output-names = "clk_out_sd0", "clk_in_sd0"; + #clock-cells = <1>; + clk-phase-sd-hs = <63>, <72>; + }; From patchwork Mon Jul 1 05:29:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 11024897 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E01E6746 for ; Mon, 1 Jul 2019 05:32:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBD9327B2F for ; Mon, 1 Jul 2019 05:32:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFDBD284ED; Mon, 1 Jul 2019 05:32:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 226D327B2F for ; Mon, 1 Jul 2019 05:32:54 +0000 (UTC) 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=neEHw+p/0lsIRteaqUZ9gz66WXNw0MKwEZeSsE5LH/0=; b=TXYQZYaOV43EWY mS24aGMh5y2j9gkcWYIMCw6zybGJ1CAydn+WjTOqMnMqbQN+QcFg5LVp/YbC0eQZqlbiUm1+mjygy yyHzDXKBJ2edftRJWOOuNQOHtkcKluEhgYx9Q6gE8218gsv7GFWIDjnnQJ1G5BoXfydIdIp4vEkEy WGwJ/YZ5Q97ECmG176SR/m+at7e/K1wsHOhcZjcDkgJSc11dDtjnSf8lorjKicc8tTZnttIrNNasP NFLNEV2pfgLsByphjPIiYgrbBmUIKxgM1OuAYyovY4LhFGvSGHjWhrn5vQQ96JT4xfQ+lTjE5yUgn ZkKtL3gvZNqdqIYFSgcg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hhovs-00012U-5m; Mon, 01 Jul 2019 05:32:52 +0000 Received: from mail-eopbgr760082.outbound.protection.outlook.com ([40.107.76.82] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hhotH-0007LE-Kx; Mon, 01 Jul 2019 05:30:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dUA72EvoKP7jjMM7blwJWBJAdFDGoEeg8uvtkSuLNgI=; b=BRZoW+paXVC+RBh3Z5h8+1DQODcrAeRs+J9eND3eCLLZ55chm1I9nox8WEhSFZI+0iCViO0PX0tQ0EltjJ4MfbNhU3xVqtzO4enjqt01S38qgk8OZiX405+XDVvPdJLRkYjGqeubAkEGyNxg47YhXWPyG4zdrArYnaKIOjSYUA8= Received: from SN4PR0201CA0012.namprd02.prod.outlook.com (2603:10b6:803:2b::22) by DM6PR02MB5244.namprd02.prod.outlook.com (2603:10b6:5:48::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Mon, 1 Jul 2019 05:30:07 +0000 Received: from BL2NAM02FT008.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::209) by SN4PR0201CA0012.outlook.office365.com (2603:10b6:803:2b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2032.20 via Frontend Transport; Mon, 1 Jul 2019 05:30:07 +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 BL2NAM02FT008.mail.protection.outlook.com (10.152.76.162) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2032.15 via Frontend Transport; Mon, 1 Jul 2019 05:30:07 +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 1hhotC-0002rn-Dt; Sun, 30 Jun 2019 22:30:06 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1hhot7-0003EO-8P; Sun, 30 Jun 2019 22:30:01 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x615TuGY008189; Sun, 30 Jun 2019 22:29:56 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1hhot2-0003Cg-4i; Sun, 30 Jun 2019 22:29:56 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 667AD12175A; Mon, 1 Jul 2019 10:59:54 +0530 (IST) From: Manish Narani To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, heiko@sntech.de, michal.simek@xilinx.com, adrian.hunter@intel.com, christoph.muellner@theobroma-systems.com, philipp.tomsich@theobroma-systems.com, viresh.kumar@linaro.org, scott.branden@broadcom.com, ayaka@soulik.info, kernel@esmil.dk, tony.xie@rock-chips.com, rajan.vaja@xilinx.com, jolly.shah@xilinx.com, nava.manne@xilinx.com, mdf@kernel.org, manish.narani@xilinx.com, olof@lixom.net Subject: [PATCH v2 11/11] mmc: sdhci-of-arasan: Add support for ZynqMP Platform Tap Delays Setup Date: Mon, 1 Jul 2019 10:59:51 +0530 Message-Id: <1561958991-21935-12-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1561958991-21935-1-git-send-email-manish.narani@xilinx.com> References: <1561958991-21935-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)(136003)(376002)(396003)(39860400002)(2980300002)(189003)(199004)(336012)(4326008)(6266002)(5660300002)(426003)(52956003)(106002)(103686004)(42186006)(478600001)(72206003)(50226002)(2906002)(63266004)(7416002)(51416003)(36756003)(476003)(70206006)(81166006)(126002)(8936002)(50466002)(26005)(356004)(76176011)(186003)(6666004)(48376002)(47776003)(81156014)(446003)(2616005)(8676002)(36386004)(11346002)(305945005)(14444005)(316002)(486006)(44832011)(16586007)(70586007)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB5244; 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: 5df68a71-4728-4b1e-a9a7-08d6fde52d8f X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328); SRVR:DM6PR02MB5244; X-MS-TrafficTypeDiagnostic: DM6PR02MB5244: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-Forefront-PRVS: 00851CA28B X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: wi9ef65SqQ7ogaew/4nrVOKx4WSEBFtIWgNVujDO+GDF/0VWYa7Pds8zABf43HcXtXJDXTvJjPZcref0pZYG0o9KV6DMWzJUEn2A73Jt7lEecxwZYECb/BjNOZqSroHHmKSrY2VjrBjtkTu0zOq6YLeLl1y6q9WOmXeCOGL3yQA0sQGzsmPppCaNMt00StqMbjTQV22DwQpF+MFnXh9LwrHBAs2Xq0BcOZCP602M8ZbKaeq5TUQI1UgC6T9/X+BhbsWWhOPqKC7Av/qHvL1GoCgYNnPG+zyRZ4jI8k4wknU49wtspwZb6i/G3TGIYDxcpXeZthZjZCI0Yx0AElYuqW9Ty81eH50eH4q9BxHwfD1LVJl+N6LmZLSZPkE+KkEHD4jf/vV07FJVTHH0ObKCRYQv06MhiBy++SlxZfe0SJU= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2019 05:30:07.0219 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5df68a71-4728-4b1e-a9a7-08d6fde52d8f 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: DM6PR02MB5244 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190630_223011_744839_1BCD57F8 X-CRM114-Status: GOOD ( 18.93 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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, linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 | 200 ++++++++++++++++++++++++++++++++++++- 1 file changed, 198 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index a545221..508d942 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, 60, 72, 0, 60, 72, 135, 180, 72, 36, 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; }; /** @@ -510,6 +521,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); @@ -569,6 +584,144 @@ static const struct clk_ops arasan_sampleclk_ops = { }; /** + * 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 device_id = !strcmp(clk_name, "clk_out_sd0") ? 0 : 1; + u8 tap_delay, tap_max = 0; + + if (!eemi_ops->sdio_out_setphase) + return -ENODEV; + + /* + * 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 */ + return eemi_ops->sdio_out_setphase(device_id, tap_delay); +} + +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 device_id = !strcmp(clk_name, "clk_in_sd0") ? 0 : 1; + u8 tap_delay, tap_max = 0; + + if (!eemi_ops->sdio_in_setphase) + return -ENODEV; + + /* + * 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 */ + return eemi_ops->sdio_in_setphase(device_id, tap_delay); +} + +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 * * The corecfg_clockmultiplier is supposed to contain clock multiplier @@ -693,6 +846,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 @@ -700,6 +857,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, @@ -770,7 +943,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; ret = devm_clk_hw_register(dev, &clk_data->sdcardclk_hw); @@ -834,7 +1010,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; ret = devm_clk_hw_register(dev, &clk_data->sampleclk_hw); @@ -1012,6 +1191,23 @@ static int sdhci_arasan_probe(struct platform_device *pdev) if (ret) goto unreg_clk; + 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);