netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/4] Broadcom BCM7xxx PHY updates for new entries
@ 2014-08-26 20:15 Florian Fainelli
  2014-08-26 20:15 ` [PATCH net-next v2 1/4] net: phy: bcm7xxx: introduce helper macro Florian Fainelli
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Florian Fainelli @ 2014-08-26 20:15 UTC (permalink / raw)
  To: netdev; +Cc: davem, Florian Fainelli

Hi David,

Another week, another set of updates for the Broadcom BCM7xxx PHY driver.  This
patch set cleanups the existing definitions, adds a macro to ease the addition
of future chips, and finally add two new SoCs to the list of supported chips.

Resending since the first patch did not make it to the list, sorry about that.

Changes in v2:
- rephrased commit message for patch 1 to make it pass majordomo
  capital triple X was rejected

Thanks!

Florian Fainelli (4):
  net: phy: bcm7xxx: introduce helper macro
  net: phy: broadcom: fix PHY_BCM_OUI_4
  net: phy: broadcom: add new Broadcom OUI
  net: phy: bcm7xxx: add BCM7250 and BCM7364 PHY entries

 drivers/net/phy/bcm7xxx.c | 58 ++++++++++++++++++-----------------------------
 include/linux/brcmphy.h   |  6 +++--
 2 files changed, 26 insertions(+), 38 deletions(-)

-- 
1.9.1

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

* [PATCH net-next v2 1/4] net: phy: bcm7xxx: introduce helper macro
  2014-08-26 20:15 [PATCH net-next v2 0/4] Broadcom BCM7xxx PHY updates for new entries Florian Fainelli
@ 2014-08-26 20:15 ` Florian Fainelli
  2014-08-26 20:15 ` [PATCH net-next v2 2/4] net: phy: broadcom: fix PHY_BCM_OUI_4 Florian Fainelli
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2014-08-26 20:15 UTC (permalink / raw)
  To: netdev; +Cc: davem, Florian Fainelli

All 28nm Gigabit PHYs supported by the driver have the same
callbacks, the only differences being the 32-bits OUI and the name. Use
a macro to factor this, making it easier in the future to add new
entries.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/phy/bcm7xxx.c | 54 ++++++++++++++++-------------------------------
 1 file changed, 18 insertions(+), 36 deletions(-)

diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
index e98c510b75c5..948c7086679a 100644
--- a/drivers/net/phy/bcm7xxx.c
+++ b/drivers/net/phy/bcm7xxx.c
@@ -319,44 +319,26 @@ static int bcm7xxx_dummy_config_init(struct phy_device *phydev)
 	return 0;
 }
 
+#define BCM7XXX_28NM_GPHY(_oui, _name)					\
+{									\
+	.phy_id		= (_oui),					\
+	.phy_id_mask	= 0xfffffff0,					\
+	.name		= _name,					\
+	.features	= PHY_GBIT_FEATURES |				\
+			  SUPPORTED_Pause | SUPPORTED_Asym_Pause,	\
+	.flags		= PHY_IS_INTERNAL,				\
+	.config_init	= bcm7xxx_28nm_afe_config_init,			\
+	.config_aneg	= genphy_config_aneg,				\
+	.read_status	= genphy_read_status,				\
+	.resume		= bcm7xxx_28nm_resume,				\
+	.driver		= { .owner = THIS_MODULE },			\
+}
+
 static struct phy_driver bcm7xxx_driver[] = {
+	BCM7XXX_28NM_GPHY(PHY_ID_BCM7366, "Broadcom BCM7366"),
+	BCM7XXX_28NM_GPHY(PHY_ID_BCM7439, "Broadcom BCM7439"),
+	BCM7XXX_28NM_GPHY(PHY_ID_BCM7445, "Broadcom BCM7445"),
 {
-	.phy_id		= PHY_ID_BCM7366,
-	.phy_id_mask	= 0xfffffff0,
-	.name		= "Broadcom BCM7366",
-	.features	= PHY_GBIT_FEATURES |
-			  SUPPORTED_Pause | SUPPORTED_Asym_Pause,
-	.flags		= PHY_IS_INTERNAL,
-	.config_init	= bcm7xxx_28nm_afe_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.resume		= bcm7xxx_28nm_resume,
-	.driver		= { .owner = THIS_MODULE },
-}, {
-	.phy_id		= PHY_ID_BCM7439,
-	.phy_id_mask	= 0xfffffff0,
-	.name		= "Broadcom BCM7439",
-	.features	= PHY_GBIT_FEATURES |
-			  SUPPORTED_Pause | SUPPORTED_Asym_Pause,
-	.flags		= PHY_IS_INTERNAL,
-	.config_init	= bcm7xxx_28nm_afe_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.resume		= bcm7xxx_28nm_resume,
-	.driver		= { .owner = THIS_MODULE },
-}, {
-	.phy_id		= PHY_ID_BCM7445,
-	.phy_id_mask	= 0xfffffff0,
-	.name		= "Broadcom BCM7445",
-	.features	= PHY_GBIT_FEATURES |
-			  SUPPORTED_Pause | SUPPORTED_Asym_Pause,
-	.flags		= PHY_IS_INTERNAL,
-	.config_init	= bcm7xxx_28nm_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.resume		= bcm7xxx_28nm_afe_config_init,
-	.driver		= { .owner = THIS_MODULE },
-}, {
 	.phy_id		= PHY_BCM_OUI_4,
 	.phy_id_mask	= 0xffff0000,
 	.name		= "Broadcom BCM7XXX 40nm",
-- 
1.9.1

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

* [PATCH net-next v2 2/4] net: phy: broadcom: fix PHY_BCM_OUI_4
  2014-08-26 20:15 [PATCH net-next v2 0/4] Broadcom BCM7xxx PHY updates for new entries Florian Fainelli
  2014-08-26 20:15 ` [PATCH net-next v2 1/4] net: phy: bcm7xxx: introduce helper macro Florian Fainelli
