mailbox: mailbox: add eth calc data read interface [2/2]

PD#SWPL-3498

Problem:
ethernet need read data from efuse

Solution:
add interface to read data

Verify:
g12a_skt

Change-Id: I7ce7ffe2f194c875155e6db8acb55eb8ac5500a0
Signed-off-by: Shunzhou Jiang <shunzhou.jiang@amlogic.com>
This commit is contained in:
Shunzhou Jiang
2018-12-21 17:12:01 +08:00
committed by Dongjin Kim
parent d9ab958858
commit bc49e191c5
2 changed files with 21 additions and 0 deletions

View File

@@ -541,3 +541,21 @@ int scpi_get_cec_val(enum scpi_std_cmd index, u32 *p_cec)
}
EXPORT_SYMBOL_GPL(scpi_get_cec_val);
u8 scpi_get_ethernet_calc(void)
{
struct scpi_data_buf sdata;
struct mhu_data_buf mdata;
u8 temp = 0;
struct __packed {
u32 status;
u8 eth_calc;
} buf;
SCPI_SETUP_DBUF(sdata, mdata, SCPI_CL_NONE,
SCPI_CMD_GET_ETHERNET_CALC, temp, buf);
if (scpi_execute_cmd(&sdata))
return -EPERM;
return buf.eth_calc;
}
EXPORT_SYMBOL_GPL(scpi_get_ethernet_calc);

View File

@@ -67,6 +67,8 @@ enum scpi_std_cmd {
SCPI_CMD_OSCRING_VALUE = 0x43,
SCPI_CMD_WAKEUP_REASON_GET = 0x30,
SCPI_CMD_WAKEUP_REASON_CLR = 0X31,
SCPI_CMD_GET_ETHERNET_CALC = 0x32,
SCPI_CMD_GET_CEC1 = 0xB4,
SCPI_CMD_GET_CEC2 = 0xB5,
SCPI_CMD_COUNT
@@ -98,4 +100,5 @@ int scpi_get_ring_value(unsigned char *val);
int scpi_get_wakeup_reason(u32 *wakeup_reason);
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);
#endif /*_SCPI_PROTOCOL_H_*/