1 /* Copyright 2014 Freescale Semiconductor Inc. 2 * 3 * SPDX-License-Identifier: GPL-2.0+ 4 */ 5 #ifndef __FSL_DPMNG_CMD_H 6 #define __FSL_DPMNG_CMD_H 7 8 /* Command IDs */ 9 #define DPMNG_CMDID_GET_VERSION 0x831 10 #define DPMNG_CMDID_RESET_AIOP 0x832 11 #define DPMNG_CMDID_LOAD_AIOP 0x833 12 #define DPMNG_CMDID_RUN_AIOP 0x834 13 #define DPMNG_CMDID_RESET_MC_PORTAL 0x835 14 15 /* cmd, param, offset, width, type, arg_name */ 16 #define DPMNG_RSP_GET_VERSION(cmd, mc_ver_info) \ 17 do { \ 18 MC_RSP_OP(cmd, 0, 0, 32, uint32_t, mc_ver_info->revision); \ 19 MC_RSP_OP(cmd, 0, 32, 32, uint32_t, mc_ver_info->major); \ 20 MC_RSP_OP(cmd, 1, 0, 32, uint32_t, mc_ver_info->minor); \ 21 } while (0) 22 23 /* cmd, param, offset, width, type, arg_name */ 24 #define DPMNG_CMD_RESET_AIOP(cmd, container_id, aiop_tile_id) \ 25 do { \ 26 MC_CMD_OP(cmd, 0, 0, 32, int, aiop_tile_id); \ 27 MC_CMD_OP(cmd, 0, 32, 32, int, container_id); \ 28 } while (0) 29 30 /* cmd, param, offset, width, type, arg_name */ 31 #define DPMNG_CMD_LOAD_AIOP(cmd, container_id, aiop_tile_id, img_size, \ 32 img_iova) \ 33 do { \ 34 MC_CMD_OP(cmd, 0, 0, 32, int, aiop_tile_id); \ 35 MC_CMD_OP(cmd, 0, 32, 32, int, container_id); \ 36 MC_CMD_OP(cmd, 1, 0, 32, uint32_t, img_size); \ 37 MC_CMD_OP(cmd, 2, 0, 64, uint64_t, img_iova); \ 38 } while (0) 39 40 /* cmd, param, offset, width, type, arg_name */ 41 #define DPMNG_CMD_RUN_AIOP(cmd, container_id, aiop_tile_id, cfg) \ 42 do { \ 43 MC_CMD_OP(cmd, 0, 0, 32, int, aiop_tile_id); \ 44 MC_CMD_OP(cmd, 0, 32, 32, int, container_id); \ 45 MC_CMD_OP(cmd, 1, 0, 32, uint32_t, cfg->cores_mask); \ 46 MC_CMD_OP(cmd, 2, 0, 64, uint64_t, cfg->options); \ 47 } while (0) 48 49 #endif /* __FSL_DPMNG_CMD_H */ 50