@ 2014-08-26 20:15 ` Florian Fainelli
  2014-08-26 20:15 ` [PATCH net-next v2 3/4] net: phy: broadcom: add new Broadcom OUI Florian Fainelli
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2014-08-26 20:15 UTC (permalink / raw)
  To: netdev; +Cc: davem, Florian Fainelli

PHY_BCM_OUI_4 is missing two significant digits that actually make it an
OUI, add those missing bits so it becomes usable again for matching.

Fixes: b560a58c45c6 ("net: phy: add Broadcom BCM7xxx internal PHY driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 include/linux/brcmphy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index ee1431d976fa..921f17ca4c26 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -21,7 +21,7 @@
 #define PHY_BCM_OUI_1			0x00206000
 #define PHY_BCM_OUI_2			0x0143bc00
 #define PHY_BCM_OUI_3			0x03625c00
-#define PHY_BCM_OUI_4			0x600d0000
+#define PHY_BCM_OUI_4			0x600d8400
 #define PHY_BCM_OUI_5			0x03625e00
 
 
-- 
1.9.1

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

* [PATCH net-next v2 3/4] net: phy: broadcom: add new Broadcom OUI
  2014-08-26 20:15 [PATCH net-next v2 0/4] Broadcom BCM7xxx PHY updates for new entries Florian Fainelli
  2014-08-26 20:15 ` [PATCH net-next v2 1/4] net: phy: bcm7xxx: introduce helper macro Florian Fainelli
  2014-08-26 20:15 ` [PATCH net-next v2 2/4] net: phy: broadcom: fix PHY_BCM_OUI_4 Florian Fainelli
@ 2014-08-26 20:15 ` Florian Fainelli
  2014-08-26 20:15 ` [PATCH net-next v2 4/4] net: phy: bcm7xxx: add BCM7250 and BCM7364 PHY entries Florian Fainelli
  2014-08-28  1:15 ` [PATCH net-next v2 0/4] Broadcom BCM7xxx PHY updates for new entries David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2014-08-26 20:15 UTC (permalink / raw)
  To: netdev; +Cc: davem, Florian Fainelli

Broadcom started to use a new OUI for its 2013 and newer products:
D4-01-29 which translates into 0xae025000 for a 32-bits OUI, add its
definition.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 include/linux/brcmphy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index 921f17ca4c26..cbcfad36d4c0 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -23,7 +23,7 @@
 #define PHY_BCM_OUI_3			0x03625c00
 #define PHY_BCM_OUI_4			0x600d8400
 #define PHY_BCM_OUI_5			0x03625e00
-
+#define PHY_BCM_OUI_6			0xae025000
 
 #define PHY_BCM_FLAGS_MODE_COPPER	0x00000001
 #define PHY_BCM_FLAGS_MODE_1000BX	0x00000002
-- 
1.9.1

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

* [PATCH net-next v2 4/4] net: phy: bcm7xxx: add BCM7250 and BCM7364 PHY entries
  2014-08-26 20:15 [PATCH net-next v2 0/4] Broadcom BCM7xxx PHY updates for new entries Florian Fainelli
                   ` (2 preceding siblings ...)
  2014-08-26 20:15 ` [PATCH net-next v2 3/4] net: phy: broadcom: add new Broadcom OUI Florian Fainelli
@ 2014-08-26 20:15 ` Florian Fainelli
  2014-08-28  1:15 ` [PATCH net-next v2 0/4] Broadcom BCM7xxx PHY updates for new entries David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2014-08-26 20:15 UTC (permalink / raw)
  To: netdev; +Cc: davem, Florian Fainelli

Add two new entries to the Broadcom BCM7xxx internal PHY driver for
BCM7250 and BCM7364 chips. Those chips share the usual 28nm process
Gigabit PHY sequence and require the same workarounds so far.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/phy/bcm7xxx.c | 4 ++++
 include/linux/brcmphy.h   | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
index 948c7086679a..09dd6e1dc6e1 100644
--- a/drivers/net/phy/bcm7xxx.c
+++ b/drivers/net/phy/bcm7xxx.c
@@ -335,6 +335,8 @@ static int bcm7xxx_dummy_config_init(struct phy_device *phydev)
 }
 
 static struct phy_driver bcm7xxx_driver[] = {
+	BCM7XXX_28NM_GPHY(PHY_ID_BCM7250, "Broadcom BCM7250"),
+	BCM7XXX_28NM_GPHY(PHY_ID_BCM7364, "Broadcom BCM7364"),
 	BCM7XXX_28NM_GPHY(PHY_ID_BCM7366, "Broadcom BCM7366"),
 	BCM7XXX_28NM_GPHY(PHY_ID_BCM7439, "Broadcom BCM7439"),
 	BCM7XXX_28NM_GPHY(PHY_ID_BCM7445, "Broadcom BCM7445"),
@@ -367,6 +369,8 @@ static struct phy_driver bcm7xxx_driver[] = {
 } };
 
 static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = {
+	{ PHY_ID_BCM7250, 0xfffffff0, },
+	{ PHY_ID_BCM7364, 0xfffffff0, },
 	{ PHY_ID_BCM7366, 0xfffffff0, },
 	{ PHY_ID_BCM7439, 0xfffffff0, },
 	{ PHY_ID_BCM7445, 0xfffffff0, },
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index cbcfad36d4c0..5bd35cc0d471 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -13,6 +13,8 @@
 #define PHY_ID_BCM5461			0x002060c0
 #define PHY_ID_BCM57780			0x03625d90
 
+#define PHY_ID_BCM7250			0xae025280
+#define PHY_ID_BCM7364			0xae025260
 #define PHY_ID_BCM7366			0x600d8490
 #define PHY_ID_BCM7439			0x600d8480
 #define PHY_ID_BCM7445			0x600d8510
-- 
1.9.1

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

* Re: [PATCH net-next v2 0/4] Broadcom BCM7xxx PHY updates for new entries
  2014-08-26 20:15 [PATCH net-next v2 0/4] Broadcom BCM7xxx PHY updates for new entries Florian Fainelli
                   ` (3 preceding siblings ...)
  2014-08-26 20:15 ` [PATCH net-next v2 4/4] net: phy: bcm7xxx: add BCM7250 and BCM7364 PHY entries Florian Fainelli
@ 2014-08-28  1:15 ` David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2014-08-28  1:15 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue, 26 Aug 2014 13:15:23 -0700

> Another week, another set of updates for the Broadcom BCM7xxx PHY driver.  This
> patch set cleanups the existing definitions, adds a macro to ease the addition
> of future chips, and finally add two new SoCs to the list of supported chips.
> 
> Resending since the first patch did not make it to the list, sorry about that.
> 
> Changes in v2:
> - rephrased commit message for patch 1 to make it pass majordomo
>   capital triple X was rejected

Series applied, thanks Florian.

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

end of thread, other threads:[~2014-08-28  1:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-26 20:15 [PATCH net-next v2 0/4] Broadcom BCM7xxx PHY updates for new entries Florian Fainelli
2014-08-26 20:15 ` [PATCH net-next v2 1/4] net: phy: bcm7xxx: introduce helper macro Florian Fainelli
2014-08-26 20:15 ` [PATCH net-next v2 2/4] net: phy: broadcom: fix PHY_BCM_OUI_4 Florian Fainelli
2014-08-26 20:15 ` [PATCH net-next v2 3/4] net: phy: broadcom: add new Broadcom OUI Florian Fainelli
2014-08-26 20:15 ` [PATCH net-next v2 4/4] net: phy: bcm7xxx: add BCM7250 and BCM7364 PHY entries Florian Fainelli
2014-08-28  1:15 ` [PATCH net-next v2 0/4] Broadcom BCM7xxx PHY updates for new entries David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).