Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meru800bfa: add UCD90320 sensors #196

Closed

Conversation

adamcalabrigo
Copy link
Contributor

@adamcalabrigo adamcalabrigo commented Apr 24, 2024

Summary

Adds sensor support for UCD90320 and corrects the names of two existing temp sensors to follow the convention used by the other temp sensors. Note that this is supported on P2 only currently.

Testing

Tested on Meru800bfa.

ucd90320 is correctly initialized:

[ 5416.277630] ucd9000 12-0011: Device ID UCD90320U|3.0.0.3323|211011
[ 5417.830854] i2c i2c-12: new_device: Instantiated device ucd90320 at 0x11

platform_manager creates the symlink for the UCD90320 sensors. From the service log:

Creating symlink from /run/devmap/sensors/SMB_UCD90320 to /sys/bus/i2c/devices/12-0011/hwmon/hwmon19. DevicePath: /SMB_SLOT@0/[SMB_UCD90320]

Ran sensor_service and ensured that the new sensors are being polled correctly. From the service log:

SMB_DPM_12V: Path=/run/devmap/sensors/SMB_UCD90320/in1_input, Compute=@/1000.0, FRU=SMB
SMB_DPM_1V2_DKR: Path=/run/devmap/sensors/SMB_UCD90320/in4_input, Compute=@/1000.0, FRU=SMB
SMB_DPM_1V9_DKR: Path=/run/devmap/sensors/SMB_UCD90320/in3_input, Compute=@/1000.0, FRU=SMB
SMB_DPM_3V3: Path=/run/devmap/sensors/SMB_UCD90320/in7_input, Compute=@/1000.0, FRU=SMB
SMB_DPM_3V3_DKR: Path=/run/devmap/sensors/SMB_UCD90320/in2_input, Compute=@/1000.0, FRU=SMB
SMB_DPM_5V0: Path=/run/devmap/sensors/SMB_UCD90320/in8_input, Compute=@/1000.0, FRU=SMB
...
SMB_DPM_5V0 (/run/devmap/sensors/SMB_UCD90320/in8_input) : 4.928                                                                                                                                        
SMB_DPM_3V3_DKR (/run/devmap/sensors/SMB_UCD90320/in2_input) : 3.305                                                                                                                                    
SMB_DPM_3V3 (/run/devmap/sensors/SMB_UCD90320/in7_input) : 3.311                                                                                                                                        
SMB_DPM_1V2_DKR (/run/devmap/sensors/SMB_UCD90320/in4_input) : 1.197                                                                                                                                    
SMB_DPM_12V (/run/devmap/sensors/SMB_UCD90320/in1_input) : 12.089

On P1, platform_manager logs the failures:

Failures in PmUnit SMB at /SMB_SLOT@0
1. Failed to create i2c device for SMB_UCD90320 (ucd90320) at bus: 12, addr: 0x11 with exit status 0
2. Failed to create a symlink /run/devmap/sensors/SMB_UCD90320 for DevicePath /SMB_SLOT@0/[SMB_UCD90320]. Reason: SMB_UCD90320 is not plugged-in to the platform

sensor_service logs the failures also:

Could not read data for SMB_DPM_12V from path:/run/devmap/sensors/SMB_UCD90320/in1_input, error:File does not exist
Could not read data for SMB_DPM_1V2_DKR from path:/run/devmap/sensors/SMB_UCD90320/in4_input, error:File does not exist
Could not read data for SMB_DPM_1V9_DKR from path:/run/devmap/sensors/SMB_UCD90320/in3_input, error:File does not exist
Could not read data for SMB_DPM_3V3 from path:/run/devmap/sensors/SMB_UCD90320/in7_input, error:File does not exist
Could not read data for SMB_DPM_3V3_DKR from path:/run/devmap/sensors/SMB_UCD90320/in2_input, error:File does not exist
Could not read data for SMB_DPM_5V0 from path:/run/devmap/sensors/SMB_UCD90320/in8_input, error:File does not exist
Processed 145 Sensors. 6 Failures.

@facebook-github-bot
Copy link
Contributor

