aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMD Danish Anwar2024-02-15 03:49:46 -0600
committerUdit Kumar2024-02-15 04:22:00 -0600
commit61ea32c0eb0c2d827a7ebc52a2befe8dfbd1de56 (patch)
tree11fd7e2e0a15415411af79cfd173e4acea200ea1
parent96387ef0215ae1310b9b874166adb56993f1aee0 (diff)
downloadti-u-boot-61ea32c0eb0c2d827a7ebc52a2befe8dfbd1de56.tar.gz
ti-u-boot-61ea32c0eb0c2d827a7ebc52a2befe8dfbd1de56.tar.xz
ti-u-boot-61ea32c0eb0c2d827a7ebc52a2befe8dfbd1de56.zip
dma: ti: k3-udma: Use ring_idx to pair k3 nav rings
Use ring_idx to pair rings. ring_idx will be same as tx flow_id for all non-negative flow_ids. For negative flow_ids, ring_idx will be tchan->id added with bchan_cnt. Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
-rw-r--r--drivers/dma/ti/k3-udma.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
index a018f70c545..bdaadc9e780 100644
--- a/drivers/dma/ti/k3-udma.c
+++ b/drivers/dma/ti/k3-udma.c
@@ -875,13 +875,20 @@ static int udma_alloc_tx_resources(struct udma_chan *uc)
875{ 875{
876 struct k3_nav_ring_cfg ring_cfg; 876 struct k3_nav_ring_cfg ring_cfg;
877 struct udma_dev *ud = uc->ud; 877 struct udma_dev *ud = uc->ud;
878 int ret; 878 struct udma_tchan *tchan;
879 int ring_idx, ret;
879 880
880 ret = udma_get_tchan(uc); 881 ret = udma_get_tchan(uc);
881 if (ret) 882 if (ret)
882 return ret; 883 return ret;
883 884
884 ret = k3_nav_ringacc_request_rings_pair(ud->ringacc, uc->tchan->id, -1, 885 tchan = uc->tchan;
886 if (tchan->tflow_id >= 0)
887 ring_idx = tchan->tflow_id;
888 else
889 ring_idx = ud->bchan_cnt + tchan->id;
890
891 ret = k3_nav_ringacc_request_rings_pair(ud->ringacc, ring_idx, -1,
885 &uc->tchan->t_ring, 892 &uc->tchan->t_ring,
886 &uc->tchan->tc_ring); 893 &uc->tchan->tc_ring);
887 if (ret) { 894 if (ret) {