summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMD Danish Anwar <danishanwar@ti.com>2024-09-11 13:46:00 +0530
committerJakub Kicinski <kuba@kernel.org>2024-09-14 15:14:07 -0700
commit4ebe0599fc36ea3ff51e76e8554a2127e8126778 (patch)
tree3a5bc29b063ce6dc49bf7ebce6d313471d67c4dd
parent8f88c072c2ba9201c1db27dec35f5015489776ec (diff)
net: ti: icssg-prueth: Stop hardcoding def_inc
The def_inc is stored in icss_iep structure. Currently default increment (ns per clock tick) is hardcoded to 4 (Clock frequency being 250 MHz). Change this to use the iep->def_inc variable as the iep structure is now accessible to the driver files. Reviewed-by: Roger Quadros <rogerq@kernel.org> Signed-off-by: MD Danish Anwar <danishanwar@ti.com> Link: https://patch.msgid.link/20240911081603.2521729-3-danishanwar@ti.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/ti/icssg/icssg_prueth.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
index 6644203d6bb7..5343d8754edd 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
@@ -365,7 +365,8 @@ static void prueth_iep_settime(void *clockops_data, u64 ns)
sc_desc.cyclecounter0_set = cyclecount & GENMASK(31, 0);
sc_desc.cyclecounter1_set = (cyclecount & GENMASK(63, 32)) >> 32;
sc_desc.iepcount_set = ns % cycletime;
- sc_desc.CMP0_current = cycletime - 4; //Count from 0 to (cycle time)-4
+ /* Count from 0 to (cycle time) - emac->iep->def_inc */
+ sc_desc.CMP0_current = cycletime - emac->iep->def_inc;
memcpy_toio(sc_descp, &sc_desc, sizeof(sc_desc));