Ejemplo n.º 1
0
 def __init__(self, thermal_index):
     ThermalBase.__init__(self)
     self.index = thermal_index + 1
     temp_hwmon = '/sys/bus/i2c/devices/' + self.SENSOR_MAPPING[
         thermal_index][1] + '/hwmon'
     self.temp_file = temp_hwmon + '/' + os.listdir(
         temp_hwmon)[0] + '/' + 'temp1_input'
Ejemplo n.º 2
0
    def __init__(self, thermal_index):
        ThermalBase.__init__(self)
        self.is_cpu_thermal = False
        self.index = thermal_index + 1

        if self.index < 5:
            hwmon_temp_index = self.index
            dev_path = "/sys/devices/platform/SMF.512/hwmon/"
        else:
            hwmon_temp_index = self.index - 3
            self.is_cpu_thermal = True
            dev_path = "/sys/devices/platform/coretemp.0/hwmon/"

        hwmon_node = os.listdir(dev_path)[0]
        self.HWMON_DIR = dev_path + hwmon_node + '/'

        self.thermal_status_file = self.HWMON_DIR \
            + "temp{}_alarm".format(hwmon_temp_index)
        self.thermal_temperature_file = self.HWMON_DIR \
            + "temp{}_input".format(hwmon_temp_index)
        self.thermal_high_threshold_file = self.HWMON_DIR \
            + "temp{}_max".format(hwmon_temp_index)
        self.thermal_low_threshold_file = self.HWMON_DIR \
            + "temp{}_min".format(hwmon_temp_index)

        if not self.is_cpu_thermal:
            self.thermal_high_crit_threshold_file = self.HWMON_DIR \
                + "temp{}_crit".format(hwmon_temp_index)
Ejemplo n.º 3
0
    def __init__(self, thermal_index):
        ThermalBase.__init__(self)
        self.index = thermal_index
        # driver path
        tmp_bus_num = [1, 4, 5]
        tmp_address = ["4f", "4d", "4c"]

        self.tmp_node = "/sys/bus/i2c/devices/{}-00{}/hwmon/".format(
            tmp_bus_num[self.index], tmp_address[self.index])
Ejemplo n.º 4
0
 def __init__(self, thermal_index, airflow):
     ThermalBase.__init__(self)
     self.index = thermal_index
     self._api_helper = APIHelper()
     self._airflow = airflow
     self._thermal_info = THERMAL_INFO[self.index]
     self._hwmon_path = "{}/{}".format(I2C_ADAPTER_PATH,
                                       self._thermal_info["i2c_path"])
     self.name = self.get_name()
     self.postion = self._thermal_info["postion"]
     self.ss_index = 1
Ejemplo n.º 5
0
    def __init__(self, thermal_index):
        ThermalBase.__init__(self)
        self.index = thermal_index + 1
        self.is_psu_thermal = False
        self.dependency = None
        self._minimum = None
        self._maximum = None
        self.thermal_high_threshold_file = None
        # PCB temperature sensors
        if self.index < 3:
            i2c_path = self.I2C_CLASS_DIR + self.I2C_DEV_MAPPING[self.index -
                                                                 1][0]
            sensor_index = self.I2C_DEV_MAPPING[self.index - 1][1]
            sensor_max_suffix = "max"
            sensor_crit_suffix = None
            hwmon_node = os.listdir(i2c_path)[0]
            self.SENSOR_DIR = i2c_path + hwmon_node + '/'

        # ADT7473 temperature sensors
        elif self.index < 6:
            i2c_path = self.I2C_CLASS_DIR + self.I2C_DEV_MAPPING[self.index -
                                                                 1][0]
            sensor_index = self.I2C_DEV_MAPPING[self.index - 1][1]
            sensor_max_suffix = "max"
            sensor_crit_suffix = "crit"
            self.SENSOR_DIR = i2c_path

        # Armada 38x SOC temperature sensor
        else:
            dev_path = self.HWMON_CLASS_DIR
            sensor_index = 1
            sensor_max_suffix = None
            sensor_crit_suffix = None
            hwmon_node = os.listdir(dev_path)[0]
            self.SENSOR_DIR = dev_path + hwmon_node + '/'

        # sysfs file for current temperature value
        self.thermal_temperature_file = self.SENSOR_DIR \
            + "temp{}_input".format(sensor_index)

        # sysfs file for high threshold value if supported for this sensor
        if sensor_max_suffix:
            self.thermal_high_threshold_file = self.SENSOR_DIR \
                + "temp{}_{}".format(sensor_index, sensor_max_suffix)
        else:
            self.thermal_high_threshold_file = None

        # sysfs file for crit high threshold value if supported for this sensor
        if sensor_crit_suffix:
            self.thermal_high_crit_threshold_file = self.SENSOR_DIR \
                + "temp{}_{}".format(sensor_index, sensor_crit_suffix)
        else:
            self.thermal_high_crit_threshold_file = None
