All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2] net: phy: broadcom: remove BCM5482 1000Base-BX support
@ 2021-02-08 23:17 Michael Walle
  2021-02-09  1:30 ` Andrew Lunn
  2021-02-09 19:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Walle @ 2021-02-08 23:17 UTC (permalink / raw)
  To: bcm-kernel-feedback-list, netdev, linux-kernel
  Cc: Florian Fainelli, Andrew Lunn, Heiner Kallweit, Russell King,
	David S . Miller, Jakub Kicinski, Michael Walle

It is nowhere used in the kernel. It also seems to be lacking the
proper fiber advertise flags. Remove it.

Signed-off-by: Michael Walle <michael@walle.cc>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
---
changes since v1:
 - added queue to subject
 - reworded 1000BX to 1000Base-BX

 drivers/net/phy/broadcom.c | 93 +-------------------------------------
 1 file changed, 1 insertion(+), 92 deletions(-)

diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index 8a4ec3222168..3142ba768313 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -361,96 +361,6 @@ static int bcm54811_config_init(struct phy_device *phydev)
 	return err;
 }
 
-static int bcm5482_config_init(struct phy_device *phydev)
-{
-	int err, reg;
-
-	err = bcm54xx_config_init(phydev);
-
-	if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX) {
-		/*
-		 * Enable secondary SerDes and its use as an LED source
-		 */
-		reg = bcm_phy_read_shadow(phydev, BCM5482_SHD_SSD);
-		bcm_phy_write_shadow(phydev, BCM5482_SHD_SSD,
-				     reg |
-				     BCM5482_SHD_SSD_LEDM |
-				     BCM5482_SHD_SSD_EN);
-
-		/*
-		 * Enable SGMII slave mode and auto-detection
-		 */
-		reg = BCM5482_SSD_SGMII_SLAVE | MII_BCM54XX_EXP_SEL_SSD;
-		err = bcm_phy_read_exp(phydev, reg);
-		if (err < 0)
-			return err;
-		err = bcm_phy_write_exp(phydev, reg, err |
-					BCM5482_SSD_SGMII_SLAVE_EN |
-					BCM5482_SSD_SGMII_SLAVE_AD);
-		if (err < 0)
-			return err;
-
-		/*
-		 * Disable secondary SerDes powerdown
-		 */
-		reg = BCM5482_SSD_1000BX_CTL | MII_BCM54XX_EXP_SEL_SSD;
-		err = bcm_phy_read_exp(phydev, reg);
-		if (err < 0)
-			return err;
-		err = bcm_phy_write_exp(phydev, reg,
-					err & ~BCM5482_SSD_1000BX_CTL_PWRDOWN);
-		if (err < 0)
-			return err;
-
-		/*
-		 * Select 1000BASE-X register set (primary SerDes)
-		 */
-		reg = bcm_phy_read_shadow(phydev, BCM54XX_SHD_MODE);
-		bcm_phy_write_shadow(phydev, BCM54XX_SHD_MODE,
-				     reg | BCM54XX_SHD_MODE_1000BX);
-
-		/*
-		 * LED1=ACTIVITYLED, LED3=LINKSPD[2]
-		 * (Use LED1 as secondary SerDes ACTIVITY LED)
-		 */
-		bcm_phy_write_shadow(phydev, BCM5482_SHD_LEDS1,
-			BCM5482_SHD_LEDS1_LED1(BCM_LED_SRC_ACTIVITYLED) |
-			BCM5482_SHD_LEDS1_LED3(BCM_LED_SRC_LINKSPD2));
-
-		/*
-		 * Auto-negotiation doesn't seem to work quite right
-		 * in this mode, so we disable it and force it to the
-		 * right speed/duplex setting.  Only 'link status'
-		 * is important.
-		 */
-		phydev->autoneg = AUTONEG_DISABLE;
-		phydev->speed = SPEED_1000;
-		phydev->duplex = DUPLEX_FULL;
-	}
-
-	return err;
-}
-
-static int bcm5482_read_status(struct phy_device *phydev)
-{
-	int err;
-
-	err = genphy_read_status(phydev);
-
-	if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX) {
-		/*
-		 * Only link status matters for 1000Base-X mode, so force
-		 * 1000 Mbit/s full-duplex status
-		 */
-		if (phydev->link) {
-			phydev->speed = SPEED_1000;
-			phydev->duplex = DUPLEX_FULL;
-		}
-	}
-
-	return err;
-}
-
 static int bcm5481_config_aneg(struct phy_device *phydev)
 {
 	struct device_node *np = phydev->mdio.dev.of_node;
@@ -800,8 +710,7 @@ static struct phy_driver broadcom_drivers[] = {
 	.phy_id_mask	= 0xfffffff0,
 	.name		= "Broadcom BCM5482",
 	/* PHY_GBIT_FEATURES */
-	.config_init	= bcm5482_config_init,
-	.read_status	= bcm5482_read_status,
+	.config_init	= bcm54xx_config_init,
 	.config_intr	= bcm_phy_config_intr,
 	.handle_interrupt = bcm_phy_handle_interrupt,
 }, {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] net: phy: broadcom: remove BCM5482 1000Base-BX support
  2021-02-08 23:17 [PATCH net-next v2] net: phy: broadcom: remove BCM5482 1000Base-BX support Michael Walle
@ 2021-02-09  1:30 ` Andrew Lunn
  2021-02-09  6:51   ` Heiner Kallweit
  2021-02-09 19:20 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2021-02-09  1:30 UTC (permalink / raw)
  To: Michael Walle
  Cc: bcm-kernel-feedback-list, netdev, linux-kernel, Florian Fainelli,
	Heiner Kallweit, Russell King, David S . Miller, Jakub Kicinski

On Tue, Feb 09, 2021 at 12:17:06AM +0100, Michael Walle wrote:
> It is nowhere used in the kernel. It also seems to be lacking the
> proper fiber advertise flags. Remove it.

Maybe also remove the #define for PHY_BCM_FLAGS_MODE_1000BX? Maybe
there is an out of tree driver using this? By removing the #define, it
will fail at compile time, making it obvious the support has been
removed?

Otherwise:

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] net: phy: broadcom: remove BCM5482 1000Base-BX support
  2021-02-09  1:30 ` Andrew Lunn
