]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
soc/fsl/qbman: Use shared-dma-pool for BMan private memory allocations
authorRoy Pledge <roy.pledge@nxp.com>
Mon, 18 Sep 2017 20:39:37 +0000 (16:39 -0400)
committerLi Yang <leoyang.li@nxp.com>
Fri, 22 Sep 2017 18:33:07 +0000 (13:33 -0500)
Use the shared-memory-pool mechanism for free buffer proxy record
area allocation.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
drivers/soc/fsl/qbman/bman_ccsr.c

index eaa9585c7347518f3054e6b176b9521d05e7c01a..05c42235dd41de138ebde5b5fce9289ae5a5b4bc 100644 (file)
@@ -201,6 +201,21 @@ static int fsl_bman_probe(struct platform_device *pdev)
                return -ENODEV;
        }
 
+       /*
+        * If FBPR memory wasn't defined using the qbman compatible string
+        * try using the of_reserved_mem_device method
+        */
+       if (!fbpr_a) {
+               ret = qbman_init_private_mem(dev, 0, &fbpr_a, &fbpr_sz);
+               if (ret) {
+                       dev_err(dev, "qbman_init_private_mem() failed 0x%x\n",
+                               ret);
+                       return -ENODEV;
+               }
+       }
+
+       dev_dbg(dev, "Allocated FBPR 0x%llx 0x%zx\n", fbpr_a, fbpr_sz);
+
        bm_set_memory(fbpr_a, fbpr_sz);
 
        err_irq = platform_get_irq(pdev, 0);