blob: 8bec5484dc86473d93bcc82b0394a5d683ad55bb [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Leo Yan3c7241b2011-08-15 11:09:52 +08002/*
Leo Yan3c7241b2011-08-15 11:09:52 +08003 * SRAM Memory Management
4 *
5 * Copyright (c) 2011 Marvell Semiconductors Inc.
Leo Yan3c7241b2011-08-15 11:09:52 +08006 */
7
Sachin Kamat61310a32013-12-30 10:46:31 +05308#ifndef __DMA_MMP_TDMA_H
9#define __DMA_MMP_TDMA_H
Leo Yan3c7241b2011-08-15 11:09:52 +080010
11#include <linux/genalloc.h>
12
13/* ARBITRARY: SRAM allocations are multiples of this 2^N size */
14#define SRAM_GRANULARITY 512
15
16enum sram_type {
17 MMP_SRAM_UNDEFINED = 0,
18 MMP_ASRAM,
19 MMP_ISRAM,
20};
21
22struct sram_platdata {
23 char *pool_name;
24 int granularity;
25};
26
Vinod Koul93d05f12016-09-02 15:57:09 +053027#ifdef CONFIG_MMP_SRAM
Leo Yan3c7241b2011-08-15 11:09:52 +080028extern struct gen_pool *sram_get_gpool(char *pool_name);
Rob Herring09aa8ac2015-02-03 17:07:35 -060029#else
30static inline struct gen_pool *sram_get_gpool(char *pool_name)
31{
32 return NULL;
33}
34#endif
Leo Yan3c7241b2011-08-15 11:09:52 +080035
Sachin Kamat61310a32013-12-30 10:46:31 +053036#endif /* __DMA_MMP_TDMA_H */