Skip to content

Commit

Permalink
yosemite4: Adjust ina233 config for matching hardware design
Browse files Browse the repository at this point in the history
Summary:
# Description:
Adjust ina233 config for matching hardware design. The external shunt is 5 mohm, so the resistor-calibration should be 0x0400.

This patch is for hardware testing. According to the datasheet and upstream review comment, resistor-calibration should be calculated, and we should set external shunt on DTS instead. We will revise the ina233 driver by the upstream review comment and contribute the code once we finish.

# Motivation:
Hardware team reported that the current reading wasn't correct.

X-link: facebookexternal/openbmc.wiwynn#2997

Test Plan: Measure the current with current load and compare with the BMC's reading - pass

Reviewed By: wangx6f

Differential Revision: D54569359

fbshipit-source-id: 134dfeb4881c93013e05469631c47ded1de0ad70
  • Loading branch information
PeterHo-wiwynn authored and facebook-github-bot committed Mar 8, 2024
1 parent c57fd02 commit 0a12bb3
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
From 6e15f71291c5b1ab7bbed0d97ab5e865888fbfbe Mon Sep 17 00:00:00 2001
From: PeterHo-wiwynn <Peter_MH_Ho@wiwynn.com>
Date: Tue, 5 Mar 2024 15:15:49 +0800
Subject: [PATCH] Adjust resistor-calibration for matching hardware design

This patch is for hardware testing. According to the datasheet and
upstream review comment, resistor-calibration should be calculated,
and we should set external shunt on DTS instead. We will revise the
ina233 driver by the upstream review comment and contribute the code
once we finish.
---
.../boot/dts/aspeed/aspeed-bmc-facebook-yosemite4.dts | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-yosemite4.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-yosemite4.dts
index 45248c31db22..a8b724049e83 100644
--- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-yosemite4.dts
+++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-yosemite4.dts
@@ -1079,35 +1079,35 @@ adc@37 {
power-sensor@40 {
compatible = "ti,ina233";
reg = <0x40>;
- resistor-calibration = /bits/ 16 <0x0a00>;
+ resistor-calibration = /bits/ 16 <0x0400>;
current-lsb= /bits/ 16 <0x0001>;
};

power-sensor@41 {
compatible = "ti,ina233";
reg = <0x41>;
- resistor-calibration = /bits/ 16 <0x0a00>;
+ resistor-calibration = /bits/ 16 <0x0400>;
current-lsb= /bits/ 16 <0x0001>;
};

power-sensor@42 {
compatible = "ti,ina233";
reg = <0x42>;
- resistor-calibration = /bits/ 16 <0x0a00>;
+ resistor-calibration = /bits/ 16 <0x0400>;
current-lsb= /bits/ 16 <0x0001>;
};

power-sensor@43 {
compatible = "ti,ina233";
reg = <0x43>;
- resistor-calibration = /bits/ 16 <0x0a00>;
+ resistor-calibration = /bits/ 16 <0x0400>;
current-lsb= /bits/ 16 <0x0001>;
};

power-sensor@44 {
compatible = "ti,ina233";
reg = <0x44>;
- resistor-calibration = /bits/ 16 <0x0a00>;
+ resistor-calibration = /bits/ 16 <0x0400>;
current-lsb= /bits/ 16 <0x0001>;
};

--
2.25.1

Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ SRC_URI += " \
file://0509-Meta-yv4-dts-add-mac-config-property.patch \
file://0510-yosemite4-Add-EEPROMs-for-NICs-in-DTS.patch \
file://0511-Add-ina233-and-ina238-devicetree-config.patch \
file://0512-Adjust-resistor-calibration-for-matching-hardware-de.patch \
"

0 comments on commit 0a12bb3

Please sign in to comment.