netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] stmmac: added device tree support for fixed_phy and phy_addr
@ 2013-06-13  1:25 Byungho An
  2013-06-13  9:31 ` David Miller
  2013-06-13 10:02 ` Giuseppe CAVALLARO
  0 siblings, 2 replies; 6+ messages in thread
From: Byungho An @ 2013-06-13  1:25 UTC (permalink / raw)
  To: netdev
  Cc: 'Giuseppe CAVALLARO', '김국진',
	davem, cpgs


This patch adds device tree support for fixed_phy and phy_addr it means
fixed_phy and phy_addr can be set in device tree file. "fixed_phy" and
"phy_addr" can be added in the device tree blob. 

Signed-off-by: Byungho An <bh74.an@samsung.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 1d3780f..33ba995 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -34,6 +34,7 @@ static int stmmac_probe_config_dt(struct platform_device
*pdev,
 				  const char **mac)
 {
 	struct device_node *np = pdev->dev.of_node;
+	u32 phy_addr;
 
 	if (!np)
 		return -ENODEV;
@@ -56,6 +57,12 @@ static int stmmac_probe_config_dt(struct platform_device
*pdev,
 		plat->pmt = 1;
 	}
 
+	if (of_find_property(np, "fixed_phy", NULL)) {
+		plat->phy_bus_name = "fixed";
+		of_property_read_u32(np, "phy_addr", &phy_addr);
+		plat->phy_addr = phy_addr;
+	}
+
 	return 0;
 }
 #else
-- 
1.7.10.4

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

* Re: [PATCH net-next] stmmac: added device tree support for fixed_phy and phy_addr
  2013-06-13  1:25 [PATCH net-next] stmmac: added device tree support for fixed_phy and phy_addr Byungho An
@ 2013-06-13  9:31 ` David Miller
  2013-06-13 10:02 ` Giuseppe CAVALLARO
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2013-06-13  9:31 UTC (permalink / raw)
  To: bh74.an; +Cc: netdev, peppe.cavallaro, kgene.kim, cpgs

From: Byungho An <bh74.an@samsung.com>
Date: Thu, 13 Jun 2013 10:25:44 +0900

