Commit 4ebe0599 authored by MD Danish Anwar's avatar MD Danish Anwar Committed by Jakub Kicinski

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: default avatarRoger Quadros <rogerq@kernel.org>
Signed-off-by: default avatarMD Danish Anwar <danishanwar@ti.com>
Link: https://patch.msgid.link/20240911081603.2521729-3-danishanwar@ti.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 8f88c072
......@@ -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));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment