st_slim_rproc.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * SLIM core rproc driver header
  4. *
  5. * Copyright (C) 2016 STMicroelectronics
  6. *
  7. * Author: Peter Griffin <[email protected]>
  8. */
  9. #ifndef _ST_REMOTEPROC_SLIM_H
  10. #define _ST_REMOTEPROC_SLIM_H
  11. #define ST_SLIM_MEM_MAX 2
  12. #define ST_SLIM_MAX_CLK 4
  13. enum {
  14. ST_SLIM_DMEM,
  15. ST_SLIM_IMEM,
  16. };
  17. /**
  18. * struct st_slim_mem - slim internal memory structure
  19. * @cpu_addr: MPU virtual address of the memory region
  20. * @bus_addr: Bus address used to access the memory region
  21. * @size: Size of the memory region
  22. */
  23. struct st_slim_mem {
  24. void __iomem *cpu_addr;
  25. phys_addr_t bus_addr;
  26. size_t size;
  27. };
  28. /**
  29. * struct st_slim_rproc - SLIM slim core
  30. * @rproc: rproc handle
  31. * @mem: slim memory information
  32. * @slimcore: slim slimcore regs
  33. * @peri: slim peripheral regs
  34. * @clks: slim clocks
  35. */
  36. struct st_slim_rproc {
  37. struct rproc *rproc;
  38. struct st_slim_mem mem[ST_SLIM_MEM_MAX];
  39. void __iomem *slimcore;
  40. void __iomem *peri;
  41. /* st_slim_rproc private */
  42. struct clk *clks[ST_SLIM_MAX_CLK];
  43. };
  44. struct st_slim_rproc *st_slim_rproc_alloc(struct platform_device *pdev,
  45. char *fw_name);
  46. void st_slim_rproc_put(struct st_slim_rproc *slim_rproc);
  47. #endif