linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/phy: Add Cortina CS43xx PHY support
@ 2014-03-05  8:16 Shengzhou Liu
  2014-03-05  9:29 ` Kumar Gala
  0 siblings, 1 reply; 5+ messages in thread
From: Shengzhou Liu @ 2014-03-05  8:16 UTC (permalink / raw)
  To: linuxppc-dev, scottwood; +Cc: YongHua Cao, Shengzhou Liu

Add support for Cortina CS4315/CS4340 10G PHY.
(Tested with CS4315 on T2080RDB and CS4340 on T4240RDB).

Signed-off-by: YongHua Cao <B43619@freescale.com>
Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
---
 drivers/net/phy/Kconfig   |  5 +++
 drivers/net/phy/Makefile  |  1 +
 drivers/net/phy/cortina.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 98 insertions(+)
 create mode 100644 drivers/net/phy/cortina.c

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 1d18443..f7d6c8c 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -60,6 +60,11 @@ config VITESSE_PHY
         ---help---
           Currently supports the vsc8244
 
+config CORTINA_PHY
+	tristate "Drivers for the Cortina PHYs"
+	---help---
+	  Currently supports the CS4315 and CS4340 PHY.
+
 config SMSC_PHY
 	tristate "Drivers for SMSC PHYs"
 	---help---
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index a4f96b7..4047042 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_LXT_PHY)		+= lxt.o
 obj-$(CONFIG_QSEMI_PHY)		+= qsemi.o
 obj-$(CONFIG_SMSC_PHY)		+= smsc.o
 obj-$(CONFIG_VITESSE_PHY)	+= vitesse.o
+obj-$(CONFIG_CORTINA_PHY)	+= cortina.o
 obj-$(CONFIG_BROADCOM_PHY)	+= broadcom.o
 obj-$(CONFIG_BCM63XX_PHY)	+= bcm63xx.o
 obj-$(CONFIG_BCM87XX_PHY)	+= bcm87xx.o
diff --git a/drivers/net/phy/cortina.c b/drivers/net/phy/cortina.c
new file mode 100644
index 0000000..154827c
--- /dev/null
+++ b/drivers/net/phy/cortina.c
@@ -0,0 +1,92 @@
+/* Driver for Cortina PHYs
+ *
+ * Copyright 2013-2014 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/mii.h>
+#include <linux/ethtool.h>
+#include <linux/phy.h>
+
+#define PHY_ID_CS4340	0x13e51002
+
+MODULE_DESCRIPTION("Cortina PHY driver");
+MODULE_AUTHOR("Caoyh");
+MODULE_LICENSE("GPL");
+
+static int cs4340_config_init(struct phy_device *phydev)
+{
+	phydev->supported = SUPPORTED_10000baseT_Full;
+	phydev->advertising = SUPPORTED_10000baseT_Full;
+
+	return 0;
+}
+
+static int cs4340_config_aneg(struct phy_device *phydev)
+{
+	return 0;
+}
+
+static int cs4340_read_status(struct phy_device *phydev)
+{
+	phydev->link = 1;
+	phydev->speed = 10000;
+	phydev->duplex = DUPLEX_FULL;
+	return 0;
+}
+
+static int cs4340_ack_interrupt(struct phy_device *phydev)
+{
+	return 0;
+}
+
+static int cs4340_config_intr(struct phy_device *phydev)
+{
+	return 0;
+}
+
+static struct phy_driver cs4340_driver = {
+	.phy_id		= PHY_ID_CS4340,
+	.phy_id_mask	= 0xffffffff,
+	.name		= "Cortina CS4315/CS4340",
+	.features	= 0,
+	.config_init	= &cs4340_config_init,
+	.config_aneg	= &cs4340_config_aneg,
+	.read_status	= &cs4340_read_status,
+	.ack_interrupt	= &cs4340_ack_interrupt,
+	.config_intr	= &cs4340_config_intr,
+	.driver		= { .owner = THIS_MODULE,},
+};
+
+static int __init cs4340_init(void)
+{
+	int err;
+
+	err = phy_driver_register(&cs4340_driver);
+	if (err < 0)
+			return err;
+
+	return 0;
+}
+
+static void __exit cs4340_exit(void)
+{
+	phy_driver_unregister(&cs4340_driver);
+}
+
+module_init(cs4340_init);
+module_exit(cs4340_exit);
+
+static struct mdio_device_id __maybe_unused cortina_tbl[] = {
+	{ PHY_ID_CS4340, 0xffffffff},
+	{},
+};
+
+MODULE_DEVICE_TABLE(mdio, cortina_tbl);
-- 
1.8.0

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

* Re: [PATCH] net/phy: Add Cortina CS43xx PHY support
  2014-03-05  8:16 [PATCH] net/phy: Add Cortina CS43xx PHY support Shengzhou Liu
@ 2014-03-05  9:29 ` Kumar Gala
  2014-03-05  9:52   ` Shengzhou.Liu
  2014-03-05 11:09   ` Shengzhou.Liu
  0 siblings, 2 replies; 5+ messages in thread
