]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
soc: ti: k3-navss-ringacc: Fix reset ring API
authorVignesh Raghavendra <vigneshr@ti.com>
Mon, 26 Aug 2024 10:25:08 +0000 (15:55 +0530)
committerTom Rini <trini@konsulko.com>
Fri, 30 Aug 2024 19:57:39 +0000 (13:57 -0600)
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@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
drivers/soc/ti/k3-navss-ringacc-u-boot.c

index f958239c2aff4b67ec4659deee67458489cc417a..2799f214c77f5741a7ec0a4f03c16f4d87397a43 100644 (file)
@@ -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)