Ejemplo n.º 6
0
    def __init__(self, thermal_index, airflow):
        ThermalBase.__init__(self)
        self.index = thermal_index
        self._api_common = Common()

        self._airflow = airflow
        self._thermal_info = THERMAL_INFO[self.index]
        self._hwmon_path = self._get_hwmon_path()
        self._ss_index = self._thermal_info["ss_index"]

        self.name = self.get_name()
        self.postion = self._thermal_info["postion"]
Ejemplo n.º 7
0
    def __init__(self, thermal_index):
        self.index = thermal_index

        # Add thermal name
        self.THERMAL_NAME_LIST.append("Top-Rear")
        self.THERMAL_NAME_LIST.append("Top-Front")
        self.THERMAL_NAME_LIST.append("Right-Front")
        self.THERMAL_NAME_LIST.append("Top-Center")
        self.THERMAL_NAME_LIST.append("Left-Front")
        self.THERMAL_NAME_LIST.append("Bottom-Front")
        self.THERMAL_NAME_LIST.append("Bottom-Rear")
        ThermalBase.__init__(self)
Ejemplo n.º 8
0
    def __init__(self, thermal_index):
        self.index = thermal_index

        # Add thermal name
        self.THERMAL_NAME_LIST.append("Switch")
        self.THERMAL_NAME_LIST.append("UFRNT1")
        self.THERMAL_NAME_LIST.append("UFRNT2")
        self.THERMAL_NAME_LIST.append("UFRNT3")
        self.THERMAL_NAME_LIST.append("UFRNT4")
        self.THERMAL_NAME_LIST.append("UREAR1")
        self.THERMAL_NAME_LIST.append("UCPUB")
        self.THERMAL_NAME_LIST.append("UFANB")
        ThermalBase.__init__(self)
Ejemplo n.º 9
0
    def __init__(self,
                 thermal_index,
                 psu_index=1,
                 psu_thermal=False,
                 dependency=None):
        ThermalBase.__init__(self)
        self.is_psu_thermal = psu_thermal
        self.dependency = dependency
        self.is_driver_initialized = True

        if self.is_psu_thermal:
            self.index = (2 * psu_index) + thermal_index + 2
        else:
            # CPU thermal
            if thermal_index > 3:
                self.index = thermal_index + 5
            else:
                self.index = thermal_index + 1

        if self.index < 9:
            i2c_path = self.I2C_DIR + self.I2C_DEV_MAPPING[self.index - 1][0]
            hwmon_temp_index = self.I2C_DEV_MAPPING[self.index - 1][1]
            hwmon_temp_suffix = "max"
            try:
                hwmon_node = os.listdir(i2c_path)[0]
            except OSError:
                hwmon_node = "hwmon*"
                self.is_driver_initialized = False

            self.HWMON_DIR = i2c_path + hwmon_node + '/'

            if self.index == 4:
                hwmon_temp_suffix = "crit"
        else:
            dev_path = "/sys/devices/platform/coretemp.0/hwmon/"
            hwmon_temp_index = self.index - 7
            hwmon_temp_suffix = "crit"
            try:
                hwmon_node = os.listdir(dev_path)[0]
            except OSError:
                hwmon_node = "hwmon*"
                self.is_driver_initialized = False

            self.HWMON_DIR = dev_path + hwmon_node + '/'

        self.thermal_temperature_file = self.HWMON_DIR \
            + "temp{}_input".format(hwmon_temp_index)
        self.thermal_high_threshold_file = self.HWMON_DIR \
            + "temp{}_{}".format(hwmon_temp_index, hwmon_temp_suffix)
        self.thermal_low_threshold_file = self.HWMON_DIR \
            + "temp{}_min".format(hwmon_temp_index)
Ejemplo n.º 10
0
    def __init__(self, temp_index):
        self.index = temp_index + 1

        if os.path.exists("/sys/bus/i2c/devices/3-004d/hwmon/") == False:
            temp_node_map = {
                1: "/sys/bus/i2c/devices/0-004f/hwmon/",
                2: "/sys/bus/i2c/devices/18-004d/hwmon/",
                3: "/sys/bus/i2c/devices/19-004c/hwmon/"
            }

            temp_name_map = {
                1: "lm75-i2c-0-004f",
                2: "lm75-i2c-18-004d",
                3: "lm75-i2c-19-004c"
            }

        ThermalBase.__init__(self)
