ion: unmapped heap support in ion dummy driver **not for mainline**
authorEtienne Carriere <etienne.carriere@linaro.org>
Thu, 23 Mar 2017 13:03:05 +0000 (14:03 +0100)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:56:41 +0000 (14:56 -0500)
Add configuration ION_DUMMY_UNMAPPED_HEAP to enable optional definition
of a statically defined "unmapped" heap for test purpose: kernel config
must provide the memory pool base address and byte size.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
(cherry picked from commit 961993fde60ebd06715d1433f8eb265471a0f38c
 linaro repo https://github.com/linaro-swg/linux.git
 tag optee-v4.9-20171005)

drivers/staging/android/ion/Kconfig
drivers/staging/android/ion/ion_dummy_driver.c

index 22ab230..4c26316 100644 (file)
@@ -60,3 +60,24 @@ config ION_OF
 
          If using Ion and devicetree, you should say Y here
 
+config ION_DUMMY_UNMAPPED_HEAP
+       bool "ION dummy driver define an ION unmapped heap"
+       depends on ION_DUMMY
+       help
+         Dummy ION driver will create a unmapped heap from physical
+         location provided through CONFIG_ION_DUMMY_UNMAPPED_BASE and
+         CONFIG_ION_DUMMY_UNMAPPED_SIZE.
+
+config ION_DUMMY_UNMAPPED_BASE
+       hex "Physical base address of the ION unmapped heap"
+       depends on ION_DUMMY_UNMAPPED_HEAP
+       help
+         Allows one the statically define an unmapped heap from the
+         ION dummy driver to exercice unamped heaps buffer managment.
+
+config ION_DUMMY_UNMAPPED_SIZE
+       hex "Physical byte size of the ION unmapped heap"
+       depends on ION_DUMMY_UNMAPPED_HEAP
+       help
+         Allows one the statically define an unmapped heap from the
+         ION dummy driver to exercice unamped heaps buffer managment.
index b23f2c7..c39009a 100644 (file)
@@ -56,6 +56,16 @@ static struct ion_platform_heap dummy_heaps[] = {
                        .align  = SZ_16K,
                        .priv   = (void *)(SZ_16K),
                },
+#ifdef CONFIG_ION_DUMMY_UNMAPPED_HEAP
+               {
+                       .id     = ION_HEAP_TYPE_UNMAPPED,
+                       .type   = ION_HEAP_TYPE_UNMAPPED,
+                       .name   = "unmapped",
+                       .base   = CONFIG_ION_DUMMY_UNMAPPED_BASE,
+                       .size   = CONFIG_ION_DUMMY_UNMAPPED_SIZE,
+                       .align  = SZ_4K,
+               },
+#endif
 };
 
 static struct ion_platform_data dummy_ion_pdata = {