summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 81ab5d5)
raw | patch | inline | side by side (parent: 81ab5d5)
author | Sam Nelson <sam.nelson@ti.com> | |
Wed, 13 Apr 2016 21:21:06 +0000 (17:21 -0400) | ||
committer | Sam Nelson <sam.nelson@ti.com> | |
Wed, 27 Apr 2016 12:49:41 +0000 (08:49 -0400) |
cmem_cma_dev_0 need not be keystone 2 specific and can be common for all
platforms. Added similar handling for all platforms.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
platforms. Added similar handling for all platforms.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
src/cmem/module/cmemk.c | patch | blob | history |
index 9aa801674da4d8ec7953ae064ed3473b243ed0a1..877412233b0dd1e2c7b158d5801390205fbf5680 100644 (file)
--- a/src/cmem/module/cmemk.c
+++ b/src/cmem/module/cmemk.c
static int cmem_cma_heapsize = 0;
static struct device *cmem_cma_dev;
static struct pool_object *cmem_cma_p_objs;
+#endif
+
+static struct device *cmem_cma_dev_0;
#if IS_ENABLED(CONFIG_ARCH_KEYSTONE) && IS_ENABLED(CONFIG_ARM_LPAE) \
&& (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
-static struct device *cmem_cma_dev_0;
#define KEYSTONE_DMA_PFN_OFFSET 0x780000UL
#endif
-#endif
/*
* For CMA allocations we treat p_objs[NBLOCKS] as a special "pool" array.
if (cmem_cma_heapsize == 0) {
__D("no explicit CMEM CMA heap, using global area\n");
-#if IS_ENABLED(CONFIG_ARCH_KEYSTONE) && IS_ENABLED(CONFIG_ARM_LPAE) \
- && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
dev = cmem_cma_dev_0;
-#else
- dev = NULL;
-#endif
}
else {
dev = &cmem_cma_dev[heap_pool[bi]];
goto fail_after_reg;
}
-#if IS_ENABLED(CONFIG_ARCH_KEYSTONE) && IS_ENABLED(CONFIG_ARM_LPAE) \
- && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
+ /* Create cmem device */
cmem_cma_dev_0 = device_create(cmem_class, NULL, MKDEV(cmem_major, 0),
NULL, "cmem");
-
+#if IS_ENABLED(CONFIG_ARCH_KEYSTONE) && IS_ENABLED(CONFIG_ARM_LPAE) \
+ && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
cmem_cma_dev_0->coherent_dma_mask = DMA_BIT_MASK(32);
cmem_cma_dev_0->dma_pfn_offset = KEYSTONE_DMA_PFN_OFFSET;
-#else
- device_create(cmem_class, NULL, MKDEV(cmem_major, 0), NULL, "cmem");
#endif
for (bi = 0; bi < NBLOCKS; bi++) {
if (!block_start[bi] || !block_end[bi]) {