Lines Matching refs:bcom_sram

31 struct bcom_sram *bcom_sram = NULL;  variable
32 EXPORT_SYMBOL_GPL(bcom_sram); /* needed for inline functions */
49 if (bcom_sram) { in bcom_sram_init()
55 bcom_sram = kmalloc(sizeof(struct bcom_sram), GFP_KERNEL); in bcom_sram_init()
56 if (!bcom_sram) { in bcom_sram_init()
73 bcom_sram->base_phys = (phys_addr_t) regaddr64; in bcom_sram_init()
74 bcom_sram->size = (unsigned int) size64; in bcom_sram_init()
77 if (!request_mem_region(bcom_sram->base_phys, bcom_sram->size, owner)) { in bcom_sram_init()
86 bcom_sram->base_virt = (void*) ioremap(bcom_sram->base_phys, bcom_sram->size); in bcom_sram_init()
88 if (!bcom_sram->base_virt) { in bcom_sram_init()
91 owner, (long)bcom_sram->base_phys, bcom_sram->size ); in bcom_sram_init()
97 bcom_sram->rh = rh_create(4); in bcom_sram_init()
110 rh_attach_region(bcom_sram->rh, 0, bcom_sram->size); in bcom_sram_init()
115 rh_attach_region(bcom_sram->rh, zbase - bcom_sram->base_phys, regaddr_p[1]); in bcom_sram_init()
122 spin_lock_init(&bcom_sram->lock); in bcom_sram_init()
127 release_mem_region(bcom_sram->base_phys, bcom_sram->size); in bcom_sram_init()
129 kfree(bcom_sram); in bcom_sram_init()
130 bcom_sram = NULL; in bcom_sram_init()
139 if (bcom_sram) { in bcom_sram_cleanup()
140 rh_destroy(bcom_sram->rh); in bcom_sram_cleanup()
141 iounmap((void __iomem *)bcom_sram->base_virt); in bcom_sram_cleanup()
142 release_mem_region(bcom_sram->base_phys, bcom_sram->size); in bcom_sram_cleanup()
143 kfree(bcom_sram); in bcom_sram_cleanup()
144 bcom_sram = NULL; in bcom_sram_cleanup()
153 spin_lock(&bcom_sram->lock); in bcom_sram_alloc()
154 offset = rh_alloc_align(bcom_sram->rh, size, align, NULL); in bcom_sram_alloc()
155 spin_unlock(&bcom_sram->lock); in bcom_sram_alloc()
160 *phys = bcom_sram->base_phys + offset; in bcom_sram_alloc()
161 return bcom_sram->base_virt + offset; in bcom_sram_alloc()
172 offset = ptr - bcom_sram->base_virt; in bcom_sram_free()
174 spin_lock(&bcom_sram->lock); in bcom_sram_free()
175 rh_free(bcom_sram->rh, offset); in bcom_sram_free()
176 spin_unlock(&bcom_sram->lock); in bcom_sram_free()