From patchwork Thu Jun 8 20:04:26 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: 9776393 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 B23FE60393 for ; Thu, 8 Jun 2017 20:05:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2F8E28418 for ; Thu, 8 Jun 2017 20:05:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9780928472; Thu, 8 Jun 2017 20:05:32 +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 1240F28418 for ; Thu, 8 Jun 2017 20:05:32 +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=JftVVmnXuUWuZxMGr/RzW9iqTv9cOjhhIzO+u0+s154=; b=kOyAfAfj1/f8iB vcocsKyr3bssUbB/DK/kRVUKkN+29SM8IHOKdWISIhgqANkK8RchqloDJDVsCaXOCB099AfEaMKUH otxUkWVwrPoX5Eota8V8ipUfeWpRQuL2DMCf2HenqGEBCXQ4YFRBfhdth/3VpZecMTdx/JVNvjs07 Sy5hv+wHY3cy+PhJsjn1eIqXvvhrGwKcLBeSPHdbiybmbPKDiptI1Xo61RnlyCWEb3A0QfLPDGAr3 t3vEYai0Wl309WzRwk7Dsnc35ZiHN9poXWuvpiCWaO/EHCVbaMBHaXPhPCMW90kdS2n/tlZv5joqb bM8XcsUSRX6Dneq7Ztww==; 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 1dJ3gR-00037G-22; Thu, 08 Jun 2017 20:05:31 +0000 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dJ3g1-0001OU-Ao for linux-arm-kernel@lists.infradead.org; Thu, 08 Jun 2017 20:05:07 +0000 Received: by mail-lf0-x242.google.com with SMTP id v20so3814430lfa.2 for ; Thu, 08 Jun 2017 13:04:46 -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=AvMZ/66s4Klj7BPMv8kpqcaosR6Dnnb9kjCbaxM2aJM=; b=YemSo4NGbElkS3m/R11fGUGVEHUmKozdK742b/huTjgt9/XAfo8gthob1lJbYut1N1 5XXyqr21AYLvi4HTgZzVyOQmdI8Il+wL1Sd/PZz3dy8qpLUqTrJ/CkQuaVWrUbW9O3iv uX1QymjkKgaUJjwMGXhEQTtbVawK/NlrssRjg7DE0j8IJnB4Ou0dP9xQq47o8CdRagXT 9ZAMy1fuBIAxn7j6ObcVK9FPfqP0qkjx+SoK2P38iQvF8C1UTgSop/v8OjMozFo4S4M6 sCF5KCFswh5b63lwKqYo21Me1oxHNAoLe+ATrVLE04pGS99bgtpHxSmpamp5sXJYHSX+ Pesw== 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=AvMZ/66s4Klj7BPMv8kpqcaosR6Dnnb9kjCbaxM2aJM=; b=HDIpb6oOQVzzIupKj+SZbOWC4QHIINFBPWYNErxL7JamfH/PuTXkpNdThwnsVMQGRS GAIxG2H1VAU/UODBdysAxCEfzuuypKzgaDap0yGzfHDcF3azqLbU4p5sP5zfbP+WEA11 JF50NnOtgzIqj/Cbsgz6jUD9QQAg285WPIhZSmGB3MLjixARcmzXXzTJ6FMv/LFBab6W 80RQ5rjz+3iwXRZ3cny8YjAih1I9lQMUKfkA7daxmMI2VQVIchhnaKi8nTre4Qy4oI/2 WFode4oOx8uhwokBf2IBrMiPcrer/rD1aZfb9kgHeJ66wLtGlJi32K4XiJEcfaI8A4n0 Uexg== X-Gm-Message-State: AODbwcCHJDDiz24xDkx3Nvf1AriOfCO7Egj1afJsZQ/BS/Y+aVZQV02H heae4CCumRctDUgr X-Received: by 10.25.125.133 with SMTP id y127mr11654324lfc.12.1496952285539; Thu, 08 Jun 2017 13:04:45 -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 s14sm37477ljd.3.2017.06.08.13.04.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 13:04:44 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kishon Vijay Abraham I Subject: [PATCH V2 3/5] phy: bcm-ns-usb3: enable MDIO in the platform specific code Date: Thu, 8 Jun 2017 22:04:26 +0200 Message-Id: <20170608200428.9187-4-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170608200428.9187-1-zajec5@gmail.com> References: <20170511132925.14564-1-zajec5@gmail.com> <20170608200428.9187-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170608_130505_629083_9ACC0B85 X-CRM114-Status: GOOD ( 12.34 ) 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/broadcom/phy-bcm-ns-usb3.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/phy/broadcom/phy-bcm-ns-usb3.c b/drivers/phy/broadcom/phy-bcm-ns-usb3.c index 3d0fe5728029..2c9a0d5f43d8 100644 --- a/drivers/phy/broadcom/phy-bcm-ns-usb3.c +++ b/drivers/phy/broadcom/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);