@joancaneus has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@joancaneus
Copy link
Contributor

@adamcalabrigo can you please also add the P1 testing log in this PR?

@facebook-github-bot
Copy link
Contributor

@joancaneus has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@somasun
Copy link
Contributor

somasun commented May 17, 2024

@adamcalabrigo - are the failures for UCD90320 in P1 expected? If so, why?

@adamcalabrigo
Copy link
Contributor Author

@joancaneus I have since retested P1 with the updated CPLD image and there are no more failures.

facebook-github-bot pushed a commit that referenced this pull request Sep 19, 2024
Summary:
# Description
- Symlinks are now organized in the following order for each PMUnit starting from root:
  - Fpgas
  - I2c Buses
  - SMB Idrpom
  - I2c devices
  - Embedded sensors
  - Xcvrs
  - Spi Devices
- Meru800BFA: Added symlinks to spi devices
- Sensor service configs are sorted based on the order of i2c devices they’re on
-  Removed symlink for "/[IDPROM]" on Meru800BIA as PM handles creating the symlink without a config for it.
- Meru800BIA now uses the lm75 driver instead of tmp75. The tmp75 driver is not compatible with some of the parts sourced from some vendors which can cause unexpected behavior.  The lm75 is a more general driver and avoids any part specific configurations.
- PM configs updated to configure temp sensors overtemp limits

PR includes all changes in the following PRs: #195, #196

# Test

### Meru800BFA:
- Flash devices symlinks
```
# ls -al /run/devmap/flashes/
total 0
drwxr-xr-x 2 root root 140 Aug 27 17:52 .
drwxr-xr-x 9 root root 180 Aug 27 17:13 ..
lrwxrwxrwx 1 root root  17 Aug 27 17:52 SMB_SPI0_MASTER0_DEVICE1 -> /dev/spidev2005.0
lrwxrwxrwx 1 root root  17 Aug 27 17:52 SMB_SPI1_MASTER0_DEVICE1 -> /dev/spidev3005.0
lrwxrwxrwx 1 root root  17 Aug 27 17:52 SMB_SPI2_MASTER0_DEVICE1 -> /dev/spidev4005.0
lrwxrwxrwx 1 root root  17 Aug 27 17:52 SMB_SPI3_MASTER0_DEVICE1 -> /dev/spidev5005.0
lrwxrwxrwx 1 root root  17 Aug 27 17:13 SMB_SPI_MASTER0_DEVICE1 -> /dev/spidev5005.0
```
- PM initializes successfully. Some "failures" are reported but are not caused by this PR.
  - Wrong FAN CPLD firmware  version path. The version files are located under hwmon directories that the check omits. . Likely introduced by 77d10bc
  - Known failure logs due to SCM_IDPROM_P1
```
 Failed to open firmware version file /run/devmap/cplds/FAN0_CPLD/cpld_ver: No such file or directory
 Failed to open firmware version file /run/devmap/cplds/FAN0_CPLD/cpld_sub_ver: No such file or directory
 Reporting firmware version for FAN0_CPLD - version string:0.0 ODS value:0
 Failed to open firmware version file /run/devmap/cplds/FAN1_CPLD/cpld_ver: No such file or directory
 Failed to open firmware version file /run/devmap/cplds/FAN1_CPLD/cpld_sub_ver: No such file or directory
 Reporting firmware version for FAN1_CPLD - version string:0.0 ODS value:0
 Failed to open firmware version file /run/devmap/cplds/FAN2_CPLD/cpld_ver: No such file or directory
 Failed to open firmware version file /run/devmap/cplds/FAN2_CPLD/cpld_sub_ver: No such file or directory
 Reporting firmware version for FAN2_CPLD - version string:0.0 ODS value:0
 Reporting firmware version for MERU800BFA_SMB_CPLD - version string:4.4 ODS value:4004
 Reporting firmware version for MERU800BFA_SMB_FPGA0 - version string:1.19 ODS value:1019
 Reporting firmware version for MERU800BFA_SMB_FPGA1 - version string:1.19 ODS value:1019
 Reporting firmware version for MERU800BFA_SMB_FPGA2 - version string:1.26 ODS value:1026
 Reporting firmware version for MERU800BFA_SMB_FPGA3 - version string:1.23 ODS value:1023
 Reporting firmware version for MERU_SCM_CPLD - version string:4.13 ODS value:4013
 Completed setting up devices with errors
 Failures in PmUnit SCM at /
 1. Failed to create i2c device for SCM_IDPROM_P1 (24c512) at bus: 3, addr: 0x50 with exit status 0
 2. Failed to create a symlink /run/devmap/eeproms/MERU_SCM_EEPROM_P1 for DevicePath /[SCM_IDPROM_P1]. Reason: SCM_IDPROM_P1 is not plugged-in to the platform
```
- sensor_service
```
========================================================
Processed 147 Sensors. 0 Failures.
Using thread manager (resource pools not enabled) on address/port 5970: runtime: thriftFlagNotSet, , thrift flag: false, enable gflag: false, disable gflag: false
Processed 147 Sensors. 0 Failures.
Processed 147 Sensors. 0 Failures.
Processed 147 Sensors. 0 Failures.
```

