* [PATCH] net: davinci_emac: Add support for fixed-link PHY
@ 2015-09-22 8:57 Neil Armstrong
2015-09-23 1:10 ` Tony Lindgren
2015-09-23 22:06 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Neil Armstrong @ 2015-09-22 8:57 UTC (permalink / raw)
To: Tony Lindgren, David S. Miller, Felipe Balbi, Mark A. Greer
Cc: netdev, linux-kernel
In case the DaVinci Emac is directly connected to a
non-mdio PHY/device, it should be possible to provide
a fixed link configuration in the DT.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
drivers/net/ethernet/ti/davinci_emac.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index aeebc0a..6521dfb 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1861,8 +1861,12 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv)
pdata->no_bd_ram = of_property_read_bool(np, "ti,davinci-no-bd-ram");
priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
- if (!priv->phy_node)
- pdata->phy_id = NULL;
+ if (!priv->phy_node) {
+ if (!of_phy_is_fixed_link(np))
+ pdata->phy_id = NULL;
+ else if (of_phy_register_fixed_link(np) >= 0)
+ priv->phy_node = of_node_get(np);
+ }
auxdata = pdev->dev.platform_data;
if (auxdata) {
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: davinci_emac: Add support for fixed-link PHY
2015-09-22 8:57 [PATCH] net: davinci_emac: Add support for fixed-link PHY Neil Armstrong
@ 2015-09-23 1:10 ` Tony Lindgren
2015-09-23 22:06 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2015-09-23 1:10 UTC (permalink / raw)
To: Neil Armstrong
Cc: David S. Miller, Felipe Balbi, Mark A. Greer, netdev,
linux-kernel
* Neil Armstrong <narmstrong@baylibre.com> [150922 02:01]:
> In case the DaVinci Emac is directly connected to a
> non-mdio PHY/device, it should be possible to provide
> a fixed link configuration in the DT.
>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Ethernet works for me with this patch:
Tested-by: Tony Lindgren <tony@atomide.com>
> ---
> drivers/net/ethernet/ti/davinci_emac.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> index aeebc0a..6521dfb 100644
> --- a/drivers/net/ethernet/ti/davinci_emac.c
> +++ b/drivers/net/ethernet/ti/davinci_emac.c
> @@ -1861,8 +1861,12 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv)
> pdata->no_bd_ram = of_property_read_bool(np, "ti,davinci-no-bd-ram");
>
> priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
> - if (!priv->phy_node)
> - pdata->phy_id = NULL;
> + if (!priv->phy_node) {
> + if (!of_phy_is_fixed_link(np))
> + pdata->phy_id = NULL;
> + else if (of_phy_register_fixed_link(np) >= 0)
> + priv->phy_node = of_node_get(np);
> + }
>
> auxdata = pdev->dev.platform_data;
> if (auxdata) {
> --
> 1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: davinci_emac: Add support for fixed-link PHY
2015-09-22 8:57 [PATCH] net: davinci_emac: Add support for fixed-link PHY Neil Armstrong
2015-09-23 1:10 ` Tony Lindgren
@ 2015-09-23 22:06 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-09-23 22:06 UTC (permalink / raw)
To: narmstrong; +Cc: tony, balbi, mgreer, netdev, linux-kernel
From: Neil Armstrong <narmstrong@baylibre.com>
Date: Tue, 22 Sep 2015 10:57:04 +0200
> In case the DaVinci Emac is directly connected to a
> non-mdio PHY/device, it should be possible to provide
> a fixed link configuration in the DT.
>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-23 22:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-22 8:57 [PATCH] net: davinci_emac: Add support for fixed-link PHY Neil Armstrong
2015-09-23 1:10 ` Tony Lindgren
2015-09-23 22:06 ` David Miller
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).