SMI clock should be running only for the time when there are transactions
on the bus.
Signed-off-by: Damian Eppel <[email protected]>
Signed-off-by: Piyush Malgujar <[email protected]>
---
drivers/net/mdio/mdio-thunder.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/mdio/mdio-thunder.c b/drivers/net/mdio/mdio-thunder.c
index 822d2cdd2f3599025f3e79d4243337c18114c951..715c835ace785da345ac037177b0f291678e4c47 100644
--- a/drivers/net/mdio/mdio-thunder.c
+++ b/drivers/net/mdio/mdio-thunder.c
@@ -58,6 +58,7 @@ static int thunder_mdiobus_pci_probe(struct pci_dev *pdev,
struct resource r;
struct mii_bus *mii_bus;
struct cavium_mdiobus *bus;
+ union cvmx_smix_clk smi_clk;
union cvmx_smix_en smi_en;
/* If it is not an OF node we cannot handle it yet, so
@@ -87,6 +88,10 @@ static int thunder_mdiobus_pci_probe(struct pci_dev *pdev,
bus->register_base = nexus->bar0 +
r.start - pci_resource_start(pdev, 0);
+ smi_clk.u64 = oct_mdio_readq(bus->register_base + SMI_CLK);
+ smi_clk.s.clk_idle = 1;
+ oct_mdio_writeq(smi_clk.u64, bus->register_base + SMI_CLK);
+
smi_en.u64 = 0;
smi_en.s.en = 1;
oct_mdio_writeq(smi_en.u64, bus->register_base + SMI_EN);
--
2.17.1