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

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

Merge branch 'dsa-port-config'



Andrew Lunn says:

====================
DSA port configuration and status

This patchset allows various switch port settings to be configured and
port status to be sampled. Some of these patches have been posted
before.

The first three patches provide infrastructure for configuring a
switch ports link speed and duplex from a fixed_link phy.

Patch four then uses this infrastructure to allow the CPU and DSA
ports of a switch to be configured using a fixed-link property in the
device tree.

Patches five and six allow a phy-mode property to be specified in the
device tree, and allow this to be used for configuring RGMII delays.

Patches seven through nine allow link status, for example that of an
SFP module, to be read from a gpio.

Changes since v1:

Rewrite 9/9 so that it hopefully does not regression on
868a4215 ("net: phy: fixed_phy: handle link-down case")
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 6ea3c9d5 bc0f4a87
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ properties:
  enabled.
* 'asym-pause' (boolean, optional), to indicate that asym_pause should
  be enabled.
* 'link-gpios' ('gpio-list', optional), to indicate if a gpio can be read
  to determine if the link is up.

Old, deprecated 'fixed-link' binding:

@@ -30,7 +32,7 @@ Old, deprecated 'fixed-link' binding:
  - e: asymmetric pause configuration: 0 for no asymmetric pause, 1 for
    asymmetric pause

Example:
Examples:

ethernet@0 {
	...
@@ -40,3 +42,13 @@ ethernet@0 {
	};
	...
};

ethernet@1 {
	...
	fixed-link {
	      speed = <1000>;
	      pause;
	      link-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
	};
	...
};
+1 −1
Original line number Diff line number Diff line
@@ -254,7 +254,7 @@ static struct fixed_phy_status stmmac0_fixed_phy_status = {

During the board's device_init we can configure the first
MAC for fixed_link by calling:
  fixed_phy_add(PHY_POLL, 1, &stmmac0_fixed_phy_status));)
  fixed_phy_add(PHY_POLL, 1, &stmmac0_fixed_phy_status, -1);
and the second one, with a real PHY device attached to the bus,
by using the stmmac_mdio_bus_data structure (to provide the id, the
reset procedure etc).
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ static struct fixed_phy_status nettel_fixed_phy_status __initdata = {
static int __init init_BSP(void)
{
	m5272_uarts_init();
	fixed_phy_add(PHY_POLL, 0, &nettel_fixed_phy_status);
	fixed_phy_add(PHY_POLL, 0, &nettel_fixed_phy_status, -1);
	return 0;
}

+3 −2
Original line number Diff line number Diff line
@@ -679,7 +679,8 @@ static int __init ar7_register_devices(void)
	}

	if (ar7_has_high_cpmac()) {
		res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status);
		res = fixed_phy_add(PHY_POLL, cpmac_high.id,
				    &fixed_phy_status, -1);
		if (!res) {
			cpmac_get_mac(1, cpmac_high_data.dev_addr);

@@ -692,7 +693,7 @@ static int __init ar7_register_devices(void)
	} else
		cpmac_low_data.phy_mask = 0xffffffff;

	res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status);
	res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status, -1);
	if (!res) {
		cpmac_get_mac(0, cpmac_low_data.dev_addr);
		res = platform_device_register(&cpmac_low);
+1 −1
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ static int __init bcm47xx_register_bus_complete(void)
	bcm47xx_leds_register();
	bcm47xx_workarounds();

	fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status);
	fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status, -1);
	return 0;
}
device_initcall(bcm47xx_register_bus_complete);
Loading