Linux 4.16.11
[linux/fpc-iii.git] / drivers / misc / sram.h
blobc181ce4c8fca8221e1a1153d411491426c180b75
1 /*
2 * Defines for the SRAM driver
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8 #ifndef __SRAM_H
9 #define __SRAM_H
11 struct sram_partition {
12 void __iomem *base;
14 struct gen_pool *pool;
15 struct bin_attribute battr;
16 struct mutex lock;
17 struct list_head list;
20 struct sram_dev {
21 struct device *dev;
22 void __iomem *virt_base;
24 struct gen_pool *pool;
25 struct clk *clk;
27 struct sram_partition *partition;
28 u32 partitions;
31 struct sram_reserve {
32 struct list_head list;
33 u32 start;
34 u32 size;
35 bool export;
36 bool pool;
37 bool protect_exec;
38 const char *label;
41 #ifdef CONFIG_SRAM_EXEC
42 int sram_check_protect_exec(struct sram_dev *sram, struct sram_reserve *block,
43 struct sram_partition *part);
44 int sram_add_protect_exec(struct sram_partition *part);
45 #else
46 static inline int sram_check_protect_exec(struct sram_dev *sram,
47 struct sram_reserve *block,
48 struct sram_partition *part)
50 return -ENODEV;
53 static inline int sram_add_protect_exec(struct sram_partition *part)
55 return -ENODEV;
57 #endif /* CONFIG_SRAM_EXEC */
58 #endif /* __SRAM_H */