blob: 8314243f35615aa0fdeadafb5328268114447de0 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Prabhakar Kushwahaa2a55e52015-03-19 09:20:45 -07002/* Copyright 2013-2015 Freescale Semiconductor Inc.
J. German Rivera7b3bd9a2015-01-06 13:19:02 -08003 */
4#include <fsl-mc/fsl_mc_sys.h>
5#include <fsl-mc/fsl_mc_cmd.h>
6#include <fsl-mc/fsl_dpmng.h>
7#include "fsl_dpmng_cmd.h"
8
Prabhakar Kushwaha87457d12015-07-07 15:40:06 +05309int mc_get_version(struct fsl_mc_io *mc_io,
10 uint32_t cmd_flags,
11 struct mc_version *mc_ver_info)
J. German Rivera7b3bd9a2015-01-06 13:19:02 -080012{
13 struct mc_command cmd = { 0 };
14 int err;
15
16 /* prepare command */
17 cmd.header = mc_encode_cmd_header(DPMNG_CMDID_GET_VERSION,
Prabhakar Kushwaha87457d12015-07-07 15:40:06 +053018 cmd_flags,
19 0);
J. German Rivera7b3bd9a2015-01-06 13:19:02 -080020
21 /* send command to mc*/
22 err = mc_send_command(mc_io, &cmd);
23 if (err)
24 return err;
25
26 /* retrieve response parameters */
27 DPMNG_RSP_GET_VERSION(cmd, mc_ver_info);
28
29 return 0;
30}