summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
diff options
context:
space:
mode:
authorRusaimi Amira Ruslan <rusaimi.amira.rusaimi@intel.com>2020-09-28 18:12:12 +0800
committerDavid S. Miller <davem@davemloft.net>2020-09-28 18:43:57 -0700
commitb4c5f83ae3f3e2b3239751c304e424eace62448b (patch)
treecf23ef2e88d5fe01ca0106a9ff45b4d4c127975e /drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
parent3f53094ded4a78c87f9dada995e01cc491c196dd (diff)
stmmac: intel: Adding ref clock 1us tic for LPI cntr
Adding reference clock (1us tic) for all LPI timer on Intel platforms. The reference clock is derived from ptp clk. This also enables all LPI counter. Signed-off-by: Rusaimi Amira Ruslan <rusaimi.amira.rusaimi@intel.com> Signed-off-by: Voon Weifeng <weifeng.voon@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
index b1323d5c95b5..f61cb997a8f6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
@@ -11,6 +11,7 @@
#include <linux/platform_device.h>
#include <linux/stmmac.h>
+#include "dwmac4.h"
#include "stmmac.h"
#include "stmmac_platform.h"
@@ -146,6 +147,14 @@ static int intel_eth_plat_probe(struct platform_device *pdev)
}
plat_dat->bsp_priv = dwmac;
+ plat_dat->eee_usecs_rate = plat_dat->clk_ptp_rate;
+
+ if (plat_dat->eee_usecs_rate > 0) {
+ u32 tx_lpi_usec;
+
+ tx_lpi_usec = (plat_dat->eee_usecs_rate / 1000000) - 1;
+ writel(tx_lpi_usec, stmmac_res.addr + GMAC_1US_TIC_COUNTER);
+ }
ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
if (ret) {