1. fix the pus voltage value 2. modify the shut down thermal temperature

Signed-off-by: hans <hans.taeng@delta.com.tw>
Signed-off-by: duobliu1 <bo.liu@delta.com>
This commit is contained in:
hans
2017-08-16 10:54:46 +08:00
committed by duobliu1
parent c896d729b0
commit 4b402202ba
3 changed files with 30 additions and 10 deletions

View File

@@ -201,10 +201,9 @@ static ssize_t for_vout_data(struct device *dev, struct device_attribute \
exponent = two_complement_to_int(data->vout_mode, 5, 0x1f);
mantissa = data->v_out;
return (exponent > 0) ? sprintf(buf, "%d\n", \
(mantissa << exponent) * multiplier) : \
sprintf(buf, "%d\n", (mantissa << exponent) / (1 << -exponent));
return (exponent > 0) ? sprintf(buf, "%d\n", \
mantissa * (1 << exponent)) : \
sprintf(buf, "%d\n", mantissa / (1 << -exponent) * multiplier);
}

View File

@@ -38,6 +38,12 @@
} \
} while(0)
#define dni_onlp_thermal_threshold(WARNING_DEFAULT, ERROR_DEFAULT, SHUTDOWN_DEFAULT){ \
WARNING_DEFAULT, \
ERROR_DEFAULT, \
SHUTDOWN_DEFAULT, \
}
static char* last_path[] = /* must map with onlp_thermal_id */
{
"reserved",
@@ -70,27 +76,27 @@ static onlp_thermal_info_t linfo[] = {
},
{ { ONLP_THERMAL_ID_CREATE(THERMAL_1_ON_CPU_BOARD), "Thermal sensor near CPU (U57, middle)", 0},
ONLP_THERMAL_STATUS_PRESENT,
ONLP_THERMAL_CAPS_ALL, 0, ONLP_THERMAL_THRESHOLD_INIT_DEFAULTS
ONLP_THERMAL_CAPS_ALL, 0, dni_onlp_thermal_threshold(65000,75000,80000)
},
{ { ONLP_THERMAL_ID_CREATE(THERMAL_2_ON_FAN_BOARD), "Thermal sensor near Middle of front vents (U291, Middle)", 0},
ONLP_THERMAL_STATUS_PRESENT,
ONLP_THERMAL_CAPS_ALL, 0, ONLP_THERMAL_THRESHOLD_INIT_DEFAULTS
ONLP_THERMAL_CAPS_ALL, 0, dni_onlp_thermal_threshold(55000,65000,70000)
},
{ { ONLP_THERMAL_ID_CREATE(THERMAL_3_ON_MAIN_BOARD), "Thermal sensor near Left of front vents (U290, Left)", 0},
ONLP_THERMAL_STATUS_PRESENT,
ONLP_THERMAL_CAPS_ALL, 0, ONLP_THERMAL_THRESHOLD_INIT_DEFAULTS
ONLP_THERMAL_CAPS_ALL, 0, dni_onlp_thermal_threshold(45000,55000,60000)
},
{ { ONLP_THERMAL_ID_CREATE(THERMAL_4_ON_MAIN_BOARD), "Thermal sensor near MAC (U288, Middle)", 0},
ONLP_THERMAL_STATUS_PRESENT,
ONLP_THERMAL_CAPS_ALL, 0, ONLP_THERMAL_THRESHOLD_INIT_DEFAULTS
ONLP_THERMAL_CAPS_ALL, 0, dni_onlp_thermal_threshold(70000,80000,85000)
},
{ { ONLP_THERMAL_ID_CREATE(THERMAL_5_ON_MAIN_BOARD), "Thermal sensor near Right of front vents (U289, right)", 0},
ONLP_THERMAL_STATUS_PRESENT,
ONLP_THERMAL_CAPS_ALL, 0, ONLP_THERMAL_THRESHOLD_INIT_DEFAULTS
ONLP_THERMAL_CAPS_ALL, 0, dni_onlp_thermal_threshold(50000,60000,65000)
},
{ { ONLP_THERMAL_ID_CREATE(THERMAL_6_ON_MAIN_BOARD), "Thermal sensor near DC fan (U334, Middle)", 0},
ONLP_THERMAL_STATUS_PRESENT,
ONLP_THERMAL_CAPS_ALL, 0, ONLP_THERMAL_THRESHOLD_INIT_DEFAULTS
ONLP_THERMAL_CAPS_ALL, 0, dni_onlp_thermal_threshold(45000,55000,60000)
},
{ { ONLP_THERMAL_ID_CREATE(THERMAL_1_ON_PSU1), "PSU-1 Thermal Sensor 1", ONLP_PSU_ID_CREATE(PSU1_ID)},
ONLP_THERMAL_STATUS_PRESENT,

View File

@@ -48,6 +48,21 @@ class OnlPlatform_x86_64_delta_ag5648_r0(OnlPlatformDelta,
os.system("echo 0x04 > /sys/bus/i2c/devices/2-0039/addr")
os.system("echo 0x10 > /sys/bus/i2c/devices/2-0039/data")
#set thermal Thigh & Tlow
os.system("echo 80000 > /sys/class/hwmon/hwmon5/temp1_max")
os.system("echo 70000 > /sys/class/hwmon/hwmon6/temp1_max")
os.system("echo 60000 > /sys/class/hwmon/hwmon7/temp1_max")
os.system("echo 85000 > /sys/class/hwmon/hwmon8/temp1_max")
os.system("echo 65000 > /sys/class/hwmon/hwmon9/temp1_max")
os.system("echo 60000 > /sys/class/hwmon/hwmon10/temp1_max")
os.system("echo 75000 > /sys/class/hwmon/hwmon5/temp1_max_hyst")
os.system("echo 65000 > /sys/class/hwmon/hwmon6/temp1_max_hyst")
os.system("echo 55000 > /sys/class/hwmon/hwmon7/temp1_max_hyst")
os.system("echo 80000 > /sys/class/hwmon/hwmon8/temp1_max_hyst")
os.system("echo 60000 > /sys/class/hwmon/hwmon9/temp1_max_hyst")
os.system("echo 55000 > /sys/class/hwmon/hwmon10/temp1_max_hyst")
return True