diff --git a/hif/src/ar6320v2def.h b/hif/src/ar6320v2def.h index 99e81bfc0f26..910815544f3c 100644 --- a/hif/src/ar6320v2def.h +++ b/hif/src/ar6320v2def.h @@ -187,6 +187,9 @@ #define AR6320V2_SOC_CHIP_ID_VERSION_LSB 18 #define AR6320V2_SOC_CHIP_ID_REVISION_MASK 0x00000f00 #define AR6320V2_SOC_CHIP_ID_REVISION_LSB 8 +#if defined(HIF_SDIO) +#define AR6320V2_FW_IND_HELPER 4 +#endif #if defined(HIF_PCI) || defined(HIF_SNOC) || defined(HIF_AHB) #define AR6320V2_CE_WRAPPER_BASE_ADDRESS 0x00034000 #define AR6320V2_CE0_BASE_ADDRESS 0x00034400 @@ -747,6 +750,9 @@ struct hostdef_s ar6320v2_hostdef = { .d_HOST_CE_COUNT = 8, .d_ENABLE_MSI = 0, #endif +#if defined(HIF_SDIO) + .d_FW_IND_HELPER = AR6320V2_FW_IND_HELPER, +#endif }; #if defined(HIF_PCI) || defined(HIF_SNOC) || defined(HIF_AHB) diff --git a/hif/src/sdio/if_sdio.c b/hif/src/sdio/if_sdio.c index f117f04ec244..71896fc3c738 100644 --- a/hif/src/sdio/if_sdio.c +++ b/hif/src/sdio/if_sdio.c @@ -55,6 +55,7 @@ #endif #include "epping_main.h" #include "pld_sdio.h" +#include "targaddrs.h" #ifndef ATH_BUS_PM #ifdef CONFIG_PM @@ -610,15 +611,28 @@ void hif_trigger_dump(struct hif_opaque_softc *scn, uint8_t cmd_id, bool start) } /** - * hif_check_fw_reg() - hif_check_fw_reg - * @scn: scn - * @state: + * hif_check_fw_reg() - check fw selfrecovery indication + * @hif_ctx: hif_opaque_softc * * Return: int */ -int hif_check_fw_reg(struct hif_opaque_softc *scn) +int hif_check_fw_reg(struct hif_opaque_softc *hif_ctx) { - return 0; + int ret = 1; + uint32_t fw_indication = 0; + struct hif_sdio_softc *scn = HIF_GET_SDIO_SOFTC(hif_ctx); + + if (hif_diag_read_access(hif_ctx, FW_INDICATOR_ADDRESS, + &fw_indication) != QDF_STATUS_SUCCESS) { + HIF_ERROR("%s Get fw indication failed\n", __func__); + return 1; + } + HIF_INFO("%s: fw indication is 0x%x def 0x%x.\n", __func__, + fw_indication, FW_IND_HELPER); + if (fw_indication & FW_IND_HELPER) + ret = 0; + + return ret; } /**