dma: pl330: support the arm_exynos_dma_mcode_ops in device tree
authorLee Yongjin <yongjin0.lee@samsung.com>
Fri, 13 Sep 2013 05:39:19 +0000 (14:39 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:21:49 +0000 (20:21 +0300)
This patch is dma micro code allocation in special memory area.

Change-Id: Ic40c162e3a6ec317e70d8af675304304f2e5886c
Signed-off-by: Lee Yongjin <yongjin0.lee@samsung.com>
Signed-off-by: Seokju Yoon <sukju.yoon@samsung.com>
drivers/dma/pl330.c

index 8b41da1260915cf4abb96ef22805309e68be287d..382a0476f698c2a03246ab12fb8f23600876f4c7 100644 (file)
@@ -1795,6 +1795,15 @@ static int dmac_alloc_resources(struct pl330_dmac *pl330)
 {
        int chans = pl330->pcfg.num_chan;
        int ret;
+       dma_addr_t addr;
+
+       if (pl330->ddma.dev->of_node) {
+               addr = of_dma_get_mcode_addr(pl330->ddma.dev->of_node);
+               if (addr) {
+                       set_dma_ops(pl330->ddma.dev, &arm_exynos_dma_mcode_ops);
+                       pl330->mcode_bus = addr;
+               }
+       }
 
        /*
         * Alloc MicroCode buffer for 'chans' Channel threads.
@@ -2859,7 +2868,6 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
        pd = &pl330->ddma;
        pd->dev = &adev->dev;
 
-       pl330->mcbufsz = 0;
 
        /* get quirk */
        for (i = 0; i < ARRAY_SIZE(of_quirks); i++)