mailbox: mailbox: add eth calc data read interface [2/2]
authorShunzhou Jiang <shunzhou.jiang@amlogic.com>
Fri, 21 Dec 2018 09:12:01 +0000 (17:12 +0800)
committerLuan Yuan <luan.yuan@amlogic.com>
Mon, 7 Jan 2019 03:15:04 +0000 (11:15 +0800)
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>
drivers/amlogic/mailbox/scpi_protocol.c
include/linux/amlogic/scpi_protocol.h

index f8592ad..20f05c1 100644 (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);
index c0c9de6..771b2bf 100644 (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_*/