[COMMON] fimc-is2: changed reserved memory map for BCM monitoring
authorEunyoung Lee <ey470.lee@samsung.com>
Mon, 25 Jun 2018 04:59:11 +0000 (13:59 +0900)
committerWooyeon Kim <wooy88.kim@samsung.com>
Fri, 6 Jul 2018 01:43:26 +0000 (10:43 +0900)
Change-Id: I832073b952e7b5dd71f227ea4a6f01aa1d149046
Signed-off-by: Eunyoung Lee <ey470.lee@samsung.com>
drivers/media/platform/exynos/fimc-is2/fimc-is-resourcemgr.c
drivers/media/platform/exynos/fimc-is2/include/fimc-is-binary.h
drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-library.c

index f34ed8966ba7bf696caeadbd6573abd26b160715..0d9afd29eb47297c1e0599ee561ec34406707154 100644 (file)
@@ -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;
index dd526d1d7355f46d9a89d9e2e4c5f584be155518..2dc2e116c89fd05caa0b546b19d1a8307a15d567 100644 (file)
 #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)
index e2531ebfc515e53689e82e216ac79eac2b70fa31..508803f1d63f6a05de3e86491fe7acffe97bd77f 100644 (file)
@@ -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)