netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
To: Byungho An <bh74.an@samsung.com>
Cc: netdev@vger.kernel.org, '김국진' <kgene.kim@samsung.com>,
	davem@davemloft.net, cpgs@samsung.com
Subject: Re: [PATCH net-next] stmmac: added device tree support for fixed_phy and phy_addr
Date: Thu, 13 Jun 2013 12:02:07 +0200	[thread overview]
Message-ID: <51B9989F.5020603@st.com> (raw)
In-Reply-To: <019301ce67d4$ed1e32b0$c75a9810$%an@samsung.com>

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
> 

  parent reply	other threads:[~2013-06-13 10:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2013-06-13 10:25   ` Byungho An
2013-06-13 12:08     ` 'Kukjin Kim'
2013-06-14  6:29       ` Giuseppe CAVALLARO

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51B9989F.5020603@st.com \
    --to=peppe.cavallaro@st.com \
    --cc=bh74.an@samsung.com \
    --cc=cpgs@samsung.com \
    --cc=davem@davemloft.net \
    --cc=kgene.kim@samsung.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).