Skip to contentSkip to conversation

net: phy: add BCM7425 and BCM7429 PHYs

PATCH Superseded Petri Gynther 2 participants 3 messages Oct 1, 2014

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: add BCM7425 and BCM7429 PHYs

---
 drivers/net/phy/bcm7xxx.c | 28 ++++++++++++++++++++++++++++
 include/linux/brcmphy.h   |  2 ++
 2 files changed, 30 insertions(+)
drivers/net/phy/bcm7xxx.c +28 -0
index daae699..0ae90f1 100644
@@ -350,6 +350,32 @@ static struct phy_driver bcm7xxx_driver[] = {
 	BCM7XXX_28NM_GPHY(PHY_ID_BCM7439, "Broadcom BCM7439"),
 	BCM7XXX_28NM_GPHY(PHY_ID_BCM7445, "Broadcom BCM7445"),
 {
+	.phy_id         = PHY_ID_BCM7425,
+	.phy_id_mask    = 0xffffffff,
+	.name           = "Broadcom BCM7425 External PHY",
+	.features       = PHY_GBIT_FEATURES |
+			  SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+	.flags          = 0,
+	.config_init    = bcm7xxx_config_init,
+	.config_aneg    = genphy_config_aneg,
+	.read_status    = genphy_read_status,
+	.suspend        = bcm7xxx_suspend,
+	.resume         = bcm7xxx_config_init,
+	.driver         = { .owner = THIS_MODULE },
+}, {
+	.phy_id         = PHY_ID_BCM7429,
+	.phy_id_mask    = 0xffffffff,
+	.name           = "Broadcom BCM7429 Internal PHY",
+	.features       = PHY_GBIT_FEATURES |
+			  SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+	.flags          = PHY_IS_INTERNAL,
+	.config_init    = bcm7xxx_config_init,
+	.config_aneg    = genphy_config_aneg,
+	.read_status    = genphy_read_status,
+	.suspend        = bcm7xxx_suspend,
+	.resume         = bcm7xxx_config_init,
+	.driver         = { .owner = THIS_MODULE },
+}, {
 	.phy_id		= PHY_BCM_OUI_4,
 	.phy_id_mask	= 0xffff0000,
 	.name		= "Broadcom BCM7XXX 40nm",
@@ -381,6 +407,8 @@ static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = {
 	{ PHY_ID_BCM7250, 0xfffffff0, },
 	{ PHY_ID_BCM7364, 0xfffffff0, },
 	{ PHY_ID_BCM7366, 0xfffffff0, },
+	{ PHY_ID_BCM7425, 0xffffffff, },
+	{ PHY_ID_BCM7429, 0xffffffff, },
 	{ PHY_ID_BCM7439, 0xfffffff0, },
 	{ PHY_ID_BCM7445, 0xfffffff0, },
 	{ PHY_BCM_OUI_4, 0xffff0000 },
include/linux/brcmphy.h +2 -0
index 3f626fe..666132e 100644
@@ -16,6 +16,8 @@
 #define PHY_ID_BCM7250			0xae025280
 #define PHY_ID_BCM7364			0xae025260
 #define PHY_ID_BCM7366			0x600d8490
+#define PHY_ID_BCM7425			0x03625e69
+#define PHY_ID_BCM7429			0x600d8731
 #define PHY_ID_BCM7439			0x600d8480
 #define PHY_ID_BCM7445			0x600d8510
 
Signature · 1 line
2.1.0.rc2.206.gedb03e5
#1 lore raw

Hello Petri,

This looks good to me, some minor comments below

Quoted 11 lines · Petri Gynther
---
 drivers/net/phy/bcm7xxx.c | 28 ++++++++++++++++++++++++++++
 include/linux/brcmphy.h   |  2 ++
 2 files changed, 30 insertions(+)
drivers/net/phy/bcm7xxx.c +0 -0
index daae699..0ae90f1 100644

drivers/net/phy/bcm7xxx.c static struct phy_driver bcm7xxx_driver[] = { · line 354

Quoted 5 lines
drivers/net/phy/bcm7xxx.c +2 -0
@@ -350,6 +350,32 @@ static struct phy_driver bcm7xxx_driver[] = {
 	BCM7XXX_28NM_GPHY(PHY_ID_BCM7439, "Broadcom BCM7439"),
 	BCM7XXX_28NM_GPHY(PHY_ID_BCM7445, "Broadcom BCM7445"),
 {
+	.phy_id         = PHY_ID_BCM7425,
+	.phy_id_mask    = 0xffffffff,

The last 4 bits contain the revision, although we never increased it, it is safer to match with 0xffff_fff0. If that means dropping the catch all 40nm entry, that's fine by me.

drivers/net/phy/bcm7xxx.c static struct phy_driver bcm7xxx_driver[] = { · line 355

Quoted 1 line
drivers/net/phy/bcm7xxx.c +1 -0
+	.name           = "Broadcom BCM7425 External PHY",

Just use "Broadcom BCM7425" here, for consistency with the other entries, and since that's really the internal PHY of the chip.

drivers/net/phy/bcm7xxx.c static struct phy_driver bcm7xxx_driver[] = { · line 368

Quoted 13 lines
drivers/net/phy/bcm7xxx.c +13 -0
+	.features       = PHY_GBIT_FEATURES |
+			  SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+	.flags          = 0,
+	.config_init    = bcm7xxx_config_init,
+	.config_aneg    = genphy_config_aneg,
+	.read_status    = genphy_read_status,
+	.suspend        = bcm7xxx_suspend,
+	.resume         = bcm7xxx_config_init,
+	.driver         = { .owner = THIS_MODULE },
+}, {
+	.phy_id         = PHY_ID_BCM7429,
+	.phy_id_mask    = 0xffffffff,
+	.name           = "Broadcom BCM7429 Internal PHY",

Same thing here.

Quoted 36 lines
drivers/net/phy/bcm7xxx.c +12 -0
+	.features       = PHY_GBIT_FEATURES |
+			  SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+	.flags          = PHY_IS_INTERNAL,
+	.config_init    = bcm7xxx_config_init,
+	.config_aneg    = genphy_config_aneg,
+	.read_status    = genphy_read_status,
+	.suspend        = bcm7xxx_suspend,
+	.resume         = bcm7xxx_config_init,
+	.driver         = { .owner = THIS_MODULE },
+}, {
 	.phy_id		= PHY_BCM_OUI_4,
 	.phy_id_mask	= 0xffff0000,
 	.name		= "Broadcom BCM7XXX 40nm",
@@ -381,6 +407,8 @@ static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = {
 	{ PHY_ID_BCM7250, 0xfffffff0, },
 	{ PHY_ID_BCM7364, 0xfffffff0, },
 	{ PHY_ID_BCM7366, 0xfffffff0, },
+	{ PHY_ID_BCM7425, 0xffffffff, },
+	{ PHY_ID_BCM7429, 0xffffffff, },
 	{ PHY_ID_BCM7439, 0xfffffff0, },
 	{ PHY_ID_BCM7445, 0xfffffff0, },
 	{ PHY_BCM_OUI_4, 0xffff0000 },
include/linux/brcmphy.h +2 -0
index 3f626fe..666132e 100644
@@ -16,6 +16,8 @@
 #define PHY_ID_BCM7250			0xae025280
 #define PHY_ID_BCM7364			0xae025260
 #define PHY_ID_BCM7366			0x600d8490
+#define PHY_ID_BCM7425			0x03625e69
+#define PHY_ID_BCM7429			0x600d8731
 #define PHY_ID_BCM7439			0x600d8480
 #define PHY_ID_BCM7445			0x600d8510
 
#2 lore raw

Hi Florian,

Quoted 11 lines · Florian Fainelli

Hello Petri,

This looks good to me, some minor comments below

Quoted 6 lines · Petri Gynther
---
 drivers/net/phy/bcm7xxx.c | 28 ++++++++++++++++++++++++++++
 include/linux/brcmphy.h   |  2 ++
 2 files changed, 30 insertions(+)
Quoted 15 lines

drivers/net/phy/bcm7xxx.c static struct phy_driver bcm7xxx_driver[] = { · line 354

Quoted 10 lines
drivers/net/phy/bcm7xxx.c +2 -0
index daae699..0ae90f1 100644
@@ -350,6 +350,32 @@ static struct phy_driver bcm7xxx_driver[] = {
      BCM7XXX_28NM_GPHY(PHY_ID_BCM7439, "Broadcom BCM7439"),
      BCM7XXX_28NM_GPHY(PHY_ID_BCM7445, "Broadcom BCM7445"),
 {
+     .phy_id         = PHY_ID_BCM7425,
+     .phy_id_mask    = 0xffffffff,

The last 4 bits contain the revision, although we never increased it, it is safer to match with 0xffff_fff0. If that means dropping the catch all 40nm entry, that's fine by me.

OK. Will fix.

Quoted 5 lines

drivers/net/phy/bcm7xxx.c static struct phy_driver bcm7xxx_driver[] = { · line 355

Quoted 1 line
drivers/net/phy/bcm7xxx.c +1 -0
+     .name           = "Broadcom BCM7425 External PHY",

Just use "Broadcom BCM7425" here, for consistency with the other entries, and since that's really the internal PHY of the chip.

OK.

Quoted 14 lines

drivers/net/phy/bcm7xxx.c static struct phy_driver bcm7xxx_driver[] = { · line 368

Quoted 13 lines
drivers/net/phy/bcm7xxx.c +13 -0
+     .features       = PHY_GBIT_FEATURES |
+                       SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+     .flags          = 0,
+     .config_init    = bcm7xxx_config_init,
+     .config_aneg    = genphy_config_aneg,
+     .read_status    = genphy_read_status,
+     .suspend        = bcm7xxx_suspend,
+     .resume         = bcm7xxx_config_init,
+     .driver         = { .owner = THIS_MODULE },
+}, {
+     .phy_id         = PHY_ID_BCM7429,
+     .phy_id_mask    = 0xffffffff,
+     .name           = "Broadcom BCM7429 Internal PHY",
Quoted 2 lines

Same thing here.

OK.

Quoted 11 lines
Quoted 11 lines
drivers/net/phy/bcm7xxx.c +10 -0
+     .features       = PHY_GBIT_FEATURES |
+                       SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+     .flags          = PHY_IS_INTERNAL,
+     .config_init    = bcm7xxx_config_init,
+     .config_aneg    = genphy_config_aneg,
+     .read_status    = genphy_read_status,
+     .suspend        = bcm7xxx_suspend,
+     .resume         = bcm7xxx_config_init,
+     .driver         = { .owner = THIS_MODULE },
+}, {
      .phy_id         = PHY_BCM_OUI_4,
Quoted 8 lines

drivers/net/phy/bcm7xxx.c static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = { · line 411

Quoted 8 lines
drivers/net/phy/bcm7xxx.c +2 -0
      .phy_id_mask    = 0xffff0000,
      .name           = "Broadcom BCM7XXX 40nm",
@@ -381,6 +407,8 @@ static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = {
      { PHY_ID_BCM7250, 0xfffffff0, },
      { PHY_ID_BCM7364, 0xfffffff0, },
      { PHY_ID_BCM7366, 0xfffffff0, },
+     { PHY_ID_BCM7425, 0xffffffff, },
+     { PHY_ID_BCM7429, 0xffffffff, },

I need to adjust these masks as well.

Quoted 4 lines
Quoted 4 lines
drivers/net/phy/bcm7xxx.c +0 -0
      { PHY_ID_BCM7439, 0xfffffff0, },
      { PHY_ID_BCM7445, 0xfffffff0, },
      { PHY_BCM_OUI_4, 0xffff0000 },
include/linux/brcmphy.h +0 -0
Quoted 8 lines

include/linux/brcmphy.h line 19

Quoted 8 lines

index 3f626fe..666132e 100644

include/linux/brcmphy.h +1 -0
@@ -16,6 +16,8 @@
 #define PHY_ID_BCM7250                       0xae025280
 #define PHY_ID_BCM7364                       0xae025260
 #define PHY_ID_BCM7366                       0x600d8490
+#define PHY_ID_BCM7425                       0x03625e69

This should then be 0x03625e60, right?

Quoted 1 line

include/linux/brcmphy.h line 20

Quoted 1 line
include/linux/brcmphy.h +1 -0
+#define PHY_ID_BCM7429                       0x600d8731

And this 0x600d8730?

Quoted 5 lines

include/linux/brcmphy.h line 23

Quoted 4 lines
include/linux/brcmphy.h +0 -0
 #define PHY_ID_BCM7439                       0x600d8480
 #define PHY_ID_BCM7445                       0x600d8510
 

-- Petri