-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DellEMC S6100 : Platform2.0 API implementation for PSU (#3132)
- Loading branch information
1 parent
9764589
commit e520cbe
Showing
6 changed files
with
487 additions
and
6 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
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
42 changes: 42 additions & 0 deletions
42
platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/fan.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,42 @@ | ||
#!/usr/bin/env python | ||
|
||
######################################################################## | ||
# DellEMC | ||
# | ||
# Module contains an implementation of SONiC Platform Base API and | ||
# provides the Fans' information which are available in the platform | ||
# | ||
######################################################################## | ||
|
||
|
||
try: | ||
import os | ||
from sonic_platform_base.fan_base import FanBase | ||
except ImportError as e: | ||
raise ImportError(str(e) + "- required module not found") | ||
|
||
|
||
MAX_S6100_PSU_FAN_SPEED = 18000 | ||
MAX_S6100_FAN_SPEED = 16000 | ||
|
||
|
||
class Fan(FanBase): | ||
"""DellEMC Platform-specific FAN class""" | ||
|
||
HWMON_DIR = "/sys/devices/platform/SMF.512/hwmon/" | ||
HWMON_NODE = os.listdir(HWMON_DIR)[0] | ||
MAILBOX_DIR = HWMON_DIR + HWMON_NODE | ||
|
||
def __init__(self, fan_index, psu_fan=False): | ||
self.is_psu_fan = psu_fan | ||
if not self.is_psu_fan: | ||
# Fan is 1-based in DellEMC platforms | ||
self.index = fan_index + 1 | ||
self.get_fan_speed_reg = "fan{}_input".format(2*self.index - 1) | ||
self.max_fan_speed = MAX_S6100_FAN_SPEED | ||
else: | ||
# PSU Fan index starts from 11 | ||
self.index = fan_index + 10 | ||
self.get_fan_speed_reg = "fan{}_input".format(self.index) | ||
self.max_fan_speed = MAX_S6100_PSU_FAN_SPEED | ||
|
Oops, something went wrong.