> @@ -34,6 +34,7 @@ static int stmmac_probe_config_dt(struct platform_device
> *pdev,

Your email client destroyed this patch, making it unusable for us.

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

* Re: [PATCH net-next] stmmac: added device tree support for fixed_phy and phy_addr
  2013-06-13  1:25 [PATCH net-next] stmmac: added device tree support for fixed_phy and phy_addr Byungho An
  2013-06-13  9:31 ` David Miller
@ 2013-06-13 10:02 ` Giuseppe CAVALLARO
  2013-06-13 10:25   ` Byungho An
  1 sibling, 1 reply; 6+ messages in thread
From: Giuseppe CAVALLARO @ 2013-06-13 10:02 UTC (permalink / raw)
  To: Byungho An; +Cc: netdev, '김국진', davem, cpgs

On 6/13/2013 3:25 AM, Byungho An wrote:
> 
> This patch adds device tree support for fixed_phy and phy_addr it means
> fixed_phy and phy_addr can be set in device tree file. "fixed_phy" and
> "phy_addr" can be added in the device tree blob.

concerning this, we had added some work to pass from the platform
the fixed bus name.

http://git.stlinux.com/?p=stm/linux-stm.git;a=blob;f=drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c;h=2d540e1d2151e4412a5af5356d24d5c6b66cf72e;hb=HEAD

I wanted to also do a clean-up and update the DT support because
the binding documentation remains obsolete etc.

peppe

> 
> Signed-off-by: Byungho An <bh74.an@samsung.com>
> ---
>   drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c |    7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index 1d3780f..33ba995 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -34,6 +34,7 @@ static int stmmac_probe_config_dt(struct platform_device
> *pdev,
>   				  const char **mac)
>   {
>   	struct device_node *np = pdev->dev.of_node;
> +	u32 phy_addr;
>   
>   	if (!np)
>   		return -ENODEV;
> @@ -56,6 +57,12 @@ static int stmmac_probe_config_dt(struct platform_device
> *pdev,
>   		plat->pmt = 1;
>   	}
>   
> +	if (of_find_property(np, "fixed_phy", NULL)) {
> +		plat->phy_bus_name = "fixed";
> +		of_property_read_u32(np, "phy_addr", &phy_addr);
> +		plat->phy_addr = phy_addr;
> +	}
> +
>   	return 0;
>   }
>   #else
> 

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

* RE: [PATCH net-next] stmmac: added device tree support for fixed_phy and phy_addr
  2013-06-13 10:02 ` Giuseppe CAVALLARO
@ 2013-06-13 10:25   ` Byungho An
  2013-06-13 12:08     ` 'Kukjin Kim'
  0 siblings, 1 reply; 6+ messages in thread
From: Byungho An @ 2013-06-13 10:25 UTC (permalink / raw)
  To: 'Giuseppe CAVALLARO'
  Cc: netdev, '김국진', davem, cpgs


On 6/13/2013 7:04 PM, Giuseppe CAVALLARO wrote: 
> On 6/13/2013 3:25 AM, Byungho An wrote:
> >
> > This patch adds device tree support for fixed_phy and phy_addr it means
> > fixed_phy and phy_addr can be set in device tree file. "fixed_phy" and
> > "phy_addr" can be added in the device tree blob.
> 
> concerning this, we had added some work to pass from the platform
> the fixed bus name.
> 
> http://git.stlinux.com/?p=stm/linux-
> stm.git;a=blob;f=drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c;h=2d540e1d2151e4412a5af5356d24d
> 5c6b66cf72e;hb=HEAD
> 
> I wanted to also do a clean-up and update the DT support because
> the binding documentation remains obsolete etc.
> 

I think your previous work for DT support can cover my patch.
Do you have a plan to update and clean-up for DT support?

> peppe
> 
> >
> > Signed-off-by: Byungho An <bh74.an@samsung.com>
> > ---
> >   drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c |    7 +++++++
> >   1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > index 1d3780f..33ba995 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > @@ -34,6 +34,7 @@ static int stmmac_probe_config_dt(struct platform_device
> > *pdev,
> >   				  const char **mac)
> >   {
> >   	struct device_node *np = pdev->dev.of_node;
> > +	u32 phy_addr;
> >
> >   	if (!np)
> >   		return -ENODEV;
> > @@ -56,6 +57,12 @@ static int stmmac_probe_config_dt(struct platform_device
> > *pdev,
> >   		plat->pmt = 1;
> >   	}
> >
> > +	if (of_find_property(np, "fixed_phy", NULL)) {
> > +		plat->phy_bus_name = "fixed";
> > +		of_property_read_u32(np, "phy_addr", &phy_addr);
> > +		plat->phy_addr = phy_addr;
> > +	}
> > +
> >   	return 0;
> >   }
> >   #else
> >

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

* RE: [PATCH net-next] stmmac: added device tree support for fixed_phy and phy_addr
  2013-06-13 10:25   ` Byungho An
@ 2013-06-13 12:08     ` 'Kukjin Kim'
  2013-06-14  6:29       ` Giuseppe CAVALLARO
  0 siblings, 1 reply; 6+ messages in thread
From: 'Kukjin Kim' @ 2013-06-13 12:08 UTC (permalink / raw)
  To: 'Byungho An', 'Giuseppe CAVALLARO'; +Cc: netdev, davem

Byungho An wrote:
> 
> 
> On 6/13/2013 7:04 PM, Giuseppe CAVALLARO wrote:
> > On 6/13/2013 3:25 AM, Byungho An wrote:
> > >
> > > This patch adds device tree support for fixed_phy and phy_addr it
> means
> > > fixed_phy and phy_addr can be set in device tree file. "fixed_phy" and
> > > "phy_addr" can be added in the device tree blob.
> >
> > concerning this, we had added some work to pass from the platform
> > the fixed bus name.
> >
> > http://git.stlinux.com/?p=stm/linux-
> >
> stm.git;a=blob;f=drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c;h=2
> d540e1d2151e4412a5af5356d24d
> > 5c6b66cf72e;hb=HEAD
> >
Looks good.

> > I wanted to also do a clean-up and update the DT support because
> > the binding documentation remains obsolete etc.
> >
Yeah, I see...

> 
> I think your previous work for DT support can cover my patch.
> Do you have a plan to update and clean-up for DT support?
> 
Same here, would be nice if the patch could be seen in upcoming kernel.

If any help is required, let us know. Byungho will help you.

Thanks,
- Kukjin

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

* Re: [PATCH net-next] stmmac: added device tree support for fixed_phy and phy_addr
  2013-06-13 12:08     ` 'Kukjin Kim'
@ 2013-06-14  6:29       ` Giuseppe CAVALLARO
  0 siblings, 0 replies; 6+ messages in thread
From: Giuseppe CAVALLARO @ 2013-06-14  6:29 UTC (permalink / raw)
  To: 'Kukjin Kim'; +Cc: 'Byungho An', netdev, davem

On 6/13/2013 2:08 PM, 'Kukjin Kim' wrote:
> Byungho An wrote:
>>
>>
>> On 6/13/2013 7:04 PM, Giuseppe CAVALLARO wrote:
>>> On 6/13/2013 3:25 AM, Byungho An wrote:
>>>>
>>>> This patch adds device tree support for fixed_phy and phy_addr it
>> means
>>>> fixed_phy and phy_addr can be set in device tree file. "fixed_phy" and
>>>> "phy_addr" can be added in the device tree blob.
>>>
>>> concerning this, we had added some work to pass from the platform
>>> the fixed bus name.
>>>
>>> http://git.stlinux.com/?p=stm/linux-
>>>
>> stm.git;a=blob;f=drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c;h=2
>> d540e1d2151e4412a5af5356d24d
>>> 5c6b66cf72e;hb=HEAD
>>>
> Looks good.
>
>>> I wanted to also do a clean-up and update the DT support because
>>> the binding documentation remains obsolete etc.
>>>
> Yeah, I see...
>
>>
>> I think your previous work for DT support can cover my patch.
>> Do you have a plan to update and clean-up for DT support?
>>
> Same here, would be nice if the patch could be seen in upcoming kernel.

for sure, I'll plan to send this work asasp

>
> If any help is required, let us know. Byungho will help you.

ok, thx

peppe

>
> Thanks,
> - Kukjin
>
>
>

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

end of thread, other threads:[~2013-06-14  6:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-13  1:25 [PATCH net-next] stmmac: added device tree support for fixed_phy and phy_addr Byungho An
2013-06-13  9:31 ` David Miller
2013-06-13 10:02 ` Giuseppe CAVALLARO
2013-06-13 10:25   ` Byungho An
2013-06-13 12:08     ` 'Kukjin Kim'
2013-06-14  6:29       ` Giuseppe CAVALLARO

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