Re: [PATCH net-next v2 4/4] net: phy: bcm54140: add second PHY ID

2020-04-30 Thread David Miller
From: Michael Walle 
Date: Wed, 29 Apr 2020 01:06:59 +0200

> This PHY has two PHY IDs depending on its mode. Adjust the mask so that
> it includes both IDs.
> 
> Signed-off-by: Michael Walle 

Applied.


Re: [PATCH net-next v2 4/4] net: phy: bcm54140: add second PHY ID

2020-04-28 Thread Florian Fainelli



On 4/28/2020 4:06 PM, Michael Walle wrote:
> This PHY has two PHY IDs depending on its mode. Adjust the mask so that
> it includes both IDs.
> 
> Signed-off-by: Michael Walle 

Reviewed-by: Florian Fainelli 

For future submissions to netdev, if you have a patch count > 1, please
include a cover letter:

Thanks!
-- 
Florian


Re: [PATCH net-next v2 4/4] net: phy: bcm54140: add second PHY ID

2020-04-28 Thread Andrew Lunn
On Wed, Apr 29, 2020 at 01:06:59AM +0200, Michael Walle wrote:
> This PHY has two PHY IDs depending on its mode. Adjust the mask so that
> it includes both IDs.
> 
> Signed-off-by: Michael Walle 

Reviewed-by: Andrew Lunn 

Andrew


[PATCH net-next v2 4/4] net: phy: bcm54140: add second PHY ID

2020-04-28 Thread Michael Walle
This PHY has two PHY IDs depending on its mode. Adjust the mask so that
it includes both IDs.

Signed-off-by: Michael Walle 
---
changes since v1:
 - leave the PHY ID in brcmphy.h but clear the masked bit
 - fixed typo in commit message

 drivers/net/phy/bcm54140.c | 11 +--
 include/linux/brcmphy.h|  2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/bcm54140.c b/drivers/net/phy/bcm54140.c
index d73cbddbc69b..b5325157206a 100644
--- a/drivers/net/phy/bcm54140.c
+++ b/drivers/net/phy/bcm54140.c
@@ -115,6 +115,13 @@
 #define BCM54140_HWMON_IN_ALARM_BIT(ch) ((ch) ? BCM54140_RDB_MON_ISR_3V3 \
  : BCM54140_RDB_MON_ISR_1V0)
 
+/* This PHY has two different PHY IDs depening on its MODE_SEL pin. This
+ * pin choses between 4x SGMII and QSGMII mode:
+ *   AE02_5009 4x SGMII
+ *   AE02_5019 QSGMII
+ */
+#define BCM54140_PHY_ID_MASK   0xffe8
+
 #define BCM54140_PHY_ID_REV(phy_id)((phy_id) & 0x7)
 #define BCM54140_REV_B01
 
@@ -857,7 +864,7 @@ static int bcm54140_set_tunable(struct phy_device *phydev,
 static struct phy_driver bcm54140_drivers[] = {
{
.phy_id = PHY_ID_BCM54140,
-   .phy_id_mask= 0xfff8,
+   .phy_id_mask= BCM54140_PHY_ID_MASK,
.name   = "Broadcom BCM54140",
.features   = PHY_GBIT_FEATURES,
.config_init= bcm54140_config_init,
@@ -875,7 +882,7 @@ static struct phy_driver bcm54140_drivers[] = {
 module_phy_driver(bcm54140_drivers);
 
 static struct mdio_device_id __maybe_unused bcm54140_tbl[] = {
-   { PHY_ID_BCM54140, 0xfff8 },
+   { PHY_ID_BCM54140, BCM54140_PHY_ID_MASK },
{ }
 };
 
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index 8be150e69c7c..58d0150acc3e 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -25,7 +25,7 @@
 #define PHY_ID_BCM5461 0x002060c0
 #define PHY_ID_BCM54612E   0x03625e60
 #define PHY_ID_BCM54616S   0x03625d10
-#define PHY_ID_BCM541400xae025019
+#define PHY_ID_BCM541400xae025009
 #define PHY_ID_BCM577800x03625d90
 #define PHY_ID_BCM896100x03625cd0
 
-- 
2.20.1