linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: f.fainelli@gmail.com (Florian Fainelli)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] net: stmmac: add fixed_phy and phy_addr support using DT file
Date: Thu, 22 Jan 2015 20:15:25 -0800	[thread overview]
Message-ID: <54C1CADD.4060103@gmail.com> (raw)
In-Reply-To: <1421980893-14475-3-git-send-email-ming.lei@canonical.com>

Le 22/01/2015 18:41, Ming Lei a ?crit :
> From: Byungho An <bh74.an@samsung.com>
> 
> This patch adds codes for DT file support, fixed_phy and phy_addr 
> can be set in DT file.
> 
> Signed-off-by: Byungho An <bh74.an@samsung.com> (bypass check for
> fixed phy) Signed-off-by: Ming Lei<ming.lei@canonical.com> --- 
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |    5 ++++- 
> .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |    7 +++++++ 2
> files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index
> 8c6b7c16..ddb4351 100644 ---
> a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -847,8
> +847,11 @@ static int stmmac_init_phy(struct net_device *dev) * 0
> rather than 0xffff. Catch this here and treat 0 as a non-existent *
> device as well. * Note: phydev->phy_id is the result of reading the
> UID PHY registers. +	 * But phy_id returned from fixed phy is
> always zero, so bypass the +	 * check for fixed phy. */ -	if
> (phydev->phy_id == 0) { +	if (phydev->phy_id == 0 &&
> (!priv->plat->phy_bus_name || +
> strcmp(priv->plat->phy_bus_name,"fixed"))) { 
> phy_disconnect(phydev); return -ENODEV; } diff --git
> a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index
> 879e29f..4f11491 100644 ---
> a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -128,6
> +128,7 @@ static int stmmac_probe_config_dt(struct platform_device
> *pdev, struct device_node *np = pdev->dev.of_node; struct
> stmmac_dma_cfg *dma_cfg; const struct of_device_id *device; +	u32
> phy_addr;
> 
> if (!np) return -ENODEV; @@ -217,6 +218,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; +	}

Humm, same here, it would look like you could use the existing Device
Tree helpers for parsing and registering a fixed PHY here, provided
that you use the proper binding though.

BTW, Ming Lei's email is bouncing, do we have an updated email he
could be contacted with?

> + if (of_device_is_compatible(np, "snps,dwmac-3.610") || 
> of_device_is_compatible(np, "snps,dwmac-3.710")) { plat->enh_desc =
> 1;
> 


-- 
Florian

  reply	other threads:[~2015-01-23  4:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23  2:41 [PATCH 0/2] ARM & NET: add fixed phy support on stmmac Ming Lei
2015-01-23  2:41 ` [PATCH 1/2] ARM: EXYNOS: add fixed phy support for EXYNOS5440 Ming Lei
2015-01-23  4:12   ` Florian Fainelli
2015-01-23  2:41 ` [PATCH 2/2] net: stmmac: add fixed_phy and phy_addr support using DT file Ming Lei
2015-01-23  4:15   ` Florian Fainelli [this message]
2015-01-23  4:57     ` Ming Lei

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=54C1CADD.4060103@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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).