diff options
| author | Rodrigo Vivi <[email protected]> | 2018-07-23 09:13:12 -0700 | 
|---|---|---|
| committer | Rodrigo Vivi <[email protected]> | 2018-07-23 09:13:12 -0700 | 
| commit | c74a7469f97c0f40b46e82ee979f9fb1bb6e847c (patch) | |
| tree | f2690a1a916b73ef94657fbf0e0141ae57701825 /drivers/net/phy/micrel.c | |
| parent | 6f15a7de86c8cf2dc09fc9e6d07047efa40ef809 (diff) | |
| parent | 500775074f88d9cf5416bed2ca19592812d62c41 (diff) | |
Merge drm/drm-next into drm-intel-next-queued
We need a backmerge to get DP_DPCD_REV_14 before we push other
i915 changes to dinq that could break compilation.
Signed-off-by: Rodrigo Vivi <[email protected]>
Diffstat (limited to 'drivers/net/phy/micrel.c')
| -rw-r--r-- | drivers/net/phy/micrel.c | 36 | 
1 files changed, 32 insertions, 4 deletions
| diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index f41b224a9cdb..3db06b40580d 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -573,9 +573,40 @@ static int ksz9031_config_init(struct phy_device *phydev)  		ksz9031_of_load_skew_values(phydev, of_node,  				MII_KSZ9031RN_TX_DATA_PAD_SKEW, 4,  				tx_data_skews, 4); + +		/* Silicon Errata Sheet (DS80000691D or DS80000692D): +		 * When the device links in the 1000BASE-T slave mode only, +		 * the optional 125MHz reference output clock (CLK125_NDO) +		 * has wide duty cycle variation. +		 * +		 * The optional CLK125_NDO clock does not meet the RGMII +		 * 45/55 percent (min/max) duty cycle requirement and therefore +		 * cannot be used directly by the MAC side for clocking +		 * applications that have setup/hold time requirements on +		 * rising and falling clock edges. +		 * +		 * Workaround: +		 * Force the phy to be the master to receive a stable clock +		 * which meets the duty cycle requirement. +		 */ +		if (of_property_read_bool(of_node, "micrel,force-master")) { +			result = phy_read(phydev, MII_CTRL1000); +			if (result < 0) +				goto err_force_master; + +			/* enable master mode, config & prefer master */ +			result |= CTL1000_ENABLE_MASTER | CTL1000_AS_MASTER; +			result = phy_write(phydev, MII_CTRL1000, result); +			if (result < 0) +				goto err_force_master; +		}  	}  	return ksz9031_center_flp_timing(phydev); + +err_force_master: +	phydev_err(phydev, "failed to force the phy to master mode\n"); +	return result;  }  #define KSZ8873MLL_GLOBAL_CONTROL_4	0x06 @@ -650,9 +681,6 @@ static void kszphy_get_strings(struct phy_device *phydev, u8 *data)  	}  } -#ifndef UINT64_MAX -#define UINT64_MAX              (u64)(~((u64)0)) -#endif  static u64 kszphy_get_stat(struct phy_device *phydev, int i)  {  	struct kszphy_hw_stat stat = kszphy_hw_stats[i]; @@ -662,7 +690,7 @@ static u64 kszphy_get_stat(struct phy_device *phydev, int i)  	val = phy_read(phydev, stat.reg);  	if (val < 0) { -		ret = UINT64_MAX; +		ret = U64_MAX;  	} else {  		val = val & ((1 << stat.bits) - 1);  		priv->stats[i] += val; |