From patchwork Thu May 11 13:29:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9721511 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0FFE060364 for ; Thu, 11 May 2017 13:30:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0450328684 for ; Thu, 11 May 2017 13:30:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED60D28682; Thu, 11 May 2017 13:30:30 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 62C5928685 for ; Thu, 11 May 2017 13:30:30 +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=Kg7PcEiMUGsKXmNMnhkLZ5cbTqAsKaYF1P3ZPupInk4=; b=TTW1uwEFTP5gTp ULxd/YDVZrlr8mDlmM8v1m8HASM9/cD4XQsiLKzBKnEHSXywmUy3ni4J+63Bnna+kHvPlSr++fZkV mCWEkRAC0XgPiEQhRKxhOj3iPcNuB/aWt0/jSV0LvlhSIfpme53DPFaKyXopUMxpNoBlsgjlrLruq 4lm/rWCEboHSxEHhV6/RdrHKKej7YqnYsy+8MGWEXU5WVXlLzL4uXEgqUdvSidNLFsuTLnwdrbTsS 0tlDZXwgr15C7rNjj3L2oDVPlu9GIAFKxiiL/QEOsQ2/jwh9GW6glUqNMz2DHk+JEUbk75Zcv9rye oerstyJF0No/4rrg6qPw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d8oAn-0005AV-RF; Thu, 11 May 2017 13:30:29 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d8oAR-0003P9-2C for linux-arm-kernel@lists.infradead.org; Thu, 11 May 2017 13:30:09 +0000 Received: by mail-wm0-x242.google.com with SMTP id u65so6960154wmu.3 for ; Thu, 11 May 2017 06:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OpLtOENgFwUKcM3ZTQUSLj+cG5jrr1mMT4SVDh4Bnkc=; b=N2NwGyIhFkX4EZqfUjErBdc4vTpWAc2vrWt/EVHSxzqPF3PcGBEy7WMkcWyxhokrT/ Xo4LhgprKfUnSF48iIcIVxRfUMvvbsjsKkL/gy+1zoG4ZLV5Kz4+50SZ2VNuDhQsKA5C EfXwmO6cFW+zYvpwkbB7HnkuhL6BPmGB56HxiIOO7jZJLWSEzVUs/yi5EqdPVfdwcnZB mt9AF76RT/KdzYkwU+yK/OfyHskRKc+s2AR7YuBP69Px6mTIjEmNXPiWxMucF14qYX+y BFBLr6HNNDeR/S2jF+GBqZ9CW3RpuwXay30+SJ17ZtOAuTKexCMjA1Oe3XE1GuAfsEUl jL+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OpLtOENgFwUKcM3ZTQUSLj+cG5jrr1mMT4SVDh4Bnkc=; b=b3iIq7piDIt2j01Guw4UBW8yym9SnCSD0wm5gFgZSjhZztEgg+RlDD8QHvhUXuu4Be j9Bg2SaDkvKobC5ZeV9T7bluQsex2I982RmhvUaKcbQJ7wxx6wds8diqywMGF48KPLo+ pRqUvw6teViHYJoLO5yBV/kJkDxCcRKsM1KXEmkT6Ft8yD0rkW3u93ByPpETbhPViR6Z wFx4rCn2+OOZwMKWIk0U9mrHeog8EShgOdRItRUXm9oGWg/GCF1y9Nqnq70ioz/1kcbo GVZH4uhKn2Kg+czvBddRTMmYiVBbfAx2SEUGBuk8P6I2ex06s6hPnkdQHIqVTzugDnSO dw/Q== X-Gm-Message-State: AODbwcB0dy41vGR2j9RxIsY/TS+Gh7MyDBZluGAuT9T/zUhSrFfh7eKa jIpmJmClH3/vhg== X-Received: by 10.25.193.193 with SMTP id r184mr106312lff.125.1494509386922; Thu, 11 May 2017 06:29:46 -0700 (PDT) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id i18sm31725ljd.28.2017.05.11.06.29.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2017 06:29:46 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kishon Vijay Abraham I Subject: [PATCH 3/5] phy: bcm-ns-usb3: enable MDIO in the platform specific code Date: Thu, 11 May 2017 15:29:23 +0200 Message-Id: <20170511132925.14564-4-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170511132925.14564-1-zajec5@gmail.com> References: <20170511132925.14564-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170511_063007_529764_32825AC4 X-CRM114-Status: GOOD ( 12.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Florian Fainelli , Jon Mason , linux-kernel@vger.kernel.org, Yendapally Reddy Dhananjaya Reddy , bcm-kernel-feedback-list@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafał Miłecki When we finally start using MDIO layer then bus initialization will be handled in a separated driver. It means our code handling this has to be used for the platform driver only. Signed-off-by: Rafał Miłecki --- drivers/phy/phy-bcm-ns-usb3.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/phy/phy-bcm-ns-usb3.c b/drivers/phy/phy-bcm-ns-usb3.c index 3d0fe5728029..2c9a0d5f43d8 100644 --- a/drivers/phy/phy-bcm-ns-usb3.c +++ b/drivers/phy/phy-bcm-ns-usb3.c @@ -80,12 +80,6 @@ static int bcm_ns_usb3_phy_init_ns_bx(struct bcm_ns_usb3 *usb3) { int err; - /* Enable MDIO. Setting MDCDIV as 26 */ - writel(0x0000009a, usb3->ccb_mii + BCMA_CCB_MII_MNG_CTL); - - /* Wait for MDIO? */ - udelay(2); - /* USB3 PLL Block */ err = bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PHY_BASE_ADDR_REG, BCM_NS_USB3_PHY_PLL30_BLOCK); @@ -134,12 +128,6 @@ static int bcm_ns_usb3_phy_init_ns_ax(struct bcm_ns_usb3 *usb3) { int err; - /* Enable MDIO. Setting MDCDIV as 26 */ - writel(0x0000009a, usb3->ccb_mii + BCMA_CCB_MII_MNG_CTL); - - /* Wait for MDIO? */ - udelay(2); - /* PLL30 block */ err = bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PHY_BASE_ADDR_REG, BCM_NS_USB3_PHY_PLL30_BLOCK); @@ -278,6 +266,12 @@ static int bcm_ns_usb3_probe(struct platform_device *pdev) return PTR_ERR(usb3->ccb_mii); } + /* Enable MDIO. Setting MDCDIV as 26 */ + writel(0x0000009a, usb3->ccb_mii + BCMA_CCB_MII_MNG_CTL); + + /* Wait for MDIO? */ + udelay(2); + usb3->phy_write = bcm_ns_usb3_platform_phy_write; usb3->phy = devm_phy_create(dev, NULL, &ops);