soc: add mailbox interface for dsp sec reg ops [3/3]
authorzhiqiang liang <zhiqiang.liang@amlogic.com>
Thu, 4 Apr 2019 07:58:50 +0000 (15:58 +0800)
committerJianxiong Pan <jianxiong.pan@amlogic.com>
Thu, 11 Apr 2019 06:49:45 +0000 (14:49 +0800)
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>
drivers/amlogic/mailbox/scpi_protocol.c
include/linux/amlogic/scpi_protocol.h

index 22883ee..cc5f369 100644 (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;
index c886ce4..06c829d 100644 (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_*/