Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / misc / sram.h
blob397205b8bf6ff61145272ae8857d8c2d1339c249
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Defines for the SRAM driver
4 */
5 #ifndef __SRAM_H
6 #define __SRAM_H
8 struct sram_config {
9 int (*init)(void);
10 bool map_only_reserved;
13 struct sram_partition {
14 void __iomem *base;
16 struct gen_pool *pool;
17 struct bin_attribute battr;
18 struct mutex lock;
19 struct list_head list;
22 struct sram_dev {
23 const struct sram_config *config;
25 struct device *dev;
26 void __iomem *virt_base;
27 bool no_memory_wc;
29 struct gen_pool *pool;
31 struct sram_partition *partition;
32 u32 partitions;
35 struct sram_reserve {
36 struct list_head list;
37 u32 start;
38 u32 size;
39 struct resource res;
40 bool export;
41 bool pool;
42 bool protect_exec;
43 const char *label;
46 #ifdef CONFIG_SRAM_EXEC
47 int sram_check_protect_exec(struct sram_dev *sram, struct sram_reserve *block,
48 struct sram_partition *part);
49 int sram_add_protect_exec(struct sram_partition *part);
50 #else
51 static inline int sram_check_protect_exec(struct sram_dev *sram,
52 struct sram_reserve *block,
53 struct sram_partition *part)
55 return -ENODEV;
58 static inline int sram_add_protect_exec(struct sram_partition *part)
60 return -ENODEV;
62 #endif /* CONFIG_SRAM_EXEC */
63 #endif /* __SRAM_H */