devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next PATCH 0/8] add phy driver for Atheros AR8031 and CPSW phy-mode DT enhancement
@ 2013-06-04  6:10 Mugunthan V N
  2013-06-04  6:10 ` [net-next PATCH 1/8] drivers: net: phy: at803x code cleanup on register and unregister driver Mugunthan V N
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Mugunthan V N @ 2013-06-04  6:10 UTC (permalink / raw)
  To: netdev
  Cc: davem, devicetree-discuss, linux-omap, benoit.cousson, paul,
	Mugunthan V N

This patch series adds the following feature
* Atheros phy driver code cleanup
* Add AT8031 phy driver to at803x driver
* Add RGMII tx delay support via phy_if
* Add phy_if DT enhancement to CPSW Driver and DT

Mugunthan V N (8):
  drivers: net: phy: at803x code cleanup on register and unregister
    driver
  drivers: net: phy: at803x: seperate wol specific code to wol standard
    apis
  drivers: net: phy: at803x: add interface mode support
  drivers: net: phy: at803x: add support for AT8031
  ARM: OMAP2+: omap2plus_defconfig: Enable Atheros support
  ARM: dts: AM33XX: Add CPSW phy_id device tree data to am335x-evmsk
  drivers: net: ethernet: cpsw: add phy-mode support to cpsw driver
  ARM: dts: AM33XX: Add phy-mode to CPSW node

 Documentation/devicetree/bindings/net/cpsw.txt |    6 ++
 arch/arm/boot/dts/am335x-bone.dts              |    2 +
 arch/arm/boot/dts/am335x-evm.dts               |    2 +
 arch/arm/boot/dts/am335x-evmsk.dts             |   10 ++
 arch/arm/configs/omap2plus_defconfig           |    1 +
 drivers/net/ethernet/ti/cpsw.c                 |    2 +
 drivers/net/phy/at803x.c                       |  128 ++++++++++++++++--------
 7 files changed, 111 insertions(+), 40 deletions(-)

-- 
1.7.9.5


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

* [net-next PATCH 1/8] drivers: net: phy: at803x code cleanup on register and unregister driver
  2013-06-04  6:10 [net-next PATCH 0/8] add phy driver for Atheros AR8031 and CPSW phy-mode DT enhancement Mugunthan V N
@ 2013-06-04  6:10 ` Mugunthan V N
  2013-06-04 12:02   ` Sergei Shtylyov
  2013-06-04  6:10 ` [net-next PATCH 2/8] drivers: net: phy: at803x: seperate wol specific code to wol standard apis Mugunthan V N
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 13+ messages in thread
From: Mugunthan V N @ 2013-06-04  6:10 UTC (permalink / raw)
  To: netdev
  Cc: davem, devicetree-discuss, linux-omap, benoit.cousson, paul,
	Mugunthan V N, Matus Ujhelyi

Make use of phy_drivers_register/phy_drivers_unregister to register/unregister
multiple phy drivers in a single module.

Cc: Matus Ujhelyi <ujhelyi.m@gmail.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 drivers/net/phy/at803x.c |   35 ++++++++++-------------------------
 1 file changed, 10 insertions(+), 25 deletions(-)

diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index 45cbc10..a1063e1 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -108,8 +108,9 @@ static int at803x_config_init(struct phy_device *phydev)
 	return 0;
 }
 
