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