[Accton][wedge800bact] Calibrate HSC and ADC XP3R3V scaling in sensor_service.json #811
+6
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit install
Summary
In the sensor_service.json of Wedge800BACT, the compute value methods for voltage, current and power monitoring within the pmUnitScoped sections, which interface with the kernel drivers, need to be adjusted.
ADC128D818 Kernel Driver
The conversion formula for the XP3R3V voltage input under pmUnitScopedName needs to be modified for the adc128d818 driver.
--
Original: "compute": "(8/5)@/1000"
Updated: "compute": "(5/3)@/1000"
--
LTC4287 Kernel Driver
The conversion formulas for the HSC (Hot Swap Controller) current and power values under pmUnitScopedName need to be adjusted for the ltc4287 driver.
--
Original: "compute": "(3/5)@/1000"
Updated: "compute": "(6/5)@/1000"
--
Modification Rationale:$R_{sense}$ value used in the kernel driver's internal calculation formula is $0.3\text{ m}\Omega$ .$0.5\text{ m}\Omega$ resistors in parallel, resulting in an effective total resistance ($R_{total}$ ) of $0.25\text{ m}\Omega$ .


$$\text{Correction Factor} = \frac{\text{Driver Default } R_{sense}}{\text{Actual Hardware } R_{sense}} = \frac{0.3\text{ m}\Omega}{0.25\text{ m}\Omega} = 1.2 \text{ (which is } 6/5)$$ $(6/5)$ to ensure accurate data reporting.
The default
(Reference: drivers/hwmon/pmbus/ltc4286.c)
However, based on our hardware specifications, the actual sensing circuit utilizes two
To compensate for this hardware difference, the scaling factor must be adjusted as follows:
.
.
Therefore, the compute value is updated to
Test Plan
sensor_service and ensureall sensor values can be read without errors.w800b_20260112_sensor_service.txt
sensor_service_hw_testand confirm that all test items pass.w800b_20260112_sensor_service_hw_test.txt
sensor_service_clientcommand and confirmed that all test items passed.w800b_20260112_sensor_service_client.txt
Furthermore, by observing the data from the
sensor_service_clientcommand,I verified that the values for the modified items mentioned above are consistent with our expected results.
|name | before | after |
| MCB_U33_XP3R3V_MCB | 3.19 | 3.33 |
| MCB_U33_XP3R3V_FCB | 3.19 | 3.32 |
| MCB_U33_XP3R3V_IOB | 3.19 | 3.32 |
| SMB_U42_XP3R3V | 3.20 | 3.33 |
| MCB_U41_HSC_PIN |288.40 |578.80 |
| MCB_U41_HSC_IOUT | 5.32 | 10.68 |