-/* ATHEROS 8035 */
-static struct phy_driver at8035_driver = {
+static struct phy_driver at803x_driver[] = {
+{
+	/* ATHEROS 8035 */
 	.phy_id		= 0x004dd072,
 	.name		= "Atheros 8035 ethernet",
 	.phy_id_mask	= 0xffffffef,
@@ -121,10 +122,8 @@ static struct phy_driver at8035_driver = {
 	.driver		= {
 		.owner = THIS_MODULE,
 	},
-};
-
-/* ATHEROS 8030 */
-static struct phy_driver at8030_driver = {
+}, {
+	/* ATHEROS 8030 */
 	.phy_id		= 0x004dd076,
 	.name		= "Atheros 8030 ethernet",
 	.phy_id_mask	= 0xffffffef,
@@ -136,32 +135,18 @@ static struct phy_driver at8030_driver = {
 	.driver		= {
 		.owner = THIS_MODULE,
 	},
-};
+} };
 
 static int __init atheros_init(void)
 {
-	int ret;
-
-	ret = phy_driver_register(&at8035_driver);
-	if (ret)
-		goto err1;
-
-	ret = phy_driver_register(&at8030_driver);
-	if (ret)
-		goto err2;
-
-	return 0;
-
-err2:
-	phy_driver_unregister(&at8035_driver);
-err1:
-	return ret;
+	return phy_drivers_register(at803x_driver,
+				    ARRAY_SIZE(at803x_driver));
 }
 
 static void __exit atheros_exit(void)
 {
-	phy_driver_unregister(&at8035_driver);
-	phy_driver_unregister(&at8030_driver);
+	return phy_drivers_unregister(at803x_driver,
+				      ARRAY_SIZE(at803x_driver));
 }
 
 module_init(atheros_init);
-- 
1.7.9.5

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

* [net-next PATCH 2/8] drivers: net: phy: at803x: seperate wol specific code to wol standard apis
  2013-06-04  6:10 [net-next PATCH 0/8] add phy driver for Atheros AR8031 and CPSW phy-mode DT enhancement Mugunthan V N
  2013-06-04  6:10 ` [net-next PATCH 1/8] drivers: net: phy: at803x code cleanup on register and unregister driver Mugunthan V N
@ 2013-06-04  6:10 ` Mugunthan V N
  2013-06-04  6:10 ` [net-next PATCH 3/8] drivers: net: phy: at803x: add interface mode support Mugunthan V N
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Mugunthan V N @ 2013-06-04  6:10 UTC (permalink / raw)
  To: netdev
  Cc: davem, devicetree-discuss, linux-omap, benoit.cousson, paul,
	Mugunthan V N, Matus Ujhelyi

WOL is initilized in phy config_init, but there are standard apis
(set_wol/get_wol) for WOL in phy frame work. So this patch moves
WOL specific code from config_init to wol standard apis.

Cc: Matus Ujhelyi <ujhelyi.m@gmail.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 drivers/net/phy/at803x.c |   64 ++++++++++++++++++++++++++++++++++------------
 1 file changed, 48 insertions(+), 16 deletions(-)

diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index a1063e1..63444b7 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -32,10 +32,13 @@ MODULE_DESCRIPTION("Atheros 803x PHY driver");
 MODULE_AUTHOR("Matus Ujhelyi");
 MODULE_LICENSE("GPL");
 
-static void at803x_set_wol_mac_addr(struct phy_device *phydev)
+static int at803x_set_wol(struct phy_device *phydev,
+			  struct ethtool_wolinfo *wol)
 {
 	struct net_device *ndev = phydev->attached_dev;
 	const u8 *mac;
+	int ret;
+	u32 value;
 	unsigned int i, offsets[] = {
 		AT803X_LOC_MAC_ADDR_32_47_OFFSET,
 		AT803X_LOC_MAC_ADDR_16_31_OFFSET,
@@ -43,30 +46,60 @@ static void at803x_set_wol_mac_addr(struct phy_device *phydev)
 	};
 
 	if (!ndev)
-		return;
+		return -ENODEV;
 
-	mac = (const u8 *) ndev->dev_addr;
+	if (wol->wolopts & WAKE_MAGIC) {
+		mac = (const u8 *) ndev->dev_addr;
 
-	if (!is_valid_ether_addr(mac))
-		return;
+		if (!is_valid_ether_addr(mac))
+			return -EFAULT;
 
-	for (i = 0; i < 3; i++) {
-		phy_write(phydev, AT803X_MMD_ACCESS_CONTROL,
+		for (i = 0; i < 3; i++) {
+			phy_write(phydev, AT803X_MMD_ACCESS_CONTROL,
 				  AT803X_DEVICE_ADDR);
-		phy_write(phydev, AT803X_MMD_ACCESS_CONTROL_DATA,
+			phy_write(phydev, AT803X_MMD_ACCESS_CONTROL_DATA,
 				  offsets[i]);
-		phy_write(phydev, AT803X_MMD_ACCESS_CONTROL,
+			phy_write(phydev, AT803X_MMD_ACCESS_CONTROL,
 				  AT803X_FUNC_DATA);
-		phy_write(phydev, AT803X_MMD_ACCESS_CONTROL_DATA,
+			phy_write(phydev, AT803X_MMD_ACCESS_CONTROL_DATA,
 				  mac[(i * 2) + 1] | (mac[(i * 2)] << 8));
+		}
+
+		value = phy_read(phydev, AT803X_INTR_ENABLE);
+		value |= AT803X_WOL_ENABLE;
+		ret = phy_write(phydev, AT803X_INTR_ENABLE, value);
+		if (ret)
+			return ret;
+		value = phy_read(phydev, AT803X_INTR_STATUS);
+	} else {
+		value = phy_read(phydev, AT803X_INTR_ENABLE);
+		value &= (~AT803X_WOL_ENABLE);
+		ret = phy_write(phydev, AT803X_INTR_ENABLE, value);
+		if (ret)
+			return ret;
+		value = phy_read(phydev, AT803X_INTR_STATUS);
 	}
+
+	return ret;
+}
+
+static void at803x_get_wol(struct phy_device *phydev,
+			   struct ethtool_wolinfo *wol)
+{
+	u32 value;
+
+	wol->supported = WAKE_MAGIC;
+	wol->wolopts = 0;
+
+	value = phy_read(phydev, AT803X_INTR_ENABLE);
+	if (value & AT803X_WOL_ENABLE)
+		wol->wolopts |= WAKE_MAGIC;
 }
 
 static int at803x_config_init(struct phy_device *phydev)
 {
 	int val;
 	u32 features;
-	int status;
 
 	features = SUPPORTED_TP | SUPPORTED_MII | SUPPORTED_AUI |
 		   SUPPORTED_FIBRE | SUPPORTED_BNC;
@@ -100,11 +133,6 @@ static int at803x_config_init(struct phy_device *phydev)
 	phydev->supported = features;
 	phydev->advertising = features;
 
-	/* enable WOL */
-	at803x_set_wol_mac_addr(phydev);
-	status = phy_write(phydev, AT803X_INTR_ENABLE, AT803X_WOL_ENABLE);
-	status = phy_read(phydev, AT803X_INTR_STATUS);
-
 	return 0;
 }
 
@@ -115,6 +143,8 @@ static struct phy_driver at803x_driver[] = {
 	.name		= "Atheros 8035 ethernet",
 	.phy_id_mask	= 0xffffffef,
 	.config_init	= at803x_config_init,
+	.set_wol	= at803x_set_wol,
+	.get_wol	= at803x_get_wol,
 	.features	= PHY_GBIT_FEATURES,
 	.flags		= PHY_HAS_INTERRUPT,
 	.config_aneg	= &genphy_config_aneg,
@@ -128,6 +158,8 @@ static struct phy_driver at803x_driver[] = {
 	.name		= "Atheros 8030 ethernet",
 	.phy_id_mask	= 0xffffffef,
 	.config_init	= at803x_config_init,
+	.set_wol	= at803x_set_wol,
+	.get_wol	= at803x_get_wol,
 	.features	= PHY_GBIT_FEATURES,
 	.flags		= PHY_HAS_INTERRUPT,
 	.config_aneg	= &genphy_config_aneg,
-- 
1.7.9.5

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

* [net-next PATCH 3/8] drivers: net: phy: at803x: add interface mode support
  2013-06-04  6:10 [net-next PATCH 0/8] add phy driver for Atheros AR8031 and CPSW phy-mode DT enhancement Mugunthan V N
  2013-06-04  6:10 ` [net-next PATCH 1/8] drivers: net: phy: at803x code cleanup on register and unregister driver Mugunthan V N
  2013-06-04  6:10 ` [net-next PATCH 2/8] drivers: net: phy: at803x: seperate wol specific code to wol standard apis Mugunthan V N
@ 2013-06-04  6:10 ` Mugunthan V N
  2013-06-04  6:10 ` [net-next PATCH 4/8] drivers: net: phy: at803x: add support for AT8031 Mugunthan V N
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Mugunthan V N @ 2013-06-04  6:10 UTC (permalink / raw)
  To: netdev
  Cc: davem, devicetree-discuss, linux-omap, benoit.cousson, paul,
	Mugunthan V N

This patch adds support for RGMII TX delay configuration on Atheros 803X,
this can be enabled in debug registers. With this patch,
PHY_INTERFACE_MODE_RGMII_TXID modes are now supported.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 drivers/net/phy/at803x.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index 63444b7..dda07ed 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -27,6 +27,10 @@
 #define AT803X_MMD_ACCESS_CONTROL		0x0D
 #define AT803X_MMD_ACCESS_CONTROL_DATA		0x0E
 #define AT803X_FUNC_DATA			0x4003
+#define AT803X_DEBUG_ADDR			0x1D
+#define AT803X_DEBUG_DATA			0x1E
+#define AT803X_DEBUG_SYSTEM_MODE_CTRL		0x05
+#define AT803X_DEBUG_RGMII_TX_CLK_DLY		BIT(8)
 
 MODULE_DESCRIPTION("Atheros 803x PHY driver");
 MODULE_AUTHOR("Matus Ujhelyi");
@@ -99,6 +103,7 @@ static void at803x_get_wol(struct phy_device *phydev,
 static int at803x_config_init(struct phy_device *phydev)
 {
 	int val;
+	int ret;
 	u32 features;
 
 	features = SUPPORTED_TP | SUPPORTED_MII | SUPPORTED_AUI |
@@ -133,6 +138,17 @@ static int at803x_config_init(struct phy_device *phydev)
 	phydev->supported = features;
 	phydev->advertising = features;
 
+	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) {
+		ret = phy_write(phydev, AT803X_DEBUG_ADDR,
+				AT803X_DEBUG_SYSTEM_MODE_CTRL);
+		if (ret)
+			return ret;
+		ret = phy_write(phydev, AT803X_DEBUG_DATA,
+				AT803X_DEBUG_RGMII_TX_CLK_DLY);
+		if (ret)
+			return ret;
+	}
+
 	return 0;
 }
 
-- 
1.7.9.5

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

* [net-next PATCH 4/8] drivers: net: phy: at803x: add support for AT8031
  2013-06-04  6:10 [net-next PATCH 0/8] add phy driver for Atheros AR8031 and CPSW phy-mode DT enhancement Mugunthan V N
                   ` (2 preceding siblings ...)
  2013-06-04  6:10 ` [net-next PATCH 3/8] drivers: net: phy: at803x: add interface mode support Mugunthan V N
@ 2013-06-04  6:10 ` Mugunthan V N
  2013-06-04  6:10 ` [net-next PATCH 5/8] ARM: OMAP2+: omap2plus_defconfig: Enable Atheros support Mugunthan V N
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Mugunthan V N @ 2013-06-04  6:10 UTC (permalink / raw)
  To: netdev
  Cc: davem, devicetree-discuss, linux-omap, benoit.cousson, paul,
	Mugunthan V N

This patch adds support for Atheros 8031 phy driver.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 drivers/net/phy/at803x.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index dda07ed..1f7091b 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -183,6 +183,21 @@ static struct phy_driver at803x_driver[] = {
 	.driver		= {
 		.owner = THIS_MODULE,
 	},
+}, {
+	/* ATHEROS 8031 */
+	.phy_id		= 0x004dd074,
+	.name		= "Atheros 8031 ethernet",
+	.phy_id_mask	= 0xffffffef,
+	.config_init	= at803x_config_init,
+	.set_wol	= at803x_set_wol,
+	.get_wol	= at803x_get_wol,
+	.features	= PHY_GBIT_FEATURES,
+	.flags		= PHY_HAS_INTERRUPT,
+	.config_aneg	= &genphy_config_aneg,
+	.read_status	= &genphy_read_status,
+	.driver		= {
+		.owner = THIS_MODULE,
+	},
 } };
 
 static int __init atheros_init(void)
-- 
1.7.9.5

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

* [net-next PATCH 5/8] ARM: OMAP2+: omap2plus_defconfig: Enable Atheros support
  2013-06-04  6:10 [net-next PATCH 0/8] add phy driver for Atheros AR8031 and CPSW phy-mode DT enhancement Mugunthan V N
                   ` (3 preceding siblings ...)
  2013-06-04  6:10 ` [net-next PATCH 4/8] drivers: net: phy: at803x: add support for AT8031 Mugunthan V N
@ 2013-06-04  6:10 ` Mugunthan V N
  2013-06-04  6:10 ` [net-next PATCH 6/8] ARM: dts: AM33XX: Add CPSW phy_id device tree data to am335x-evmsk Mugunthan V N
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Mugunthan V N @ 2013-06-04  6:10 UTC (permalink / raw)
  To: netdev
  Cc: davem, devicetree-discuss, linux-omap, benoit.cousson, paul,
	Mugunthan V N

Enable Atheros 803X phy driver support in defconfig which is present in
AM335x EVM and EVM Starter Kit.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 arch/arm/configs/omap2plus_defconfig |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index 435d69b..aa21009 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -283,3 +283,4 @@ CONFIG_SOC_OMAP5=y
 CONFIG_TI_DAVINCI_MDIO=y
 CONFIG_TI_DAVINCI_CPDMA=y
 CONFIG_TI_CPSW=y
+CONFIG_AT803X_PHY=y
-- 
1.7.9.5


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

* [net-next PATCH 6/8] ARM: dts: AM33XX: Add CPSW phy_id device tree data to am335x-evmsk
  2013-06-04  6:10 [net-next PATCH 0/8] add phy driver for Atheros AR8031 and CPSW phy-mode DT enhancement Mugunthan V N
                   ` (4 preceding siblings ...)
  2013-06-04  6:10 ` [net-next PATCH 5/8] ARM: OMAP2+: omap2plus_defconfig: Enable Atheros support Mugunthan V N
@ 2013-06-04  6:10 ` Mugunthan V N
  2013-06-04  6:10 ` [net-next PATCH 7/8] drivers: net: ethernet: cpsw: add phy-mode support to cpsw driver Mugunthan V N
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Mugunthan V N @ 2013-06-04  6:10 UTC (permalink / raw)
  To: netdev
  Cc: davem, devicetree-discuss, linux-omap, benoit.cousson, paul,
	Mugunthan V N

Add phy_id device tree data to am335x-evmsk device to bring up CPSW
ethernet present on am335x starter kit.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 arch/arm/boot/dts/am335x-evmsk.dts |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index f67c360..acbcac3 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -248,3 +248,11 @@
 		};
 	};
 };
+
+&cpsw_emac0 {
+	phy_id = <&davinci_mdio>, <0>;
+};
+
+&cpsw_emac1 {
+	phy_id = <&davinci_mdio>, <1>;
+};
-- 
1.7.9.5

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

* [net-next PATCH 7/8] drivers: net: ethernet: cpsw: add phy-mode support to cpsw driver
  2013-06-04  6:10 [net-next PATCH 0/8] add phy driver for Atheros AR8031 and CPSW phy-mode DT enhancement Mugunthan V N
                   ` (5 preceding siblings ...)
  2013-06-04  6:10 ` [net-next PATCH 6/8] ARM: dts: AM33XX: Add CPSW phy_id device tree data to am335x-evmsk Mugunthan V N
@ 2013-06-04  6:10 ` Mugunthan V N
  2013-06-04  6:10 ` [net-next PATCH 8/8] ARM: dts: AM33XX: Add phy-mode to CPSW node Mugunthan V N
  2013-06-04 21:17 ` [net-next PATCH 0/8] add phy driver for Atheros AR8031 and CPSW phy-mode DT enhancement David Miller
  8 siblings, 0 replies; 13+ messages in thread
From: Mugunthan V N @ 2013-06-04  6:10 UTC (permalink / raw)
  To: netdev
  Cc: davem, devicetree-discuss, linux-omap, benoit.cousson, paul,
	Mugunthan V N

Adding phy-mode support to cpsw driver and updating the cpsw binding
documentation.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 Documentation/devicetree/bindings/net/cpsw.txt |    6 ++++++
 drivers/net/ethernet/ti/cpsw.c                 |    2 ++
 2 files changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/cpsw.txt b/Documentation/devicetree/bindings/net/cpsw.txt
index 4f2ca6b..05d660e 100644
--- a/Documentation/devicetree/bindings/net/cpsw.txt
+++ b/Documentation/devicetree/bindings/net/cpsw.txt
@@ -28,6 +28,8 @@ Optional properties:
 Slave Properties:
 Required properties:
 - phy_id		: Specifies slave phy id
+- phy-mode		: The interface between the SoC and the PHY (a string
+			  that of_get_phy_mode() can understand)
 - mac-address		: Specifies slave MAC address
 
 Optional properties:
@@ -58,11 +60,13 @@ Examples:
 		cpts_clock_shift = <29>;
 		cpsw_emac0: slave@0 {
 			phy_id = <&davinci_mdio>, <0>;
+			phy-mode = "rgmii-txid";
 			/* Filled in by U-Boot */
 			mac-address = [ 00 00 00 00 00 00 ];
 		};
 		cpsw_emac1: slave@1 {
 			phy_id = <&davinci_mdio>, <1>;
+			phy-mode = "rgmii-txid";
 			/* Filled in by U-Boot */
 			mac-address = [ 00 00 00 00 00 00 ];
 		};
@@ -84,11 +88,13 @@ Examples:
 		cpts_clock_shift = <29>;
 		cpsw_emac0: slave@0 {
 			phy_id = <&davinci_mdio>, <0>;
+			phy-mode = "rgmii-txid";
 			/* Filled in by U-Boot */
 			mac-address = [ 00 00 00 00 00 00 ];
 		};
 		cpsw_emac1: slave@1 {
 			phy_id = <&davinci_mdio>, <1>;
+			phy-mode = "rgmii-txid";
 			/* Filled in by U-Boot */
 			mac-address = [ 00 00 00 00 00 00 ];
 		};
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 89a4c40..a45f64e 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1554,6 +1554,8 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
 		if (mac_addr)
 			memcpy(slave_data->mac_addr, mac_addr, ETH_ALEN);
 
+		slave_data->phy_if = of_get_phy_mode(slave_node);
+
 		if (data->dual_emac) {
 			if (of_property_read_u32(slave_node, "dual_emac_res_vlan",
 						 &prop)) {
-- 
1.7.9.5

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

* [net-next PATCH 8/8] ARM: dts: AM33XX: Add phy-mode to CPSW node
  2013-06-04  6:10 [net-next PATCH 0/8] add phy driver for Atheros AR8031 and CPSW phy-mode DT enhancement Mugunthan V N
                   ` (6 preceding siblings ...)
  2013-06-04  6:10 ` [net-next PATCH 7/8] drivers: net: ethernet: cpsw: add phy-mode support to cpsw driver Mugunthan V N
@ 2013-06-04  6:10 ` Mugunthan V N
  2013-06-04 21:17 ` [net-next PATCH 0/8] add phy driver for Atheros AR8031 and CPSW phy-mode DT enhancement David Miller
  8 siblings, 0 replies; 13+ messages in thread
From: Mugunthan V N @ 2013-06-04  6:10 UTC (permalink / raw)
  To: netdev
  Cc: davem, devicetree-discuss, linux-omap, benoit.cousson, paul,
	Mugunthan V N

Adding phy-mode to CPSW node for beaglebone, EVM and EVMsk.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 arch/arm/boot/dts/am335x-bone.dts  |    2 ++
 arch/arm/boot/dts/am335x-evm.dts   |    2 ++
 arch/arm/boot/dts/am335x-evmsk.dts |    2 ++
 3 files changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index 5302f79..4b5a8e0 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -131,8 +131,10 @@
 
 &cpsw_emac0 {
 	phy_id = <&davinci_mdio>, <0>;
+	phy-mode = "mii";
 };
 
 &cpsw_emac1 {
 	phy_id = <&davinci_mdio>, <1>;
+	phy-mode = "mii";
 };
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 0423298..814ee03 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -239,8 +239,10 @@
 
 &cpsw_emac0 {
 	phy_id = <&davinci_mdio>, <0>;
+	phy-mode = "rgmii-txid";
 };
 
 &cpsw_emac1 {
 	phy_id = <&davinci_mdio>, <1>;
+	phy-mode = "rgmii-txid";
 };
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index acbcac3..4297899 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -251,8 +251,10 @@
 
 &cpsw_emac0 {
 	phy_id = <&davinci_mdio>, <0>;
+	phy-mode = "rgmii-txid";
 };
 
 &cpsw_emac1 {
 	phy_id = <&davinci_mdio>, <1>;
+	phy-mode = "rgmii-txid";
 };
-- 
1.7.9.5


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

* Re: [net-next PATCH 1/8] drivers: net: phy: at803x code cleanup on register and unregister driver
  2013-06-04  6:10 ` [net-next PATCH 1/8] drivers: net: phy: at803x code cleanup on register and unregister driver Mugunthan V N
@ 2013-06-04 12:02   ` Sergei Shtylyov
  2013-06-04 12:43     ` Mugunthan V N
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Shtylyov @ 2013-06-04 12:02 UTC (permalink / raw)
  To: Mugunthan V N
  Cc: netdev, davem, devicetree-discuss, linux-omap, benoit.cousson,
	paul, Matus Ujhelyi

Hello.

On 04-06-2013 10:10, Mugunthan V N wrote:

> Make use of phy_drivers_register/phy_drivers_unregister to register/unregister
> multiple phy drivers in a single module.

> Cc: Matus Ujhelyi <ujhelyi.m@gmail.com>
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
> ---
>   drivers/net/phy/at803x.c |   35 ++++++++++-------------------------
>   1 file changed, 10 insertions(+), 25 deletions(-)

> diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
> index 45cbc10..a1063e1 100644
> --- a/drivers/net/phy/at803x.c
> +++ b/drivers/net/phy/at803x.c
> @@ -108,8 +108,9 @@ static int at803x_config_init(struct phy_device *phydev)
>   	return 0;
>   }
>
> -/* ATHEROS 8035 */
> -static struct phy_driver at8035_driver = {
> +static struct phy_driver at803x_driver[] = {
> +{
> +	/* ATHEROS 8035 */
>   	.phy_id		= 0x004dd072,
>   	.name		= "Atheros 8035 ethernet",
>   	.phy_id_mask	= 0xffffffef,

     That's improper indentation. Needs to be shifted by one tab.

> @@ -136,32 +135,18 @@ static struct phy_driver at8030_driver = {
>   	.driver		= {
>   		.owner = THIS_MODULE,
>   	},
> -};
> +} };

    Looks ugly...

WBR, Sergei


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

* Re: [net-next PATCH 1/8] drivers: net: phy: at803x code cleanup on register and unregister driver
  2013-06-04 12:02   ` Sergei Shtylyov
@ 2013-06-04 12:43     ` Mugunthan V N
  2013-06-04 13:43       ` Sergei Shtylyov
  0 siblings, 1 reply; 13+ messages in thread
From: Mugunthan V N @ 2013-06-04 12:43 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: netdev, davem, devicetree-discuss, linux-omap, benoit.cousson,
	paul, Matus Ujhelyi

On 6/4/2013 5:32 PM, Sergei Shtylyov wrote:
> Hello.
>
> On 04-06-2013 10:10, Mugunthan V N wrote:
>
>> Make use of phy_drivers_register/phy_drivers_unregister to 
>> register/unregister
>> multiple phy drivers in a single module.
>
>> Cc: Matus Ujhelyi <ujhelyi.m@gmail.com>
>> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
>> ---
>>   drivers/net/phy/at803x.c |   35 ++++++++++-------------------------
>>   1 file changed, 10 insertions(+), 25 deletions(-)
>
>> diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
>> index 45cbc10..a1063e1 100644
>> --- a/drivers/net/phy/at803x.c
>> +++ b/drivers/net/phy/at803x.c
>> @@ -108,8 +108,9 @@ static int at803x_config_init(struct phy_device 
>> *phydev)
>>       return 0;
>>   }
>>
>> -/* ATHEROS 8035 */
>> -static struct phy_driver at8035_driver = {
>> +static struct phy_driver at803x_driver[] = {
>> +{
>> +    /* ATHEROS 8035 */
>>       .phy_id        = 0x004dd072,
>>       .name        = "Atheros 8035 ethernet",
>>       .phy_id_mask    = 0xffffffef,
>
>     That's improper indentation. Needs to be shifted by one tab.
This indentation is as per the coding style followed in all ethernet
phy drivers. If this need so to be changed, it must be a separate patch
for all the ethernet phy drivers.
>
>> @@ -136,32 +135,18 @@ static struct phy_driver at8030_driver = {
>>       .driver        = {
>>           .owner = THIS_MODULE,
>>       },
>> -};
>> +} };
>
>    Looks ugly...
This is also the same as per the style followed in ethernet phy drivers
Please refer the below grep output

$ grep -rnaI "} };" drivers/net/phy/*
drivers/net/phy/at803x.c:201:} };
drivers/net/phy/bcm63xx.c:101:} };
drivers/net/phy/bcm87xx.c:217:} };
drivers/net/phy/broadcom.c:829:} };
drivers/net/phy/cicada.c:130:} };
drivers/net/phy/davicom.c:183:} };
drivers/net/phy/icplus.c:254:} };
drivers/net/phy/lxt.c:313:} };
drivers/net/phy/micrel.c:323:} };
drivers/net/phy/smsc.c:242:} };
drivers/net/phy/ste10Xp.c:113:} };
drivers/net/phy/vitesse.c:192:} };

Regards
Mugunthan V N

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

* Re: [net-next PATCH 1/8] drivers: net: phy: at803x code cleanup on register and unregister driver
  2013-06-04 12:43     ` Mugunthan V N
@ 2013-06-04 13:43       ` Sergei Shtylyov
  0 siblings, 0 replies; 13+ messages in thread
From: Sergei Shtylyov @ 2013-06-04 13:43 UTC (permalink / raw)
  To: Mugunthan V N
  Cc: netdev, davem, devicetree-discuss, linux-omap, benoit.cousson,
	paul, Matus Ujhelyi

On 06/04/2013 04:43 PM, Mugunthan V N wrote:

>
>>
>>> Make use of phy_drivers_register/phy_drivers_unregister to 
>>> register/unregister
>>> multiple phy drivers in a single module.
>>
>>> Cc: Matus Ujhelyi <ujhelyi.m@gmail.com>
>>> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
>>> ---
>>>   drivers/net/phy/at803x.c |   35 ++++++++++-------------------------
>>>   1 file changed, 10 insertions(+), 25 deletions(-)
>>
>>> diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
>>> index 45cbc10..a1063e1 100644
>>> --- a/drivers/net/phy/at803x.c
>>> +++ b/drivers/net/phy/at803x.c
>>> @@ -108,8 +108,9 @@ static int at803x_config_init(struct phy_device 
>>> *phydev)
>>>       return 0;
>>>   }
>>>
>>> -/* ATHEROS 8035 */
>>> -static struct phy_driver at8035_driver = {
>>> +static struct phy_driver at803x_driver[] = {
>>> +{
>>> +    /* ATHEROS 8035 */
>>>       .phy_id        = 0x004dd072,
>>>       .name        = "Atheros 8035 ethernet",
>>>       .phy_id_mask    = 0xffffffef,
>>
>>     That's improper indentation. Needs to be shifted by one tab.
> This indentation is as per the coding style followed in all ethernet
> phy drivers. If this need so to be changed, it must be a separate patch
> for all the ethernet phy drivers.
>>
>>> @@ -136,32 +135,18 @@ static struct phy_driver at8030_driver = {
>>>       .driver        = {
>>>           .owner = THIS_MODULE,
>>>       },
>>> -};
>>> +} };
>>
>>    Looks ugly...
> This is also the same as per the style followed in ethernet phy drivers
> Please refer the below grep output
>
> $ grep -rnaI "} };" drivers/net/phy/*
> drivers/net/phy/at803x.c:201:} };
> drivers/net/phy/bcm63xx.c:101:} };
> drivers/net/phy/bcm87xx.c:217:} };
> drivers/net/phy/broadcom.c:829:} };
> drivers/net/phy/cicada.c:130:} };
> drivers/net/phy/davicom.c:183:} };
> drivers/net/phy/icplus.c:254:} };
> drivers/net/phy/lxt.c:313:} };
> drivers/net/phy/micrel.c:323:} };
> drivers/net/phy/smsc.c:242:} };
> drivers/net/phy/ste10Xp.c:113:} };
> drivers/net/phy/vitesse.c:192:} };

    Sorry for the noise, coldn't imagine they're all that bad. :-)

> Regards
> Mugunthan V N

WBR, Sergei


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

* Re: [net-next PATCH 0/8] add phy driver for Atheros AR8031 and CPSW phy-mode DT enhancement
  2013-06-04  6:10 [net-next PATCH 0/8] add phy driver for Atheros AR8031 and CPSW phy-mode DT enhancement Mugunthan V N
                   ` (7 preceding siblings ...)
  2013-06-04  6:10 ` [net-next PATCH 8/8] ARM: dts: AM33XX: Add phy-mode to CPSW node Mugunthan V N
@ 2013-06-04 21:17 ` David Miller
  8 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2013-06-04 21:17 UTC (permalink / raw)
  To: mugunthanvnm; +Cc: netdev, devicetree-discuss, linux-omap, benoit.cousson, paul

From: Mugunthan V N <mugunthanvnm@ti.com>
Date: Tue, 4 Jun 2013 11:40:03 +0530

> This patch series adds the following feature
> * Atheros phy driver code cleanup
> * Add AT8031 phy driver to at803x driver
> * Add RGMII tx delay support via phy_if
> * Add phy_if DT enhancement to CPSW Driver and DT

Series applied to net-next, thanks.

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

end of thread, other threads:[~2013-06-04 21:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-04  6:10 [net-next PATCH 0/8] add phy driver for Atheros AR8031 and CPSW phy-mode DT enhancement Mugunthan V N
2013-06-04  6:10 ` [net-next PATCH 1/8] drivers: net: phy: at803x code cleanup on register and unregister driver Mugunthan V N
2013-06-04 12:02   ` Sergei Shtylyov
2013-06-04 12:43     ` Mugunthan V N
2013-06-04 13:43       ` Sergei Shtylyov
2013-06-04  6:10 ` [net-next PATCH 2/8] drivers: net: phy: at803x: seperate wol specific code to wol standard apis Mugunthan V N
2013-06-04  6:10 ` [net-next PATCH 3/8] drivers: net: phy: at803x: add interface mode support Mugunthan V N
2013-06-04  6:10 ` [net-next PATCH 4/8] drivers: net: phy: at803x: add support for AT8031 Mugunthan V N
2013-06-04  6:10 ` [net-next PATCH 5/8] ARM: OMAP2+: omap2plus_defconfig: Enable Atheros support Mugunthan V N
2013-06-04  6:10 ` [net-next PATCH 6/8] ARM: dts: AM33XX: Add CPSW phy_id device tree data to am335x-evmsk Mugunthan V N
2013-06-04  6:10 ` [net-next PATCH 7/8] drivers: net: ethernet: cpsw: add phy-mode support to cpsw driver Mugunthan V N
2013-06-04  6:10 ` [net-next PATCH 8/8] ARM: dts: AM33XX: Add phy-mode to CPSW node Mugunthan V N
2013-06-04 21:17 ` [net-next PATCH 0/8] add phy driver for Atheros AR8031 and CPSW phy-mode DT enhancement 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).