cma: Add API to get the start address of a CMA region

When setting CMA up at a fixed region, it is possible for the address
to be shared between multiple subsystems. If the address is placed
dynamically, there is no mechanism to be able to get the start address
of the region. Drivers may wish to do keep track of allocations relative
to the start address so add an API to get the start region of a CMA
address.

Change-Id: If0730c64496c876d3143064d767b22b984c6dc84
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c
index 45c9023..885721f 100644
--- a/drivers/base/dma-contiguous.c
+++ b/drivers/base/dma-contiguous.c
@@ -447,6 +447,13 @@
 }
 core_initcall(cma_init_reserved_areas);
 
+phys_addr_t cma_get_base(struct device *dev)
+{
+	struct cma *cma = dev_get_cma_area(dev);
+
+	return cma->base_pfn << PAGE_SHIFT;
+}
+
 /**
  * dma_alloc_from_contiguous() - allocate pages from contiguous area
  * @dev:   Pointer to device for which the allocation is performed.