1 /* Copyright 2014 Freescale Semiconductor Inc.
3 * SPDX-License-Identifier: GPL-2.0+
5 #include <fsl-mc/fsl_mc_sys.h>
6 #include <fsl-mc/fsl_mc_cmd.h>
7 #include <fsl-mc/fsl_dpmng.h>
8 #include "fsl_dpmng_cmd.h"
10 int mc_get_version(struct fsl_mc_io *mc_io, struct mc_version *mc_ver_info)
12 struct mc_command cmd = { 0 };
16 cmd.header = mc_encode_cmd_header(DPMNG_CMDID_GET_VERSION,
19 /* send command to mc*/
20 err = mc_send_command(mc_io, &cmd);
24 /* retrieve response parameters */
25 DPMNG_RSP_GET_VERSION(cmd, mc_ver_info);
30 int dpmng_reset_aiop(struct fsl_mc_io *mc_io, int container_id,
33 struct mc_command cmd = { 0 };
36 cmd.header = mc_encode_cmd_header(DPMNG_CMDID_RESET_AIOP,
38 DPMNG_CMD_RESET_AIOP(cmd, container_id, aiop_tile_id);
40 /* send command to mc*/
41 return mc_send_command(mc_io, &cmd);
44 int dpmng_load_aiop(struct fsl_mc_io *mc_io,
50 struct mc_command cmd = { 0 };
53 cmd.header = mc_encode_cmd_header(DPMNG_CMDID_LOAD_AIOP,
56 DPMNG_CMD_LOAD_AIOP(cmd, container_id, aiop_tile_id, img_size,
59 /* send command to mc*/
60 return mc_send_command(mc_io, &cmd);
63 int dpmng_run_aiop(struct fsl_mc_io *mc_io,
66 const struct dpmng_aiop_run_cfg *cfg)
68 struct mc_command cmd = { 0 };
71 cmd.header = mc_encode_cmd_header(DPMNG_CMDID_RUN_AIOP,
74 DPMNG_CMD_RUN_AIOP(cmd, container_id, aiop_tile_id, cfg);
76 /* send command to mc*/
77 return mc_send_command(mc_io, &cmd);
80 int dpmng_reset_mc_portal(struct fsl_mc_io *mc_io)
82 struct mc_command cmd = { 0 };
85 cmd.header = mc_encode_cmd_header(DPMNG_CMDID_RESET_MC_PORTAL,
89 /* send command to mc*/
90 return mc_send_command(mc_io, &cmd);