summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-10-29cmem: Add portability fix for user space library sourcedev1/lu-nextSam Nelson
Adds handling of 64 bit properly Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-10-19version: update to new version 4.16.0.0Sam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-10-19cmemk: Update for K3 architectureSam Nelson
Adds portabilty fix for 64 bit address handling. Also, with K3 cache coherence architecture, Cache operations are not required from the Arm Host side. This patch disables all cache operations for K3 architecture. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-08-21version: update to new version 4.15.0.24.15.00.02Sam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-08-17lu.mak: Update to allow building for aarch64Sam Nelson
Remove hard coding to ARCH=arm Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-08-17cmemk: Fix mmap failures on K2 devices with v4.14.49Suman Anna
The commit 16d7ceb04b55 ("mmap: introduce sane default mmap limits") that came through v4.14.49 stable tree has added additional range checks that resulted in the mmap() calls on the CMEM device to fail on K2 SoCs. K2 SoCs use 36-bit address spaces and the range check fails when comparing (in page indices) the 33-bit physical address against the 4 GB address imit, resulting in CMEM API failures and unable to launch MPM daemon on K2 SoCs affecting all MPM based IPC use-cases. Work around this problem by setting FMODE_UNSIGNED_OFFSET in the file flags in the driver's open() fops implementation for the /dev/cmem device. The change follows the suggestion in the above commit to mark the file descriptors as safe in the full 64-bit mmap address space by using the repurposed FMODE_UNSIGNED_OFFSET bit. The fix was also inspired by a similar fix in commit 2abd4c3ed20d ("drm: set FMODE_UNSIGNED_OFFSET for drm files") for the same problem. The same fix applies when using CMEM against kernels v4.17-rc5 and above as well overcoming the corresponding upstream equivalent commit be83bbf80682 ("mmap: introduce sane default mmap limits"). Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-03-05cmem: Update version number to 4.15.0.14.15.00.01Sam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-02-15cmemk: Update handling of get_physSam Nelson
Fixes one issue related to falling through for direct mapped memory. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-02-15cmem: Bug fix: Correct return value checkingSam Nelson
Need to check all negative values not only -1. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-01-31version: Update version number to 4.15.00.004.15.00.00_engSam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-01-31cmemk: Cleanup of tabs and spacesSam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-01-31cmemk: Update to make code work with kernel 4.14Sam Nelson
Changes are backward compatible with Linux Kernel 4.4 as well. Replaced use of deprecated ioremap_page_range function with ioremap Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-01-26cmemk: Clean up of tabs and spacesSam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-01-26cmemk: Add error checks and cleanupSam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-01-26cmemk: Need protection for find_vma for multithread useSam Nelson
There is a race condition when mmap is happening simultaneously in a different thread and find_vma returns invalid value. Adding protection here to avoid race condition Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-01-26cmem: Fix return value for export_dmabufSam Nelson
In case of error, function expected to return negative value Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-11-20cmemk: Fix the dma_buf ops names on 4.12+ kernelsSuman Anna
The dma-buf ops .kmap_atomic, .kunmap_atomic, .kmap and .kunmap have been renamed to .map_atomic, .unmap_atomic, .map and .unmap respectively on 4.12+ kernels to avoid conflict with a kmap_atomic macro from the Linux highmem.h header file. Fix the ops names in the current definitions of cmem_dmabuf_ops, so that the CMEM module can be built against 4.12+ kernels properly. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/dma-buf.h?id=f9b67f0014cba18f1aabb6fa9272335a043eb6fd Signed-off-by: Suman Anna <s-anna@ti.com>
2017-11-20cmemk: Use architecture agnostic uaccess.h headerSuman Anna
Replace the architecture specific asm/uaccess.h with the Linux generic linux/uaccess.h header file. The architecture specific header files will be included by the generic header file. This fixes an issue when building the CMEM kernel module against 4.12+ kernels. Signed-off-by: Suman Anna <s-anna@ti.com>
2017-11-20cmemk: Fix usage of get_user_pages_remote() on 4.10+ kernelsSuman Anna
The get_user_pages_remote() function signature has changed in 4.10 kernel, it gained an additional integer pointer argument [1]. Fix the current get_user_pages_remote() invocation in cmemk kernel with the appropriate signature to build properly for these kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/mm.h?id=5b56d49fc31dbb0487e14ead790fc81ca9fb2c99 Signed-off-by: Suman Anna <s-anna@ti.com>
2017-11-01cmem: Update version to 4.14.01.004.14.01.00Sam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-09-19Android: move cmem libraries/binaries to vendor partitionVishal Mahaveer
Updating Android makefile to generate cmem userspace binaries and libraries in /vendor location instead of /system. Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
2017-02-16version: Update cmem version to 4.144.14.00.00.eng4.14.00.00Sam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-02-16cmemk: Fix usage of get_user_pages() on 4.6+ kernelsSuman Anna
The get_user_pages() function has gone through a bunch of changes between 4.4 and 4.9 Linux kernel versions. The function first lost the first two arguments - the task_struct and the mm_struct pointers in 4.6 kernel (and got replaced with a new get_user_pages_remote() function)[1][2], and then replaced two other arguments 'write' and 'force' with a single 'gup_flags' argument in 4.9 kernel[3][4]. Fix the current get_user_pages() invocation in cmemk kernel with the appropriate functions to build properly for these kernels. [1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/include/linux/mm.h?id=1e9877902dc7e11d2be038371c6fbf2dfcd469d7 [2] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/include/linux/mm.h?id=c12d2da56d0e07d230968ee2305aaa86b93a6832 [3] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/include/linux/mm.h?id=768ae309a96103ed02eb1e111e838c87854d8b51 [4] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/include/linux/mm.h?id=9beae1ea89305a9667ceaab6d0bf46a045ad71e7 Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-02-16cmemk: Fix cmem_dma_buf_end_cpu_access() signature on 4.6+ kernelsSuman Anna
Commit 18b862dcd57a ("dma-buf, drm, ion: Propagate error code from dma_buf_start_cpu_access()") in Linux kernel has changed the signature for the dma_buf's end_cpu_access() ops. It now returns an error code, so adjust the signature for the cmem_dma_buf_end_cpu_access() function appropriately based on the kernel version. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-01-10cmem: Update version4.13.00.01.eng4.13.00.01Sam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-01-10cmemk: Initialize vma variableSam Nelson
This is a bug fix. Uninitialized variable caused freeing of random pointer and page fault. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-12-02version: Update cmem version4.13.00.00.engSam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-12-02Documentation: Update ti,cmem.txt with updated featuresSam Nelson
Adds support for using sram node Also updated documentation by demarcating the entries in the block subnodes Signed-off-by: Sam Nelson <sam.nelson@ti.com> --- Updated documentation with "sram" node definition ---
2016-12-02cmemk: Add support for blocks using sram nodesSam Nelson
Some memory sections can be managed by sram nodes in the dts. Adding support for sram subnodes allows the CMEM memory to use sram memory areas. Parsing of addresses on the subnodes now use of_address_to_resource for both sram and mem-region nodes. NOTE: For some of the routines the spacing and tabs are updated to general linux kernel coding guidelines. Signed-off-by: Sam Nelson <sam.nelson@ti.com> --- Change from previous version Redesigned to use "sram" node instead of mem-type. ---
2016-11-15tests: Update apitest to exercise dmabuf exportSam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-11-15cmem: Add support to export cmem buffer as dmabufSam Nelson
Added new API to export buffer as dmabuf Added kernel driver code to support dmabuf ops Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-11-15cmem: Fix duplication of block_structSam Nelson
Cleanup: The block_struct was duplicated in both cmem.c and cmemk.c Removing it and add it in the common cmem.h file Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-11-15cmemk: Add error check for ioremap function callSam Nelson
Added error check for ioremap_page_range in case of failure Also added initialisation of virtp Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-11-15cmemk: Fix for issue with allocating memory from CMA pool with non-keystoneSam Nelson
coherent_dma_mask was not set for Am57x platforms and resulted in allocation failure Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-09-26Documentation: Add kernel device tree documentation4.12.00.00Sam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-09-07cmemk: UPdate cache wb and invalidate function.4.12.00.00_engSam Nelson
- Found that __cpuc_flush_dcache_area doesnot work properly: Needed to be replaced by dmac_map_area - Other minor spacing issues fixed. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-09-07version: Update version to 4.12.0.0Sam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-09-07cmemk: Update to use local assembly for cache operationsSam Nelson
dmac_map_area and associated assembly functions are no longer available for use in kernel modules in kernel version >= 4.4 and there are no equivalent higher level function available for cache operations. Use of dma_sync_single* function creates additional issues with address translation and does not really solve the problem for memory range > 4 GB and hence reverting back that change. Reverting back to local assembly functions. Modified code to add local functions for all kernels versions where dmac_map_area is not available. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-09-07Revert "Remove assembly function hack for !MULTI_CACHE case"Sam Nelson
This reverts commit d5481f4d32edbc320a0853b2ddfdfe8dedc8d017.
2016-06-24cmem: Update version to 4.1.0.14.11.00.01Sam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-04-27cmemk: Update to use high level functions for cache operations4.11.00.00_engSam Nelson
linux kernel 4.4 made the dmac_map_area function to internal only to dma module. Replaced with higher level cache operation functions to achieve the same result, but avoid using the low level internal function to resolve issue. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-04-27cmemk: Cleanup on cmem_cma_dev_0Sam Nelson
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>
2016-04-27cmemk: Update to remove return value for seq_printfSam Nelson
In kernel version 4.4 the return value for seq_printf is removed. Removed all return value handling for seq_printf Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-04-27Remove assembly function hack for !MULTI_CACHE caseRobert Tivy
With older Linux kernels the linkage to architecture-specific cache APIs was not available, yet CMEM needed their functionality. This problem existed for architectures that didn't #define MULTI_CACHE. CMEM worked around this limitation by having a copy of the needed architecture-specific assembly functions, taken from the architecture's source code. The current Linux kernels don't suffer this limitation, so the copies of the architecture's assembly source code are no longer needed and should be removed altogether. Addresses SDOCM00117426 & SDOCM00118582 Signed-off-by: Rob Tivy <rtivy@ti.com> Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-03-17cmemk: Use #define for keystone dma pfn offsetSam Nelson
Cleanup to define the dma pfn offset at one location instead of spread all over the code Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-03-17cmemk: Update to ensure backward compatibility with older kernelSam Nelson
The per device dma_pfn_offset was introduced in Kernel version 3.18. The conditional compilation allows to compile with older kernel as well. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-03-15ks2: set dma_pfn_offset for keystone2 devices4.10.02.064.10.02.05_engVitaly Andrianov
On kestone2 SOC where aliased memory is being used dma_alloc_coherent() cannot be called with pointer to device set to NULL. The real "struct device" has to be used. And the dma_pfn_offset has to be set correctly. Otherwise the function returns wrong dma address. This commit adds the cmem_cma_dev_0 pointer, which is set by device_create(). It sets the correct coherent_dma_mask and dma_pfn_offset for this device. Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
2015-10-19Add support for LPAE in DT processing4.10.02.04_engRobert Tivy
When memory is using LPAE mode pointers are > 32 bit, and as such the "reg" values in a memory-region are 64 bits each for address and size. Change CMEM DT processing to honor #address-cells and #size-cells for memory-region nodes. Also, pool buffer sizes need to be specified as 64 bit values, so add a #pool-size-cells property to the cmem node and read values from the cmem-buf-pools property as appropriate.
2015-08-25Revert "Remove assembly function hack for !MULTI_CACHE case"Robert Tivy
This reverts commit 09d38fe7dfed7067e4e6d10a1c22a0bcc3af0271.
2015-08-20Updates to accommodate GCC 4.94.10.02.03_engRobert Tivy
A 'space' between -I and the following path seems to cause the path element to not be used for #include file searches. The __DATE__ & __TIME__ macro usage causes a warning (that can be an error with -Wall). Addresses SDOCM00118585