Leo Yan | 3c7241b | 2011-08-15 11:09:52 +0800 | [diff] [blame] | 1 | /* |
Leo Yan | 3c7241b | 2011-08-15 11:09:52 +0800 | [diff] [blame] | 2 | * SRAM Memory Management |
| 3 | * |
| 4 | * Copyright (c) 2011 Marvell Semiconductors Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | * |
| 10 | */ |
| 11 | |
Sachin Kamat | 61310a3 | 2013-12-30 10:46:31 +0530 | [diff] [blame] | 12 | #ifndef __DMA_MMP_TDMA_H |
| 13 | #define __DMA_MMP_TDMA_H |
Leo Yan | 3c7241b | 2011-08-15 11:09:52 +0800 | [diff] [blame] | 14 | |
| 15 | #include <linux/genalloc.h> |
| 16 | |
| 17 | /* ARBITRARY: SRAM allocations are multiples of this 2^N size */ |
| 18 | #define SRAM_GRANULARITY 512 |
| 19 | |
| 20 | enum sram_type { |
| 21 | MMP_SRAM_UNDEFINED = 0, |
| 22 | MMP_ASRAM, |
| 23 | MMP_ISRAM, |
| 24 | }; |
| 25 | |
| 26 | struct sram_platdata { |
| 27 | char *pool_name; |
| 28 | int granularity; |
| 29 | }; |
| 30 | |
Rob Herring | 09aa8ac | 2015-02-03 17:07:35 -0600 | [diff] [blame] | 31 | #ifdef CONFIG_ARM |
Leo Yan | 3c7241b | 2011-08-15 11:09:52 +0800 | [diff] [blame] | 32 | extern struct gen_pool *sram_get_gpool(char *pool_name); |
Rob Herring | 09aa8ac | 2015-02-03 17:07:35 -0600 | [diff] [blame] | 33 | #else |
| 34 | static inline struct gen_pool *sram_get_gpool(char *pool_name) |
| 35 | { |
| 36 | return NULL; |
| 37 | } |
| 38 | #endif |
Leo Yan | 3c7241b | 2011-08-15 11:09:52 +0800 | [diff] [blame] | 39 | |
Sachin Kamat | 61310a3 | 2013-12-30 10:46:31 +0530 | [diff] [blame] | 40 | #endif /* __DMA_MMP_TDMA_H */ |