فهرست منبع

qcacld-3.0: Update for converged thermal throttle params

Update qcacld driver to use converged CFG component for thermal
mitigation throttle offload feature config params. Also cleanup
hdd ini config based redundant entries.

Change-Id: I9c94d1cd7bf9f630ed92ebe0f9f6d6233a216ee5
CRs-fixed: 2358492
Manikandan Mohan 6 سال پیش
والد
کامیت
38dc202ad2
3فایلهای تغییر یافته به همراه237 افزوده شده و 24 حذف شده
  1. 12 16
      fw_offload/core/inc/wlan_fw_offload_main.h
  2. 20 8
      fw_offload/core/src/wlan_fw_offload_main.c
  3. 205 0
      fw_offload/dispatcher/inc/cfg_thermal_temp.h

+ 12 - 16
fw_offload/core/inc/wlan_fw_offload_main.h

@@ -63,26 +63,22 @@ struct wlan_fwol_coex_config {
 	int16_t bt_interference_high_ul;
 	int16_t bt_interference_high_ul;
 };
 };
 
 
+#define FWOL_THERMAL_LEVEL_MAX 4
+#define FWOL_THERMAL_THROTTLE_LEVEL_MAX 4
 /*
 /*
  * struct wlan_fwol_thermal_temp - Thermal temperature config items
  * struct wlan_fwol_thermal_temp - Thermal temperature config items
- * @thermal_temp_min_level0: Thermal temperature minimum level 0
- * @thermal_temp_max_level0: Thermal temperature maximum level 0
- * @thermal_temp_min_level1: Thermal temperature minimum level 1
- * @thermal_temp_max_level1: Thermal temperature maximum level 1
- * @thermal_temp_min_level2: Thermal temperature minimum level 2
- * @thermal_temp_max_level2: Thermal temperature maximum level 2
- * @thermal_temp_min_level3: Thermal temperature minimum level 3
- * @thermal_temp_max_level3: Thermal temperature maximum level 3
+ * @thermal_temp_min_level: Array of temperature minimum levels
+ * @thermal_temp_max_level: Array of temperature maximum levels
+ * @thermal_mitigation_enable: Control for Thermal mitigation feature
+ * @throttle_period: Thermal throttle period value
+ * @throttle_dutycycle_level: Array of throttle duty cycle levels
  */
  */
 struct wlan_fwol_thermal_temp {
 struct wlan_fwol_thermal_temp {
-	uint16_t thermal_temp_min_level0;
-	uint16_t thermal_temp_max_level0;
-	uint16_t thermal_temp_min_level1;
-	uint16_t thermal_temp_max_level1;
-	uint16_t thermal_temp_min_level2;
-	uint16_t thermal_temp_max_level2;
-	uint16_t thermal_temp_min_level3;
-	uint16_t thermal_temp_max_level3;
+	bool     thermal_mitigation_enable;
+	uint32_t throttle_period;
+	uint16_t thermal_temp_min_level[FWOL_THERMAL_LEVEL_MAX];
+	uint16_t thermal_temp_max_level[FWOL_THERMAL_LEVEL_MAX];
+	uint32_t throttle_dutycycle_level[FWOL_THERMAL_THROTTLE_LEVEL_MAX];
 };
 };
 
 
 /**
 /**

+ 20 - 8
fw_offload/core/src/wlan_fw_offload_main.c

@@ -57,22 +57,34 @@ static void
 fwol_init_thermal_temp_in_cfg(struct wlan_objmgr_psoc *psoc,
 fwol_init_thermal_temp_in_cfg(struct wlan_objmgr_psoc *psoc,
 			      struct wlan_fwol_thermal_temp *thermal_temp)
 			      struct wlan_fwol_thermal_temp *thermal_temp)
 {
 {
-	thermal_temp->thermal_temp_min_level0 =
+	thermal_temp->thermal_temp_min_level[0] =
 				cfg_get(psoc, CFG_THERMAL_TEMP_MIN_LEVEL0);
 				cfg_get(psoc, CFG_THERMAL_TEMP_MIN_LEVEL0);
-	thermal_temp->thermal_temp_max_level0 =
+	thermal_temp->thermal_temp_max_level[0] =
 				cfg_get(psoc, CFG_THERMAL_TEMP_MAX_LEVEL0);
 				cfg_get(psoc, CFG_THERMAL_TEMP_MAX_LEVEL0);
-	thermal_temp->thermal_temp_min_level1 =
+	thermal_temp->thermal_temp_min_level[1] =
 				cfg_get(psoc, CFG_THERMAL_TEMP_MIN_LEVEL1);
 				cfg_get(psoc, CFG_THERMAL_TEMP_MIN_LEVEL1);
-	thermal_temp->thermal_temp_max_level1 =
+	thermal_temp->thermal_temp_max_level[1] =
 				cfg_get(psoc, CFG_THERMAL_TEMP_MAX_LEVEL1);
 				cfg_get(psoc, CFG_THERMAL_TEMP_MAX_LEVEL1);
-	thermal_temp->thermal_temp_min_level2 =
+	thermal_temp->thermal_temp_min_level[2] =
 				cfg_get(psoc, CFG_THERMAL_TEMP_MIN_LEVEL2);
 				cfg_get(psoc, CFG_THERMAL_TEMP_MIN_LEVEL2);
-	thermal_temp->thermal_temp_max_level2 =
+	thermal_temp->thermal_temp_max_level[2] =
 				cfg_get(psoc, CFG_THERMAL_TEMP_MAX_LEVEL2);
 				cfg_get(psoc, CFG_THERMAL_TEMP_MAX_LEVEL2);
-	thermal_temp->thermal_temp_min_level3 =
+	thermal_temp->thermal_temp_min_level[3] =
 				cfg_get(psoc, CFG_THERMAL_TEMP_MIN_LEVEL3);
 				cfg_get(psoc, CFG_THERMAL_TEMP_MIN_LEVEL3);
-	thermal_temp->thermal_temp_max_level3 =
+	thermal_temp->thermal_temp_max_level[3] =
 				cfg_get(psoc, CFG_THERMAL_TEMP_MAX_LEVEL3);
 				cfg_get(psoc, CFG_THERMAL_TEMP_MAX_LEVEL3);
+
+	thermal_temp->thermal_mitigation_enable =
+				cfg_get(psoc, CFG_THERMAL_MITIGATION_ENABLE);
+	thermal_temp->throttle_period = cfg_get(psoc, CFG_THROTTLE_PERIOD);
+	thermal_temp->throttle_dutycycle_level[0] =
+				cfg_get(psoc, CFG_THROTTLE_DUTY_CYCLE_LEVEL0);
+	thermal_temp->throttle_dutycycle_level[1]=
+				cfg_get(psoc, CFG_THROTTLE_DUTY_CYCLE_LEVEL1);
+	thermal_temp->throttle_dutycycle_level[2]=
+				cfg_get(psoc, CFG_THROTTLE_DUTY_CYCLE_LEVEL2);
+	thermal_temp->throttle_dutycycle_level[3]=
+				cfg_get(psoc, CFG_THROTTLE_DUTY_CYCLE_LEVEL3);
 }
 }
 
 
 /**
 /**

+ 205 - 0
fw_offload/dispatcher/inc/cfg_thermal_temp.h

@@ -23,6 +23,17 @@
 #ifndef __CFG_THERMAL_TEMP_H
 #ifndef __CFG_THERMAL_TEMP_H
 #define __CFG_THERMAL_TEMP_H
 #define __CFG_THERMAL_TEMP_H
 
 
+/*
+ * <ini>
+ * gThermalTempMinLevel0 - Set Thermal Temp Min Level0
+ * @Min: 0
+ * @Max: 1000
+ * @Default: 0
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
 #define CFG_THERMAL_TEMP_MIN_LEVEL0 CFG_INI_UINT( \
 #define CFG_THERMAL_TEMP_MIN_LEVEL0 CFG_INI_UINT( \
 			"gThermalTempMinLevel0", \
 			"gThermalTempMinLevel0", \
 			0, \
 			0, \
@@ -31,6 +42,17 @@
 			CFG_VALUE_OR_DEFAULT, \
 			CFG_VALUE_OR_DEFAULT, \
 			"Thermal Temp Min Level0")
 			"Thermal Temp Min Level0")
 
 
+/*
+ * <ini>
+ * gThermalTempMaxLevel0 - Set Thermal Temp Max Level0
+ * @Min: 0
+ * @Max: 1000
+ * @Default: 90
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
 #define CFG_THERMAL_TEMP_MAX_LEVEL0 CFG_INI_UINT( \
 #define CFG_THERMAL_TEMP_MAX_LEVEL0 CFG_INI_UINT( \
 			"gThermalTempMaxLevel0", \
 			"gThermalTempMaxLevel0", \
 			0, \
 			0, \
@@ -39,6 +61,17 @@
 			CFG_VALUE_OR_DEFAULT, \
 			CFG_VALUE_OR_DEFAULT, \
 			"Thermal Temp Max Level0")
 			"Thermal Temp Max Level0")
 
 
+/*
+ * <ini>
+ * gThermalTempMinLevel1 - Set Thermal Temp Min Level1
+ * @Min: 0
+ * @Max: 1000
+ * @Default: 70
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
 #define CFG_THERMAL_TEMP_MIN_LEVEL1 CFG_INI_UINT( \
 #define CFG_THERMAL_TEMP_MIN_LEVEL1 CFG_INI_UINT( \
 			"gThermalTempMinLevel1", \
 			"gThermalTempMinLevel1", \
 			0, \
 			0, \
@@ -47,6 +80,17 @@
 			CFG_VALUE_OR_DEFAULT, \
 			CFG_VALUE_OR_DEFAULT, \
 			"Thermal Temp Min Level1")
 			"Thermal Temp Min Level1")
 
 
+/*
+ * <ini>
+ * gThermalTempMaxLevel1 - Set Thermal Temp Max Level1
+ * @Min: 0
+ * @Max: 1000
+ * @Default: 110
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
 #define CFG_THERMAL_TEMP_MAX_LEVEL1 CFG_INI_UINT( \
 #define CFG_THERMAL_TEMP_MAX_LEVEL1 CFG_INI_UINT( \
 			"gThermalTempMaxLevel1", \
 			"gThermalTempMaxLevel1", \
 			0, \
 			0, \
@@ -55,6 +99,17 @@
 			CFG_VALUE_OR_DEFAULT, \
 			CFG_VALUE_OR_DEFAULT, \
 			"Thermal Temp Max Level1")
 			"Thermal Temp Max Level1")
 
 
+/*
+ * <ini>
+ * gThermalTempMinLevel2 - Set Thermal Temp Min Level2
+ * @Min: 0
+ * @Max: 1000
+ * @Default: 90
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
 #define CFG_THERMAL_TEMP_MIN_LEVEL2 CFG_INI_UINT( \
 #define CFG_THERMAL_TEMP_MIN_LEVEL2 CFG_INI_UINT( \
 			"gThermalTempMinLevel2", \
 			"gThermalTempMinLevel2", \
 			0, \
 			0, \
@@ -63,6 +118,17 @@
 			CFG_VALUE_OR_DEFAULT, \
 			CFG_VALUE_OR_DEFAULT, \
 			"Thermal Temp Min Level2")
 			"Thermal Temp Min Level2")
 
 
+/*
+ * <ini>
+ * gThermalTempMaxLevel2 - Set Thermal Temp Max Level2
+ * @Min: 0
+ * @Max: 1000
+ * @Default: 125
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
 #define CFG_THERMAL_TEMP_MAX_LEVEL2 CFG_INI_UINT( \
 #define CFG_THERMAL_TEMP_MAX_LEVEL2 CFG_INI_UINT( \
 			"gThermalTempMaxLevel2", \
 			"gThermalTempMaxLevel2", \
 			0, \
 			0, \
@@ -71,6 +137,17 @@
 			CFG_VALUE_OR_DEFAULT, \
 			CFG_VALUE_OR_DEFAULT, \
 			"Thermal Temp Max Level2")
 			"Thermal Temp Max Level2")
 
 
+/*
+ * <ini>
+ * gThermalTempMinLevel3 - Set Thermal Temp Min Level3
+ * @Min: 0
+ * @Max: 1000
+ * @Default: 110
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
 #define CFG_THERMAL_TEMP_MIN_LEVEL3 CFG_INI_UINT( \
 #define CFG_THERMAL_TEMP_MIN_LEVEL3 CFG_INI_UINT( \
 			"gThermalTempMinLevel3", \
 			"gThermalTempMinLevel3", \
 			0, \
 			0, \
@@ -79,6 +156,17 @@
 			CFG_VALUE_OR_DEFAULT, \
 			CFG_VALUE_OR_DEFAULT, \
 			"Thermal Temp Min Level3")
 			"Thermal Temp Min Level3")
 
 
+/*
+ * <ini>
+ * gThermalTempMaxLevel3 - Set Thermal Temp Max Level3
+ * @Min: 0
+ * @Max: 1000
+ * @Default: 0
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
 #define CFG_THERMAL_TEMP_MAX_LEVEL3 CFG_INI_UINT( \
 #define CFG_THERMAL_TEMP_MAX_LEVEL3 CFG_INI_UINT( \
 			"gThermalTempMaxLevel3", \
 			"gThermalTempMaxLevel3", \
 			0, \
 			0, \
@@ -87,6 +175,117 @@
 			CFG_VALUE_OR_DEFAULT, \
 			CFG_VALUE_OR_DEFAULT, \
 			"Thermal Temp Max Level3")
 			"Thermal Temp Max Level3")
 
 
+/*
+ * <ini>
+ * gThermalMitigationEnable - Set Thermal mitigation feature control
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_THERMAL_MITIGATION_ENABLE CFG_INI_BOOL( \
+			"gThermalMitigationEnable", \
+			0, \
+			"Thermal mitigation feature control")
+
+/*
+ * <ini>
+ * gThrottlePeriod - Set Thermal mitigation throttle period
+ * @Min: 10
+ * @Max: 10000
+ * @Default: 4000
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_THROTTLE_PERIOD CFG_INI_UINT( \
+			"gThrottlePeriod", \
+			10, \
+			10000, \
+			4000, \
+			CFG_VALUE_OR_DEFAULT, \
+			"Thermal mitigation throttle period")
+
+/*
+ * <ini>
+ * gThrottleDutyCycleLevel0 - Set Thermal mitigation throttle duty cycle level0
+ * @Min: 0
+ * @Max: 0
+ * @Default: 0
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_THROTTLE_DUTY_CYCLE_LEVEL0 CFG_INI_UINT( \
+			"gThrottleDutyCycleLevel0", \
+			0, \
+			0, \
+			0, \
+			CFG_VALUE_OR_DEFAULT, \
+			"Thermal mitigation throttle duty cycle level0")
+
+/*
+ * <ini>
+ * gThrottleDutyCycleLevel1 - Set Thermal mitigation throttle duty cycle level1
+ * @Min: 0
+ * @Max: 100
+ * @Default: 50
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_THROTTLE_DUTY_CYCLE_LEVEL1 CFG_INI_UINT( \
+			"gThrottleDutyCycleLevel1", \
+			0, \
+			100, \
+			50, \
+			CFG_VALUE_OR_DEFAULT, \
+			"Thermal mitigation throttle duty cycle level1")
+
+/*
+ * <ini>
+ * gThrottleDutyCycleLevel2 - Set Thermal mitigation throttle duty cycle level2
+ * @Min: 0
+ * @Max: 100
+ * @Default: 75
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_THROTTLE_DUTY_CYCLE_LEVEL2 CFG_INI_UINT( \
+			"gThrottleDutyCycleLevel2", \
+			0, \
+			100, \
+			75, \
+			CFG_VALUE_OR_DEFAULT, \
+			"Thermal mitigation throttle duty cycle level2")
+
+/*
+ * <ini>
+ * gThrottleDutyCycleLevel3 - Set Thermal mitigation throttle duty cycle level3
+ * @Min: 0
+ * @Max: 100
+ * @Default: 94
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_THROTTLE_DUTY_CYCLE_LEVEL3 CFG_INI_UINT( \
+			"gThrottleDutyCycleLevel3", \
+			0, \
+			100, \
+			94, \
+			CFG_VALUE_OR_DEFAULT, \
+			"Thermal mitigation throttle duty cycle level3")
+
 #define CFG_THERMAL_TEMP_ALL \
 #define CFG_THERMAL_TEMP_ALL \
 	CFG(CFG_THERMAL_TEMP_MIN_LEVEL0) \
 	CFG(CFG_THERMAL_TEMP_MIN_LEVEL0) \
 	CFG(CFG_THERMAL_TEMP_MAX_LEVEL0) \
 	CFG(CFG_THERMAL_TEMP_MAX_LEVEL0) \
@@ -96,6 +295,12 @@
 	CFG(CFG_THERMAL_TEMP_MAX_LEVEL2) \
 	CFG(CFG_THERMAL_TEMP_MAX_LEVEL2) \
 	CFG(CFG_THERMAL_TEMP_MIN_LEVEL3) \
 	CFG(CFG_THERMAL_TEMP_MIN_LEVEL3) \
 	CFG(CFG_THERMAL_TEMP_MAX_LEVEL3) \
 	CFG(CFG_THERMAL_TEMP_MAX_LEVEL3) \
+	CFG(CFG_THERMAL_MITIGATION_ENABLE) \
+	CFG(CFG_THROTTLE_PERIOD) \
+	CFG(CFG_THROTTLE_DUTY_CYCLE_LEVEL0) \
+	CFG(CFG_THROTTLE_DUTY_CYCLE_LEVEL1) \
+	CFG(CFG_THROTTLE_DUTY_CYCLE_LEVEL2) \
+	CFG(CFG_THROTTLE_DUTY_CYCLE_LEVEL3)
 
 
 #endif
 #endif