q6core.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef __Q6CORE_H__
  13. #define __Q6CORE_H__
  14. #include <mach/qdsp6v2/apr.h>
  15. #include <mach/ocmem.h>
  16. #define AVCS_CMD_GET_LOW_POWER_SEGMENTS_INFO 0x00012903
  17. struct avcs_cmd_get_low_power_segments_info {
  18. struct apr_hdr hdr;
  19. } __packed;
  20. #define AVCS_CMDRSP_GET_LOW_POWER_SEGMENTS_INFO 0x00012904
  21. #define AVCS_CMD_ADSP_EVENT_GET_STATE 0x0001290C
  22. #define AVCS_CMDRSP_ADSP_EVENT_GET_STATE 0x0001290D
  23. /* @brief AVCS_CMDRSP_GET_LOW_POWER_SEGMENTS_INFO payload
  24. * structure. Payload for this event comprises one instance of
  25. * avcs_cmd_rsp_get_low_power_segments_info_t, followed
  26. * immediately by num_segments number of instances of the
  27. * avcs_mem_segment_t structure.
  28. */
  29. /* Types of Low Power Memory Segments. */
  30. #define READ_ONLY_SEGMENT 1
  31. /*< Read Only memory segment. */
  32. #define READ_WRITE_SEGMENT 2
  33. /*< Read Write memory segment. */
  34. /*Category indicates whether audio/os/sensor segments. */
  35. #define AUDIO_SEGMENT 1
  36. /*< Audio memory segment. */
  37. #define OS_SEGMENT 2
  38. /*< QDSP6's OS memory segment. */
  39. /* @brief Payload structure for AVS low power memory segment
  40. * structure.
  41. */
  42. struct avcs_mem_segment_t {
  43. uint16_t type;
  44. /*< Indicates which type of memory this segment is.
  45. *Allowed values: READ_ONLY_SEGMENT or READ_WRITE_SEGMENT only.
  46. */
  47. uint16_t category;
  48. /*< Indicates whether audio or OS segments.
  49. *Allowed values: AUDIO_SEGMENT or OS_SEGMENT only.
  50. */
  51. uint32_t size;
  52. /*< Size (in bytes) of this segment.
  53. * Will be a non-zero value.
  54. */
  55. uint32_t start_address_lsw;
  56. /*< Lower 32 bits of the 64-bit physical start address
  57. * of this segment.
  58. */
  59. uint32_t start_address_msw;
  60. /*< Upper 32 bits of the 64-bit physical start address
  61. * of this segment.
  62. */
  63. };
  64. struct avcs_cmd_rsp_get_low_power_segments_info_t {
  65. uint32_t num_segments;
  66. /*< Number of segments in this response.
  67. * 0: there are no known sections that should be mapped
  68. * from DDR to OCMEM.
  69. * >0: the number of memory segments in the following list.
  70. */
  71. uint32_t bandwidth;
  72. /*< Required OCMEM read/write bandwidth (in bytes per second)
  73. * if OCMEM is granted.
  74. * 0 if num_segments = 0
  75. * >0 if num_segments > 0.
  76. */
  77. struct avcs_mem_segment_t mem_segment[OCMEM_MAX_CHUNKS];
  78. };
  79. int core_get_low_power_segments(
  80. struct avcs_cmd_rsp_get_low_power_segments_info_t **);
  81. bool q6core_is_adsp_ready(void);
  82. #define ADSP_CMD_SET_DOLBY_MANUFACTURER_ID 0x00012918
  83. struct adsp_dolby_manufacturer_id {
  84. struct apr_hdr hdr;
  85. int manufacturer_id;
  86. };
  87. uint32_t core_set_dolby_manufacturer_id(int manufacturer_id);
  88. #endif /* __Q6CORE_H__ */