lkml.org 
[lkml]   [2022]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 1/3] net: mdio: mdio-thunder: stop toggling SMI clock on idle
Date
SMI clock should be running only for the time when there are transactions
on the bus.

Signed-off-by: Damian Eppel <deppel@marvell.com>
Signed-off-by: Piyush Malgujar <pmalgujar@marvell.com>
---
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
\
 
 \ /
  Last update: 2022-05-30 14:58    [W:0.068 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site