Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1639444 > unrolled thread

[PATCH for 4.13 0/5] phy: bcm-ns-usb3: add MDIO driver

Started byRafał Miłecki <zajec5@gmail.com>
First post2017-05-11 15:40 +0200
Last post2017-05-11 15:40 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH for 4.13 0/5] phy: bcm-ns-usb3: add MDIO driver Rafał Miłecki <zajec5@gmail.com> - 2017-05-11 15:40 +0200
    [PATCH 1/5] phy: bcm-ns-usb3: always wait for idle after writing to the PHY reg Rafał Miłecki <zajec5@gmail.com> - 2017-05-11 15:40 +0200

#1639444 — [PATCH for 4.13 0/5] phy: bcm-ns-usb3: add MDIO driver

FromRafał Miłecki <zajec5@gmail.com>
Date2017-05-11 15:40 +0200
Subject[PATCH for 4.13 0/5] phy: bcm-ns-usb3: add MDIO driver
Message-ID<tFWtY-6Ru-13@gated-at.bofh.it>
From: Rafał Miłecki <rafal@milecki.pl>

As explained in the commit 9200c6f177638 ("Revert "phy: Add USB3 PHY support
for Broadcom NSP SoC"") this module should be modified to use MDIO bus as
this is how PHY is really attached.

This should allow reusing this driver on NSP and any other platform with
MDIO bus and this particular PHY.

This is material for the next merge window (4.13 kernel) obviously.

Rafał Miłecki (5):
  phy: bcm-ns-usb3: always wait for idle after writing to the PHY reg
  phy: bcm-ns-usb3: use pointer for PHY writing function
  phy: bcm-ns-usb3: enable MDIO in the platform specific code
  dt-bindings: phy: Modify Broadcom NS USB 3.0 PHY binding to use MDIO
  phy: bcm-ns-usb3: add MDIO driver using proper bus layer

 .../devicetree/bindings/phy/bcm-ns-usb3-phy.txt    |  27 ++-
 drivers/phy/Kconfig                                |   1 +
 drivers/phy/phy-bcm-ns-usb3.c                      | 223 +++++++++++++++------
 3 files changed, 179 insertions(+), 72 deletions(-)

-- 
2.11.0

[toc] | [next] | [standalone]


#1639446 — [PATCH 1/5] phy: bcm-ns-usb3: always wait for idle after writing to the PHY reg

FromRafał Miłecki <zajec5@gmail.com>
Date2017-05-11 15:40 +0200
Subject[PATCH 1/5] phy: bcm-ns-usb3: always wait for idle after writing to the PHY reg
Message-ID<tFWtY-6Ru-31@gated-at.bofh.it>
In reply to#1639444
From: Rafał Miłecki <rafal@milecki.pl>

Move MDIO specific code to the writing helper function. This makes init
code a bit more generic and doesn't require it to track what happens
after every write.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 drivers/phy/phy-bcm-ns-usb3.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/phy/phy-bcm-ns-usb3.c b/drivers/phy/phy-bcm-ns-usb3.c
index 22b5e7047fa6..5e89326886dc 100644
--- a/drivers/phy/phy-bcm-ns-usb3.c
+++ b/drivers/phy/phy-bcm-ns-usb3.c
@@ -112,7 +112,7 @@ static int bcm_ns_usb3_mdio_phy_write(struct bcm_ns_usb3 *usb3, u16 reg,
 	tmp |= value;
 	writel(tmp, usb3->ccb_mii + BCMA_CCB_MII_MNG_CMD_DATA);
 
-	return 0;
+	return bcm_ns_usb3_mii_mng_wait_idle(usb3);
 }
 
 static int bcm_ns_usb3_phy_init_ns_bx(struct bcm_ns_usb3 *usb3)
@@ -143,9 +143,6 @@ static int bcm_ns_usb3_phy_init_ns_bx(struct bcm_ns_usb3 *usb3)
 	/* Deaaserting PLL Reset */
 	bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PLLA_CONTROL1, 0x8000);
 
-	/* Waiting MII Mgt interface idle */
-	bcm_ns_usb3_mii_mng_wait_idle(usb3);
-
 	/* Deasserting USB3 system reset */
 	writel(0, usb3->dmp + BCMA_RESET_CTL);
 
@@ -169,9 +166,6 @@ static int bcm_ns_usb3_phy_init_ns_bx(struct bcm_ns_usb3 *usb3)
 	/* Enabling SSC */
 	bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_TX_PMD_CONTROL1, 0x1003);
 
-	/* Waiting MII Mgt interface idle */
-	bcm_ns_usb3_mii_mng_wait_idle(usb3);
-
 	return 0;
 }
 
@@ -205,9 +199,6 @@ static int bcm_ns_usb3_phy_init_ns_ax(struct bcm_ns_usb3 *usb3)
 
 	bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_TX_PMD_CONTROL1, 0x1003);
 
-	/* Waiting MII Mgt interface idle */
-	bcm_ns_usb3_mii_mng_wait_idle(usb3);
-
 	/* Deasserting USB3 system reset */
 	writel(0, usb3->dmp + BCMA_RESET_CTL);
 
-- 
2.11.0

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web