Lines Matching refs:bcom_sram

27 struct bcom_sram *bcom_sram = NULL;  variable
28 EXPORT_SYMBOL_GPL(bcom_sram); /* needed for inline functions */
45 if (bcom_sram) { in bcom_sram_init()
51 bcom_sram = kmalloc(sizeof(struct bcom_sram), GFP_KERNEL); in bcom_sram_init()
52 if (!bcom_sram) { in bcom_sram_init()
66 bcom_sram->base_phys = res.start; in bcom_sram_init()
67 bcom_sram->size = resource_size(&res); in bcom_sram_init()
79 bcom_sram->base_virt = (void *)ioremap(res.start, resource_size(&res)); in bcom_sram_init()
81 if (!bcom_sram->base_virt) { in bcom_sram_init()
84 owner, (long)bcom_sram->base_phys, bcom_sram->size ); in bcom_sram_init()
90 bcom_sram->rh = rh_create(4); in bcom_sram_init()
103 rh_attach_region(bcom_sram->rh, 0, bcom_sram->size); in bcom_sram_init()
108 rh_attach_region(bcom_sram->rh, zbase - bcom_sram->base_phys, regaddr_p[1]); in bcom_sram_init()
115 spin_lock_init(&bcom_sram->lock); in bcom_sram_init()
122 kfree(bcom_sram); in bcom_sram_init()
123 bcom_sram = NULL; in bcom_sram_init()
132 if (bcom_sram) { in bcom_sram_cleanup()
133 rh_destroy(bcom_sram->rh); in bcom_sram_cleanup()
134 iounmap((void __iomem *)bcom_sram->base_virt); in bcom_sram_cleanup()
135 release_mem_region(bcom_sram->base_phys, bcom_sram->size); in bcom_sram_cleanup()
136 kfree(bcom_sram); in bcom_sram_cleanup()
137 bcom_sram = NULL; in bcom_sram_cleanup()
146 spin_lock(&bcom_sram->lock); in bcom_sram_alloc()
147 offset = rh_alloc_align(bcom_sram->rh, size, align, NULL); in bcom_sram_alloc()
148 spin_unlock(&bcom_sram->lock); in bcom_sram_alloc()
153 *phys = bcom_sram->base_phys + offset; in bcom_sram_alloc()
154 return bcom_sram->base_virt + offset; in bcom_sram_alloc()
165 offset = ptr - bcom_sram->base_virt; in bcom_sram_free()
167 spin_lock(&bcom_sram->lock); in bcom_sram_free()
168 rh_free(bcom_sram->rh, offset); in bcom_sram_free()
169 spin_unlock(&bcom_sram->lock); in bcom_sram_free()