### Meru800BIA:
- PM initializes successfully. Some "failures" are reported but are not caused by this PR.
  - Wrong FAN CPLD firmware version path. The version files are located under hwmon directories that the check omits. Likely introduced by 77d10bc
  - Known failure logs due to SCM_IDPROM_P1
```
Failed to open firmware version file /run/devmap/cplds/FAN_CPLD/cpld_ver: No such file or directory
Failed to open firmware version file /run/devmap/cplds/FAN_CPLD/cpld_sub_ver: No such file or directory
Reporting firmware version for FAN_CPLD - version string:0.0 ODS value:0
Reporting firmware version for MERU800BIA_SMB_FPGA - version string:4.13 ODS value:4013
Reporting firmware version for MERU_SCM_CPLD - version string:4.13 ODS value:4013
Completed setting up devices with errors
Failures in PmUnit SCM at /
1. Failed to create i2c device for SCM_IDPROM_P1 (24c512) at bus: 3, addr: 0x50 with exit status 0
2. Failed to create a symlink /run/devmap/eeproms/MERU_SCM_EEPROM_P1 for DevicePath /[SCM_IDPROM_P1]. Reason: SCM_IDPROM_P1 is not plugged-in to the platform
```
- sensor_service
```
SMB_J3_BOARD_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp1_input, Compute=@/1000.0, FRU=SMB
SMB_J3_DIODE_CORE_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp2_input, Compute=@/1000.0, FRU=SMB
SMB_J3_DIODE_FAB0_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp3_input, Compute=@/1000.0, FRU=SMB
SMB_J3_DIODE_FAB1_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp4_input, Compute=@/1000.0, FRU=SMB
SMB_J3_DIODE_NIF0_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp5_input, Compute=@/1000.0, FRU=SMB
SMB_J3_DIODE_NIF1_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp6_input, Compute=@/1000.0, FRU=SMB
SMB_J3_DIODE_HBM0_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp7_input, Compute=@/1000.0, FRU=SMB
SMB_J3_DIODE_HBM1_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp8_input, Compute=@/1000.0, FRU=SMB
SMB_MGMT_INLET_TEMP: Path=/run/devmap/sensors/SMB_MGMT_TMP75/temp1_input, Compute=@/1000.0, FRU=SMB
========================================================
Processed 79 Sensors. 0 Failures.
Using thread manager (resource pools not enabled) on address/port 5970: runtime: thriftFlagNotSet, , thrift flag: false, enable gflag: false, disable gflag: false
Processed 79 Sensors. 0 Failures.
Processed 79 Sensors. 0 Failures.
Processed 79 Sensors. 0 Failures.
```

Pull Request resolved: #208

Reviewed By: kimdo8736

Differential Revision: D61759564

Pulled By: joancaneus

fbshipit-source-id: 38ba3b449637e937ee5e450a9b82c57ad301c570
@adamcalabrigo
Copy link
Contributor Author

Redundant to the changes in #208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants