This source file includes following definitions.
- bcom_sram_va2pa
- bcom_sram_pa2va
1
2
3
4
5
6
7
8
9
10
11
12 #ifndef __BESTCOMM_SRAM_H__
13 #define __BESTCOMM_SRAM_H__
14
15 #include <asm/rheap.h>
16 #include <asm/mmu.h>
17 #include <linux/spinlock.h>
18
19
20
21
22
23
24 struct bcom_sram {
25 phys_addr_t base_phys;
26 void *base_virt;
27 unsigned int size;
28 rh_info_t *rh;
29 spinlock_t lock;
30 };
31
32 extern struct bcom_sram *bcom_sram;
33
34
35
36 extern int bcom_sram_init(struct device_node *sram_node, char *owner);
37 extern void bcom_sram_cleanup(void);
38
39 extern void* bcom_sram_alloc(int size, int align, phys_addr_t *phys);
40 extern void bcom_sram_free(void *ptr);
41
42 static inline phys_addr_t bcom_sram_va2pa(void *va) {
43 return bcom_sram->base_phys +
44 (unsigned long)(va - bcom_sram->base_virt);
45 }
46
47 static inline void *bcom_sram_pa2va(phys_addr_t pa) {
48 return bcom_sram->base_virt +
49 (unsigned long)(pa - bcom_sram->base_phys);
50 }
51
52
53 #endif
54