xref: /openbmc/linux/arch/arm/mach-davinci/sram.h (revision f759f5b5)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * mach/sram.h - DaVinci simple SRAM allocator
4  *
5  * Copyright (C) 2009 David Brownell
6  */
7 #ifndef __MACH_SRAM_H
8 #define __MACH_SRAM_H
9 
10 /* ARBITRARY:  SRAM allocations are multiples of this 2^N size */
11 #define SRAM_GRANULARITY	512
12 
13 /*
14  * SRAM allocations return a CPU virtual address, or NULL on error.
15  * If a DMA address is requested and the SRAM supports DMA, its
16  * mapped address is also returned.
17  *
18  * Errors include SRAM memory not being available, and requesting
19  * DMA mapped SRAM on systems which don't allow that.
20  */
21 extern void *sram_alloc(size_t len, dma_addr_t *dma);
22 extern void sram_free(void *addr, size_t len);
23 
24 /* Get the struct gen_pool * for use in platform data */
25 extern struct gen_pool *sram_get_gen_pool(void);
26 
27 #endif /* __MACH_SRAM_H */
28