Skip to content

Commit

Permalink
ion: "unmapped" heap for secure data path
Browse files Browse the repository at this point in the history
OP-TEE/SDP (Secure Data Path) memory pools are created through ION
secure type heap" from Allwinner. This change renames "secure" into
"unmapped" as, from Linux point of view, the heap constraint is
manipulating unampped memory pools/buffers.

"Unmapped" heap support is integrated in ION UAPI (actually this was
the Allwinner initial proposal) and ION DT parsing support.

Based in work from Sunny <sunny@allwinnertech.com> for Allwinner.

Changes:
- rename "secure_heap" into "unmapped_heap"
- define ION_HEAP_TYPE_UNMAPPED in ION UAPI (sic!)
- add structure "struct unmapped_buffer_priv" to hold allocated buffer
  private data (currently only the buffer physical address.
- adapt to recent ION (i.e ion_phys_addr_t => phys_addr_t)
- Support dummy heap configuration: one can hard code into the Linux
  kernel configuration the location of a "unmapped heap". It will be
  created during ION device inits: see CONFIG_ION_DUMMY_UNMAPPED_HEAP.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
  • Loading branch information
etienne-lms committed Aug 14, 2017
1 parent 6f3606e commit a87b3b5
Show file tree
Hide file tree
Showing 5 changed files with 296 additions and 178 deletions.
32 changes: 32 additions & 0 deletions drivers/staging/android/ion/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,35 @@ config ION_CMA_HEAP
Choose this option to enable CMA heaps with Ion. This heap is backed
by the Contiguous Memory Allocator (CMA). If your system has these
regions, you should say Y here.

config ION_UNMAPPED_HEAP
bool "ION unmapped heap support"
depends on ION
help
Choose this option to enable UNMAPPED heaps with Ion. This heap is
backed in specific memory pools, carveout from the Linux memory.
Unless you know your system has these regions, you should say N here.

config ION_DUMMY_UNMAPPED_HEAP
bool "ION dummy driver define an ION unmapped heap"
depends on ION_UNMAPPED_HEAP
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
default 0
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
default 0
help
Allows one the statically define an unmapped heap from the
ION dummy driver to exercice unamped heaps buffer managment.
1 change: 1 addition & 0 deletions drivers/staging/android/ion/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ obj-$(CONFIG_ION_SYSTEM_HEAP) += ion_system_heap.o ion_page_pool.o
obj-$(CONFIG_ION_CARVEOUT_HEAP) += ion_carveout_heap.o
obj-$(CONFIG_ION_CHUNK_HEAP) += ion_chunk_heap.o
obj-$(CONFIG_ION_CMA_HEAP) += ion_cma_heap.o
obj-$(CONFIG_ION_UNMAPPED_HEAP) += ion_unmapped_heap.o
178 changes: 0 additions & 178 deletions drivers/staging/android/ion/ion_secure_heap.c

This file was deleted.

0 comments on commit a87b3b5

Please sign in to comment.