Commit 9e95505f authored by Rohan G Thomas's avatar Rohan G Thomas Committed by Jakub Kicinski
Browse files

net: stmmac: Add support for EST cycle-time-extension



Add support for cycle-time-extension. TER GCL-register needs to be
updated with the cycle-time-extension. Width of TER register is EST
time interval width + 7 bits.

Signed-off-by: default avatarRohan G Thomas <rohan.g.thomas@intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231201055252.1302-4-rohan.g.thomas@intel.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c3f3b972
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -975,6 +975,8 @@ static int tc_setup_taprio(struct stmmac_priv *priv,
		return -EINVAL;
	if (!qopt->cycle_time)
		return -ERANGE;
	if (qopt->cycle_time_extension >= BIT(wid + 7))
		return -ERANGE;

	if (!plat->est) {
		plat->est = devm_kzalloc(priv->device, sizeof(*plat->est),
@@ -1041,6 +1043,8 @@ static int tc_setup_taprio(struct stmmac_priv *priv,
	priv->plat->est->ctr[0] = do_div(ctr, NSEC_PER_SEC);
	priv->plat->est->ctr[1] = (u32)ctr;

	priv->plat->est->ter = qopt->cycle_time_extension;

	if (fpe && !priv->dma_cap.fpesel) {
		mutex_unlock(&priv->plat->est->lock);
		return -EOPNOTSUPP;