@ 2021-02-09  6:51   ` Heiner Kallweit
  0 siblings, 0 replies; 4+ messages in thread
From: Heiner Kallweit @ 2021-02-09  6:51 UTC (permalink / raw)
  To: Andrew Lunn, Michael Walle
  Cc: bcm-kernel-feedback-list, netdev, linux-kernel, Florian Fainelli,
	Russell King, David S . Miller, Jakub Kicinski

On 09.02.2021 02:30, Andrew Lunn wrote:
> On Tue, Feb 09, 2021 at 12:17:06AM +0100, Michael Walle wrote:
>> It is nowhere used in the kernel. It also seems to be lacking the
>> proper fiber advertise flags. Remove it.
> 
> Maybe also remove the #define for PHY_BCM_FLAGS_MODE_1000BX? Maybe
> there is an out of tree driver using this? By removing the #define, it
> will fail at compile time, making it obvious the support has been
> removed?
> 

AFAICS this flag is still used in BCM54616S PHY driver code.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] net: phy: broadcom: remove BCM5482 1000Base-BX support
  2021-02-08 23:17 [PATCH net-next v2] net: phy: broadcom: remove BCM5482 1000Base-BX support Michael Walle
  2021-02-09  1:30 ` Andrew Lunn
@ 2021-02-09 19:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-09 19:20 UTC (permalink / raw)
  To: Michael Walle
  Cc: bcm-kernel-feedback-list, netdev, linux-kernel, f.fainelli,
	andrew, hkallweit1, linux, davem, kuba

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Tue,  9 Feb 2021 00:17:06 +0100 you wrote:
> It is nowhere used in the kernel. It also seems to be lacking the
> proper fiber advertise flags. Remove it.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>
> Acked-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> changes since v1:
>  - added queue to subject
>  - reworded 1000BX to 1000Base-BX
> 
> [...]

Here is the summary with links:
  - [net-next,v2] net: phy: broadcom: remove BCM5482 1000Base-BX support
    https://git.kernel.org/netdev/net-next/c/1e2e61af1996

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-09 23:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 23:17 [PATCH net-next v2] net: phy: broadcom: remove BCM5482 1000Base-BX support Michael Walle
2021-02-09  1:30 ` Andrew Lunn
2021-02-09  6:51   ` Heiner Kallweit
2021-02-09 19:20 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.