Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb421c28 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'fixed_phy'



Florian Fainelli says:

====================
net: of_phy_connect_fixed_link removal

This patch set removes of_phy_connect_fixed_link() from the tree now that
we have a better solution for dealing with fixed PHY (emulated PHY) devices
for drivers that require them.

First two patches update the 'fixed-link' Device Tree binding and drivers to
refere to it.

Patches 3 to 7 update the in-tree network drivers that use
of_phy_connect_fixed_link()

Patch 8 removes of_phy_connect_fixed_link

Patch 9 removes the PowerPC code that parsed the 'fixed-link' property.

Patch 9 can be merged via the net-next tree if the PowerPC folks ack it,
but it really has to be merged after the first 8 patches in order to avoid
breakage.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents a33fa47e 1f8c486f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ Optional properties:
- fixed-link: When the GENET interface is connected to a MoCA hardware block or
  when operating in a RGMII to RGMII type of connection, or when the MDIO bus is
  voluntarily disabled, this property should be used to describe the "fixed link".
  See Documentation/devicetree/bindings/net/fsl-tsec-phy.txt for information on
  See Documentation/devicetree/bindings/net/fixed-link.txt for information on
  the property specifics

Required child nodes:
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ Required properties:
- local-mac-address: Ethernet MAC address (48 bits) of this adapter
- phy-mode: Should be a string describing the PHY interface to the
  Ethernet switch/PHY, see Documentation/devicetree/bindings/net/ethernet.txt
- fixed-link: see Documentation/devicetree/bindings/net/fsl-tsec-phy.txt for
- fixed-link: see Documentation/devicetree/bindings/net/fixed-link.txt for
  the property specific details

Optional properties:
+12 −0
Original line number Diff line number Diff line
@@ -18,6 +18,18 @@ properties:
* 'asym-pause' (boolean, optional), to indicate that asym_pause should
  be enabled.

Old, deprecated 'fixed-link' binding:

* A 'fixed-link' property in the Ethernet MAC node, with 5 cells, of the
  form <a b c d e> with the following accepted values:
  - a: emulated PHY ID, choose any but but unique to the all specified
    fixed-links, from 0 to 31
  - b: duplex configuration: 0 for half duplex, 1 for full duplex
  - c: link speed in Mbits/sec, accepted values are: 10, 100 and 1000
  - d: pause configuration: 0 for no pause, 1 for pause
  - e: asymmetric pause configuration: 0 for no asymmetric pause, 1 for
    asymmetric pause

Example:

ethernet@0 {
+1 −4
Original line number Diff line number Diff line
@@ -42,10 +42,7 @@ Properties:
    interrupt.  For TSEC and eTSEC devices, the first interrupt is
    transmit, the second is receive, and the third is error.
  - phy-handle : See ethernet.txt file in the same directory.
  - fixed-link : <a b c d e> where a is emulated phy id - choose any,
    but unique to the all specified fixed-links, b is duplex - 0 half,
    1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no
    pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause.
  - fixed-link : See fixed-link.txt in the same directory.
  - phy-connection-type : See ethernet.txt file in the same directory.
    This property is only really needed if the connection is of type
    "rgmii-id", as all other connection types are detected by hardware.
+0 −32
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/phy.h>
#include <linux/phy_fixed.h>
#include <linux/spi/spi.h>
#include <linux/fsl_devices.h>
#include <linux/fs_enet_pd.h>
@@ -178,37 +177,6 @@ u32 get_baudrate(void)
EXPORT_SYMBOL(get_baudrate);
#endif /* CONFIG_CPM2 */

#ifdef CONFIG_FIXED_PHY
static int __init of_add_fixed_phys(void)
{
	int ret;
	struct device_node *np;
	u32 *fixed_link;
	struct fixed_phy_status status = {};

	for_each_node_by_name(np, "ethernet") {
		fixed_link  = (u32 *)of_get_property(np, "fixed-link", NULL);
		if (!fixed_link)
			continue;

		status.link = 1;
		status.duplex = fixed_link[1];
		status.speed = fixed_link[2];
		status.pause = fixed_link[3];
		status.asym_pause = fixed_link[4];

		ret = fixed_phy_add(PHY_POLL, fixed_link[0], &status);
		if (ret) {
			of_node_put(np);
			return ret;
		}
	}

	return 0;
}
arch_initcall(of_add_fixed_phys);
#endif /* CONFIG_FIXED_PHY */

#if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx)
static __be32 __iomem *rstcr;

Loading