facebook / openbmc

OpenBMC is an open software framework to build a complete Linux image for a Board Management Controller (BMC).
633 stars 277 forks source link

wedge400: add simplified ir35215 driver #214

Closed Scott8440 closed 1 year ago

Scott8440 commented 1 year ago

Summary: Adds a much simpler ir35215 driver as a patch in preparation of upstreaming this version of the driver.

Reasoning:

So these files don't add any benefit and just cause us to have to carry around this patch and not have the driver upstreamed. If anyone needs to directly control voltage output, they can use set_vdd.sh

Next steps are to upstream this driver so we can remove this patch altogether.

Test Plan: From the patch test plan:

  1. check device and driver installation

    root@fboss312380834-oob:~# ls -l /sys/bus/i2c/devices/1-0047/
    lrwxrwxrwx    1 root     root             0 Apr 12 15:02 driver -> ../../../../../../../../bus/i2c/drivers/ir35215
    drwxr-xr-x    3 root     root             0 Apr 12 15:02 hwmon
    -r--r--r--    1 root     root          4096 Apr 12 15:26 modalias
    -r--r--r--    1 root     root          4096 Apr 12 15:26 name
    -rw-r--r--    1 root     root          4096 Apr 12 15:26 pec
    drwxr-xr-x    2 root     root             0 Apr 12 15:26 power
    lrwxrwxrwx    1 root     root             0 Apr 12 15:05 subsystem -> ../../../../../../../../bus/i2c
    -rw-r--r--    1 root     root          4096 Apr 12 15:02 uevent
    root@fboss312380834-oob:~# cat /sys/bus/i2c/devices/1-0047/name
    ir35215
    root@fboss312380834-oob:~# ls /sys/bus/i2c/devices/1-0047/hwmon/hwmon8/
    curr1_input       curr3_crit        curr4_input       in1_label         in2_min_alarm     in3_max_alarm     in4_lcrit_alarm   power1_input      power4_label      temp2_crit_alarm
    curr1_label       curr3_crit_alarm  curr4_label       in1_min           in3_crit          in3_min           in4_max           power1_label      subsystem         temp2_input
    curr1_max         curr3_input       curr4_max         in1_min_alarm     in3_crit_alarm    in3_min_alarm     in4_max_alarm     power2_alarm      temp1_crit        temp2_max
    curr1_max_alarm   curr3_label       curr4_max_alarm   in2_crit          in3_input         in4_crit          in4_min           power2_input      temp1_crit_alarm  temp2_max_alarm
    curr2_input       curr3_max         device            in2_crit_alarm    in3_label         in4_crit_alarm    in4_min_alarm     power2_label      temp1_input       uevent
    curr2_label       curr3_max_alarm   in1_crit          in2_input         in3_lcrit         in4_input         name              power3_input      temp1_max
    curr2_max         curr4_crit        in1_crit_alarm    in2_label         in3_lcrit_alarm   in4_label         power             power3_label      temp1_max_alarm
    curr2_max_alarm   curr4_crit_alarm  in1_input         in2_min           in3_max           in4_lcrit         power1_alarm      power4_input      temp2_crit
    root@fboss312380834-oob:~#
  2. Check sensor command

    
    root@fboss312380834-oob:~# ls /sys/bus/i2c/devices/1-0047/hwmon/hwmon8/
    curr1_input       curr3_crit        curr4_input       in1_label         in2_min_alarm     in3_max_alarm     in4_lcrit_alarm   power1_input      power4_label      temp2_crit_alarm
    curr1_label       curr3_crit_alarm  curr4_label       in1_min           in3_crit          in3_min           in4_max           power1_label      subsystem         temp2_input
    curr1_max         curr3_input       curr4_max         in1_min_alarm     in3_crit_alarm    in3_min_alarm     in4_max_alarm     power2_alarm      temp1_crit        temp2_max
    curr1_max_alarm   curr3_label       curr4_max_alarm   in2_crit          in3_input         in4_crit          in4_min           power2_input      temp1_crit_alarm  temp2_max_alarm
    curr2_input       curr3_max         device            in2_crit_alarm    in3_label         in4_crit_alarm    in4_min_alarm     power2_label      temp1_input       uevent
    curr2_label       curr3_max_alarm   in1_crit          in2_input         in3_lcrit         in4_input         name              power3_input      temp1_max
    curr2_max         curr4_crit        in1_crit_alarm    in2_label         in3_lcrit_alarm   in4_label         power             power3_label      temp1_max_alarm
    curr2_max_alarm   curr4_crit_alarm  in1_input         in2_min           in3_max           in4_lcrit         power1_alarm      power4_input      temp2_crit
    root@fboss312380834-oob:~# sensors ir35215-*
    ir35215-i2c-1-4d
    Adapter: 1e78a080.i2c-bus
    Chip 3V3 Left Input Voltage:  +12.03 V  (min = +10.50 V, crit max = +14.56 V)
    PVDD0P8 Input Voltage:        +12.03 V  (min =  +0.06 V, crit max = +14.56 V)
    Chip 3V3 Left Output Voltage:  +3.31 V  (crit min =  +1.40 V, min =  +2.80 V)
                                        (max =  +3.60 V, crit max =  +3.80 V)
    PVDD0P8 Output Voltage:        +0.80 V  (crit min =  +0.50 V, min =  +0.60 V)
                                        (max =  +0.90 V, crit max =  +2.05 V)
    Chip 3V3 Left Temp:            +18.0 C  (high = +100.0 C, crit = +125.0 C)
    PVDD0P8 Temp:                  +19.0 C  (high = +100.0 C, crit = +125.0 C)
    Chip 3V3 Left Input Power:    1000.00 mW
    PVDD0P8 Input Power:            0.00 W
    Chip 3V3 Left Output Power:   1000.00 mW
    PVDD0P8 Output Power:           0.00 W
    Chip 3V3 Left Input Current:   +0.06 A  (max = +30.00 A)
    PVDD0P8 Input Current:         +0.00 A  (max = +30.00 A)
    Chip 3V3 Left Output Current:  +0.95 A  (max = +61.75 A, crit max = +110.40 A)
    PVDD0P8 Output Current:        +0.39 A  (max = +17.09 A, crit max = +21.26 A)

