Browse Source

qcacmn: add FW self recovery for SDIO

add hif_check_fw_reg implementation for SDIO
solution.

Change-Id: Ic6948cfc7400d93a53e27074a17d5ceac45b558b
CRs-Fixed: 2071352
Liangwei Dong 7 years ago
parent
commit
7a3433459f
2 changed files with 25 additions and 5 deletions
  1. 6 0
      hif/src/ar6320v2def.h
  2. 19 5
      hif/src/sdio/if_sdio.c

+ 6 - 0
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)

+ 19 - 5
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;
 }
 
 /**