/** @brief setup the logical map for an IPC region @param mld the pointer to a mem_link_device instance @param start the physical address of an IPC region @param size the size of the IPC region */ int mem_setup_ipc_map(struct mem_link_device *mld, unsigned long start, unsigned long size) { struct link_device *ld = &mld->link_dev; char __iomem *base; if (!mld->remap_region) { mif_err("%s: ERR! NO remap_region method\n", ld->name); return -EFAULT; } base = mld->remap_region(start, size); if (!base) { mif_err("%s: ERR! remap_region fail\n", ld->name); return -EINVAL; } mif_err("%s: IPC_RGN phys_addr:0x%08lx virt_addr:0x%08x size:%lu\n", ld->name, start, (int)base, size); mld->start = start; mld->size = size; mld->base = (char __iomem *)base; if (mem_type_shmem(mld->type) && mld->size == SZ_4M) remap_4mb_map_to_ipc_dev(mld); else return -EINVAL; memset(mld->base, 0, mld->size); return 0; }
void mem_setup_ipc_map(struct mem_link_device *mld) { remap_4mb_map_to_ipc_dev(mld); }