From 909a7e94bba1cb3787a2b62063930c22a71f5582 Mon Sep 17 00:00:00 2001 From: roylee123 Date: Fri, 22 Dec 2017 10:54:30 +0800 Subject: [PATCH 1/5] Update sonic-platform-modules-accton to lastest Signed-off-by: roylee123 --- platform/broadcom/sonic-platform-modules-accton | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sonic-platform-modules-accton b/platform/broadcom/sonic-platform-modules-accton index 7ba26ec403c7..e66b74fcf7a9 160000 --- a/platform/broadcom/sonic-platform-modules-accton +++ b/platform/broadcom/sonic-platform-modules-accton @@ -1 +1 @@ -Subproject commit 7ba26ec403c7f0d0acb958f794311ac3fd1af9a1 +Subproject commit e66b74fcf7a943d8c7c8f241a8221eca65171ced From c824380d4479898c3ea9ed7156077b6385dffa11 Mon Sep 17 00:00:00 2001 From: roylee123 Date: Thu, 28 Dec 2017 14:08:11 +0800 Subject: [PATCH 2/5] [AS7712-32X] Add fancontrol. Signed-off-by: roylee123 --- device/accton/x86_64-accton_as7712_32x-r0/fancontrol | 9 +++++++++ platform/broadcom/sonic-platform-modules-accton | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 device/accton/x86_64-accton_as7712_32x-r0/fancontrol diff --git a/device/accton/x86_64-accton_as7712_32x-r0/fancontrol b/device/accton/x86_64-accton_as7712_32x-r0/fancontrol new file mode 100644 index 000000000000..9d057024f946 --- /dev/null +++ b/device/accton/x86_64-accton_as7712_32x-r0/fancontrol @@ -0,0 +1,9 @@ +INTERVAL=10 +FCTEMPS=/sys/bus/i2c/devices/2-0066/pwm1=/sys/bus/i2c/devices/2-0066/sys_temp +FCFANS=/sys/bus/i2c/devices/2-0066/pwm1=/sys/bus/i2c/devices/2-0066/fan1_input /sys/bus/i2c/devices/2-0066/pwm1=/sys/bus/i2c/devices/2-0066/fan2_input /sys/bus/i2c/devices/2-0066/pwm1=/sys/bus/i2c/devices/2-0066/fan3_input /sys/bus/i2c/devices/2-0066/pwm1=/sys/bus/i2c/devices/2-0066/fan4_input /sys/bus/i2c/devices/2-0066/pwm1=/sys/bus/i2c/devices/2-0066/fan5_input /sys/bus/i2c/devices/2-0066/pwm1=/sys/bus/i2c/devices/2-0066/fan6_input /sys/bus/i2c/devices/2-0066/pwm1=/sys/bus/i2c/devices/2-0066/fan11_input /sys/bus/i2c/devices/2-0066/pwm1=/sys/bus/i2c/devices/2-0066/fan12_input /sys/bus/i2c/devices/2-0066/pwm1=/sys/bus/i2c/devices/2-0066/fan13_input /sys/bus/i2c/devices/2-0066/pwm1=/sys/bus/i2c/devices/2-0066/fan14_input /sys/bus/i2c/devices/2-0066/pwm1=/sys/bus/i2c/devices/2-0066/fan15_input /sys/bus/i2c/devices/2-0066/pwm1=/sys/bus/i2c/devices/2-0066/fan16_input +MINTEMP=/sys/bus/i2c/devices/2-0066/pwm1=135 +MAXTEMP=/sys/bus/i2c/devices/2-0066/pwm1=160 +MINSTART=/sys/bus/i2c/devices/2-0066/pwm1=100 +MINSTOP=/sys/bus/i2c/devices/2-0066/pwm1=32 +MINPWM=/sys/bus/i2c/devices/2-0066/pwm1=32 +MAXPWM=/sys/bus/i2c/devices/2-0066/pwm1=69 diff --git a/platform/broadcom/sonic-platform-modules-accton b/platform/broadcom/sonic-platform-modules-accton index e66b74fcf7a9..c1dbffde9053 160000 --- a/platform/broadcom/sonic-platform-modules-accton +++ b/platform/broadcom/sonic-platform-modules-accton @@ -1 +1 @@ -Subproject commit e66b74fcf7a943d8c7c8f241a8221eca65171ced +Subproject commit c1dbffde9053f430d3fccb3e9f73066ff8c04b78 From d6283e32af90270ac3504799ec15dcaafd76ebd5 Mon Sep 17 00:00:00 2001 From: roylee123 Date: Fri, 29 Dec 2017 12:01:11 +0800 Subject: [PATCH 3/5] [AS7712-32X] add psuutil.py and sensors.conf Signed-off-by: roylee123 --- .../plugins/psuutil.py | 61 +++++++++++++++++++ .../x86_64-accton_as7712_32x-r0/sensors.conf | 22 +++++++ 2 files changed, 83 insertions(+) create mode 100644 device/accton/x86_64-accton_as7712_32x-r0/plugins/psuutil.py create mode 100644 device/accton/x86_64-accton_as7712_32x-r0/sensors.conf diff --git a/device/accton/x86_64-accton_as7712_32x-r0/plugins/psuutil.py b/device/accton/x86_64-accton_as7712_32x-r0/plugins/psuutil.py new file mode 100644 index 000000000000..d7600a2af4b1 --- /dev/null +++ b/device/accton/x86_64-accton_as7712_32x-r0/plugins/psuutil.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python + +############################################################################# +# Accton +# +# Module contains an implementation of SONiC PSU Base API and +# provides the PSUs status which are available in the platform +# +############################################################################# + +import os.path + +try: + from sonic_psu.psu_base import PsuBase +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +class PsuUtil(PsuBase): + """Platform-specific PSUutil class""" + + def __init__(self): + PsuBase.__init__(self) + + self.psu_path = "/sys/bus/i2c/devices/" + self.psu_presence = "/psu_present" + self.psu_oper_status = "/psu_power_good" + self.psu_mapping = { + 1: "11-0053", + 2: "10-0050", + } + + def get_num_psus(self): + return len(self.psu_mapping) + + def get_psu_status(self, index): + if index is None: + return False + + status = 0 + node = self.psu_path + self.psu_mapping[index]+self.psu_oper_status + try: + with open(node, 'r') as power_status: + status = int(power_status.read()) + except IOError: + return False + + return status == 1 + + def get_psu_presence(self, index): + if index is None: + return False + + status = 0 + node = self.psu_path + self.psu_mapping[index] + self.psu_presence + try: + with open(node, 'r') as presence_status: + status = int(presence_status.read()) + except IOError: + return False + + return status == 1 diff --git a/device/accton/x86_64-accton_as7712_32x-r0/sensors.conf b/device/accton/x86_64-accton_as7712_32x-r0/sensors.conf new file mode 100644 index 000000000000..21e1817916f9 --- /dev/null +++ b/device/accton/x86_64-accton_as7712_32x-r0/sensors.conf @@ -0,0 +1,22 @@ +# libsensors configuration file for AS7712-32X +# ------------------------------------------------ +# + +chip "ym2651-*" + label power1 "PSU Output Power" + label temp1 "Power Supply Temp" + label fan1 "Fan Speed" + +chip "as7712_32x_fan-*" + label fan1 "Fan tray 1 front" + label fan2 "Fan tray 2 front" + label fan3 "Fan tray 3 front" + label fan4 "Fan tray 4 front" + label fan5 "Fan tray 5 front" + label fan6 "Fan tray 6 front" + label fan11 "Fan tray 1 rear" + label fan12 "Fan tray 2 rear" + label fan13 "Fan tray 3 rear" + label fan14 "Fan tray 4 rear" + label fan15 "Fan tray 5 rear" + label fan16 "Fan tray 6 rear" From 3b00b156fd068de629f9cc69686b9a8dedc2b357 Mon Sep 17 00:00:00 2001 From: roylee123 Date: Fri, 29 Dec 2017 13:39:59 +0800 Subject: [PATCH 4/5] Remove 1 reduntant line. Signed-off-by: roylee123 --- platform/broadcom/platform-modules-accton.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/platform/broadcom/platform-modules-accton.mk b/platform/broadcom/platform-modules-accton.mk index c03ca5944246..7dcfb937de63 100755 --- a/platform/broadcom/platform-modules-accton.mk +++ b/platform/broadcom/platform-modules-accton.mk @@ -17,9 +17,8 @@ SONIC_DPKG_DEBS += $(ACCTON_AS7712_32X_PLATFORM_MODULE) ACCTON_AS5712_54X_PLATFORM_MODULE = sonic-platform-accton-as5712-54x_$(ACCTON_AS5712_54X_PLATFORM_MODULE_VERSION)_amd64.deb $(ACCTON_AS5712_54X_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as5712_54x-r0 $(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_AS5712_54X_PLATFORM_MODULE))) -SONIC_DPKG_DEBS += $(ACCTON_AS5712_54X_PLATFORM_MODULE) ACCTON_AS7816_64X_PLATFORM_MODULE = sonic-platform-accton-as7816-64x_$(ACCTON_AS7816_64X_PLATFORM_MODULE_VERSION)_amd64.deb $(ACCTON_AS7816_64X_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as7816_64x-r0 - $(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_AS7816_64X_PLATFORM_MODULE))) + From 9194fcb067d8a7508ffc47e4f17fbb090fbe5547 Mon Sep 17 00:00:00 2001 From: roylee123 Date: Fri, 29 Dec 2017 13:40:42 +0800 Subject: [PATCH 5/5] [AS7712-32X] Change fan driver to support fancontrol. Signed-off-by: roylee123 --- platform/broadcom/sonic-platform-modules-accton | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sonic-platform-modules-accton b/platform/broadcom/sonic-platform-modules-accton index c1dbffde9053..dfff9a88cd94 160000 --- a/platform/broadcom/sonic-platform-modules-accton +++ b/platform/broadcom/sonic-platform-modules-accton @@ -1 +1 @@ -Subproject commit c1dbffde9053f430d3fccb3e9f73066ff8c04b78 +Subproject commit dfff9a88cd94da081e80222872c33859e4132365