Lines Matching refs:muram
46 static unsigned long fman_muram_vbase_to_offset(struct muram_info *muram, in fman_muram_vbase_to_offset() argument
49 return vaddr - (unsigned long)muram->vbase; in fman_muram_vbase_to_offset()
67 struct muram_info *muram; in fman_muram_init() local
71 muram = kzalloc(sizeof(*muram), GFP_KERNEL); in fman_muram_init()
72 if (!muram) in fman_muram_init()
75 muram->pool = gen_pool_create(ilog2(64), -1); in fman_muram_init()
76 if (!muram->pool) { in fman_muram_init()
87 ret = gen_pool_add_virt(muram->pool, (unsigned long)vaddr, in fman_muram_init()
97 muram->vbase = vaddr; in fman_muram_init()
98 muram->pbase = base; in fman_muram_init()
99 return muram; in fman_muram_init()
102 gen_pool_destroy(muram->pool); in fman_muram_init()
104 kfree(muram); in fman_muram_init()
117 unsigned long fman_muram_offset_to_vbase(struct muram_info *muram, in fman_muram_offset_to_vbase() argument
120 return offset + (unsigned long)muram->vbase; in fman_muram_offset_to_vbase()
132 unsigned long fman_muram_alloc(struct muram_info *muram, size_t size) in fman_muram_alloc() argument
136 vaddr = gen_pool_alloc(muram->pool, size); in fman_muram_alloc()
142 return fman_muram_vbase_to_offset(muram, vaddr); in fman_muram_alloc()
153 void fman_muram_free_mem(struct muram_info *muram, unsigned long offset, in fman_muram_free_mem() argument
156 unsigned long addr = fman_muram_offset_to_vbase(muram, offset); in fman_muram_free_mem()
158 gen_pool_free(muram->pool, addr, size); in fman_muram_free_mem()