Skip to content

Commit

Permalink
ELBERT: Tune TH4 MAX6581 Temp sensor (#180) (#104)
Browse files Browse the repository at this point in the history
Summary:
* ELBERT: Tune TH4 MAX6581 Temp sensor

Tune Temp sensor on TH4 Diode accoring to HW measurements.

This sensor is being moved to the dts of elbert instead of setup_i2c.

- Resistance Cancellation register 0x4A = 0x03
- Transistor Ideality register 0x4B = 0x1F
- Ideality Select register 0x4C = 0x03

root@bmc-oob:~# sensors max6581-i2c-4-4d
max6581-i2c-4-4d
Adapter: 1e78a280.i2c-bus
SMB T:           +29.6 C  (high = +90.0 C, crit = +80.0 C)
TH4 Die Temp 0:  +35.9 C  (high = +127.0 C, crit = +110.0 C)
TH4 Die Temp 1:  +35.8 C  (high = +127.0 C, crit = +110.0 C)
SMB R:           +27.0 C  (high = +100.0 C, crit = +127.0 C)
SMB U:           +27.8 C  (high = +100.0 C, crit = +90.0 C)
SMB L:           +28.1 C  (high = +100.0 C, crit = +90.0 C)

* Moved TH4 MAX6581 to dts with tuned configs

Pull Request resolved: facebookexternal/openbmc.arista#104

Test Plan: Imported from GitHub, without a `Test Plan:` line. Test in summary

Reviewed By: mikechoifb

fbshipit-source-id: a2d6a08102
  • Loading branch information
joancaneus authored and facebook-github-bot committed Nov 4, 2020
1 parent 407069b commit fa614ff
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ hwmon_device_add() {
# long or is in bad shape
# Supvervisor Inlet
hwmon_device_add 11 0x4c max6658
# TH4 and board temp sensor
hwmon_device_add 4 0x4d max6581

# SMBus 0
# Currently not using I2C TPM
Expand Down
41 changes: 41 additions & 0 deletions tests2/tests/elbert/test_sensor_calibration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env python3
#
# Copyright 2020-present Facebook. All Rights Reserved.
#
# This program file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program in a file named COPYING; if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA
#
import unittest

from utils.cit_logger import Logger
from utils.shell_util import run_shell_cmd


class SensorCalibrationTest(unittest.TestCase):
def setUp(self):
Logger.start(name=self._testMethodName)

def tearDown(self):
Logger.info("Finished logging for {}".format(self._testMethodName))
pass

def test_max6581_tuned(self):
# Test the IMP port state register
data = run_shell_cmd("i2cget -f -y 4 0x4d 0x4a").split("\n")
self.assertIn("0x03", data[0], "unexpected value in MAX6581 0x4A")
data = run_shell_cmd("i2cget -f -y 4 0x4d 0x4b").split("\n")
self.assertIn("0x1f", data[0], "unexpected value in MAX6581 0x4B")
data = run_shell_cmd("i2cget -f -y 4 0x4d 0x4c").split("\n")
self.assertIn("0x03", data[0], "unexpected value in MAX6581 0x4C")

0 comments on commit fa614ff

Please sign in to comment.