All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] phy: micrel: Convert micrel PHY driver to use OF
@ 2013-08-13 16:42 dinguyen
  2013-08-15 19:55 ` Linus Walleij
  2013-08-22  5:13 ` Olof Johansson
  0 siblings, 2 replies; 7+ messages in thread
From: dinguyen @ 2013-08-13 16:42 UTC (permalink / raw)
  To: dinh.linux
  Cc: Dinh Nguyen, netdev, Richard Cochran, Linus Walleij,
	Felipe Balbi, David S. Miller, Giuseppe Cavallaro,
	Olof Johansson, Rob Herring

From: Dinh Nguyen <dinguyen@altera.com>

Convert the Micrel PHY driver to use OF. This initial patch is only
the beginning of an idea to convert the PHY driver to device tree.

Signed-of-by: Dinh Nguyen <dinguyen@altera.com>
Cc: netdev@vger.kernel.org
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Felipe Balbi <balbi@ti.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Olof Johansson <olof@lixom.net>
Cc: Rob Herring <rob.herring@calxeda.com>

---
Hello,

I would like to solicit comments on the need to convert the ethernet PHY
drivers to use OF/device trees? For the platform that I'm interested in,
SOCFPGA, it is using the stmicro ethernet driver. It has a Micrel PHY
on the board. The only way that I know of how to change the skew settings
for the phy is through a board level initialization.

One of the ARM maintainers suggested that perhaps refactoring the ethernet
driver to use device tree would be nice. But that would not help me with
configuring the PHY settings.

So a little investigation led me to believe that refactoring the /net/phy
drivers into a device tree implementation would help greatly. I was thinking
it could be done like the pinctrl or some of the usb/phy driver.

Since I am only familiar with the ARM SoC space, I want to make sure that
this idea is right approach. I can start with the micrel PHY driver
first, as that is the only HW I have access to.

Thanks for any comments,

Dinh
---
 drivers/net/phy/micrel.c |  107 ++++++++++++++++------------------------------
 1 file changed, 37 insertions(+), 70 deletions(-)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 2510435..6ee1e88 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -174,6 +174,15 @@ static int ksz8873mll_config_aneg(struct phy_device *phydev)
 	return 0;
 }
 