From: Kumar Gala @ 2014-03-05  9:29 UTC (permalink / raw)
  To: Shengzhou Liu; +Cc: scottwood, linuxppc-dev, YongHua Cao


On Mar 5, 2014, at 2:16 AM, Shengzhou Liu <Shengzhou.Liu@freescale.com> =
wrote:

> Add support for Cortina CS4315/CS4340 10G PHY.
> (Tested with CS4315 on T2080RDB and CS4340 on T4240RDB).
>=20
> Signed-off-by: YongHua Cao <B43619@freescale.com>
> Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
> ---
> drivers/net/phy/Kconfig   |  5 +++
> drivers/net/phy/Makefile  |  1 +
> drivers/net/phy/cortina.c | 92 =
+++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 98 insertions(+)
> create mode 100644 drivers/net/phy/cortina.c

This patch really needs to be posted to the netdev list

- k=

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

* RE: [PATCH] net/phy: Add Cortina CS43xx PHY support
  2014-03-05  9:29 ` Kumar Gala
@ 2014-03-05  9:52   ` Shengzhou.Liu
  2014-03-05 11:09   ` Shengzhou.Liu
  1 sibling, 0 replies; 5+ messages in thread
From: Shengzhou.Liu @ 2014-03-05  9:52 UTC (permalink / raw)
  To: Kumar Gala
  Cc: Scott Wood, linuxppc-dev@lists.ozlabs.org, B43619@freescale.com

Sure, will too post to netdev list.

Regards,
Shengzhou


> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Wednesday, March 05, 2014 5:30 PM
> To: Liu Shengzhou-B36685
> Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Cao Yong Hua-B43619
> Subject: Re: [PATCH] net/phy: Add Cortina CS43xx PHY support
>=20
>=20
> On Mar 5, 2014, at 2:16 AM, Shengzhou Liu <Shengzhou.Liu@freescale.com>
> wrote:
>=20
> > Add support for Cortina CS4315/CS4340 10G PHY.
> > (Tested with CS4315 on T2080RDB and CS4340 on T4240RDB).
> >
> > Signed-off-by: YongHua Cao <B43619@freescale.com>
> > Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
> > ---
> > drivers/net/phy/Kconfig   |  5 +++
> > drivers/net/phy/Makefile  |  1 +
> > drivers/net/phy/cortina.c | 92
> +++++++++++++++++++++++++++++++++++++++++++++++
> > 3 files changed, 98 insertions(+)
> > create mode 100644 drivers/net/phy/cortina.c
>=20
> This patch really needs to be posted to the netdev list
>=20
> - k

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

* RE: [PATCH] net/phy: Add Cortina CS43xx PHY support
  2014-03-05  9:29 ` Kumar Gala
  2014-03-05  9:52   ` Shengzhou.Liu
@ 2014-03-05 11:09   ` Shengzhou.Liu
  2014-03-05 18:08     ` Scott Wood
  1 sibling, 1 reply; 5+ messages in thread
From: Shengzhou.Liu @ 2014-03-05 11:09 UTC (permalink / raw)
  To: Kumar Gala
  Cc: Scott Wood, linuxppc-dev@lists.ozlabs.org, B43619@freescale.com

Abandon this patch, in Kernel gen10g_driver can support Cortina PHY,  we ne=
ed specific PHY driver just in u-boot.

-Shengzhou

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

* Re: [PATCH] net/phy: Add Cortina CS43xx PHY support
  2014-03-05 11:09   ` Shengzhou.Liu
@ 2014-03-05 18:08     ` Scott Wood
  0 siblings, 0 replies; 5+ messages in thread
From: Scott Wood @ 2014-03-05 18:08 UTC (permalink / raw)
  To: Liu Shengzhou-B36685; +Cc: linuxppc-dev@lists.ozlabs.org, Cao Yong Hua-B43619

On Wed, 2014-03-05 at 05:09 -0600, Liu Shengzhou-B36685 wrote:
> Abandon this patch, in Kernel gen10g_driver can support Cortina PHY,  we need specific PHY driver just in u-boot.

Why shouldn't U-Boot have a generic driver too?

-Scott

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

end of thread, other threads:[~2014-03-05 18:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-05  8:16 [PATCH] net/phy: Add Cortina CS43xx PHY support Shengzhou Liu
2014-03-05  9:29 ` Kumar Gala
2014-03-05  9:52   ` Shengzhou.Liu
2014-03-05 11:09   ` Shengzhou.Liu
2014-03-05 18:08     ` Scott Wood

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).