From: Eunyoung Lee Date: Mon, 25 Jun 2018 04:59:11 +0000 (+0900) Subject: [COMMON] fimc-is2: changed reserved memory map for BCM monitoring X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5e95b9dbd90e878d67da6a0dbc8db40f1913be24;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] fimc-is2: changed reserved memory map for BCM monitoring Change-Id: I832073b952e7b5dd71f227ea4a6f01aa1d149046 Signed-off-by: Eunyoung Lee --- diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-resourcemgr.c b/drivers/media/platform/exynos/fimc-is2/fimc-is-resourcemgr.c index f34ed8966ba7..0d9afd29eb47 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-resourcemgr.c +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-resourcemgr.c @@ -601,12 +601,12 @@ static int __init fimc_is_lib_mem_alloc(char *str) if (kstrtoul(str, 0, (ulong *)&addr) || !addr) { probe_warn("invalid fimc-is library memory address, use default"); - addr = LIB_START; + addr = __LIB_START; } - if (addr != LIB_START) + if (addr != __LIB_START) probe_warn("use different address [reserve-fimc=0x%lx default:0x%lx]", - addr, LIB_START); + addr, __LIB_START); fimc_is_lib_vm.phys_addr = memblock_alloc(LIB_SIZE, SZ_4K); fimc_is_lib_vm.addr = (void *)addr; diff --git a/drivers/media/platform/exynos/fimc-is2/include/fimc-is-binary.h b/drivers/media/platform/exynos/fimc-is2/include/fimc-is-binary.h index dd526d1d7355..2dc2e116c89f 100644 --- a/drivers/media/platform/exynos/fimc-is2/include/fimc-is-binary.h +++ b/drivers/media/platform/exynos/fimc-is2/include/fimc-is-binary.h @@ -77,8 +77,11 @@ #define DEBUGCTL_OFFSET (DEBUG_REGION_OFFSET + DEBUG_REGION_SIZE) #else /* #ifdef ENABLE_IS_CORE */ /* static reserved memory for libraries */ +#define CDH_SIZE SZ_128K /* CDH : Camera Debug Helper */ + #define LIB_OFFSET (VMALLOC_START + 0xF6000000 - 0x8000000) -#define LIB_START (LIB_OFFSET + 0x04000000) +#define __LIB_START (LIB_OFFSET + 0x04000000 - CDH_SIZE) +#define LIB_START (__LIB_START + CDH_SIZE) #define VRA_LIB_ADDR (LIB_START) #define VRA_LIB_SIZE (SZ_512K + SZ_256K) @@ -90,9 +93,9 @@ #define RTA_LIB_SIZE (SZ_2M + SZ_2M) #ifdef USE_RTA_BINARY -#define LIB_SIZE (VRA_LIB_SIZE + DDK_LIB_SIZE + RTA_LIB_SIZE) +#define LIB_SIZE (VRA_LIB_SIZE + DDK_LIB_SIZE + RTA_LIB_SIZE + CDH_SIZE) #else -#define LIB_SIZE (VRA_LIB_SIZE + DDK_LIB_SIZE) +#define LIB_SIZE (VRA_LIB_SIZE + DDK_LIB_SIZE + CDH_SIZE) #endif #define HEAP_START (LIB_START + SZ_16M) diff --git a/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-library.c b/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-library.c index e2531ebfc515..508803f1d63f 100644 --- a/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-library.c +++ b/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-library.c @@ -2229,8 +2229,8 @@ int fimc_is_load_ddk_bin(int loadType) bin_type, was_loaded_by(&bin) ? "built-in" : "user-provided"); if (bin.size <= bin_size) { - memcpy((void *)lib_addr, bin.data, bin.size); - __flush_dcache_area((void *)lib_addr, bin.size); + memcpy((void *)lib_addr, bin.data + CDH_SIZE, bin.size - CDH_SIZE); + __flush_dcache_area((void *)lib_addr, bin.size - CDH_SIZE); #if defined(CONFIG_TIMA_RKP) if (!(gPtr_lib_support.binary_code_load_flg & BINARY_LOAD_DDK_DONE)) { flush_cache_all(); @@ -2257,18 +2257,18 @@ int fimc_is_load_ddk_bin(int loadType) bin_type, was_loaded_by(&bin) ? "built-in" : "user-provided"); memcpy((void *)lib_addr + CAMERA_BINARY_VRA_DATA_OFFSET, - bin.data + CAMERA_BINARY_VRA_DATA_OFFSET, - CAMERA_BINARY_VRA_DATA_SIZE); + bin.data + CAMERA_BINARY_VRA_DATA_OFFSET + CDH_SIZE, + CAMERA_BINARY_VRA_DATA_SIZE - CDH_SIZE); __flush_dcache_area((void *)lib_addr + CAMERA_BINARY_VRA_DATA_OFFSET, - CAMERA_BINARY_VRA_DATA_SIZE); + CAMERA_BINARY_VRA_DATA_SIZE - CDH_SIZE); info_lib("binary info[%s] - type: D, from: %s\n", bin_type, was_loaded_by(&bin) ? "built-in" : "user-provided"); memcpy((void *)lib_addr + CAMERA_BINARY_DDK_DATA_OFFSET, - bin.data + CAMERA_BINARY_DDK_DATA_OFFSET, - (bin.size - CAMERA_BINARY_DDK_DATA_OFFSET)); + bin.data + CAMERA_BINARY_DDK_DATA_OFFSET + CDH_SIZE, + (bin.size - CAMERA_BINARY_DDK_DATA_OFFSET - CDH_SIZE)); __flush_dcache_area((void *)lib_addr + CAMERA_BINARY_DDK_DATA_OFFSET, - bin.size - CAMERA_BINARY_DDK_DATA_OFFSET); + bin.size - CAMERA_BINARY_DDK_DATA_OFFSET - CDH_SIZE); } else { err_lib("DDK bin size is bigger than memory area. %zd[%zd]", bin.size, bin_size); @@ -2277,7 +2277,7 @@ int fimc_is_load_ddk_bin(int loadType) } } - fimc_is_ischain_version(FIMC_IS_BIN_DDK_LIBRARY, bin.data, bin.size); + fimc_is_ischain_version(FIMC_IS_BIN_DDK_LIBRARY, bin.data + CDH_SIZE, bin.size - CDH_SIZE); release_binary(&bin); #if !defined(CONFIG_TIMA_RKP)