diff options
author | Robert Hancock <hancock@sedsystems.ca> | 2019-06-12 14:49:06 -0600 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-14 19:11:53 -0700 |
commit | 79c8bd15b61eca456c49d20d083f02a2614b4d12 (patch) | |
tree | a1a6a97dabe62a2e9abe505cdd06527ff1895bd4 /drivers | |
parent | 1fc33199185ddb2296270a7ae8114c40ab28b17b (diff) | |
download | linux-79c8bd15b61eca456c49d20d083f02a2614b4d12.tar.bz2 |
net: dsa: microchip: Support optional 125MHz SYNCLKO output
The KSZ9477 series chips have a SYNCLKO pin which by default outputs a
25MHz clock, but some board setups require a 125MHz clock instead. Added
a microchip,synclko-125 device tree property to allow indicating a
125MHz clock output is required.
Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/dsa/microchip/ksz9477.c | 4 | ||||
-rw-r--r-- | drivers/net/dsa/microchip/ksz_common.c | 2 | ||||
-rw-r--r-- | drivers/net/dsa/microchip/ksz_priv.h | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index 7be6d848b69f..508380f80875 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -258,6 +258,10 @@ static int ksz9477_reset_switch(struct ksz_device *dev) data16 |= (BROADCAST_STORM_VALUE * BROADCAST_STORM_PROT_RATE) / 100; ksz_write16(dev, REG_SW_MAC_CTRL_2, data16); + if (dev->synclko_125) + ksz_write8(dev, REG_SW_GLOBAL_OUTPUT_CTRL__1, + SW_ENABLE_REFCLKO | SW_REFCLKO_IS_125MHZ); + return 0; } diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index 39dace8e3512..40c57d84816f 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -460,6 +460,8 @@ int ksz_switch_register(struct ksz_device *dev, ret = of_get_phy_mode(dev->dev->of_node); if (ret >= 0) dev->interface = ret; + dev->synclko_125 = of_property_read_bool(dev->dev->of_node, + "microchip,synclko-125"); } ret = dsa_register_switch(dev->ds); diff --git a/drivers/net/dsa/microchip/ksz_priv.h b/drivers/net/dsa/microchip/ksz_priv.h index 724301df91db..c615d2a81dd5 100644 --- a/drivers/net/dsa/microchip/ksz_priv.h +++ b/drivers/net/dsa/microchip/ksz_priv.h @@ -78,6 +78,7 @@ struct ksz_device { phy_interface_t interface; u32 regs_size; bool phy_errata_9477; + bool synclko_125; struct vlan_table *vlan_cache; |