pru_rproc.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * PRUSS Remote Processor specific types
  3. *
  4. * Copyright (C) 2014-2017 Texas Instruments Incorporated - http://www.ti.com/
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. *
  11. * * Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. * * Redistributions in binary form must reproduce the above copyright
  14. * notice, this list of conditions and the following disclaimer in
  15. * the documentation and/or other materials provided with the
  16. * distribution.
  17. * * Neither the name Texas Instruments nor the names of its
  18. * contributors may be used to endorse or promote products derived
  19. * from this software without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. #ifndef _PRU_REMOTEPROC_H_
  34. #define _PRU_REMOTEPROC_H_
  35. /**
  36. * enum pruss_rsc_types - PRU specific resource types
  37. *
  38. * @PRUSS_RSC_INTRS: Resource holding information on PRU PINTC configuration
  39. * @PRUSS_RSC_MAX: Indicates end of known/defined PRU resource types.
  40. * This should be the last definition.
  41. *
  42. * Introduce new custom resource types before PRUSS_RSC_MAX.
  43. */
  44. enum pruss_rsc_types {
  45. PRUSS_RSC_INTRS = 1,
  46. PRUSS_RSC_MAX = 2,
  47. };
  48. /**
  49. * struct pruss_event_chnl - PRU system events _to_ channel mapping
  50. * @event: number of the system event
  51. * @chnl: channel number assigned to a given @event
  52. *
  53. * PRU system events are mapped to channels, and these channels are mapped
  54. * to host interrupts. Events can be mapped to channels in a one-to-one or
  55. * many-to-one ratio (multiple events per channel), and channels can be
  56. * mapped to host interrupts in a one-to-one or many-to-one ratio (multiple
  57. * channels per interrupt).
  58. *
  59. */
  60. struct pruss_event_chnl {
  61. s8 event;
  62. s8 chnl;
  63. };
  64. /**
  65. * struct fw_rsc_custom_intrmap - custom resource to define PRU interrupts
  66. * @version: version number for the resource type
  67. * @chnl_host_intr_map: array of PRU channels to host interrupt mappings
  68. * @event_chnl_map_size: number of event_channel mappings defined in
  69. * @event_chnl_map
  70. * @event_chnl_map: pointer to array of events to channel mappings
  71. *
  72. * PRU system events are mapped to channels, and these channels are mapped
  73. * to host interrupts. Events can be mapped to channels in a one-to-one or
  74. * many-to-one ratio (multiple events per channel), and channels can be
  75. * mapped to host interrupts in a one-to-one or many-to-one ratio (multiple
  76. * channels per interrupt).
  77. *
  78. * @da is the device address of the interrupt controller, @channel_map is
  79. * used to specify to which channel, if any, an event is mapped, and @host_map
  80. * specifies to which host, if any, a channel is mapped.
  81. */
  82. struct fw_rsc_custom_intrmap {
  83. u16 version;
  84. s8 chnl_host_intr_map[10];
  85. u32 event_chnl_map_size;
  86. struct pruss_event_chnl *event_chnl_map;
  87. };
  88. #endif /* _PRU_REMOTEPROC_H_ */