Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * mach/sram.h - DaVinci simple SRAM allocator
0004  *
0005  * Copyright (C) 2009 David Brownell
0006  */
0007 #ifndef __MACH_SRAM_H
0008 #define __MACH_SRAM_H
0009 
0010 /* ARBITRARY:  SRAM allocations are multiples of this 2^N size */
0011 #define SRAM_GRANULARITY    512
0012 
0013 /*
0014  * SRAM allocations return a CPU virtual address, or NULL on error.
0015  * If a DMA address is requested and the SRAM supports DMA, its
0016  * mapped address is also returned.
0017  *
0018  * Errors include SRAM memory not being available, and requesting
0019  * DMA mapped SRAM on systems which don't allow that.
0020  */
0021 extern void *sram_alloc(size_t len, dma_addr_t *dma);
0022 extern void sram_free(void *addr, size_t len);
0023 
0024 /* Get the struct gen_pool * for use in platform data */
0025 extern struct gen_pool *sram_get_gen_pool(void);
0026 
0027 #endif /* __MACH_SRAM_H */