[PATCH v6 04/11] soc: ti: k3-navss-ringacc: Fix reset ring API

Chintan Vankar c-vankar at ti.com
Mon Aug 26 12:25:08 CEST 2024


From: Vignesh Raghavendra <vigneshr at ti.com>

Expectation of k3_ringacc_ring_reset_raw() is to reset the ring to
requested size and not to 0. Fix this.

Signed-off-by: Vignesh Raghavendra <vigneshr at ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli at ti.com>
Signed-off-by: Chintan Vankar <c-vankar at ti.com>
---

Link to v5:
https://lore.kernel.org/r/20240813105400.4054657-5-c-vankar@ti.com/

Changes from v5 to v6:
- Updated function "k3_ringacc_ring_reset_raw" to reset only ring
  size field in ring configuration register as pointed out by Alexander
  Sverdlin.

 drivers/soc/ti/k3-navss-ringacc-u-boot.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/ti/k3-navss-ringacc-u-boot.c b/drivers/soc/ti/k3-navss-ringacc-u-boot.c
index f958239c2af..2799f214c77 100644
--- a/drivers/soc/ti/k3-navss-ringacc-u-boot.c
+++ b/drivers/soc/ti/k3-navss-ringacc-u-boot.c
@@ -25,9 +25,16 @@ struct k3_nav_ring_cfg_regs {
 #define KNAV_RINGACC_CFG_RING_SIZE_ELSIZE_MASK		GENMASK(26, 24)
 #define KNAV_RINGACC_CFG_RING_SIZE_ELSIZE_SHIFT		(24)
 
+#define KNAV_RINGACC_CFG_RING_SIZE_MASK			GENMASK(19, 0)
+
 static void k3_ringacc_ring_reset_raw(struct k3_nav_ring *ring)
 {
-	writel(0, &ring->cfg->size);
+	u32 reg;
+
+	reg = readl(&ring->cfg->size);
+	reg &= ~KNAV_RINGACC_CFG_RING_SIZE_MASK;
+	reg |= ring->size;
+	writel(reg, &ring->cfg->size);
 }
 
 static void k3_ringacc_ring_reconfig_qmode_raw(struct k3_nav_ring *ring, enum k3_nav_ring_mode mode)
-- 
2.34.1



More information about the U-Boot mailing list