Browse Source

Revert "cnss2: loads different fw binary per running mode"

This reverts Change-Id I848309440fdffd6517463e18190c03c1b7ed9269.

Reason for revert: Separate FW Binary not required

Change-Id: Ib694d38922f81895ce6bc01f4e38f95813625730
CRs-Fixed: 3726340
Naman Padhiar 1 year ago
parent
commit
e38803e8a0
4 changed files with 2 additions and 77 deletions
  1. 0 1
      cnss2/main.c
  2. 0 1
      cnss2/main.h
  3. 2 74
      cnss2/pci.c
  4. 0 1
      inc/cnss2.h

+ 0 - 1
cnss2/main.c

@@ -5438,7 +5438,6 @@ static int cnss_probe(struct platform_device *plat_dev)
 
 	plat_priv->bus_type = cnss_get_bus_type(plat_priv);
 	plat_priv->use_nv_mac = cnss_use_nv_mac(plat_priv);
-	plat_priv->driver_mode = CNSS_DRIVER_MODE_MAX;
 	cnss_set_plat_priv(plat_dev, plat_priv);
 	cnss_set_device_name(plat_priv);
 	platform_set_drvdata(plat_dev, plat_priv);

+ 0 - 1
cnss2/main.h

@@ -634,7 +634,6 @@ struct cnss_plat_data {
 	u32 hang_data_addr_offset;
 	/* bitmap to detect FEM combination */
 	u8 hwid_bitmap;
-	enum cnss_driver_mode driver_mode;
 	uint32_t num_shadow_regs_v3;
 	bool sec_peri_feature_disable;
 	struct device_node *dev_node;

+ 2 - 74
cnss2/pci.c

@@ -53,7 +53,6 @@
 #define PHY_UCODE_V2_FILE_NAME		"phy_ucode20.elf"
 #define DEFAULT_FW_FILE_NAME		"amss.bin"
 #define FW_V2_FILE_NAME			"amss20.bin"
-#define FW_V2_FTM_FILE_NAME		"amss20_ftm.bin"
 #define DEVICE_MAJOR_VERSION_MASK	0xF
 
 #define WAKE_MSI_NAME			"WAKE"
@@ -3336,21 +3335,6 @@ static int cnss_qca6174_ramdump(struct cnss_pci_data *pci_priv)
 	return cnss_do_ramdump(plat_priv);
 }
 
-static void cnss_get_driver_mode_update_fw_name(struct cnss_plat_data *plat_priv)
-{
-	struct cnss_pci_data *pci_priv;
-	struct cnss_wlan_driver *driver_ops;
-
-	pci_priv = plat_priv->bus_priv;
-	driver_ops = pci_priv->driver_ops;
-
-	if (driver_ops && driver_ops->get_driver_mode) {
-		plat_priv->driver_mode = driver_ops->get_driver_mode();
-		cnss_pci_update_fw_name(pci_priv);
-		cnss_pr_dbg("New driver mode is %d", plat_priv->driver_mode);
-	}
-}
-
 static int cnss_qca6290_powerup(struct cnss_pci_data *pci_priv)
 {
 	int ret = 0;
@@ -3371,8 +3355,6 @@ static int cnss_qca6290_powerup(struct cnss_pci_data *pci_priv)
 	pci_priv->qmi_send_usage_count = 0;
 
 	plat_priv->power_up_error = 0;
-
-	cnss_get_driver_mode_update_fw_name(plat_priv);
 retry:
 	ret = cnss_power_on_device(plat_priv, false);
 	if (ret) {
@@ -3834,8 +3816,6 @@ int cnss_wlan_register_driver(struct cnss_wlan_driver *driver_ops)
 			    plat_priv->device_version.major_version);
 		return -ENODEV;
 	}
-
-	cnss_get_driver_mode_update_fw_name(plat_priv);
 	set_bit(CNSS_DRIVER_REGISTER, &plat_priv->driver_state);
 
 	if (!plat_priv->cbc_enabled ||
@@ -6655,65 +6635,17 @@ static int cnss_pci_update_fw_name(struct cnss_pci_data *pci_priv)
 			 FW_V2_FILE_NAME);
 		break;
 	case QCA6490_DEVICE_ID:
