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()
69 bcom_sram->base_phys = (phys_addr_t) regaddr64; in bcom_sram_init()
70 bcom_sram->size = (unsigned int) size64; in bcom_sram_init()
73 if (!request_mem_region(bcom_sram->base_phys, bcom_sram->size, owner)) { in bcom_sram_init()
82 bcom_sram->base_virt = (void*) ioremap(bcom_sram->base_phys, bcom_sram->size); in bcom_sram_init()
84 if (!bcom_sram->base_virt) { in bcom_sram_init()
87 owner, (long)bcom_sram->base_phys, bcom_sram->size ); in bcom_sram_init()
93 bcom_sram->rh = rh_create(4); in bcom_sram_init()
106 rh_attach_region(bcom_sram->rh, 0, bcom_sram->size); in bcom_sram_init()
111 rh_attach_region(bcom_sram->rh, zbase - bcom_sram->base_phys, regaddr_p[1]); in bcom_sram_init()
118 spin_lock_init(&bcom_sram->lock); in bcom_sram_init()
123 release_mem_region(bcom_sram->base_phys, bcom_sram->size); in bcom_sram_init()
125 kfree(bcom_sram); in bcom_sram_init()
126 bcom_sram = NULL; in bcom_sram_init()
135 if (bcom_sram) { in bcom_sram_cleanup()
136 rh_destroy(bcom_sram->rh); in bcom_sram_cleanup()
137 iounmap((void __iomem *)bcom_sram->base_virt); in bcom_sram_cleanup()
138 release_mem_region(bcom_sram->base_phys, bcom_sram->size); in bcom_sram_cleanup()
139 kfree(bcom_sram); in bcom_sram_cleanup()
140 bcom_sram = NULL; in bcom_sram_cleanup()
149 spin_lock(&bcom_sram->lock); in bcom_sram_alloc()
150 offset = rh_alloc_align(bcom_sram->rh, size, align, NULL); in bcom_sram_alloc()
151 spin_unlock(&bcom_sram->lock); in bcom_sram_alloc()
156 *phys = bcom_sram->base_phys + offset; in bcom_sram_alloc()
157 return bcom_sram->base_virt + offset; in bcom_sram_alloc()
168 offset = ptr - bcom_sram->base_virt; in bcom_sram_free()
170 spin_lock(&bcom_sram->lock); in bcom_sram_free()
171 rh_free(bcom_sram->rh, offset); in bcom_sram_free()
172 spin_unlock(&bcom_sram->lock); in bcom_sram_free()