sram.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Defines for the SRAM driver
  3. *
  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
  10. struct sram_partition {
  11. void __iomem *base;
  12. struct gen_pool *pool;
  13. struct bin_attribute battr;
  14. struct mutex lock;
  15. struct list_head list;
  16. };
  17. struct sram_dev {
  18. struct device *dev;
  19. void __iomem *virt_base;
  20. struct gen_pool *pool;
  21. struct clk *clk;
  22. struct sram_partition *partition;
  23. u32 partitions;
  24. };
  25. struct sram_reserve {
  26. struct list_head list;
  27. u32 start;
  28. u32 size;
  29. bool export;
  30. bool pool;
  31. bool protect_exec;
  32. const char *label;
  33. };
  34. #ifdef CONFIG_SRAM_EXEC
  35. int sram_check_protect_exec(struct sram_dev *sram, struct sram_reserve *block,
  36. struct sram_partition *part);
  37. int sram_add_protect_exec(struct sram_partition *part);
  38. #else
  39. static inline int sram_check_protect_exec(struct sram_dev *sram,
  40. struct sram_reserve *block,
  41. struct sram_partition *part)
  42. {
  43. return -ENODEV;
  44. }
  45. static inline int sram_add_protect_exec(struct sram_partition *part)
  46. {
  47. return -ENODEV;
  48. }
  49. #endif /* CONFIG_SRAM_EXEC */
  50. #endif /* __SRAM_H */