ir35215-i2c-1-47 Adapter: 1e78a080.i2c-bus Chip 3V3 Right Input Voltage: +11.94 V (min = +10.50 V, crit max = +14.56 V) TRVDD0R8 Input Voltage: +11.94 V (min = +0.06 V, crit max = +14.56 V) Chip 3V3 Right Output Voltage: +3.31 V (crit min = +1.40 V, min = +2.80 V) (max = +3.60 V, crit max = +3.80 V) TRVDD0R8 Output Voltage: +0.79 V (crit min = +0.50 V, min = +0.60 V) (max = +0.90 V, crit max = +2.05 V) Chip 3V3 Right Temp: +19.0 C (high = +100.0 C, crit = +125.0 C) TRVDD0R8 Temp: +19.0 C (high = +100.0 C, crit = +125.0 C) Chip 3V3 Right Input Power: 0.00 W TRVDD0R8 Input Power: 500.00 mW Chip 3V3 Right Output Power: 0.00 W TRVDD0R8 Output Power: 0.00 W Chip 3V3 Right Input Current: +0.00 A (max = +30.00 A) TRVDD0R8 Input Current: +0.03 A (max = +30.00 A) Chip 3V3 Right Output Current: +0.01 A (max = +62.06 A, crit max = +111.71 A) TRVDD0R8 Output Current: +1.52 A (max = +84.97 A, crit max = +90.97 A)

Reviewed By: tao-ren

Differential Revision: D44937979

facebook-github-bot commented 1 year ago

This pull request was exported from Phabricator. Differential Revision: D44937979

facebook-github-bot commented 1 year ago

This pull request was exported from Phabricator. Differential Revision: D44937979

facebook-github-bot commented 1 year ago

This pull request has been merged in facebook/openbmc@780d49efeef90386ede8902bea6df8f27c947597.