-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[platform]: As7712 32x add fancontrol (#1270)
* Update sonic-platform-modules-accton to lastest Signed-off-by: roylee123 <roy_lee@accton.com> * [AS7712-32X] Add fancontrol. Signed-off-by: roylee123 <roy_lee@accton.com> * [AS7712-32X] add psuutil.py and sensors.conf Signed-off-by: roylee123 <roy_lee@accton.com> * Remove 1 reduntant line. Signed-off-by: roylee123 <roy_lee@accton.com> * [AS7712-32X] Change fan driver to support fancontrol. Signed-off-by: roylee123 <roy_lee@accton.com>
- Loading branch information
Showing
5 changed files
with
94 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
61 changes: 61 additions & 0 deletions
61
device/accton/x86_64-accton_as7712_32x-r0/plugins/psuutil.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule sonic-platform-modules-accton
updated
1 files
+347 −82 | as7712-32x/modules/accton_as7712_32x_fan.c |