keystone_remoteproc.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (C) 2015-2017 Texas Instruments Incorporated - http://www.ti.com/
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation version 2.
  7. *
  8. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  9. * kind, whether express or implied; without even the implied warranty
  10. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef _UAPI_LINUX_KEYSTONE_REMOTEPROC_H_
  14. #define _UAPI_LINUX_KEYSTONE_REMOTEPROC_H_
  15. #include <linux/types.h>
  16. #include <linux/ioctl.h>
  17. /**
  18. * enum keystone_rproc_state - keystone remoteproc state setting values
  19. *
  20. * @KEYSTONE_RPROC_OFFLINE: request to configure the remoteproc into an offline
  21. * state
  22. * @KEYSTONE_RPROC_RUNNING: request to configure the remoteproc into a ready
  23. * state
  24. */
  25. enum keystone_rproc_state {
  26. KEYSTONE_RPROC_OFFLINE,
  27. KEYSTONE_RPROC_RUNNING,
  28. };
  29. /**
  30. * struct keystone_rproc_set_state_params - keystone remoteproc set state
  31. * parameters structure
  32. *
  33. * @state: enumerated state value to set
  34. * @boot_addr: boot address/entry point for the remote processor
  35. */
  36. struct keystone_rproc_set_state_params {
  37. enum keystone_rproc_state state;
  38. uint32_t boot_addr;
  39. };
  40. /* Macros used within mmap function */
  41. #define KEYSTONE_RPROC_UIO_MAP_INDEX_MASK (0x7)
  42. #define KEYSTONE_RPROC_UIO_MAP_OFFSET_SHIFT (3)
  43. /* IOCTL definitions */
  44. #define KEYSTONE_RPROC_IOC_MAGIC 'I'
  45. #define KEYSTONE_RPROC_IOC_SET_RSC_TABLE _IOW(KEYSTONE_RPROC_IOC_MAGIC, \
  46. 0, void *)
  47. #define KEYSTONE_RPROC_IOC_SET_STATE _IOW(KEYSTONE_RPROC_IOC_MAGIC, \
  48. 1, \
  49. struct keystone_rproc_set_state_params)
  50. #define KEYSTONE_RPROC_IOC_SET_LOADED_RSC_TABLE _IOW(KEYSTONE_RPROC_IOC_MAGIC, \
  51. 2, uint32_t)
  52. #define KEYSTONE_RPROC_IOC_DSP_RESET _IO(KEYSTONE_RPROC_IOC_MAGIC, 3)
  53. #define KEYSTONE_RPROC_IOC_DSP_BOOT _IOW(KEYSTONE_RPROC_IOC_MAGIC, \
  54. 4, uint32_t)
  55. #define KEYSTONE_RPROC_IOC_MAXNR (5)
  56. #endif /* _UAPI_LINUX_KEYSTONE_REMOTEPROC_H_ */