dsp_ps_ns.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. struct csi_dsp_task_create_resp{
  98. csi_dsp_status_e status;
  99. char task_ns[TASK_NAME_LINE];
  100. int task_id;
  101. };
  102. struct csi_dsp_task_free_req{
  103. int task_id;
  104. char task_ns[TASK_NAME_LINE];
  105. };
  106. struct csi_dsp_ip_test_par{
  107. char case_name[32];
  108. char case_goup[32];
  109. int result_buf_size;
  110. };
  111. // struct csi_dsp_algo_config_par{
  112. // uint16_t algo_id;
  113. // char* algo;
  114. // union
  115. // {
  116. // float gam_coef[4];
  117. // short beta_coef[4];
  118. // };
  119. // };
  120. #ifdef __cplusplus
  121. }
  122. #endif
  123. #endif