Merge tag 'LA.VENDOR.14.3.0.r1-21600-lanai.QSSI15.0' into staging/lineage-22.2_merge-LA.VENDOR.14.3.0.r1-21600-lanai.QSSI15.0
LA.VENDOR.14.3.0.r1-21600-lanai.QSSI15.0
* tag 'LA.VENDOR.14.3.0.r1-21600-lanai.QSSI15.0':
thermal-hal: Return failure only for uninitialized sensor request
thermal-hal: Add severity aggregation logic for display sensors for neo vxr
thermal-hal: Add namespace configuration for google specific path
thermal-hal: Add skin disp sensors support for neo vxp variant
thermal-hal: Add support for neo configuration
thermal-hal: Update proper skin thermistors for seraph
thermal-hal: Update hal settings for monaco
Conflicts:
Android.bp
thermalConfig.cpp
Change-Id: I5a7306af51f4d8472891d0342d28029fefd0df5d
diff --git a/.gitupstream b/.gitupstream
new file mode 100644
index 0000000..7d6f0fd
--- /dev/null
+++ b/.gitupstream
@@ -0,0 +1 @@
+https://git.codelinaro.org/clo/la/platform/hardware/qcom/thermal
diff --git a/Android.bp b/Android.bp
index 7d4ca8d..a5c90da 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,3 +1,6 @@
+soong_namespace {
+}
+
soong_config_module_type {
name: "thermal_hal_namespace",
module_type: "soong_namespace",
@@ -21,38 +24,90 @@
},
}
+soong_config_module_type {
+ name: "qti_thermal_hal_cc_defaults",
+ module_type: "cc_defaults",
+ config_namespace: "qti_thermal",
+ variables: ["netlink"],
+ properties: [
+ "cflags",
+ "header_libs",
+ "shared_libs",
+ "srcs",
+ ],
+}
+
+soong_config_string_variable {
+ name: "netlink",
+ values: [
+ "true",
+ "false",
+ ],
+}
+
+qti_thermal_hal_cc_defaults {
+ name: "qti_thermal_hal_defaults",
+ soong_config_variables: {
+ netlink: {
+ true: {
+ cflags: ["-DENABLE_THERMAL_NETLINK"],
+ header_libs: ["qti_kernel_headers"],
+ shared_libs: ["libnl"],
+ srcs: [
+ "thermalUtilsNetlink.cpp",
+ "thermalMonitorNetlink.cpp",
+ ],
+ },
+ false: {
+ cflags: [],
+ header_libs: [],
+ shared_libs: [],
+ srcs: [
+ "thermalUtils.cpp",
+ "thermalMonitor.cpp",
+ ],
+ },
+ conditions_default: {
+ cflags: ["-DENABLE_THERMAL_NETLINK"],
+ header_libs: ["qti_kernel_headers"],
+ shared_libs: ["libnl"],
+ srcs: [
+ "thermalUtilsNetlink.cpp",
+ "thermalMonitorNetlink.cpp",
+ ],
+ },
+ },
+ },
+}
+
cc_binary {
name: "android.hardware.thermal-service.qti",
+ defaults: ["qti_thermal_hal_defaults"],
relative_install_path: "hw",
init_rc: ["android.hardware.thermal-service.qti.rc"],
vintf_fragments: ["android.hardware.thermal-service.qti.xml"],
vendor: true,
shared_libs: [
- "libbase",
- "libbinder_ndk",
- "android.hardware.thermal-V1-ndk",
- "libcutils",
- "libutils",
- "liblog",
- "libnl",
+ "libbase",
+ "libbinder_ndk",
+ "android.hardware.thermal-V1-ndk",
+ "libcutils",
+ "libutils",
+ "liblog",
],
srcs: [
"service.cpp",
"thermal.cpp",
"thermalConfig.cpp",
"thermalCommon.cpp",
- "thermalUtilsNetlink.cpp",
- "thermalMonitorNetlink.cpp",
],
header_libs: [
"liblog_headers",
"libcutils_headers",
- "qti_kernel_headers"
],
cflags: [
"-Wno-unused-parameter",
"-Wno-unused-variable",
- "-DENABLE_THERMAL_NETLINK",
"-fexceptions",
],
}
diff --git a/android.hardware.thermal-service.qti.rc b/android.hardware.thermal-service.qti.rc
index a593a40..888f276 100644
--- a/android.hardware.thermal-service.qti.rc
+++ b/android.hardware.thermal-service.qti.rc
@@ -37,3 +37,7 @@
class hal
user root
group root
+
+on boot
+ wait /sys/kernel/boot_adsp/boot
+ restart vendor.thermal-hal
diff --git a/thermalCommon.cpp b/thermalCommon.cpp
index b602f39..d45fa44 100644
--- a/thermalCommon.cpp
+++ b/thermalCommon.cpp
@@ -30,7 +30,7 @@
/* Changes from Qualcomm Innovation Center are provided under the following license:
-Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause-Clear */
#include <cstdio>
@@ -273,16 +273,17 @@
sensor.lastThrottleStatus = sensor.t.throttlingStatus =
ThrottlingSeverity::NONE;
sensor.thresh.type = sensor.t.type = cfg.type;
+ sensor.throt_severity = cfg.throt_severity;
for (idx = 0; idx <= (size_t)ThrottlingSeverity::SHUTDOWN; idx++) {
sensor.thresh.hotThrottlingThresholds.push_back(UNKNOWN_TEMPERATURE);
sensor.thresh.coldThrottlingThresholds.push_back(UNKNOWN_TEMPERATURE);
}
if (cfg.throt_thresh != 0 && cfg.positive_thresh_ramp)
- sensor.thresh.hotThrottlingThresholds[(size_t)ThrottlingSeverity::SEVERE] =
+ sensor.thresh.hotThrottlingThresholds[(size_t)sensor.throt_severity] =
cfg.throt_thresh / (float)sensor.mulFactor;
else if (cfg.throt_thresh != 0 && !cfg.positive_thresh_ramp)
- sensor.thresh.coldThrottlingThresholds[(size_t)ThrottlingSeverity::SEVERE] =
+ sensor.thresh.coldThrottlingThresholds[(size_t)sensor.throt_severity] =
cfg.throt_thresh / (float)sensor.mulFactor;
if (cfg.shutdwn_thresh != 0 && cfg.positive_thresh_ramp)
diff --git a/thermalConfig.cpp b/thermalConfig.cpp
index da4329a..e07ae9c 100644
--- a/thermalConfig.cpp
+++ b/thermalConfig.cpp
@@ -34,12 +34,13 @@
/* Changes from Qualcomm Innovation Center are provided under the following license:
-Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause-Clear */
#include <unordered_map>
#include <android-base/logging.h>
#include <aidl/android/hardware/thermal/BnThermal.h>
+#include <utility>
#include "thermalData.h"
#include "thermalConfig.h"
@@ -50,24 +51,77 @@
namespace thermal {
constexpr std::string_view socIDPath("/sys/devices/soc0/soc_id");
+ constexpr std::string_view hwPlatformPath("/sys/devices/soc0/hw_platform");
- std::vector<std::string> cpu_sensors_bengal =
+ std::vector<std::string> cpu_sensors_439 =
{
- "cpuss-2-usr",
- "cpuss-2-usr",
- "cpuss-2-usr",
- "cpuss-2-usr",
- "cpu-1-0-usr",
- "cpu-1-1-usr",
- "cpu-1-2-usr",
- "cpu-1-3-usr",
+ "apc1-cpu0-usr",
+ "apc1-cpu1-usr",
+ "apc1-cpu2-usr",
+ "apc1-cpu3-usr",
+ "cpuss0-usr",
+ "cpuss0-usr",
+ "cpuss0-usr",
+ "cpuss0-usr",
};
- std::vector<struct target_therm_cfg> sensor_cfg_bengal =
+ std::vector<struct target_therm_cfg> sensor_cfg_sdm632 =
{
{
TemperatureType::CPU,
- cpu_sensors_bengal,
+ cpu_sensors_439,
+ "",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
+ { "gpu0-usr" },
+ "GPU",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::SKIN,
+ { "xo-therm-adc" },
+ "skin",
+ 40000,
+ 95000,
+ true,
+ },
+ {
+ TemperatureType::BCL_VOLTAGE,
+ { "pmi-vbat-lvl0" },
+ "vbat",
+ 3200,
+ 3000,
+ false,
+ },
+ {
+ TemperatureType::BCL_CURRENT,
+ { "pmi-ibat-lvl0" },
+ "ibat",
+ 4200,
+ 4400,
+ true,
+ },
+ {
+ TemperatureType::BCL_PERCENTAGE,
+ { "soc" },
+ "soc",
+ 10,
+ 2,
+ false,
+ },
+ };
+
+ std::vector<struct target_therm_cfg> sensor_cfg_439 =
+ {
+ {
+ TemperatureType::CPU,
+ cpu_sensors_439,
"",
95000,
115000,
@@ -83,7 +137,7 @@
},
{
TemperatureType::SKIN,
- { "xo-therm-usr" },
+ { "quiet-therm-adc" },
"skin",
40000,
95000,
@@ -91,14 +145,180 @@
},
{
TemperatureType::BCL_VOLTAGE,
- { "pmi632-vbat-lvl0" },
+ { "vbat_adc" },
"vbat",
+ 3200,
3000,
- 2800,
false,
},
{
TemperatureType::BCL_CURRENT,
+ { "ibat-high" },
+ "ibat",
+ 4200,
+ 4400,
+ true,
+ },
+ {
+ TemperatureType::BCL_PERCENTAGE,
+ { "soc" },
+ "soc",
+ 10,
+ 2,
+ false,
+ },
+ };
+
+ std::vector<std::string> cpu_sensors_sdm710 =
+ {
+ "cpu0-silver-usr",
+ "cpu1-silver-usr",
+ "cpu2-silver-usr",
+ "cpu3-silver-usr",
+ "cpu4-silver-usr",
+ "cpu5-silver-usr",
+ "cpu0-gold-usr",
+ "cpu1-gold-usr",
+ };
+
+ std::vector<struct target_therm_cfg> sensor_cfg_sdm710 = {
+ {
+ TemperatureType::CPU,
+ cpu_sensors_sdm710,
+ "",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
+ {"gpu0-usr"},
+ "gpu0",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
+ {"gpu1-usr"},
+ "gpu1",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::SKIN,
+ {"xo-therm-adc"},
+ "skin",
+ 55000,
+ 95000,
+ true,
+ },
+ {
+ TemperatureType::BCL_PERCENTAGE,
+ {"soc"},
+ "soc",
+ 10,
+ 2,
+ false,
+ },
+ };
+
+ std::vector<std::string> cpu_sensors_sdm845 =
+ {
+ "cpu0-silver-usr",
+ "cpu1-silver-usr",
+ "cpu2-silver-usr",
+ "cpu3-silver-usr",
+ "cpu0-gold-usr",
+ "cpu1-gold-usr",
+ "cpu2-gold-usr",
+ "cpu3-gold-usr",
+ };
+
+ std::vector<struct target_therm_cfg> sensor_cfg_sdm845 = {
+ {
+ TemperatureType::CPU,
+ cpu_sensors_sdm845,
+ "",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
+ {"gpu0-usr"},
+ "gpu0",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
+ {"gpu1-usr"},
+ "gpu1",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::SKIN,
+ {"xo-therm-adc"},
+ "skin",
+ 55000,
+ 95000,
+ true,
+ },
+ {
+ TemperatureType::BCL_PERCENTAGE,
+ {"soc"},
+ "soc",
+ 10,
+ 2,
+ false,
+ },
+ };
+
+ std::vector<std::string> cpu_sensors_bengal =
+ {
+ "cpuss-0",
+ "cpuss-1",
+ "cpuss-2",
+ "cpuss-2",
+ "cpu-1-0",
+ "cpu-1-1",
+ "cpu-1-2",
+ "cpu-1-3",
+ };
+
+ std::vector<struct target_therm_cfg> sensor_cfg_bengal =
+ {
+ {
+ TemperatureType::CPU,
+ cpu_sensors_bengal,
+ "",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
+ { "gpu" },
+ "GPU",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::SKIN,
+ { "xo-therm" },
+ "skin",
+ 40000,
+ 95000,
+ true,
+ },
+ {
+ TemperatureType::BCL_CURRENT,
{ "pmi632-ibat-lvl0" },
"ibat",
4000,
@@ -107,10 +327,10 @@
},
{
TemperatureType::BCL_PERCENTAGE,
- { "soc" },
- "soc",
- 10,
- 2,
+ { "socd" },
+ "socd",
+ 90,
+ 99,
false,
},
};
@@ -169,8 +389,9 @@
std::vector<std::string> cpu_sensors_khaje =
{
- "cpuss-0",
- "cpuss-1",
+ "cpuss-2",
+ "cpuss-2",
+ "cpuss-2",
"cpuss-2",
"cpu-1-0",
"cpu-1-1",
@@ -206,7 +427,7 @@
},
{
TemperatureType::BCL_VOLTAGE,
- { "pm7250b-vbat-lvl0" },
+ { "vbat" },
"vbat",
3000,
2800,
@@ -222,24 +443,24 @@
},
{
TemperatureType::BCL_PERCENTAGE,
- { "soc" },
- "soc",
- 10,
- 2,
- false,
+ { "socd" },
+ "socd",
+ 90,
+ 99,
+ true,
},
};
std::vector<std::string> cpu_sensors_trinket =
{
- "cpuss-0-usr",
- "cpuss-0-usr",
- "cpuss-0-usr",
- "cpuss-0-usr",
- "cpu-1-0-usr",
- "cpu-1-1-usr",
- "cpu-1-2-usr",
- "cpu-1-3-usr",
+ "cpuss-0",
+ "cpuss-0",
+ "cpuss-0",
+ "cpuss-0",
+ "cpu-1-0",
+ "cpu-1-1",
+ "cpu-1-2",
+ "cpu-1-3",
};
std::vector<struct target_therm_cfg> sensor_cfg_trinket =
@@ -254,6 +475,58 @@
},
{
TemperatureType::GPU,
+ { "gpu" },
+ "GPU",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::SKIN,
+ { "xo-therm" },
+ "skin",
+ 40000,
+ 95000,
+ true,
+ },
+ {
+ TemperatureType::BCL_VOLTAGE,
+ { "vbat" },
+ "vbat",
+ 3000,
+ 2800,
+ false,
+ },
+ {
+ TemperatureType::BCL_CURRENT,
+ { "pmi632-ibat-lvl0" },
+ "ibat",
+ 4000,
+ 4200,
+ true,
+ },
+ {
+ TemperatureType::BCL_PERCENTAGE,
+ { "socd" },
+ "socd",
+ 90,
+ 99,
+ true,
+ },
+ };
+
+ std::vector<struct target_therm_cfg> sensor_cfg_sdm660 =
+ {
+ {
+ TemperatureType::CPU,
+ cpu_sensors_trinket,
+ "",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
{ "gpu-usr" },
"GPU",
95000,
@@ -269,22 +542,6 @@
true,
},
{
- TemperatureType::BCL_VOLTAGE,
- { "pmi632-vbat-lvl0" },
- "vbat",
- 3000,
- 2800,
- false,
- },
- {
- TemperatureType::BCL_CURRENT,
- { "pmi632-ibat-lvl0" },
- "ibat",
- 4000,
- 4200,
- true,
- },
- {
TemperatureType::BCL_PERCENTAGE,
{ "soc" },
"soc",
@@ -328,7 +585,7 @@
TemperatureType::SKIN,
{ "xo-therm-usr" },
"skin",
- 40000,
+ 55000,
95000,
true,
},
@@ -577,14 +834,14 @@
std::vector<std::string> cpu_sensors_kona =
{
- "cpu-0-0-usr",
- "cpu-0-1-usr",
- "cpu-0-2-usr",
- "cpu-0-3-usr",
- "cpu-1-0-usr",
- "cpu-1-1-usr",
- "cpu-1-2-usr",
- "cpu-1-3-usr",
+ "cpu-0-0",
+ "cpu-0-1",
+ "cpu-0-2",
+ "cpu-0-3",
+ "cpu-1-0",
+ "cpu-1-1",
+ "cpu-1-2",
+ "cpu-1-3",
};
std::vector<struct target_therm_cfg> kona_common = {
@@ -598,7 +855,7 @@
},
{
TemperatureType::GPU,
- { "gpuss-0-usr" },
+ { "gpuss-0" },
"GPU0",
95000,
115000,
@@ -606,7 +863,7 @@
},
{
TemperatureType::GPU,
- { "gpuss-1-usr" },
+ { "gpuss-1" },
"GPU1",
95000,
115000,
@@ -614,7 +871,7 @@
},
{
TemperatureType::SKIN,
- { "skin-msm-therm-usr" },
+ { "skin-msm-therm" },
"skin",
40000,
95000,
@@ -633,7 +890,7 @@
},
{
TemperatureType::BCL_VOLTAGE,
- { "pm8150b-vbat-lvl0" },
+ { "vbat" },
"vbat",
3200,
3000,
@@ -641,15 +898,15 @@
},
{
TemperatureType::BCL_PERCENTAGE,
- { "soc" },
- "soc",
- 10,
- 2,
+ { "socd" },
+ "socd",
+ 90,
+ 99,
false,
},
{
TemperatureType::NPU,
- { "npu-usr" },
+ { "npu" },
"npu",
95000,
115000,
@@ -795,7 +1052,7 @@
TemperatureType::SKIN,
{ "quiet-therm-usr" },
"skin",
- 40000,
+ 55000,
95000,
true,
},
@@ -864,6 +1121,63 @@
},
};
+ std::vector<struct target_therm_cfg> diwali_common = {
+ {
+ TemperatureType::CPU,
+ cpu_sensors_waipio,
+ "",
+ 95000,
+ 115000,
+ true,
+ ThrottlingSeverity::LIGHT,
+ },
+ {
+ TemperatureType::GPU,
+ { "gpuss-0" },
+ "GPU0",
+ 95000,
+ 115000,
+ true,
+ ThrottlingSeverity::LIGHT,
+ },
+ {
+ TemperatureType::GPU,
+ { "gpuss-1" },
+ "GPU1",
+ 95000,
+ 115000,
+ true,
+ ThrottlingSeverity::LIGHT,
+ },
+ {
+ TemperatureType::NPU,
+ { "nspss-0" },
+ "nsp0",
+ 95000,
+ 115000,
+ true,
+ ThrottlingSeverity::LIGHT,
+ },
+ {
+ TemperatureType::NPU,
+ { "nspss-1" },
+ "nsp1",
+ 95000,
+ 115000,
+ true,
+ ThrottlingSeverity::LIGHT,
+ },
+ {
+ TemperatureType::NPU,
+ { "nspss-2" },
+ "nsp2",
+ 95000,
+ 115000,
+ true,
+ ThrottlingSeverity::LIGHT,
+ },
+ };
+
std::vector<struct target_therm_cfg> waipio_specific = {
{
TemperatureType::BCL_CURRENT,
@@ -1021,10 +1335,235 @@
},
};
+ std::vector<std::string> cpu_sensors_crow =
+ {
+ "cpu-0-0",
+ "cpu-0-1",
+ "cpu-0-2",
+ "cpu-0-3",
+ "cpu-1-0",
+ "cpu-1-2",
+ "cpu-1-4",
+ "cpu-1-6",
+ };
+
+ std::vector<struct target_therm_cfg> crow_common = {
+ {
+ TemperatureType::CPU,
+ cpu_sensors_crow,
+ "",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
+ { "gpuss-0" },
+ "GPU0",
+ 102000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
+ { "gpuss-1" },
+ "GPU1",
+ 102000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::NPU,
+ { "nspss-0" },
+ "nsp0",
+ 100000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::NPU,
+ { "nspss-1" },
+ "nsp1",
+ 100000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::NPU,
+ { "nspss-2" },
+ "nsp2",
+ 100000,
+ 115000,
+ true,
+ },
+ };
+
+ std::vector<struct target_therm_cfg> crow_specific = {
+ {
+ TemperatureType::SKIN,
+ { "sys-therm-3" },
+ "skin",
+ 60000,
+ 95000,
+ true,
+ },
+ };
+
std::vector<struct target_therm_cfg> diwali_specific = {
{
TemperatureType::BCL_CURRENT,
- { "pm8350b-ibat-lvl0" },
+ { "pm7250b-ibat-lvl0" },
+ "ibat",
+ 9000,
+ 9500,
+ true,
+ },
+ {
+ TemperatureType::SKIN,
+ { "quiet-therm" },
+ "skin",
+ 46000,
+ 95000,
+ true,
+ ThrottlingSeverity::LIGHT,
+ },
+ };
+
+ std::vector<std::string> cpu_sensors_neo =
+ {
+ "cpu-0-0",
+ "cpu-0-1",
+ "cpu-0-2",
+ "cpu-0-3",
+ };
+
+ std::vector<struct target_therm_cfg> neo_common = {
+ {
+ TemperatureType::CPU,
+ cpu_sensors_neo,
+ "",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
+ { "gpuss-0" },
+ "GPU0",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
+ { "gpuss-1" },
+ "GPU1",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::NPU,
+ { "nspss-0" },
+ "nsp0",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::NPU,
+ { "nspss-1" },
+ "nsp1",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::NPU,
+ { "nspss-2" },
+ "nsp2",
+ 95000,
+ 115000,
+ true,
+ },
+ // Google specific changes for aurora vxp product.
+ {
+ TemperatureType::SKIN,
+ { "disp-lea-right" },
+ "SKIN-DISP-LEA",
+ 65000,
+ 85000,
+ true,
+ },
+ {
+ TemperatureType::SKIN,
+ { "disp-lea-left" },
+ "SKIN-DISP-LEA",
+ 65000,
+ 85000,
+ true,
+ },
+ };
+
+ std::vector<std::string> cpu_sensors_parrot =
+ {
+ "cpu-0-0",
+ "cpu-0-1",
+ "cpu-0-2",
+ "cpu-0-3",
+ "cpu-1-0",
+ "cpu-1-2",
+ "cpu-1-4",
+ "cpu-1-6",
+ };
+
+ std::vector<struct target_therm_cfg> parrot_common = {
+ {
+ TemperatureType::CPU,
+ cpu_sensors_parrot,
+ "",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
+ { "gpuss-0" },
+ "GPU0",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
+ { "gpuss-1" },
+ "GPU1",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::NPU,
+ { "nspss-0" },
+ "nsp0",
+ 95000,
+ 115000,
+ true,
+ },
+ {
+ TemperatureType::NPU,
+ { "nspss-1" },
+ "nsp1",
+ 95000,
+ 115000,
+ true,
+ },
+ };
+
+ std::vector<struct target_therm_cfg> parrot_specific = {
+ {
+ TemperatureType::BCL_CURRENT,
+ { "pm7250b-ibat-lvl0" },
"ibat",
6000,
7500,
@@ -1032,14 +1571,77 @@
},
{
TemperatureType::SKIN,
- { "quiet-therm" },
+ { "xo-therm" },
"skin",
- 40000,
+ 55000,
95000,
true,
},
};
+ std::vector<std::string> cpu_sensors_lemansAU =
+ {
+ "cpu-0-0-0",
+ "cpu-0-1-0",
+ "cpu-0-2-0",
+ "cpu-0-3-0",
+ "cpu-1-0-0",
+ "cpu-1-1-0",
+ "cpu-1-2-0",
+ "cpu-1-3-0",
+ };
+
+ std::vector<struct target_therm_cfg> lemansAU_common = {
+ {
+ TemperatureType::CPU,
+ cpu_sensors_lemansAU,
+ "",
+ 105000,
+ 118000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
+ { "gpuss-0" },
+ "GPU0",
+ 105000,
+ 118000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
+ { "gpuss-1" },
+ "GPU1",
+ 105000,
+ 118000,
+ true,
+ },
+ {
+ TemperatureType::GPU,
+ { "gpuss-2" },
+ "GPU2",
+ 105000,
+ 118000,
+ true,
+ },
+ {
+ TemperatureType::NPU,
+ { "nsp-0-0-0" },
+ "nsp0",
+ 105000,
+ 118000,
+ true,
+ },
+ {
+ TemperatureType::NPU,
+ { "nsp-1-0-0" },
+ "nsp1",
+ 105000,
+ 118000,
+ true,
+ },
+ };
+
struct target_therm_cfg bat_conf = {
TemperatureType::BATTERY,
{ "battery" },
@@ -1875,18 +2477,22 @@
},
};
- std::vector<std::string> cpu_sensors_neo =
+ std::vector<std::string> cpu_sensors_ravelin =
{
"cpu-0-0",
"cpu-0-1",
"cpu-0-2",
"cpu-0-3",
+ "cpu-0-4",
+ "cpu-0-5",
+ "cpu-1-0",
+ "cpu-1-2",
};
- std::vector<struct target_therm_cfg> neo_common = {
+ std::vector<struct target_therm_cfg> ravelin_common = {
{
TemperatureType::CPU,
- cpu_sensors_neo,
+ cpu_sensors_ravelin,
"",
95000,
115000,
@@ -1894,65 +2500,58 @@
},
{
TemperatureType::GPU,
- { "gpuss-0" },
- "GPU0",
+ { "gpuss" },
+ "GPU",
95000,
115000,
true,
},
{
- TemperatureType::GPU,
- { "gpuss-1" },
- "GPU1",
- 95000,
- 115000,
- true,
- },
- {
- TemperatureType::NPU,
- { "nspss-0" },
- "nsp0",
- 95000,
- 115000,
- true,
- },
- {
- TemperatureType::NPU,
- { "nspss-1" },
- "nsp1",
- 95000,
- 115000,
- true,
- },
- {
- TemperatureType::NPU,
- { "nspss-2" },
- "nsp2",
- 95000,
- 115000,
- true,
- },
- // Google specific changes for aurora vxp product.
- {
- TemperatureType::SKIN,
- { "disp-lea-right" },
- "SKIN-DISP-LEA",
- 65000,
- 85000,
- true,
- },
- {
TemperatureType::SKIN,
- { "disp-lea-left" },
- "SKIN-DISP-LEA",
- 65000,
- 85000,
+ { "sys-therm-1" },
+ "skin",
+ 55000,
+ 95000,
+ true,
+ },
+ };
+
+ std::vector<struct target_therm_cfg> ravelin_specific_qrd = {
+ {
+ TemperatureType::BCL_CURRENT,
+ { "pmi632-ibat-lvl0" },
+ "ibat",
+ 6000,
+ 7500,
+ true,
+ },
+ };
+
+ std::vector<struct target_therm_cfg> ravelin_specific_idp = {
+ {
+ TemperatureType::BCL_CURRENT,
+ { "pm7250b-ibat-lvl0" },
+ "ibat",
+ 6000,
+ 7500,
true,
},
};
const std::unordered_map<int, std::vector<struct target_therm_cfg>>
msm_soc_map = {
+ {353, sensor_cfg_439},
+ {354, sensor_cfg_439},
+ {363, sensor_cfg_439},
+ {364, sensor_cfg_439},
+ {416, sensor_cfg_439},
+ {437, sensor_cfg_439},
+ {349, sensor_cfg_sdm632},
+ {336, sensor_cfg_sdm710}, // SDM670
+ {360, sensor_cfg_sdm710}, // SDM710
+ {393, sensor_cfg_sdm710}, // SDM712
+ {321, sensor_cfg_sdm845},
+ {341, sensor_cfg_sdm845},
{355, sensor_cfg_talos_common},
{377, sensor_cfg_sa6155_common}, // auto
{380, sensor_cfg_sa6155_common}, // auto
@@ -1964,9 +2563,18 @@
{469, sensor_cfg_bengal},
{470, sensor_cfg_bengal},
{518, sensor_cfg_khaje}, //khaje
+ {561, sensor_cfg_khaje}, //khajeP
+ {562, sensor_cfg_khaje}, //khajeQ
+ {584, sensor_cfg_khaje}, //khajeXR
+ {585, sensor_cfg_khaje}, //khajeG
+ {586, sensor_cfg_khaje}, //khajeIOT
{394, sensor_cfg_trinket},
{467, sensor_cfg_trinket},
{468, sensor_cfg_trinket},
+ {317, sensor_cfg_sdm660},
+ {318, sensor_cfg_sdm660}, // sdm630
+ {345, sensor_cfg_sdm660}, // sdm636
+ {385, sensor_cfg_sdm660}, // sdm455
{400, sensor_cfg_lito}, // lito
{440, sensor_cfg_lito},
{407, sensor_cfg_lito}, // atoll
@@ -1982,6 +2590,8 @@
{367, sensor_cfg_sa8155_common}, //auto
{405, sensor_cfg_sa8195_common}, //auto
{356, kona_common}, // kona
+ {481, kona_common}, //kona iot
+ {548, kona_common}, //kona iot
{415, lahaina_common}, // lahaina
{439, lahaina_common}, // lahainap
{456, lahaina_common}, // lahaina-atp
@@ -1993,10 +2603,23 @@
{578, sensor_cfg_holi}, //conic
{475, sensor_cfg_yupik}, // yupik
{515, sensor_cfg_yupik}, // YUPIK-LTE
+ {576, sensor_cfg_yupik}, // yupik qcm5430 modem
+ {575, sensor_cfg_yupik}, // yupik qcm5430
+ {567, sensor_cfg_yupik}, // yupik
+ {563, sensor_cfg_yupik}, // yupik
+ {553, sensor_cfg_yupik}, // yupik
+ {546, sensor_cfg_yupik}, // yupik
+ {499, sensor_cfg_yupik}, // yupik
+ {498, sensor_cfg_yupik}, // yupik-iot
+ {497, sensor_cfg_yupik}, // yupik-iot mdm
+ {488, sensor_cfg_yupik}, // yupik
+ {487, sensor_cfg_yupik}, // yupik
{457, waipio_common}, //Waipio
{482, waipio_common}, //Waipio
{552, waipio_common}, //Waipio-LTE
- {506, waipio_common}, //diwali
+ {506, diwali_common}, //diwali
+ {547, diwali_common}, //diwali
+ {564, diwali_common}, //diwali-LTE
{530, waipio_common}, // cape
{531, waipio_common}, // cape
{540, waipio_common}, // cape
@@ -2004,6 +2627,8 @@
{536, kalama_common}, //Kalamap
{600, kalama_common}, //Kalama_sg
{601, kalama_common}, //Kalamap_sg
+ {603, kalama_common}, //Kalama_qcs
+ {604, kalama_common}, //Kalama_qcm
{557, pineapple_common}, //Pineapple
{577, pineapple_common}, //Pineapplep
{682, pineapple_common}, //Pineapple gaming
@@ -2028,11 +2653,24 @@
{673, seraph_common}, //Balsam-SAR2230P
{525, neo_common},
{554, neo_common},
+ {537, parrot_common}, //Netrani mobile
+ {583, parrot_common}, //Netrani mobile without modem
+ {613, parrot_common}, //Netrani APQ
+ {631, parrot_common},
+ {568, ravelin_common}, //Clarence Mobile
+ {581, ravelin_common}, //Clarence IOT
+ {582, ravelin_common}, //Clarence IOT without modem
+ {591, waipio_common}, //ukee
+ {608, crow_common}, //crow
+ {644, crow_common}, //crow 4G
+ {532, lemansAU_common}, //Lemans auto
};
const std::unordered_map<int, std::vector<struct target_therm_cfg>>
msm_soc_specific = {
{356, kona_specific}, // kona
+ {481, kona_specific}, //kona iot
+ {548, kona_specific}, //kona iot
{415, lahaina_specific}, // lahaina
{439, lahaina_specific}, // lahainap
{456, lahaina_specific}, // lahaina-atp
@@ -2043,6 +2681,8 @@
{482, waipio_specific}, //Waipio
{552, waipio_specific}, //Waipio-LTE
{506, diwali_specific}, //diwali
+ {547, diwali_specific}, //diwali
+ {564, diwali_specific}, //diwali-LTE
{530, waipio_specific}, // cape
{531, waipio_specific}, // cape
{540, waipio_specific}, // cape
@@ -2050,6 +2690,8 @@
{536, kalama_specific}, //Kalamap
{600, kalama_specific}, //Kalama_sg
{601, kalama_specific}, //Kalamap_sg
+ {603, kalama_specific}, //Kalama_qcs
+ {604, kalama_specific}, //Kalama_qcm
{557, pineapple_specific}, //Pineapple
{577, pineapple_specific}, //Pineapplep
{682, pineapple_specific}, //Pineapple gaming
@@ -2068,6 +2710,13 @@
{649, anorak_specific}, // Halliday Pro
{672, seraph_specific}, //Balsam-SAR1250P
{673, seraph_specific}, //Balsam-SAR2230P
+ {537, parrot_specific}, //Netrani mobile
+ {583, parrot_specific}, //Netrani mobile without modem
+ {613, parrot_specific}, //Netrani APQ
+ {631, parrot_specific},
+ {591, waipio_specific}, //ukee
+ {608, crow_specific}, //crow
+ {644, crow_specific}, //crow
};
const std::unordered_map<int, bool>
@@ -2080,6 +2729,13 @@
{405, true},
};
+ const std::unordered_multimap<int, std::pair<std::string,
+ std::vector<struct target_therm_cfg>>>
+ msm_platform_specific = {
+ {568, std::make_pair("QRD", ravelin_specific_qrd)},
+ {568, std::make_pair("IDP", ravelin_specific_idp)},
+ };
+
const std::unordered_multimap<int, std::pair<int, std::vector<struct target_therm_cfg>>>
msm_limit_profile_specific = {
{657, std::make_pair(0, volcano_common)},
@@ -2089,16 +2745,15 @@
};
std::vector<struct target_therm_cfg> add_target_config(
- int socID, int lp,
+ int socID, int lp, std::string hwPlatform,
std::vector<struct target_therm_cfg> conf)
{
std::vector<struct target_therm_cfg> targetConf;
if (msm_soc_specific.find(socID) != msm_soc_specific.end()) {
targetConf = (msm_soc_specific.find(socID))->second;
-
conf.insert(conf.end(), targetConf.begin(),
- targetConf.end());
+ targetConf.end());
}
auto range = msm_limit_profile_specific.equal_range(socID);
@@ -2108,11 +2763,24 @@
if (it->second.first != lp)
continue;
targetConf = it->second.second;
- conf.insert(conf.end(), targetConf.begin(),targetConf.end());
+ conf.insert(conf.end(), targetConf.begin(),
+ targetConf.end());
break;
}
}
+ auto hw_range = msm_platform_specific.equal_range(socID);
+ auto hw_it = hw_range.first;
+ for (; hw_it != hw_range.second; ++hw_it) {
+ if (hw_it->second.first != hwPlatform)
+ continue;
+
+ targetConf = hw_it->second.second;
+ conf.insert(conf.end(), targetConf.begin(),
+ targetConf.end());
+ break;
+ }
+
return conf;
}
@@ -2126,11 +2794,18 @@
int ct = 0;
bool read_ok = false;
+ soc_id = 0;
do {
if (cmnInst.readFromFile(socIDPath, soc_val) <= 0) {
LOG(ERROR) <<"soc ID fetch error";
return;
}
+
+ if (cmnInst.readFromFile(hwPlatformPath, hw_platform) <= 0) {
+ LOG(ERROR) <<"hw Platform fetch error";
+ continue;
+ }
+
try {
soc_id = std::stoi(soc_val, nullptr, 0);
read_ok = true;
@@ -2139,8 +2814,7 @@
LOG(ERROR) <<"soc id stoi err:" << err.what()
<< " buf:" << soc_val;
}
- ct++;
- } while (!read_ok && ct < RETRY_CT);
+ } while (ct++ && !read_ok && ct < RETRY_CT);
if (soc_id <= 0) {
LOG(ERROR) << "Invalid soc ID: " << soc_id;
return;
@@ -2160,7 +2834,7 @@
LOG(ERROR) << "No config for soc ID: " << soc_id;
return;
}
- thermalConfig = add_target_config(soc_id, limitp, it->second);
+ thermalConfig = add_target_config(soc_id, limitp, hw_platform, it->second);
for (it_vec = thermalConfig.begin();
it_vec != thermalConfig.end(); it_vec++) {
if (it_vec->type == TemperatureType::BCL_PERCENTAGE)
diff --git a/thermalConfig.h b/thermalConfig.h
index 3a8ef1c..93ed286 100644
--- a/thermalConfig.h
+++ b/thermalConfig.h
@@ -60,6 +60,7 @@
std::vector<struct target_therm_cfg> thermalConfig;
int soc_id;
int limitp;
+ std::string hw_platform;
ThermalCommon cmnInst;
};
diff --git a/thermalData.h b/thermalData.h
index 03866d6..e45c2b4 100644
--- a/thermalData.h
+++ b/thermalData.h
@@ -30,7 +30,7 @@
/* Changes from Qualcomm Innovation Center are provided under the following license:
-Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause-Clear */
#ifndef THERMAL_THERMAL_DATA_H__
@@ -68,6 +68,7 @@
int throt_thresh;
int shutdwn_thresh;
bool positive_thresh_ramp;
+ ThrottlingSeverity throt_severity = ThrottlingSeverity::SEVERE;
};
struct therm_sensor {
@@ -78,6 +79,7 @@
ThrottlingSeverity lastThrottleStatus;
Temperature t;
TemperatureThreshold thresh;
+ ThrottlingSeverity throt_severity;
};
struct therm_cdev {