Lines Matching refs:bcom_sram
30 struct bcom_sram *bcom_sram = NULL;
31 EXPORT_SYMBOL_GPL(bcom_sram); /* needed for inline functions */
48 if (bcom_sram) {
54 bcom_sram = kmalloc(sizeof(struct bcom_sram), GFP_KERNEL);
55 if (!bcom_sram) {
72 bcom_sram->base_phys = (phys_addr_t) regaddr64;
73 bcom_sram->size = (unsigned int) size64;
76 if (!request_mem_region(bcom_sram->base_phys, bcom_sram->size, owner)) {
85 bcom_sram->base_virt = (void*) ioremap(bcom_sram->base_phys, bcom_sram->size);
87 if (!bcom_sram->base_virt) {
90 owner, (long)bcom_sram->base_phys, bcom_sram->size );
96 bcom_sram->rh = rh_create(4);
104 rh_attach_region(bcom_sram->rh, 0, bcom_sram->size);
109 rh_attach_region(bcom_sram->rh, zbase - bcom_sram->base_phys, regaddr_p[1]);
116 spin_lock_init(&bcom_sram->lock);
121 release_mem_region(bcom_sram->base_phys, bcom_sram->size);
123 kfree(bcom_sram);
124 bcom_sram = NULL;
133 if (bcom_sram) {
134 rh_destroy(bcom_sram->rh);
135 iounmap((void __iomem *)bcom_sram->base_virt);
136 release_mem_region(bcom_sram->base_phys, bcom_sram->size);
137 kfree(bcom_sram);
138 bcom_sram = NULL;
147 spin_lock(&bcom_sram->lock);
148 offset = rh_alloc_align(bcom_sram->rh, size, align, NULL);
149 spin_unlock(&bcom_sram->lock);
154 *phys = bcom_sram->base_phys + offset;
155 return bcom_sram->base_virt + offset;
166 offset = ptr - bcom_sram->base_virt;
168 spin_lock(&bcom_sram->lock);
169 rh_free(bcom_sram->rh, offset);
170 spin_unlock(&bcom_sram->lock);