soc: add mailbox interface for dsp sec reg ops [3/3]

PD#SWPL-6583

Problem:
tm2 dsp bring up

Solution:
add the mbox interface

Verify:
AB311

Change-Id: Ifddb9bb0b22c651c5a0e02c2200874dcaa6dc2ce
Signed-off-by: zhiqiang liang <zhiqiang.liang@amlogic.com>
This commit is contained in:
zhiqiang liang
2019-04-04 15:58:50 +08:00
committed by Jianxiong Pan
parent aedfc41a8e
commit c1be38bbf9
2 changed files with 26 additions and 0 deletions

View File

@@ -120,6 +120,7 @@ static int high_priority_cmds[] = {
SCPI_CMD_SENSOR_CFG_BOUNDS,
SCPI_CMD_WAKEUP_REASON_GET,
SCPI_CMD_WAKEUP_REASON_CLR,
SCPI_CMD_INIT_DSP,
};
static struct scpi_dvfs_info *scpi_opps[MAX_DVFS_DOMAINS];
@@ -556,6 +557,29 @@ int scpi_clr_wakeup_reason(void)
}
EXPORT_SYMBOL_GPL(scpi_clr_wakeup_reason);
int scpi_init_dsp_cfg0(u32 id, u32 addr, u32 cfg0)
{
struct scpi_data_buf sdata;
struct mhu_data_buf mdata;
u32 temp = 0;
struct __packed {
u32 id;
u32 addr;
u32 cfg0;
} buf;
buf.id = id;
buf.addr = addr;
buf.cfg0 = cfg0;
SCPI_SETUP_DBUF(sdata, mdata, SCPI_CL_NONE,
SCPI_CMD_INIT_DSP, buf, temp);
if (scpi_execute_cmd(&sdata))
return -EPERM;
return 0;
}
EXPORT_SYMBOL_GPL(scpi_init_dsp_cfg0);
int scpi_get_cec_val(enum scpi_std_cmd index, u32 *p_cec)
{
struct scpi_data_buf sdata;

View File

@@ -69,6 +69,7 @@ enum scpi_std_cmd {
SCPI_CMD_WAKEUP_REASON_CLR = 0X31,
SCPI_CMD_GET_ETHERNET_CALC = 0x32,
SCPI_CMD_GET_CPUINFO = 0x33,
SCPI_CMD_INIT_DSP = 0x34,
SCPI_CMD_GET_CEC1 = 0xB4,
SCPI_CMD_GET_CEC2 = 0xB5,
@@ -110,4 +111,5 @@ int scpi_clr_wakeup_reason(void);
int scpi_get_cec_val(enum scpi_std_cmd index, u32 *p_cec);
u8 scpi_get_ethernet_calc(void);
int scpi_get_cpuinfo(enum scpi_get_pfm_type type, u32 *freq, u32 *vol);
int scpi_init_dsp_cfg0(u32 id, u32 addr, u32 cfg0);
#endif /*_SCPI_PROTOCOL_H_*/