+static const struct phy_driver ksphy_driver_data[] = {
+{
+	.config_init    = kszphy_config_init,
+	.config_aneg    = genphy_config_aneg,
+	.read_status    = genphy_read_status,
+	.ack_interrupt  = kszphy_ack_interrupt,
+	.config_intr    = ks_config_intr,
+};
+
 static struct phy_driver ksphy_driver[] = {
 {
 	.phy_id		= PHY_ID_KS8737,
@@ -181,12 +190,6 @@ static struct phy_driver ksphy_driver[] = {
 	.name		= "Micrel KS8737",
 	.features	= (PHY_BASIC_FEATURES | SUPPORTED_Pause),
 	.flags		= PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
-	.config_init	= kszphy_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.ack_interrupt	= kszphy_ack_interrupt,
-	.config_intr	= ks8737_config_intr,
-	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8021,
 	.phy_id_mask	= 0x00ffffff,
@@ -194,12 +197,6 @@ static struct phy_driver ksphy_driver[] = {
 	.features	= (PHY_BASIC_FEATURES | SUPPORTED_Pause |
 			   SUPPORTED_Asym_Pause),
 	.flags		= PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
-	.config_init	= ksz8021_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.ack_interrupt	= kszphy_ack_interrupt,
-	.config_intr	= kszphy_config_intr,
-	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8031,
 	.phy_id_mask	= 0x00ffffff,
@@ -207,12 +204,6 @@ static struct phy_driver ksphy_driver[] = {
 	.features	= (PHY_BASIC_FEATURES | SUPPORTED_Pause |
 			   SUPPORTED_Asym_Pause),
 	.flags		= PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
-	.config_init	= ksz8021_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.ack_interrupt	= kszphy_ack_interrupt,
-	.config_intr	= kszphy_config_intr,
-	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8041,
 	.phy_id_mask	= 0x00fffff0,
@@ -220,12 +211,6 @@ static struct phy_driver ksphy_driver[] = {
 	.features	= (PHY_BASIC_FEATURES | SUPPORTED_Pause
 				| SUPPORTED_Asym_Pause),
 	.flags		= PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
-	.config_init	= kszphy_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.ack_interrupt	= kszphy_ack_interrupt,
-	.config_intr	= kszphy_config_intr,
-	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8051,
 	.phy_id_mask	= 0x00fffff0,
@@ -233,60 +218,30 @@ static struct phy_driver ksphy_driver[] = {
 	.features	= (PHY_BASIC_FEATURES | SUPPORTED_Pause
 				| SUPPORTED_Asym_Pause),
 	.flags		= PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
-	.config_init	= ks8051_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.ack_interrupt	= kszphy_ack_interrupt,
-	.config_intr	= kszphy_config_intr,
-	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8001,
 	.name		= "Micrel KSZ8001 or KS8721",
 	.phy_id_mask	= 0x00ffffff,
 	.features	= (PHY_BASIC_FEATURES | SUPPORTED_Pause),
 	.flags		= PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
-	.config_init	= kszphy_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.ack_interrupt	= kszphy_ack_interrupt,
-	.config_intr	= kszphy_config_intr,
-	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8081,
 	.name		= "Micrel KSZ8081 or KSZ8091",
 	.phy_id_mask	= 0x00fffff0,
 	.features	= (PHY_BASIC_FEATURES | SUPPORTED_Pause),
 	.flags		= PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
-	.config_init	= kszphy_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.ack_interrupt	= kszphy_ack_interrupt,
-	.config_intr	= kszphy_config_intr,
-	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ8061,
 	.name		= "Micrel KSZ8061",
 	.phy_id_mask	= 0x00fffff0,
 	.features	= (PHY_BASIC_FEATURES | SUPPORTED_Pause),
 	.flags		= PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
-	.config_init	= kszphy_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.ack_interrupt	= kszphy_ack_interrupt,
-	.config_intr	= kszphy_config_intr,
-	.driver		= { .owner = THIS_MODULE,},
 }, {
 	.phy_id		= PHY_ID_KSZ9021,
 	.phy_id_mask	= 0x000ffffe,
 	.name		= "Micrel KSZ9021 Gigabit PHY",
 	.features	= (PHY_GBIT_FEATURES | SUPPORTED_Pause),
 	.flags		= PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
-	.config_init	= kszphy_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.ack_interrupt	= kszphy_ack_interrupt,
-	.config_intr	= ksz9021_config_intr,
-	.driver		= { .owner = THIS_MODULE, },
 }, {
 	.phy_id		= PHY_ID_KSZ9031,
 	.phy_id_mask	= 0x00fffff0,
@@ -294,32 +249,18 @@ static struct phy_driver ksphy_driver[] = {
 	.features	= (PHY_GBIT_FEATURES | SUPPORTED_Pause
 				| SUPPORTED_Asym_Pause),
 	.flags		= PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
-	.config_init	= kszphy_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.ack_interrupt	= kszphy_ack_interrupt,
-	.config_intr	= ksz9021_config_intr,
-	.driver		= { .owner = THIS_MODULE, },
 }, {
 	.phy_id		= PHY_ID_KSZ8873MLL,
 	.phy_id_mask	= 0x00fffff0,
 	.name		= "Micrel KSZ8873MLL Switch",
 	.features	= (SUPPORTED_Pause | SUPPORTED_Asym_Pause),
 	.flags		= PHY_HAS_MAGICANEG,
-	.config_init	= kszphy_config_init,
-	.config_aneg	= ksz8873mll_config_aneg,
-	.read_status	= ksz8873mll_read_status,
-	.driver		= { .owner = THIS_MODULE, },
 }, {
 	.phy_id		= PHY_ID_KSZ886X,
 	.phy_id_mask	= 0x00fffff0,
 	.name		= "Micrel KSZ886X Switch",
 	.features	= (PHY_BASIC_FEATURES | SUPPORTED_Pause),
 	.flags		= PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
-	.config_init	= kszphy_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.driver		= { .owner = THIS_MODULE, },
 } };
 
 static int __init ksphy_init(void)
@@ -334,8 +275,34 @@ static void __exit ksphy_exit(void)
 		ARRAY_SIZE(ksphy_driver));
 }
 
-module_init(ksphy_init);
-module_exit(ksphy_exit);
+static const struct of_device_id phy_micrel_match[] = {
+	{ .compatible = "micrel,ks8721", .data = &ksphy_driver_data },
+	{ .compatible = "micrel,ks8737", .data = &ksphy_driver_data },
+	{ .compatible = "micrel,ksz8001", .data = &ksphy_driver_data },
+	{ .compatible = "micrel,ksz8021", .data = &ksphy_driver_data },
+	{ .compatible = "micrel,ksz8031", .data = &ksphy_driver_data },
+	{ .compatible = "micrel,ksz8041", .data = &ksphy_driver_data },
+	{ .compatible = "micrel,ksz8051", .data = &ksphy_driver_data },
+	{ .compatible = "micrel,ksz8061", .data = &ksphy_driver_data },
+	{ .compatible = "micrel,ksz8081", .data = &ksphy_driver_data },
+	{ .compatible = "micrel,ksz8091", .data = &ksphy_driver_data },
+	{ .compatible = "micrel,ksz8021-gigabit", .data = &ksphy_driver_data },
+	{ .compatible = "micrel,ksz8031-gigabit", .data = &ksphy_driver_data },
+	{ .compatible = "micrel,ksz8873mll-switch", .data = &ksphy_driver_data },
+	{ .compatible = "micrel,ksz886x-switch", .data = &ksphy_driver_data },
+	{},
+};
+MODULE_DEVICE_TABLE(of, phy_micrel_match);
+
+static struct platform_driver phy_micrel_driver = {
+	.probe          = ksphy_init,
+	.remove         = ksphy_exit,
+	.driver         = {
+		.name           = "phy_micrel",
+		.of_match_table = of_match_ptr(phy_micrel_match),
+	},
+};
+module_platform_driver(phy_micrel_driver);
 
 MODULE_DESCRIPTION("Micrel PHY driver");
 MODULE_AUTHOR("David J. Choi");
-- 
1.7.9.5

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

* Re: [RFC] phy: micrel: Convert micrel PHY driver to use OF
  2013-08-13 16:42 [RFC] phy: micrel: Convert micrel PHY driver to use OF dinguyen
@ 2013-08-15 19:55 ` Linus Walleij
  2013-08-21 20:00   ` Dinh Nguyen
  2013-08-22  5:13 ` Olof Johansson
  1 sibling, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2013-08-15 19:55 UTC (permalink / raw)
  To: Dinh Nguyen, devicetree
  Cc: Dinh Nguyen, netdev, Richard Cochran, Felipe Balbi,
	David S. Miller, Giuseppe Cavallaro, Olof Johansson, Rob Herring

On Tue, Aug 13, 2013 at 6:42 PM,  <dinguyen@altera.com> wrote:

> From: Dinh Nguyen <dinguyen@altera.com>
>
> Convert the Micrel PHY driver to use OF. This initial patch is only
> the beginning of an idea to convert the PHY driver to device tree.
>
> Signed-of-by: Dinh Nguyen <dinguyen@altera.com>

This is full of device tree stuff so please copy it to
devicetree@vger.kernel.org.

It seems to add quite a few compatible strings so these should
be added to the bindings doc, or is it already?

Yours,
Linus Walleij

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

* Re: [RFC] phy: micrel: Convert micrel PHY driver to use OF
  2013-08-15 19:55 ` Linus Walleij
@ 2013-08-21 20:00   ` Dinh Nguyen
  0 siblings, 0 replies; 7+ messages in thread
From: Dinh Nguyen @ 2013-08-21 20:00 UTC (permalink / raw)
  To: Linus Walleij
  Cc: devicetree, Dinh Nguyen, netdev, Richard Cochran, Felipe Balbi,
	David S. Miller, Giuseppe Cavallaro, Olof Johansson, Rob Herring

On Thu, 2013-08-15 at 21:55 +0200, Linus Walleij wrote:
> On Tue, Aug 13, 2013 at 6:42 PM,  <dinguyen@altera.com> wrote:
> 
> > From: Dinh Nguyen <dinguyen@altera.com>
> >
> > Convert the Micrel PHY driver to use OF. This initial patch is only
> > the beginning of an idea to convert the PHY driver to device tree.
> >
> > Signed-of-by: Dinh Nguyen <dinguyen@altera.com>
> 
> This is full of device tree stuff so please copy it to
> devicetree@vger.kernel.org.
> 
> It seems to add quite a few compatible strings so these should
> be added to the bindings doc, or is it already?

No, there is not a bindings doc yet. I was just trying to see if this is
the right approach..

Thanks,
Dinh
> 
> Yours,
> Linus Walleij
> 

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

* Re: [RFC] phy: micrel: Convert micrel PHY driver to use OF
  2013-08-13 16:42 [RFC] phy: micrel: Convert micrel PHY driver to use OF dinguyen
  2013-08-15 19:55 ` Linus Walleij
@ 2013-08-22  5:13 ` Olof Johansson
  2013-08-22  6:34   ` Sascha Hauer
  1 sibling, 1 reply; 7+ messages in thread
From: Olof Johansson @ 2013-08-22  5:13 UTC (permalink / raw)
  To: dinguyen
  Cc: dinh.linux, netdev, Richard Cochran, Linus Walleij, Felipe Balbi,
	David S. Miller, Giuseppe Cavallaro, Rob Herring, devicetree

(adding devicetree@vger.kernel.org)


On Tue, Aug 13, 2013 at 11:42:36AM -0500, dinguyen@altera.com wrote:
> From: Dinh Nguyen <dinguyen@altera.com>
> 
> Convert the Micrel PHY driver to use OF. This initial patch is only
> the beginning of an idea to convert the PHY driver to device tree.
> 
> Signed-of-by: Dinh Nguyen <dinguyen@altera.com>
> Cc: netdev@vger.kernel.org
> Cc: Richard Cochran <richardcochran@gmail.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Cc: Olof Johansson <olof@lixom.net>
> Cc: Rob Herring <rob.herring@calxeda.com>
> 
> ---
> Hello,
> 
> I would like to solicit comments on the need to convert the ethernet PHY
> drivers to use OF/device trees? For the platform that I'm interested in,
> SOCFPGA, it is using the stmicro ethernet driver. It has a Micrel PHY
> on the board. The only way that I know of how to change the skew settings
> for the phy is through a board level initialization.
> 
> One of the ARM maintainers suggested that perhaps refactoring the ethernet
> driver to use device tree would be nice. But that would not help me with
> configuring the PHY settings.
> 
> So a little investigation led me to believe that refactoring the /net/phy
> drivers into a device tree implementation would help greatly. I was thinking
> it could be done like the pinctrl or some of the usb/phy driver.
> 
> Since I am only familiar with the ARM SoC space, I want to make sure that
> this idea is right approach. I can start with the micrel PHY driver
> first, as that is the only HW I have access to.

Hi,

Sorry for the slow reply here.

I don't think this is quite the right approach.

What you want to do is to make the phy devices register based on device tree
contents, which also means removing the run function, or rather moving it to
a generic run function in the phy subsystem that acts based on device tree
contents instead of a hard-coded per-board run function.

It sounds like defining that binding might end up getting complicated.
I suggest you consider recruiting some of the more seasoned devicetree folks on
this endeavor.

It's possible that you'll mostly have per-vendor/phy type properties to tune
the various settings, but it's also likely that you will have some generic and
shared (optional) properties such as gpios for resetting, or regulators for
powering, the phy.


-Olof

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

* Re: [RFC] phy: micrel: Convert micrel PHY driver to use OF
  2013-08-22  5:13 ` Olof Johansson
@ 2013-08-22  6:34   ` Sascha Hauer
  2013-08-22 15:30       ` Dinh Nguyen
  0 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2013-08-22  6:34 UTC (permalink / raw)
  To: Olof Johansson
  Cc: dinguyen, dinh.linux, netdev, Richard Cochran, Linus Walleij,
	Felipe Balbi, David S. Miller, Giuseppe Cavallaro, Rob Herring,
	devicetree

On Wed, Aug 21, 2013 at 10:13:47PM -0700, Olof Johansson wrote:
> (adding devicetree@vger.kernel.org)
> 
> 
> On Tue, Aug 13, 2013 at 11:42:36AM -0500, dinguyen@altera.com wrote:
> > ---
> > Hello,
> > 
> > I would like to solicit comments on the need to convert the ethernet PHY
> > drivers to use OF/device trees? For the platform that I'm interested in,
> > SOCFPGA, it is using the stmicro ethernet driver. It has a Micrel PHY
> > on the board. The only way that I know of how to change the skew settings
> > for the phy is through a board level initialization.
> > 
> > One of the ARM maintainers suggested that perhaps refactoring the ethernet
> > driver to use device tree would be nice. But that would not help me with
> > configuring the PHY settings.
> > 
> > So a little investigation led me to believe that refactoring the /net/phy
> > drivers into a device tree implementation would help greatly. I was thinking
> > it could be done like the pinctrl or some of the usb/phy driver.
> > 
> > Since I am only familiar with the ARM SoC space, I want to make sure that
> > this idea is right approach. I can start with the micrel PHY driver
> > first, as that is the only HW I have access to.
> 
> Hi,
> 
> Sorry for the slow reply here.
> 
> I don't think this is quite the right approach.
> 
> What you want to do is to make the phy devices register based on device tree
> contents, which also means removing the run function, or rather moving it to
> a generic run function in the phy subsystem that acts based on device tree
> contents instead of a hard-coded per-board run function.
> 
> It sounds like defining that binding might end up getting complicated.
> I suggest you consider recruiting some of the more seasoned devicetree folks on
> this endeavor.
> 
> It's possible that you'll mostly have per-vendor/phy type properties to tune
> the various settings, but it's also likely that you will have some generic and
> shared (optional) properties such as gpios for resetting, or regulators for
> powering, the phy.

This patch recently was merged:

http://patchwork.ozlabs.org/patch/268661/

It solves exactly the same problem of specifying the skew settings.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [RFC] phy: micrel: Convert micrel PHY driver to use OF
  2013-08-22  6:34   ` Sascha Hauer
@ 2013-08-22 15:30       ` Dinh Nguyen
  0 siblings, 0 replies; 7+ messages in thread
From: Dinh Nguyen @ 2013-08-22 15:30 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: Olof Johansson, dinh.linux, netdev, Richard Cochran,
	Linus Walleij, Felipe Balbi, David S. Miller, Giuseppe Cavallaro,
	Rob Herring, devicetree

On Thu, 2013-08-22 at 08:34 +0200, Sascha Hauer wrote:
> On Wed, Aug 21, 2013 at 10:13:47PM -0700, Olof Johansson wrote:
> > (adding devicetree@vger.kernel.org)
> > 
> > 
> > On Tue, Aug 13, 2013 at 11:42:36AM -0500, dinguyen@altera.com wrote:
> > > ---
> > > Hello,
> > > 
> > > I would like to solicit comments on the need to convert the ethernet PHY
> > > drivers to use OF/device trees? For the platform that I'm interested in,
> > > SOCFPGA, it is using the stmicro ethernet driver. It has a Micrel PHY
> > > on the board. The only way that I know of how to change the skew settings
> > > for the phy is through a board level initialization.
> > > 
> > > One of the ARM maintainers suggested that perhaps refactoring the ethernet
> > > driver to use device tree would be nice. But that would not help me with
> > > configuring the PHY settings.
> > > 
> > > So a little investigation led me to believe that refactoring the /net/phy
> > > drivers into a device tree implementation would help greatly. I was thinking
> > > it could be done like the pinctrl or some of the usb/phy driver.
> > > 
> > > Since I am only familiar with the ARM SoC space, I want to make sure that
> > > this idea is right approach. I can start with the micrel PHY driver
> > > first, as that is the only HW I have access to.
> > 
> > Hi,
> > 
> > Sorry for the slow reply here.
> > 
> > I don't think this is quite the right approach.
> > 
> > What you want to do is to make the phy devices register based on device tree
> > contents, which also means removing the run function, or rather moving it to
> > a generic run function in the phy subsystem that acts based on device tree
> > contents instead of a hard-coded per-board run function.
> > 
> > It sounds like defining that binding might end up getting complicated.
> > I suggest you consider recruiting some of the more seasoned devicetree folks on
> > this endeavor.
> > 
> > It's possible that you'll mostly have per-vendor/phy type properties to tune
> > the various settings, but it's also likely that you will have some generic and
> > shared (optional) properties such as gpios for resetting, or regulators for
> > powering, the phy.
> 
> This patch recently was merged:
> 
> http://patchwork.ozlabs.org/patch/268661/
> 
> It solves exactly the same problem of specifying the skew settings.

Thanks for the information. This is great stuff!

Dinh
> 
> Sascha
> 

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

* Re: [RFC] phy: micrel: Convert micrel PHY driver to use OF
@ 2013-08-22 15:30       ` Dinh Nguyen
  0 siblings, 0 replies; 7+ messages in thread
From: Dinh Nguyen @ 2013-08-22 15:30 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: Olof Johansson, dinh.linux, netdev, Richard Cochran,
	Linus Walleij, Felipe Balbi, David S. Miller, Giuseppe Cavallaro,
	Rob Herring, devicetree

On Thu, 2013-08-22 at 08:34 +0200, Sascha Hauer wrote:
> On Wed, Aug 21, 2013 at 10:13:47PM -0700, Olof Johansson wrote:
> > (adding devicetree@vger.kernel.org)
> > 
> > 
> > On Tue, Aug 13, 2013 at 11:42:36AM -0500, dinguyen@altera.com wrote:
> > > ---
> > > Hello,
> > > 
> > > I would like to solicit comments on the need to convert the ethernet PHY
> > > drivers to use OF/device trees? For the platform that I'm interested in,
> > > SOCFPGA, it is using the stmicro ethernet driver. It has a Micrel PHY
> > > on the board. The only way that I know of how to change the skew settings
> > > for the phy is through a board level initialization.
> > > 
> > > One of the ARM maintainers suggested that perhaps refactoring the ethernet
> > > driver to use device tree would be nice. But that would not help me with
> > > configuring the PHY settings.
> > > 
> > > So a little investigation led me to believe that refactoring the /net/phy
> > > drivers into a device tree implementation would help greatly. I was thinking
> > > it could be done like the pinctrl or some of the usb/phy driver.
> > > 
> > > Since I am only familiar with the ARM SoC space, I want to make sure that
> > > this idea is right approach. I can start with the micrel PHY driver
> > > first, as that is the only HW I have access to.
> > 
> > Hi,
> > 
> > Sorry for the slow reply here.
> > 
> > I don't think this is quite the right approach.
> > 
> > What you want to do is to make the phy devices register based on device tree
> > contents, which also means removing the run function, or rather moving it to
> > a generic run function in the phy subsystem that acts based on device tree
> > contents instead of a hard-coded per-board run function.
> > 
> > It sounds like defining that binding might end up getting complicated.
> > I suggest you consider recruiting some of the more seasoned devicetree folks on
> > this endeavor.
> > 
> > It's possible that you'll mostly have per-vendor/phy type properties to tune
> > the various settings, but it's also likely that you will have some generic and
> > shared (optional) properties such as gpios for resetting, or regulators for
> > powering, the phy.
> 
> This patch recently was merged:
> 
> http://patchwork.ozlabs.org/patch/268661/
> 
> It solves exactly the same problem of specifying the skew settings.

Thanks for the information. This is great stuff!

Dinh
> 
> Sascha
> 




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

end of thread, other threads:[~2013-08-22 15:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-13 16:42 [RFC] phy: micrel: Convert micrel PHY driver to use OF dinguyen
2013-08-15 19:55 ` Linus Walleij
2013-08-21 20:00   ` Dinh Nguyen
2013-08-22  5:13 ` Olof Johansson
2013-08-22  6:34   ` Sascha Hauer
2013-08-22 15:30     ` Dinh Nguyen
2013-08-22 15:30       ` Dinh Nguyen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.