def __init__(self, psu_index): PsuBase.__init__(self) # PSU is 1-based in DellEMC platforms self.index = psu_index + 1 self.psu_presence_reg = "psu{}_prs".format(psu_index) self.psu_status_reg = "powersupply_status" self.is_driver_initialized = False if self.index == 1: ltc_dir = self.I2C_DIR + "i2c-11/11-0042/hwmon/" else: ltc_dir = self.I2C_DIR + "i2c-11/11-0040/hwmon/" try: hwmon_node = os.listdir(ltc_dir)[0] except OSError: hwmon_node = "hwmon*" else: self.is_driver_initialized = True self.HWMON_DIR = ltc_dir + hwmon_node + '/' self.psu_voltage_reg = self.HWMON_DIR + "in1_input" self.psu_current_reg = self.HWMON_DIR + "curr1_input" self.psu_power_reg = self.HWMON_DIR + "power1_input" self.eeprom = Eeprom(is_psu=True, psu_index=self.index) self._fan_list.append(Fan(self.index, psu_fan=True, dependency=self))
def __init__(self, psu_index): PsuBase.__init__(self) self.index = psu_index for fan_index in range(0, PSU_NUM_FAN[self.index]): fan = Fan(fan_index, 0, is_psu_fan=True, psu_index=self.index) self._fan_list.append(fan) self._api_helper = APIHelper()
def __init__(self, index): PsuBase.__init__(self) self.__index = index self.__info = None self.__ts = 0 # STUB IMPLEMENTATION self.color = ""
def __init__(self, psu_index): PsuBase.__init__(self) # PSU is 1-based in DellEMC platforms self.index = psu_index + 1 self.state_sensor = IpmiSensor( self.SENSOR_MAPPING[self.index]["State"], is_discrete=True) self.voltage_sensor = IpmiSensor( self.SENSOR_MAPPING[self.index]["Voltage"]) self.current_sensor = IpmiSensor( self.SENSOR_MAPPING[self.index]["Current"]) self.power_sensor = IpmiSensor( self.SENSOR_MAPPING[self.index]["Power"]) self.input_voltage_sensor = IpmiSensor( self.SENSOR_MAPPING[self.index]["InVoltage"]) self.input_current_sensor = IpmiSensor( self.SENSOR_MAPPING[self.index]["InCurrent"]) self.input_power_sensor = IpmiSensor( self.SENSOR_MAPPING[self.index]["InPower"]) self.temp_sensor = IpmiSensor( self.SENSOR_MAPPING[self.index]["Temperature"]) self.psu_type_offset = PSU_TYPE_OFFSET self.fru = IpmiFru(self.FRU_MAPPING[self.index]) self._fan_list.append( Fan(fan_index=self.index, psu_fan=True, dependency=self))
def __init__(self, psu_index): self.PSU_TEMP_MAX = 85 * 1000 self.PSU_OUTPUT_POWER_MAX = 1300 * 1000 self.PSU_OUTPUT_VOLTAGE_MIN = 11400 self.PSU_OUTPUT_VOLTAGE_MAX = 12600 self.index = psu_index PsuBase.__init__(self)
def __init__(self, psu_index, platform): global psu_list PsuBase.__init__(self) # PSU is 1-based on Mellanox platform self.index = psu_index + 1 psu_list.append(self.index) self.psu_path = "/var/run/hw-management/" psu_oper_status = "thermal/psu{}_pwr_status".format(self.index) #psu_oper_status should always be present for all platforms self.psu_oper_status = os.path.join(self.psu_path, psu_oper_status) self._name = "PSU{}".format(psu_index + 1) if platform in platform_dict_psu: filemap = psu_profile_list[platform_dict_psu[platform]] else: filemap = psu_profile_list[0] self.psu_data = DEVICE_DATA[platform]['psus'] if not self.psu_data['hot_swappable']: self.always_present = True self.psu_voltage = None self.psu_current = None self.psu_power = None self.psu_presence = None self.psu_temp = None self.psu_temp_threshold = None else: self.always_present = False psu_voltage = filemap[PSU_VOLTAGE].format(self.index) psu_voltage = os.path.join(self.psu_path, psu_voltage) self.psu_voltage = psu_voltage psu_current = filemap[PSU_CURRENT].format(self.index) psu_current = os.path.join(self.psu_path, psu_current) self.psu_current = psu_current psu_power = filemap[PSU_POWER].format(self.index) psu_power = os.path.join(self.psu_path, psu_power) self.psu_power = psu_power psu_presence = "thermal/psu{}_status".format(self.index) psu_presence = os.path.join(self.psu_path, psu_presence) self.psu_presence = psu_presence self.psu_temp = os.path.join( self.psu_path, 'thermal/psu{}_temp'.format(self.index)) self.psu_temp_threshold = os.path.join( self.psu_path, 'thermal/psu{}_temp_max'.format(self.index)) # unplugable PSU has no FAN if self.psu_data['hot_swappable']: fan = Fan(psu_index, None, True) self._fan_list.append(fan) if self.psu_data['led_num'] == 1: self.led = ComponentFaultyIndicator(Psu.get_shared_led()) else: # 2010/2100 self.led = PsuLed(self.index)
def __init__(self, index, conf=None, fan_conf=None): PsuBase.__init__(self) self._psu_index = index self._config = conf self._api_common = Common(self._config) self._fan_conf = fan_conf self._initialize_psu_fan()
def __init__(self, psu_index): PsuBase.__init__(self) # PSU is 1-based in Nokia platforms self.index = psu_index + 1 self._fan_list = [] # PSU eeprom self.eeprom = Eeprom(is_psu=True, psu_index=self.index)
def __init__(self, index, psu_index=0, conf=None): PsuBase.__init__(self) self.psu_index = index self._config = conf self._api_common = Common() self._name = self.get_name()
def __init__(self, psu_index, sku): global psu_list PsuBase.__init__(self) # PSU is 1-based on Mellanox platform self.index = psu_index + 1 psu_list.append(self.index) self.psu_path = "/var/run/hw-management/" psu_oper_status = "thermal/psu{}_pwr_status".format(self.index) #psu_oper_status should always be present for all SKUs self.psu_oper_status = os.path.join(self.psu_path, psu_oper_status) self._name = "PSU{}".format(psu_index + 1) if sku in hwsku_dict_psu: filemap = psu_profile_list[hwsku_dict_psu[sku]] else: filemap = psu_profile_list[0] if sku in hwsku_dict_with_unplugable_psu: self.always_presence = True self.psu_voltage = None self.psu_current = None self.psu_power = None self.psu_presence = None self.psu_temp = None self.psu_temp_threshold = None else: self.always_presence = False psu_voltage = filemap[PSU_VOLTAGE].format(self.index) psu_voltage = os.path.join(self.psu_path, psu_voltage) self.psu_voltage = psu_voltage psu_current = filemap[PSU_CURRENT].format(self.index) psu_current = os.path.join(self.psu_path, psu_current) self.psu_current = psu_current psu_power = filemap[PSU_POWER].format(self.index) psu_power = os.path.join(self.psu_path, psu_power) self.psu_power = psu_power psu_presence = "thermal/psu{}_status".format(self.index) psu_presence = os.path.join(self.psu_path, psu_presence) self.psu_presence = psu_presence self.psu_temp = os.path.join( self.psu_path, 'thermal/psu{}_temp'.format(self.index)) self.psu_temp_threshold = os.path.join( self.psu_path, 'thermal/psu{}_temp_max'.format(self.index)) # unplugable PSU has no FAN if sku not in hwsku_dict_with_unplugable_psu: fan = Fan(False, psu_index, psu_index, True) self._fan_list.append(fan) self.psu_green_led_path = "led_psu_green" self.psu_red_led_path = "led_psu_red" self.psu_orange_led_path = "led_psu_orange" self.psu_led_cap_path = "led_psu_capability"
def __init__(self, index): PsuBase.__init__(self) fan = Fan(index, True) self._fan_list.append(fan) self.psu_index_mapping = { 1: 39, 2: 49, } self.psu_powerin_index_mapping = { 1: 38, 2: 48, } self.psu_currentout_index_mapping = { 1: 36, 2: 46, } self.psu_currentin_index_mapping = { 1: 35, 2: 45, } self.psu_voltageout_index_mapping = { 1: 44, 2: 54, } self.psu_voltagein_index_mapping = { 1: 43, 2: 53, } self.index = index self.psu_presence_attr = "power{}_present".format( self.psu_index_mapping[self.index]) self.psu_status_attr = "curr{}_input".format( self.psu_currentout_index_mapping[self.index]) self.psu_power_in_attr = "power{}_input".format( self.psu_powerin_index_mapping[self.index]) self.psu_power_out_attr = "power{}_input".format( self.psu_index_mapping[self.index]) self.psu_voltage_out_attr = "in{}_input".format( self.psu_voltageout_index_mapping[self.index]) self.psu_current_out_attr = "curr{}_input".format( self.psu_currentout_index_mapping[self.index]) self.psu_voltage_in_attr = "in{}_input".format( self.psu_voltagein_index_mapping[self.index]) self.psu_current_in_attr = "curr{}_input".format( self.psu_currentin_index_mapping[self.index]) self.psu_serial_attr = "power{}_sn".format( self.psu_index_mapping[self.index]) self.psu_model_attr = "power{}_model".format( self.psu_index_mapping[self.index]) self.psu_mfr_id_attr = "power{}_mfrid".format( self.psu_index_mapping[self.index]) self.psu_capacity_attr = "power{}_pout_max".format( self.psu_index_mapping[self.index]) self.psu_type_attr = "power{}_vin_type".format( self.psu_index_mapping[self.index])
def __init__(self, psu_index=0): PsuBase.__init__(self) self.index = psu_index self.i2c_num = PSU_HWMON_I2C_MAPPING[self.index]["num"] self.i2c_addr = PSU_HWMON_I2C_MAPPING[self.index]["addr"] self.hwmon_path = I2C_PATH.format(self.i2c_num, self.i2c_addr) self.i2c_num = PSU_CPLD_I2C_MAPPING[self.index]["num"] self.i2c_addr = PSU_CPLD_I2C_MAPPING[self.index]["addr"] self.cpld_path = I2C_PATH.format(self.i2c_num, self.i2c_addr)
def __init__(self, psu_index=0): PsuBase.__init__(self) self.index = psu_index bus = PSU_HWMON_I2C_MAPPING[self.index]["bus"] addr = PSU_HWMON_I2C_MAPPING[self.index]["addr"] self.hwmon_path = I2C_PATH.format(bus, addr) bus = PSU_CPLD_I2C_MAPPING[self.index]["bus"] addr = PSU_CPLD_I2C_MAPPING[self.index]["addr"] self.cpld_path = I2C_PATH.format(bus, addr) self.__initialize_fan()
def __init__(self, psu_index): PsuBase.__init__(self) self.index = psu_index + 1 # PSU is 1-based in DellEMC platforms self.psu_presence_reg = "psu{}_prs".format(psu_index) self.psu_status = "psu{}_status".format(psu_index) self.eeprom = "/sys/bus/i2c/devices/{}-0056/eeprom".format(10+psu_index) self.psu_voltage_reg = 'in3_input' self.psu_current_reg = 'curr2_input' self.psu_power_reg = 'power2_input' self.dps_hwmon = "/sys/bus/i2c/devices/{}-005e/hwmon/".format(10 + psu_index) self.dps_hwmon_exist = os.path.exists(self.dps_hwmon) self._fan_list.append(Fan(fan_index=self.index, psu_fan=True, dependency=self))
def __init__(self, psu_index): PsuBase.__init__(self) # PSU is 1-based in DellEMC platforms self.index = psu_index + 1 self.state_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["State"], is_discrete=True) self.voltage_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["Voltage"]) self.current_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["Current"]) self.power_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["Power"]) self.fru = IpmiFru(self.FRU_MAPPING[self.index]) self._fan_list.append(Fan(fan_index=self.index, psu_fan=True, dependency=self))
def __init__(self, psu_index): global psu_list PsuBase.__init__(self) # PSU is 1-based on Mellanox platform self.index = psu_index + 1 psu_list.append(psu_index) self.psu_path = "/var/run/hw-management/thermal/" self.psu_oper_status = "psu{}_pwr_status".format(self.index) self.psu_presence = "psu{}_status".format(self.index) if os.path.exists(os.path.join(self.psu_path, self.psu_presence)): self.presence_file_exists = True else: self.presence_file_exists = False
def __init__(self, psu_index): PsuBase.__init__(self) self.index = psu_index self.psu_path = "/sys/devices/platform/e1031.smc/" self.psu_presence = "psu{}_prs" self.psu_oper_status = "psu{}_status" self.i2c_num = PSU_I2C_MAPPING[self.index]["num"] self.i2c_addr = PSU_I2C_MAPPING[self.index]["addr"] self.hwmon_path = HWMON_PATH.format(self.i2c_num, self.i2c_addr) for fan_index in range(0, PSU_NUM_FAN[self.index]): fan = Fan(fan_index, 0, is_psu_fan=True, psu_index=self.index) self._fan_list.append(fan) PsuBase.__init__(self)
def __init__(self, psu_index): PsuBase.__init__(self) self.index = psu_index self.green_led_path = GREEN_LED_PATH.format(self.index + 1) self.dx010_psu_gpio = [{ 'base': self.get_gpio_base() }, { 'prs': 27, 'status': 22 }, { 'prs': 28, 'status': 25 }]
def __init__(self, psu_index): global psu_list PsuBase.__init__(self) # PSU is 1-based on Mellanox platform self.index = psu_index + 1 psu_list.append(psu_index) self.psu_path = "/var/run/hw-management/thermal/" self.psu_oper_status = "psu{}_pwr_status".format(self.index) self.psu_presence = "psu{}_status".format(self.index) if os.path.exists(os.path.join(self.psu_path, self.psu_presence)): self.presence_file_exists = True else: self.presence_file_exists = False
def __init__(self, index, info_list, is_bmc): PsuBase.__init__(self) self.index = index self.is_bmc = is_bmc self.attr_path = info_list[0] self.status_path = info_list[1] if is_bmc: speed_file = self.attr_path + 'psu{}_fan_speed'.format(index + 1) else: speed_file = self.attr_path + 'psu_fan_speed_1' fan = Fan(index, 0, [self.status_path, speed_file], True) self._fan_list.append(fan) self.psu_name = "PSU{}".format(self.index + 1)
def __init__(self, psu_index=0): PsuBase.__init__(self) self.index = psu_index self._api_helper = APIHelper() self.i2c_num = PSU_HWMON_I2C_MAPPING[self.index]["num"] self.i2c_addr = PSU_HWMON_I2C_MAPPING[self.index]["addr"] self.hwmon_path = I2C_PATH.format(self.i2c_num, self.i2c_addr) self.i2c_num = PSU_CPLD_I2C_MAPPING[self.index]["num"] self.i2c_addr = PSU_CPLD_I2C_MAPPING[self.index]["addr"] self.cpld_path = I2C_PATH.format(self.i2c_num, self.i2c_addr) self.__initialize_fan() '''
def __init__(self, index, pddf_data=None, pddf_plugin_data=None): PsuBase.__init__(self) if not pddf_data or not pddf_plugin_data: raise ValueError('PDDF JSON data error') self.pddf_obj = pddf_data self.plugin_data = pddf_plugin_data self.platform = self.pddf_obj.get_platform() self.psu_index = index + 1 self._fan_list = [] # _fan_list under PsuBase class is a global variable, hence we need to use _fan_list per class instatiation self.num_psu_fans = int(self.pddf_obj.get_num_psu_fans('PSU{}'.format(index+1))) for psu_fan_idx in range(self.num_psu_fans): psu_fan = Fan(0, psu_fan_idx, pddf_data, pddf_plugin_data, True, self.psu_index) self._fan_list.append(psu_fan)
def __init__(self, psu_index): PsuBase.__init__(self) self.psuled = None fan = PsuFan(psu_index) self._fan_list.append(fan) self.index = psu_index + 1 self.psu_drv = "yesm1300am" self.psu_path = "/sys/bus/i2c/devices/" self.psu_presence = { 1: "/psu1_present", 2: "/psu2_present", } self.psu_oper_status = { 1: "/psu1_power_good", 2: "/psu2_power_good", } self.psu_model_name = "/psu_model_name" self.psu_serial_num = "/psu_serial_num" self.psu_mfr_id = "/psu_mfr_id" self.psu_v_out = "/psu_v_out" self.psu_i_out = "/psu_i_out" self._PSU_EEPROM_SERIAL_NUM_OFFSET = 0x35 self._PSU_EEPROM_SERIAL_NUM_LENGTH = 19 self.psu_mapping = "0-005e" if not os.path.exists(self.psu_path + self.psu_mapping): self.psu_mapping = "1-005e" if os.path.exists(self.psu_path + "9-0050"): self.psu_eeprom_mapping = { 1: "9-0050", 2: "10-0051", } self.psu_pmbus_mapping = { 1: "9-0058", 2: "10-0059", } self.psu_serial_num = "/eeprom" else: self.psu_eeprom_mapping = { 1: "32-0050", 2: "33-0051", } self.psu_pmbus_mapping = { 1: "32-0058", 2: "33-0059", }
def __init__(self, psu_index): PsuBase.__init__(self) self._api_common = Common() self.index = psu_index self.psu_presence = "psu{}_prs" self.psu_oper_status = "psu{}_status" self.i2c_num = PSU_I2C_MAPPING[self.index]["num"] self.i2c_addr = PSU_I2C_MAPPING[self.index]["addr"] self.hwmon_path = HWMON_PATH.format(self.i2c_num, self.i2c_addr) self.eeprom_addr = PSU_EEPROM_PATH.format( self.i2c_num, PSU_I2C_MAPPING[self.index]["eeprom_addr"]) for fan_index in range(0, PSU_NUM_FAN[self.index]): fan = Fan(fan_index, 0, is_psu_fan=True, psu_index=self.index) self._fan_list.append(fan)
def __init__(self, psu_index): PsuBase.__init__(self) self.index = psu_index self._api_helper = APIHelper() self.green_led_path = GREEN_LED_PATH.format(self.index+1) self.dx010_psu_gpio = [ {'base': self.__get_gpio_base()}, {'prs': 27, 'status': 22}, {'prs': 28, 'status': 25} ] self.i2c_num = PSU_I2C_MAPPING[self.index]["num"] self.i2c_addr = PSU_I2C_MAPPING[self.index]["addr"] self.hwmon_path = HWMON_PATH.format(self.i2c_num, self.i2c_addr) for fan_index in range(0, PSU_NUM_FAN[self.index]): fan = Fan(fan_index, 0, is_psu_fan=True, psu_index=self.index) self._fan_list.append(fan)
def __init__(self, index, pddf_data=None, pddf_plugin_data=None): PsuBase.__init__(self) if not pddf_data or not pddf_plugin_data: raise ValueError('PDDF JSON data error') self.pddf_obj = pddf_data self.plugin_data = pddf_plugin_data self.platform = self.pddf_obj.get_platform() self.psu_index = index + 1 self.num_psu_fans = int( self.pddf_obj.get_num_psu_fans('PSU{}'.format(index + 1))) for psu_fan_idx in range(self.num_psu_fans): psu_fan = Fan(0, psu_fan_idx, pddf_data, pddf_plugin_data, True, self.psu_index) self._fan_list.append(psu_fan)
def __init__(self, psu_index): PsuBase.__init__(self) # PSU is 1-based in DellEMC platforms self.index = psu_index + 1 self.psu_presence_reg = "psu{}_presence".format(self.index) self.psu_serialno_reg = "psu{}_serialno".format(self.index) if self.index == 1: self.psu_voltage_reg = "in30_input" self.psu_current_reg = "curr602_input" self.psu_power_reg = "power2_input" elif self.index == 2: self.psu_voltage_reg = "in32_input" self.psu_current_reg = "curr702_input" self.psu_power_reg = "power4_input" # Passing True to specify it is a PSU fan psu_fan = Fan(fan_index=self.index, psu_fan=True) self._fan_list.append(psu_fan)
def __init__(self, psu_index, sku): global psu_list PsuBase.__init__(self) # PSU is 1-based on Mellanox platform self.index = psu_index + 1 psu_list.append(self.index) self.psu_path = "/var/run/hw-management/" psu_oper_status = "thermal/psu{}_pwr_status".format(self.index) #psu_oper_status should always be present for all SKUs self.psu_oper_status = os.path.join(self.psu_path, psu_oper_status) self._name = "PSU{}".format(psu_index + 1) if sku in hwsku_dict_psu: filemap = psu_profile_list[hwsku_dict_psu[sku]] else: filemap = psu_profile_list[0] if sku in hwsku_dict_with_unplugable_psu: self.always_presence = True self.psu_voltage = None self.psu_current = None self.psu_power = None self.psu_presence = None else: self.always_presence = False psu_voltage = filemap[PSU_VOLTAGE].format(self.index) psu_voltage = os.path.join(self.psu_path, psu_voltage) self.psu_voltage = psu_voltage psu_current = filemap[PSU_CURRENT].format(self.index) psu_current = os.path.join(self.psu_path, psu_current) self.psu_current = psu_current psu_power = filemap[PSU_POWER].format(self.index) psu_power = os.path.join(self.psu_path, psu_power) self.psu_power = psu_power psu_presence = "thermal/psu{}_status".format(self.index) psu_presence = os.path.join(self.psu_path, psu_presence) self.psu_presence = psu_presence fan = Fan(sku, psu_index, psu_index, True) if fan.get_presence(): self._fan_list.append(fan)
def __init__(self, psu_index): PsuBase.__init__(self) # initialize PSU Fan fan = Fan(psu_index, True) self._fan_list.append(fan) self.index = psu_index + 1 self.pus_type = "AC" # driver attribute self.psu_presence = "/psu{}_present".format(psu_index + 1) self.psu_oper_status = "/psu{}_power_good".format(psu_index + 1) self.psu_model_name = "/psu_model_name" self.psu_mfr_id = "/psu_mfr_id" self.psu_v_in = "/psu_v_in" self.psu_v_out = "/psu_v_out" self.psu_i_in = "/psu_i_in" self.psu_i_out = "/psu_i_out" self.psu_p_in = "/psu_p_in" self.psu_p_out = "/psu_p_out" self.psu_temp1_input = "/psu_temp1_input" self.psu_mfr_pout_max = "/psu_mfr_pout_max" self.psu_serial_num = "/eeprom" # psu eeprom info self._PSU_EEPROM_SERIAL_NUM_OFFSET = 0x35 self._PSU_EEPROM_SERIAL_NUM_LENGTH = 19 # driver path psu_bus_num = [10, 11] psu_eeprom_address = [50, 51] psu_pmbus_address = [58, 59] psu_path = "/sys/bus/i2c/devices/" self.psu_mapping = psu_path + "1-005e" self.psu_eeprom = psu_path + "{}-00{}".format( psu_bus_num[psu_index], psu_eeprom_address[psu_index]) self.psu_pmbus = psu_path + "{}-00{}".format( psu_bus_num[psu_index], psu_pmbus_address[psu_index])
def __init__(self, psu_index): PsuBase.__init__(self) self.index = psu_index self.psu_path = "/sys/devices/platform/e1031.smc/" self.psu_presence = "psu{}_prs" self.psu_oper_status = "psu{}_status"
def __init__(self, psu_index): self.index = psu_index PsuBase.__init__(self)