From 4b402202ba7aebb3d62dc7c05c9d9eaf857b23ec Mon Sep 17 00:00:00 2001 From: hans Date: Wed, 16 Aug 2017 10:54:46 +0800 Subject: [PATCH] 1. fix the pus voltage value 2. modify the shut down thermal temperature Signed-off-by: hans Signed-off-by: duobliu1 --- .../modules/builds/dni_ag5648_psu.c | 7 +++---- .../onlp/builds/src/module/src/thermali.c | 18 ++++++++++++------ .../python/x86_64_delta_ag5648_r0/__init__.py | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/packages/platforms/delta/x86-64/x86-64-delta-ag5648/modules/builds/dni_ag5648_psu.c b/packages/platforms/delta/x86-64/x86-64-delta-ag5648/modules/builds/dni_ag5648_psu.c index 6c7a1fa1..eae7970e 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-ag5648/modules/builds/dni_ag5648_psu.c +++ b/packages/platforms/delta/x86-64/x86-64-delta-ag5648/modules/builds/dni_ag5648_psu.c @@ -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); } diff --git a/packages/platforms/delta/x86-64/x86-64-delta-ag5648/onlp/builds/src/module/src/thermali.c b/packages/platforms/delta/x86-64/x86-64-delta-ag5648/onlp/builds/src/module/src/thermali.c index 7545b743..22448190 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-ag5648/onlp/builds/src/module/src/thermali.c +++ b/packages/platforms/delta/x86-64/x86-64-delta-ag5648/onlp/builds/src/module/src/thermali.c @@ -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, diff --git a/packages/platforms/delta/x86-64/x86-64-delta-ag5648/platform-config/r0/src/python/x86_64_delta_ag5648_r0/__init__.py b/packages/platforms/delta/x86-64/x86-64-delta-ag5648/platform-config/r0/src/python/x86_64_delta_ag5648_r0/__init__.py index 490bc6bf..336790ff 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-ag5648/platform-config/r0/src/python/x86_64_delta_ag5648_r0/__init__.py +++ b/packages/platforms/delta/x86-64/x86-64-delta-ag5648/platform-config/r0/src/python/x86_64_delta_ag5648_r0/__init__.py @@ -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