| Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| Leo Yan | 3c7241b | 2011-08-15 11:09:52 +0800 | [diff] [blame] | 2 | /* |
| Leo Yan | 3c7241b | 2011-08-15 11:09:52 +0800 | [diff] [blame] | 3 | * SRAM Memory Management |
| 4 | * |
| 5 | * Copyright (c) 2011 Marvell Semiconductors Inc. |
| Leo Yan | 3c7241b | 2011-08-15 11:09:52 +0800 | [diff] [blame] | 6 | */ |
| 7 | |
| Sachin Kamat | 61310a3 | 2013-12-30 10:46:31 +0530 | [diff] [blame] | 8 | #ifndef __DMA_MMP_TDMA_H |
| 9 | #define __DMA_MMP_TDMA_H |
| Leo Yan | 3c7241b | 2011-08-15 11:09:52 +0800 | [diff] [blame] | 10 | |
| 11 | #include <linux/genalloc.h> |
| 12 | |
| 13 | /* ARBITRARY: SRAM allocations are multiples of this 2^N size */ |
| 14 | #define SRAM_GRANULARITY 512 |
| 15 | |
| 16 | enum sram_type { |
| 17 | MMP_SRAM_UNDEFINED = 0, |
| 18 | MMP_ASRAM, |
| 19 | MMP_ISRAM, |
| 20 | }; |
| 21 | |
| 22 | struct sram_platdata { |
| 23 | char *pool_name; |
| 24 | int granularity; |
| 25 | }; |
| 26 | |
| Vinod Koul | 93d05f1 | 2016-09-02 15:57:09 +0530 | [diff] [blame] | 27 | #ifdef CONFIG_MMP_SRAM |
| Leo Yan | 3c7241b | 2011-08-15 11:09:52 +0800 | [diff] [blame] | 28 | extern struct gen_pool *sram_get_gpool(char *pool_name); |
| Rob Herring | 09aa8ac | 2015-02-03 17:07:35 -0600 | [diff] [blame] | 29 | #else |
| 30 | static inline struct gen_pool *sram_get_gpool(char *pool_name) |
| 31 | { |
| 32 | return NULL; |
| 33 | } |
| 34 | #endif |
| Leo Yan | 3c7241b | 2011-08-15 11:09:52 +0800 | [diff] [blame] | 35 | |
| Sachin Kamat | 61310a3 | 2013-12-30 10:46:31 +0530 | [diff] [blame] | 36 | #endif /* __DMA_MMP_TDMA_H */ |