diff options
author | yixuanjiang <yixuanjiang@google.com> | 2019-05-09 13:38:17 -0700 |
---|---|---|
committer | Eric Huang <ericsphuang@google.com> | 2019-05-10 07:12:30 +0000 |
commit | b997c5e063ee04f3caca198b4f129ba571085b56 (patch) | |
tree | 00575849be8749ff9b00a525a340b1f5763e567d /iaxxx_odsp_hw.h | |
parent | 085a8422fded04b18e199d0cc72f8e1ad209ab00 (diff) | |
download | android_hardware_knowles_athletico_sound_trigger_hal-b997c5e063ee04f3caca198b4f129ba571085b56.tar.gz android_hardware_knowles_athletico_sound_trigger_hal-b997c5e063ee04f3caca198b4f129ba571085b56.tar.bz2 android_hardware_knowles_athletico_sound_trigger_hal-b997c5e063ee04f3caca198b4f129ba571085b56.zip |
sthal: 9.5.1 porting
Handle user space crashes
+ Impllemented two new IOCTLs to get the FW state and to do FW reset
+ In case the user space service crashes then the ST HAL will get
restarted and all the apps will try to restart their usecases.
Query for the firmware status,
* IAXXX_FW_IDLE - Nothing is running on the chip,
firmware is in idle state, no need to do anything.
* IAXXX_FW_CRASH - Firmware has crashed, set ST HAL to not ready
and wait for recovery to complete
* IAXXX_FW_ACTIVE - Some usecase is running in the firmware,
so request the driver to redownload the firmware and set ST HAL to not
ready state and wait until firmware download is completed
Bug: 129505523
Test: build pass
Change-Id: Ic44491d0f0c697d370a81c0eac7983109dad0caa
Signed-off-by: yixuanjiang <yixuanjiang@google.com>
Diffstat (limited to 'iaxxx_odsp_hw.h')
-rwxr-xr-x[-rw-r--r--] | iaxxx_odsp_hw.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/iaxxx_odsp_hw.h b/iaxxx_odsp_hw.h index afecff7..44961fa 100644..100755 --- a/iaxxx_odsp_hw.h +++ b/iaxxx_odsp_hw.h @@ -620,6 +620,29 @@ int iaxxx_odsp_get_sys_versions(struct iaxxx_odsp_hw *odsp_hw_hdl, int iaxxx_odsp_get_device_id(struct iaxxx_odsp_hw *odsp_hw_hdl, uint32_t *device_id); +/** + * Returns Firmware status + * + * Input - odsp_hw_hdl - Handle to odsp hw structure + * mode - Returned firmware status + * 0: Firmware has crashed + * 1: Firmware is idle + * 2: Firmware is active + * + * Output - 0 on success, on failure < 0 + */ +int iaxxx_odsp_get_fw_status(struct iaxxx_odsp_hw *odsp_hw_hdl, + uint32_t *status); + +/** + * Resets the firmware by redownloading the firmware + * + * Input - odsp_hw_hdl - Handle to odsp hw structure + * + * Output - 0 on success, on failure < 0 + */ +int iaxxx_odsp_reset_fw(struct iaxxx_odsp_hw *odsp_hw_hdl); + #if __cplusplus } // extern "C" #endif |