Browse Source

qcacmn: Changes to enable PCI based Hawkeye M2M

Include Hawkeye emulation PCI device ids in probe list. This is required
to enable PCI based emulation platform to probe device and load driver
succesfully.

Change-Id: If6e750a2add334794e2d62085007fc300600f853
CRs-Fixed: 1090092
Karunakar Dasineni 8 years ago
parent
commit
f61cb0725e
6 changed files with 118 additions and 22 deletions
  1. 60 0
      hif/src/ce/ce_assignment.h
  2. 15 4
      hif/src/ce/ce_main.c
  3. 2 0
      hif/src/hif_main.c
  4. 2 0
      hif/src/hif_main.h
  5. 2 0
      hif/src/pcie/hif_io32_pci.h
  6. 37 18
      hif/src/pcie/if_pci.c

+ 60 - 0
hif/src/ce/ce_assignment.h

@@ -535,6 +535,66 @@ static struct CE_pipe_config target_ce_config_wlan_qca8074[] = {
 	{ /* CE11 */ 11, PIPEDIR_IN,  32, 2048, CE_ATTR_FLAGS, 0,},
 };
 
+static struct CE_attr host_ce_config_wlan_qca8074_pci[] = {
+	/* host->target HTC control and raw streams */
+	{ /* CE0 */ EPPING_CE_FLAGS_POLL, 0, 16, 2048, 0, NULL,},
+	/* target->host HTT + HTC control */
+	{ /* CE1 */ EPPING_CE_FLAGS_POLL, 0, 0,  2048, 512, NULL,},
+	/* target->host WMI */
+	{ /* CE2 */ EPPING_CE_FLAGS_POLL, 0, 0,  2048, 32, NULL,},
+	/* host->target WMI */
+	{ /* CE3 */ EPPING_CE_FLAGS_POLL, 0, 32, 2048, 0, NULL,},
+	/* host->target HTT */
+	{ /* CE4 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
+		CE_HTT_H2T_MSG_SRC_NENTRIES, 256, 0, NULL,},
+	/* ipa_uc->target HTC control */
+	{ /* CE5 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
+		1024, 512, 0, NULL,},
+	/* Target autonomous HIF_memcpy */
+	{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
+	/* ce_diag, the Diagnostic Window */
+	{ /* CE7 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
+		2, DIAG_TRANSFER_LIMIT, 2, NULL,},
+	/* Target to uMC */
+	{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
+	/* target->host HTT */
+	{ /* CE9 */ CE_ATTR_FLAGS, 0, 0,  2048, 512, NULL,},
+	/* target->host HTT */
+	{ /* CE10 */ CE_ATTR_FLAGS, 0, 0,  2048, 512, NULL,},
+	/* target -> host PKTLOG */
+	{ /* CE11 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
+};
+static struct CE_pipe_config target_ce_config_wlan_qca8074_pci[] = {
+	/* host->target HTC control and raw streams */
+	{ /* CE0 */ 0, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,},
+	/* target->host HTT */
+	{ /* CE1 */ 1, PIPEDIR_IN,  32, 2048, CE_ATTR_FLAGS, 0,},
+	/* target->host WMI  + HTC control */
+	{ /* CE2 */ 2, PIPEDIR_IN,  32, 2048, CE_ATTR_FLAGS, 0,},
+	/* host->target WMI */
+	{ /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,},
+	/* host->target HTT */
+	{ /* CE4 */ 4, PIPEDIR_OUT, 256, 256,
+		(CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
+	/* NB: 50% of src nentries, since tx has 2 frags */
+	/* ipa_uc->target */
+	{ /* CE5 */ 5, PIPEDIR_OUT, 1024,   64,
+		(CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
+	/* Reserved for target autonomous HIF_memcpy */
+	{ /* CE6 */ 6, PIPEDIR_INOUT, 32, 16384, CE_ATTR_FLAGS, 0,},
+	/* CE7 used only by Host */
+	{ /* CE7 */ 7, PIPEDIR_INOUT_H2H, 0, 0,
+		(CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
+	/* CE8 used only by IPA */
+	{ /* CE8 */ 8, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
+	/* CE9 target->host HTT */
+	{ /* CE9 */ 9, PIPEDIR_IN,  32, 2048, CE_ATTR_FLAGS, 0,},
+	/* CE10 target->host HTT */
+	{ /* CE10 */ 10, PIPEDIR_IN,  32, 2048, CE_ATTR_FLAGS, 0,},
+	/* Target -> host PKTLOG */
+	{ /* CE11 */ 11, PIPEDIR_IN,  32, 2048, CE_ATTR_FLAGS, 0,},
+};
+
 #define QCA_6290_CE_COUNT 9
 static struct CE_attr host_ce_config_wlan_qca6290[] = {
 	/* host->target HTC control and raw streams */

+ 15 - 4
hif/src/ce/ce_main.c

@@ -2085,10 +2085,20 @@ void hif_ce_prepare_config(struct hif_softc *scn)
 		break;
 
 	case TARGET_TYPE_QCA8074:
-		hif_state->host_ce_config = host_ce_config_wlan_qca8074;
-		hif_state->target_ce_config = target_ce_config_wlan_qca8074;
-		hif_state->target_ce_config_sz =
-					sizeof(target_ce_config_wlan_qca8074);
+		if (scn->bus_type == QDF_BUS_TYPE_PCI) {
+			hif_state->host_ce_config =
+					host_ce_config_wlan_qca8074_pci;
+			hif_state->target_ce_config =
+				target_ce_config_wlan_qca8074_pci;
+			hif_state->target_ce_config_sz =
+				sizeof(target_ce_config_wlan_qca8074_pci);
+		} else {
+			hif_state->host_ce_config = host_ce_config_wlan_qca8074;
+			hif_state->target_ce_config =
+					target_ce_config_wlan_qca8074;
+			hif_state->target_ce_config_sz =
+				sizeof(target_ce_config_wlan_qca8074);
+		}
 		break;
 	case TARGET_TYPE_QCA6290:
 		hif_state->host_ce_config = host_ce_config_wlan_qca6290;
@@ -2235,6 +2245,7 @@ int hif_config_ce(struct hif_softc *scn)
 		pipe_info->pipe_num = pipe_num;
 		pipe_info->HIF_CE_state = hif_state;
 		attr = &hif_state->host_ce_config[pipe_num];
+
 		pipe_info->ce_hdl = ce_init(scn, pipe_num, attr);
 		ce_state = scn->ce_id_to_state[pipe_num];
 		QDF_ASSERT(pipe_info->ce_hdl != NULL);

+ 2 - 0
hif/src/hif_main.c

@@ -761,6 +761,8 @@ int hif_get_device_type(uint32_t device_id,
 		break;
 
 	case QCA8074_DEVICE_ID:
+	case RUMIM2M_DEVICE_ID_NODE0:
+	case RUMIM2M_DEVICE_ID_NODE1:
 		*hif_type = HIF_TYPE_QCA8074;
 		*target_type = TARGET_TYPE_QCA8074;
 		HIF_INFO(" *********** QCA8074  *************\n");

+ 2 - 0
hif/src/hif_main.h

@@ -99,6 +99,8 @@
 					actual number once available.
 					currently defining this to 0xffff for
 					emulation purpose */
+#define RUMIM2M_DEVICE_ID_NODE0	0xabc0
+#define RUMIM2M_DEVICE_ID_NODE1	0xabc1
 
 #define HIF_GET_PCI_SOFTC(scn) ((struct hif_pci_softc *)scn)
 #define HIF_GET_CE_STATE(scn) ((struct HIF_CE_state *)scn)

+ 2 - 0
hif/src/pcie/hif_io32_pci.h

@@ -47,7 +47,9 @@
  * For keeping the target awake till the driver is
  * loaded, set this to 1
  */
+#ifndef CONFIG_ATH_PCIE_AWAKE_WHILE_DRIVER_LOAD
 #define CONFIG_ATH_PCIE_AWAKE_WHILE_DRIVER_LOAD 1
+#endif
 
 /*
  * PCI-E L1 ASPPM sub-states

+ 37 - 18
hif/src/pcie/if_pci.c

@@ -2018,6 +2018,7 @@ int hif_pci_bus_configure(struct hif_softc *hif_sc)
 	int status = 0;
 	struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_sc);
 	struct hif_opaque_softc *hif_osc = GET_HIF_OPAQUE_HDL(hif_sc);
+
 	hif_ce_prepare_config(hif_sc);
 
 	/* initialize sleep state adjust variables */
@@ -2044,7 +2045,7 @@ int hif_pci_bus_configure(struct hif_softc *hif_sc)
 	A_TARGET_ACCESS_LIKELY(hif_sc);
 
 	if (CONFIG_ATH_PCIE_MAX_PERF ||
-	    CONFIG_ATH_PCIE_AWAKE_WHILE_DRIVER_LOAD) {
+		CONFIG_ATH_PCIE_AWAKE_WHILE_DRIVER_LOAD) {
 		/*
 		 * prevent sleep for PCIE_AWAKE_WHILE_DRIVER_LOAD feature
 		 * prevent sleep when we want to keep firmware always awake
@@ -2065,7 +2066,8 @@ int hif_pci_bus_configure(struct hif_softc *hif_sc)
 	}
 
 	/* todo: consider replacing this with an srng field */
-	if (hif_sc->target_info.target_type == TARGET_TYPE_QCA8074) {
+	if ((hif_sc->target_info.target_type == TARGET_TYPE_QCA8074) &&
+			(hif_sc->bus_type == QDF_BUS_TYPE_AHB)) {
 		hif_sc->per_ce_irq = true;
 	}
 
@@ -2084,9 +2086,15 @@ int hif_pci_bus_configure(struct hif_softc *hif_sc)
 		hif_register_bmi_callbacks(hif_sc);
 	}
 
-	status = hif_configure_irq(hif_sc);
-	if (status < 0)
-		goto unconfig_ce;
+	if ((hif_sc->target_info.target_type == TARGET_TYPE_QCA8074) &&
+			(hif_sc->bus_type == QDF_BUS_TYPE_PCI))
+		HIF_INFO_MED("%s: Skip irq config for PCI based 8074 target",
+						__func__);
+	else {
+		status = hif_configure_irq(hif_sc);
+		if (status < 0)
+			goto unconfig_ce;
+	}
 
 	A_TARGET_ACCESS_UNLIKELY(hif_sc);
 
@@ -2209,6 +2217,9 @@ static int hif_enable_pci(struct hif_pci_softc *sc,
 	pr_err("*****BAR is %p\n", mem);
 
 	sc->mem = mem;
+
+	HIF_INFO("%s, mem after pci_iomap:%p\n",
+	       __func__, sc->mem);
 	sc->pdev = pdev;
 	sc->dev = &pdev->dev;
 	sc->devid = id->device;
@@ -3517,7 +3528,7 @@ end:
 	return 0;
 }
 
-#ifndef QCA_WIFI_QCA8074_VP
+#ifndef QCA_WIFI_NAPIER_EMULATION
 /**
  * hif_target_sync() : ensure the target is ready
  * @scn: hif controll structure
@@ -3639,17 +3650,22 @@ again:
 	hif_register_tbl_attach(ol_sc, hif_type);
 	hif_target_register_tbl_attach(ol_sc, target_type);
 
+	if ((id->device == RUMIM2M_DEVICE_ID_NODE0) ||
+		(id->device == RUMIM2M_DEVICE_ID_NODE1))
+		HIF_TRACE("%s:Skip tgt_wake up for PCI based 8074\n", __func__);
+	else {
 #ifndef QCA_WIFI_NAPIER_EMULATION
-	ret = hif_pci_probe_tgt_wakeup(sc);
+		ret = hif_pci_probe_tgt_wakeup(sc);
 #endif
-	if (ret < 0) {
-		HIF_ERROR("%s: ERROR - hif_pci_prob_wakeup error = %d",
-			   __func__, ret);
-		if (ret == -EAGAIN)
-			probe_again++;
-		goto err_tgtstate;
+		if (ret < 0) {
+			HIF_ERROR("%s: ERROR - hif_pci_prob_wakeup error = %d",
+					__func__, ret);
+			if (ret == -EAGAIN)
+				probe_again++;
+			goto err_tgtstate;
+		}
+		HIF_TRACE("%s: hif_pci_probe_tgt_wakeup done", __func__);
 	}
-	HIF_TRACE("%s: hif_pci_probe_tgt_wakeup done", __func__);
 
 	tgt_info->target_type = target_type;
 
@@ -3661,12 +3677,15 @@ again:
 	}
 	ol_sc->mem_pa = sc->soc_pcie_bar0;
 
-#ifndef QCA_WIFI_QCA8074_VP
-	hif_target_sync(ol_sc);
+	if ((id->device != RUMIM2M_DEVICE_ID_NODE0) &&
+		(id->device != RUMIM2M_DEVICE_ID_NODE1)) {
+#ifndef QCA_WIFI_NAPIER_EMULATION
+		hif_target_sync(ol_sc);
 #endif
 
-	if (ADRASTEA_BU)
-		hif_vote_link_up(hif_hdl);
+		if (ADRASTEA_BU)
+			hif_vote_link_up(hif_hdl);
+	}
 
 	return 0;