diff --git a/linux/LibSensors.c b/linux/LibSensors.c index bfc5903ba..8ac349801 100644 --- a/linux/LibSensors.c +++ b/linux/LibSensors.c @@ -133,13 +133,17 @@ static int tempDriverPriority(const sensors_chip_name* chip) { const char* prefix; int priority; } tempDrivers[] = { - { "coretemp", 0 }, - { "via_cputemp", 0 }, - { "cpu_thermal", 0 }, - { "k10temp", 0 }, - { "zenpower", 0 }, + { "coretemp", 0 }, + { "via_cputemp", 0 }, + { "cpu_thermal", 0 }, + { "k10temp", 0 }, + { "zenpower", 0 }, + /* Rockchip RK3588 */ + { "littlecore_thermal", 0 }, + { "bigcore0_thermal", 0 }, + { "bigcore1_thermal", 0 }, /* Low priority drivers */ - { "acpitz", 1 }, + { "acpitz", 1 }, }; for (size_t i = 0; i < ARRAYSIZE(tempDrivers); i++) @@ -208,6 +212,35 @@ void LibSensors_getCPUTemperatures(CPUData* cpus, unsigned int existingCPUs, uns if (r != 0) continue; + /* Map temperature values to Rockchip cores + * + * littlecore -> cores 1..4 + * bigcore0 -> cores 5,6 + * bigcore1 -> cores 7,8 + */ + if (existingCPUs == 8) { + if (String_eq(chip->prefix, "littlecore_thermal")) { + data[1] = temp; + data[2] = temp; + data[3] = temp; + data[4] = temp; + coreTempCount += 4; + continue; + } + if (String_eq(chip->prefix, "bigcore0_thermal")) { + data[5] = temp; + data[6] = temp; + coreTempCount += 2; + continue; + } + if (String_eq(chip->prefix, "bigcore1_thermal")) { + data[7] = temp; + data[8] = temp; + coreTempCount += 2; + continue; + } + } + /* If already set, e.g. Ryzen reporting platform temperature for each die, use the bigger one */ if (isNaN(data[tempID])) { data[tempID] = temp;