2020-04-28 23:11:26

by Michael Walle

[permalink] [raw]
Subject: [PATCH net-next v2 1/4] net: phy: bcm54140: use genphy_soft_reset()

Set the .soft_reset() op to be sure there will be a reset even if there
is no hardware reset line registered.

Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
---
changes since v1:
- added reviewed-by tags

drivers/net/phy/bcm54140.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/phy/bcm54140.c b/drivers/net/phy/bcm54140.c
index 7341f0126cc4..eb5dbacc1253 100644
--- a/drivers/net/phy/bcm54140.c
+++ b/drivers/net/phy/bcm54140.c
@@ -862,6 +862,7 @@ static struct phy_driver bcm54140_drivers[] = {
.probe = bcm54140_probe,
.suspend = genphy_suspend,
.resume = genphy_resume,
+ .soft_reset = genphy_soft_reset,
.get_tunable = bcm54140_get_tunable,
.set_tunable = bcm54140_set_tunable,
},
--
2.20.1


2020-04-28 23:12:18

by Michael Walle

[permalink] [raw]
Subject: [PATCH net-next v2 3/4] net: phy: bcm54140: apply the workaround on b0 chips

The lower three bits of the phy_id specifies the chip stepping. The
workaround is specifically for the B0 stepping. Apply it only on these
chips.

Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
---
changes since v1:
- added reviewed-by tags

drivers/net/phy/bcm54140.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/bcm54140.c b/drivers/net/phy/bcm54140.c
index edafc9dc2f63..d73cbddbc69b 100644
--- a/drivers/net/phy/bcm54140.c
+++ b/drivers/net/phy/bcm54140.c
@@ -115,6 +115,9 @@
#define BCM54140_HWMON_IN_ALARM_BIT(ch) ((ch) ? BCM54140_RDB_MON_ISR_3V3 \
: BCM54140_RDB_MON_ISR_1V0)

+#define BCM54140_PHY_ID_REV(phy_id) ((phy_id) & 0x7)
+#define BCM54140_REV_B0 1
+
#define BCM54140_DEFAULT_DOWNSHIFT 5
#define BCM54140_MAX_DOWNSHIFT 9

@@ -632,9 +635,11 @@ static int bcm54140_config_init(struct phy_device *phydev)
int ret;

/* Apply hardware errata */
- ret = bcm54140_b0_workaround(phydev);
- if (ret)
- return ret;
+ if (BCM54140_PHY_ID_REV(phydev->phy_id) == BCM54140_REV_B0) {
+ ret = bcm54140_b0_workaround(phydev);
+ if (ret)
+ return ret;
+ }

/* Unmask events we are interested in. */
reg &= ~(BCM54140_RDB_INT_DUPLEX |
--
2.20.1

2020-05-01 03:57:46

by David Miller

[permalink] [raw]
Subject: Re: [PATCH net-next v2 1/4] net: phy: bcm54140: use genphy_soft_reset()

From: Michael Walle <[email protected]>
Date: Wed, 29 Apr 2020 01:06:56 +0200

> Set the .soft_reset() op to be sure there will be a reset even if there
> is no hardware reset line registered.
>
> Signed-off-by: Michael Walle <[email protected]>
> Reviewed-by: Florian Fainelli <[email protected]>

Applied.

2020-05-01 03:58:25

by David Miller

[permalink] [raw]
Subject: Re: [PATCH net-next v2 3/4] net: phy: bcm54140: apply the workaround on b0 chips

From: Michael Walle <[email protected]>
Date: Wed, 29 Apr 2020 01:06:58 +0200

> The lower three bits of the phy_id specifies the chip stepping. The
> workaround is specifically for the B0 stepping. Apply it only on these
> chips.
>
> Signed-off-by: Michael Walle <[email protected]>
> Reviewed-by: Andrew Lunn <[email protected]>
> Reviewed-by: Florian Fainelli <[email protected]>

Applied.