Ejemplo n.º 11
0
    def __init__(self, thermal_index, airflow):
        ThermalBase.__init__(self)
        self.index = thermal_index
        self._api_helper = APIHelper()
        self._airflow = airflow
        self._thermal_info = THERMAL_INFO[self.index]

        self._i2c_hwmon_path = "{}/{}".format(I2C_ADAPTER_PATH,
                                              self._thermal_info["i2c_path"])
        self._hwmon_path = os.path.join(
            self._i2c_hwmon_path, self.__get_hwmon_name(self._i2c_hwmon_path))
        self.name = self.get_name()
        self.postion = self._thermal_info["postion"]
        self.ss_index = 1

        self.minimum_thermal = self.get_temperature()
        self.maximum_thermal = self.get_temperature()
Ejemplo n.º 12
0
    def __init__(self, thermal_index):
        ThermalBase.__init__(self)

        self.index = thermal_index

        # Add thermal name
        self.THERMAL_NAME_LIST.append("Rear  panel-Inlet ambient sensor")
        self.THERMAL_NAME_LIST.append("Rear  panel-Helix shutdown sensor")
        self.THERMAL_NAME_LIST.append(
            "Front panel-Inlet ambient sensor (right)")
        self.THERMAL_NAME_LIST.append("Front panel-Helix shutdown sensor")
        self.THERMAL_NAME_LIST.append(
            "Front panel-Inlet ambient sensor (left)")
        self.THERMAL_NAME_LIST.append("CPU board temperature sensor : 1")
        self.THERMAL_NAME_LIST.append("CPU board temperature sensor : 2")

        # Set hwmon path
        self.ss_index, self.hwmon_path = self.__get_ss_info(self.index)
        self.ss_key = self.THERMAL_NAME_LIST[self.index]
Ejemplo n.º 13
0
 def __init__(self, thermal_index):
     ThermalBase.__init__(self)
     self._api_helper = APIHelper()
     self.index = thermal_index
     self.THERMAL_LIST = [
         ('TEMP_FAN_U52', 'Fan Tray Middle Temperature Sensor', '0x00'),
         ('TEMP_FAN_U17', 'Fan Tray Right Temperature Sensor', '0x01'),
         ('TEMP_SW_U52', 'Switchboard Left Inlet Temperature Sensor',
          '0x02'),
         ('TEMP_SW_U16', 'Switchboard Right Inlet Temperature Sensor',
          '0x03'),
         ('TEMP_BB_U3', 'Baseboard Temperature Sensor', '0x04'),
         ('TEMP_CPU', 'CPU Internal Temperature Sensor', '0x05'),
         ('TEMP_SW_Internal', 'ASIC Internal Temperature Sensor', '0x61'),
         ('SW_U04_Temp', 'IR3595 Chip Left Temperature Sensor', '0x4F'),
         ('SW_U14_Temp', 'IR3595 Chip Right Temperature Sensor', '0x56'),
         ('SW_U4403_Temp', 'IR3584 Chip Temperature Sensor', '0x5D'),
     ]
     self.sensor_id = self.THERMAL_LIST[self.index][0]
     self.sensor_des = self.THERMAL_LIST[self.index][1]
     self.sensor_reading_addr = self.THERMAL_LIST[self.index][2]
Ejemplo n.º 14
0
 def __init__(self, thermal_index):
     ThermalBase.__init__(self)
     self.index = thermal_index + 1
     self.sensor = IpmiSensor(self.SENSOR_MAPPING[self.index - 1][1])
Ejemplo n.º 15
0
 def __init__(self, temp):
     ThermalBase.__init__(self)
     self._temp = temp
     self._minimum = None
     self._maximum = None
Ejemplo n.º 16
0
 def __init__(self, thermal_index=0):
     ThermalBase.__init__(self)
     self.index = thermal_index + 1
     self.sensor = IpmiSensor(self.SENSOR_MAPPING[self.index - 1][1])
     self.has_high_threshold = self.SENSOR_MAPPING[self.index - 1][2]
     self.has_high_crit_threshold = self.SENSOR_MAPPING[self.index - 1][3]
Ejemplo n.º 17
0
    def __init__(self, index, _thermal_index=0, conf=None):
        ThermalBase.__init__(self)

        self._thermal_index = index
        self._config = conf
        self._api_common = Common(self._config)