dsp_ps_ns.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /*
  2. * Copyright (c) 2021 Alibaba Group. All rights reserved.
  3. * License-Identifier: Apache-2.0
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may
  6. * not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. *
  17. */
  18. /*!
  19. * \file
  20. * \brief This section defines DSP and host shared data and strcut.
  21. *
  22. * General properties:
  23. * 1. Define the common shared struct for both DSP and Host
  24. * 2. The shared strcut only visible internal, for those open to APP shou be define in dsp_post_process_defs
  25. */
  26. #ifndef _DSP_PS_NS_H
  27. #define _DSP_PS_NS_H
  28. #include <stdint.h>
  29. #include "xrp_api.h"
  30. #include "csi_dsp_task_defs.h"
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. // enum {
  35. // PS_CMD_IDLE = 0,
  36. // PS_CMD_INLINE_START =PS_CMD_IDLE,
  37. // PS_CMD_LOOPBACK_TEST,
  38. // PS_CMD_ISP_CONFIG,
  39. // PS_CMD_RY_CONFIG,
  40. // PS_CMD_ISP_ALGO_CONFIG,
  41. // PS_CMD_QUERY_DRAM_SIZE,
  42. // PS_CMD_SET_IO_BUFFER,
  43. // PS_CMD_WITH_BUFFER_START,
  44. // };
  45. #define TASK_NAME_LINE XRP_NAMESPACE_ID_SIZE
  46. #define XRP_PS_NSID_COMMON_CMD \
  47. {0xf9, 0x3c, 0x09, 0x61, 0x9d, 0x3f, 0x45, 0x29, \
  48. 0xbd, 0xe9, 0x7a, 0x4b, 0x18, 0x91, 0xdb, 0x15}
  49. #define XRP_PS_NSID_ISP_ALGO \
  50. {0xf9, 0x3c, 0x09, 0x61, 0x9d, 0x3f, 0x45, 0x29, \
  51. 0xbd, 0xe9, 0x7a, 0x4b, 0x18, 0x91, 0xdb, 0x14}
  52. typedef struct {
  53. uint32_t cmd;
  54. uint32_t data[1];
  55. }s_cmd_t;
  56. typedef enum {
  57. PS_CMD_IDLE = 0,
  58. PS_CMD_INLINE_START =PS_CMD_IDLE,
  59. PS_CMD_TASK_ALLOC,
  60. PS_CMD_TASK_FREE,
  61. PS_CMD_LOOPBACK_TEST,
  62. PS_CMD_REPORT_CONFIG,
  63. PS_CMD_LOG_CONFIG,
  64. PS_CMD_HEART_BEAT_REQ,
  65. PS_CMD_LOAD_MINITOR_REQ,
  66. PS_CMD_FE_CONFIG,
  67. PS_CMD_BE_CONFIG,
  68. PS_CMD_ALGO_CONFIG,
  69. PS_CMD_TASK_START,
  70. PS_CMD_TASK_STOP,
  71. PS_CMD_DATA_MOVE,
  72. PS_CMD_DSP_IP_TEST,
  73. PS_CMD_BE_ASSGIN_BUF,
  74. PS_CMD_ALGO_LOAD,
  75. }ECOMMON_CMD;
  76. enum cmd_type{
  77. CMD_SETUP,
  78. CMD_RELEASE,
  79. CMD_INVALID,
  80. };
  81. struct report_config_msg{
  82. enum cmd_type flag;
  83. int32_t report_id;
  84. char task[TASK_NAME_LINE];
  85. uint32_t size;
  86. uint64_t addr;
  87. };
  88. struct data_move_msg{
  89. uint64_t src_addr;
  90. uint64_t dst_addr;
  91. uint32_t size;
  92. };
  93. struct csi_dsp_task_start_req{
  94. int task_id;
  95. char task_ns[TASK_NAME_LINE];
  96. };
  97. typedef enum csi_dsp_status{
  98. CSI_DSP_ERR_ILLEGAL_PARAM = -100,
  99. CSI_DSP_TASK_NOT_VALID,
  100. CSI_DSP_TASK_ALLOC_FAIL,
  101. CSI_DSP_TASK_ADD_TO_SCHEDULER_FAIL,
  102. CSI_DSP_TASK_ALREADY_RUNNING,
  103. CSI_DSP_TASK_START_FAIL,
  104. CSI_DSP_REPORTER_NOT_INIT,
  105. CSI_DSP_FE_NOT_VALID,
  106. CSI_DSP_FE_CONFIG_FAIL,
  107. CSI_DSP_BE_CONFIG_FAIL,
  108. CSI_DSP_BE_NOT_VALID,
  109. CSI_DSP_ALGO_INVALID,
  110. CSI_DSP_ALGO_ERR,
  111. CSI_DSP_FE_ERR,
  112. CSI_DSP_BE_ERR,
  113. CSI_DSP_BUF_TYPE_ERR,
  114. CSI_DSP_ALGO_LOAD_FAIL,
  115. CSI_DSP_MALLO_FAIL,
  116. CSI_DSP_ALGO_BUF_FAIL,
  117. CSI_DSP_FAIL,
  118. CSI_DSP_OK = 0,
  119. }csi_dsp_status_e;
  120. struct csi_dsp_task_create_req{
  121. csi_dsp_task_mode_e type;
  122. int priority;
  123. };
  124. typedef struct csi_dsp_algo_load_resp{
  125. csi_dsp_status_e status;
  126. uint16_t algo_id;
  127. uint16_t buf_desc_num;
  128. uint16_t info_prop_des_num;
  129. uint16_t set_prop_des_num;
  130. }csi_dsp_algo_load_resp_t;
  131. struct csi_dsp_task_comm_resp{
  132. csi_dsp_status_e status;
  133. };
  134. struct csi_dsp_task_create_resp{
  135. csi_dsp_status_e status;
  136. char task_ns[TASK_NAME_LINE];
  137. int task_id;
  138. };
  139. struct csi_dsp_task_free_req{
  140. int task_id;
  141. char task_ns[TASK_NAME_LINE];
  142. };
  143. struct csi_dsp_ip_test_par{
  144. char case_name[32];
  145. char case_goup[32];
  146. int result_buf_size;
  147. };
  148. #ifdef __cplusplus
  149. }
  150. #endif
  151. #endif