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;
#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)
#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)
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();
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);
}
}
- 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)