-		switch (plat_priv->device_version.major_version) {
-		case FW_V2_NUMBER:
-				cnss_pci_add_fw_prefix_name(pci_priv,
-							    plat_priv->firmware_name,
-							    FW_V2_FILE_NAME);
-				snprintf(plat_priv->fw_fallback_name,
-					 MAX_FIRMWARE_NAME_LEN,
-					 FW_V2_FILE_NAME);
-			break;
-		default:
-			cnss_pci_add_fw_prefix_name(pci_priv,
-						    plat_priv->firmware_name,
-						    DEFAULT_FW_FILE_NAME);
-			snprintf(plat_priv->fw_fallback_name,
-				 MAX_FIRMWARE_NAME_LEN,
-				 DEFAULT_FW_FILE_NAME);
-			break;
-		}
-		break;
 	case KIWI_DEVICE_ID:
 	case MANGO_DEVICE_ID:
 	case PEACH_DEVICE_ID:
 		switch (plat_priv->device_version.major_version) {
 		case FW_V2_NUMBER:
-			/*
-			 * kiwiv2 using seprate fw binary for MM and FTM mode,
-			 * platform driver loads corresponding binary according
-			 * to current mode indicated by wlan driver. Otherwise
-			 * use default binary.
-			 * Mission mode using same binary name as before,
-			 * if seprate binary is not there, fall back to default.
-			 */
-			if (plat_priv->driver_mode == CNSS_MISSION) {
-				cnss_pci_add_fw_prefix_name(pci_priv,
-							    plat_priv->firmware_name,
-							    FW_V2_FILE_NAME);
-				cnss_pci_add_fw_prefix_name(pci_priv,
-							    plat_priv->fw_fallback_name,
-							    FW_V2_FILE_NAME);
-			} else if (plat_priv->driver_mode == CNSS_FTM) {
-				cnss_pci_add_fw_prefix_name(pci_priv,
-							    plat_priv->firmware_name,
-							    FW_V2_FTM_FILE_NAME);
-				cnss_pci_add_fw_prefix_name(pci_priv,
-							    plat_priv->fw_fallback_name,
-							    FW_V2_FILE_NAME);
-			} else {
-				/*
-				 * Since during cold boot calibration phase,
-				 * wlan driver has not registered, so default
-				 * fw binary will be used.
-				 */
 				cnss_pci_add_fw_prefix_name(pci_priv,
 							    plat_priv->firmware_name,
 							    FW_V2_FILE_NAME);
 				snprintf(plat_priv->fw_fallback_name,
 					 MAX_FIRMWARE_NAME_LEN,
 					 FW_V2_FILE_NAME);
-			}
 			break;
 		default:
 			cnss_pci_add_fw_prefix_name(pci_priv,
@@ -6886,12 +6818,8 @@ static void cnss_mhi_notify_status(struct mhi_controller *mhi_ctrl,
 #if IS_ENABLED(CONFIG_MHI_BUS_MISC) && \
 (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0))
 	case MHI_CB_FALLBACK_IMG:
-		/* for kiwi_v2 binary fallback is used, skip path fallback here */
-		if (!(pci_priv->device_id == KIWI_DEVICE_ID &&
-		      plat_priv->device_version.major_version == FW_V2_NUMBER)) {
-			plat_priv->use_fw_path_with_prefix = false;
-			cnss_pci_update_fw_name(pci_priv);
-		}
+		plat_priv->use_fw_path_with_prefix = false;
+		cnss_pci_update_fw_name(pci_priv);
 		return;
 #endif
 

+ 0 - 1
inc/cnss2.h

@@ -333,7 +333,6 @@ enum cnss_driver_mode {
 	CNSS_CCPM,
 	CNSS_QVIT,
 	CNSS_CALIBRATION,
-	CNSS_DRIVER_MODE_MAX,
 };
 
 enum cnss_recovery_reason {