All of lore.kernel.org
 help / color / mirror / Atom feed
* Configuring shunt_resistor in hwmon
@ 2020-01-06 21:16 Alex Qiu
  2020-01-06 21:21 ` James Feist
  2020-01-06 23:37 ` Vijay Khemka
  0 siblings, 2 replies; 9+ messages in thread
From: Alex Qiu @ 2020-01-06 21:16 UTC (permalink / raw)
  To: openbmc; +Cc: Josh Lehan, Peter Lundgren, Devjit Gopalpur, Kais Belgaied

[-- Attachment #1: Type: text/plain, Size: 309 bytes --]

Hi OpenBMC folks,

Is there a way to configure the shunt_resistor value for a hwmon with
entity-manager or other modules? We need to configure this value to make
the INA230 report correct voltage, but for now I don't find anything in the
code for it. Shall this be a feature to implement? Thanks!

- Alex Qiu

[-- Attachment #2: Type: text/html, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Configuring shunt_resistor in hwmon
  2020-01-06 21:16 Configuring shunt_resistor in hwmon Alex Qiu
@ 2020-01-06 21:21 ` James Feist
  2020-01-06 21:29   ` Alex Qiu
  2020-01-06 23:37 ` Vijay Khemka
  1 sibling, 1 reply; 9+ messages in thread
From: James Feist @ 2020-01-06 21:21 UTC (permalink / raw)
  To: Alex Qiu, openbmc
  Cc: Josh Lehan, Kais Belgaied, Devjit Gopalpur, Peter Lundgren

On 1/6/20 1:16 PM, Alex Qiu wrote:
> Hi OpenBMC folks,
> 
> Is there a way to configure the shunt_resistor value for a hwmon with 
> entity-manager or other modules?

Have you seen this? 
https://github.com/openbmc/entity-manager/blob/0cbe6bf34101bab7544b40011868efc5145c0804/configurations/WFT%20Baseboard.json#L7

For Entity-Manager + dbus-sensors.

> We need to configure this value to make 
> the INA230 report correct voltage, but for now I don't find anything in 
> the code for it. Shall this be a feature to implement? Thanks!
> 
> - Alex Qiu

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Configuring shunt_resistor in hwmon
  2020-01-06 21:21 ` James Feist
@ 2020-01-06 21:29   ` Alex Qiu
  2020-01-06 21:37     ` James Feist
  0 siblings, 1 reply; 9+ messages in thread
From: Alex Qiu @ 2020-01-06 21:29 UTC (permalink / raw)
  To: James Feist
  Cc: openbmc, Josh Lehan, Kais Belgaied, Devjit Gopalpur, Peter Lundgren

[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]

Hi James,

Thanks for your quick reply and reviewing my code in the morning!

That looks interesting, so this ScaleFactor will be used to multiply the
voltage value from hwmon without setting the shunt_resistor explicitly? I
do have a little concern on the resolution, because it's only reporting
0.165V with default shunt_resistor setting, but we'll try and see if this
will work for our case. In the meantime, do you know any other method that
will work?

Thank you!

- Alex Qiu


On Mon, Jan 6, 2020 at 1:21 PM James Feist <james.feist@linux.intel.com>
wrote:

> On 1/6/20 1:16 PM, Alex Qiu wrote:
> > Hi OpenBMC folks,
> >
> > Is there a way to configure the shunt_resistor value for a hwmon with
> > entity-manager or other modules?
>
> Have you seen this?
>
> https://github.com/openbmc/entity-manager/blob/0cbe6bf34101bab7544b40011868efc5145c0804/configurations/WFT%20Baseboard.json#L7
>
> For Entity-Manager + dbus-sensors.
>
> > We need to configure this value to make
> > the INA230 report correct voltage, but for now I don't find anything in
> > the code for it. Shall this be a feature to implement? Thanks!
> >
> > - Alex Qiu
>

[-- Attachment #2: Type: text/html, Size: 1905 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Configuring shunt_resistor in hwmon
  2020-01-06 21:29   ` Alex Qiu
@ 2020-01-06 21:37     ` James Feist
  2020-01-06 21:44       ` Alex Qiu
  2020-01-07  3:20       ` Lei YU
  0 siblings, 2 replies; 9+ messages in thread
From: James Feist @ 2020-01-06 21:37 UTC (permalink / raw)
  To: Alex Qiu
  Cc: openbmc, Josh Lehan, Kais Belgaied, Devjit Gopalpur, Peter Lundgren

On 1/6/20 1:29 PM, Alex Qiu wrote:
> Hi James,
> 
> Thanks for your quick reply and reviewing my code in the morning!
> 
> That looks interesting, so this ScaleFactor will be used to multiply the 
> voltage value from hwmon without setting the shunt_resistor explicitly? 
> I do have a little concern on the resolution, because it's only 
> reporting 0.165V with default shunt_resistor setting, but we'll try and 
> see if this will work for our case. In the meantime, do you know any 
> other method that will work?

That's all I'm aware of in dbus-sensors. We have a voltage divider 
in-front of our ADC channels, so we use this scale factor to calculate 
the actual voltage. Anything else I think you'd need to add as a new 
change if you're using dbus-sensors. I'm not sure if phosphor-hwmon 
offers anything you could use or not.

> 
> Thank you!
> 
> - Alex Qiu
> 
> 
> On Mon, Jan 6, 2020 at 1:21 PM James Feist <james.feist@linux.intel.com 
> <mailto:james.feist@linux.intel.com>> wrote:
> 
>     On 1/6/20 1:16 PM, Alex Qiu wrote:
>      > Hi OpenBMC folks,
>      >
>      > Is there a way to configure the shunt_resistor value for a hwmon
>     with
>      > entity-manager or other modules?
> 
>     Have you seen this?
>     https://github.com/openbmc/entity-manager/blob/0cbe6bf34101bab7544b40011868efc5145c0804/configurations/WFT%20Baseboard.json#L7
> 
>     For Entity-Manager + dbus-sensors.
> 
>      > We need to configure this value to make
>      > the INA230 report correct voltage, but for now I don't find
>     anything in
>      > the code for it. Shall this be a feature to implement? Thanks!
>      >
>      > - Alex Qiu
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Configuring shunt_resistor in hwmon
  2020-01-06 21:37     ` James Feist
@ 2020-01-06 21:44       ` Alex Qiu
  2020-01-07  3:20       ` Lei YU
  1 sibling, 0 replies; 9+ messages in thread
From: Alex Qiu @ 2020-01-06 21:44 UTC (permalink / raw)
  To: James Feist
  Cc: openbmc, Josh Lehan, Kais Belgaied, Devjit Gopalpur, Peter Lundgren

[-- Attachment #1: Type: text/plain, Size: 1861 bytes --]

Hi James,

Got it. Thank you for the answer!

- Alex Qiu


On Mon, Jan 6, 2020 at 1:37 PM James Feist <james.feist@linux.intel.com>
wrote:

> On 1/6/20 1:29 PM, Alex Qiu wrote:
> > Hi James,
> >
> > Thanks for your quick reply and reviewing my code in the morning!
> >
> > That looks interesting, so this ScaleFactor will be used to multiply the
> > voltage value from hwmon without setting the shunt_resistor explicitly?
> > I do have a little concern on the resolution, because it's only
> > reporting 0.165V with default shunt_resistor setting, but we'll try and
> > see if this will work for our case. In the meantime, do you know any
> > other method that will work?
>
> That's all I'm aware of in dbus-sensors. We have a voltage divider
> in-front of our ADC channels, so we use this scale factor to calculate
> the actual voltage. Anything else I think you'd need to add as a new
> change if you're using dbus-sensors. I'm not sure if phosphor-hwmon
> offers anything you could use or not.
>
> >
> > Thank you!
> >
> > - Alex Qiu
> >
> >
> > On Mon, Jan 6, 2020 at 1:21 PM James Feist <james.feist@linux.intel.com
> > <mailto:james.feist@linux.intel.com>> wrote:
> >
> >     On 1/6/20 1:16 PM, Alex Qiu wrote:
> >      > Hi OpenBMC folks,
> >      >
> >      > Is there a way to configure the shunt_resistor value for a hwmon
> >     with
> >      > entity-manager or other modules?
> >
> >     Have you seen this?
> >
> https://github.com/openbmc/entity-manager/blob/0cbe6bf34101bab7544b40011868efc5145c0804/configurations/WFT%20Baseboard.json#L7
> >
> >     For Entity-Manager + dbus-sensors.
> >
> >      > We need to configure this value to make
> >      > the INA230 report correct voltage, but for now I don't find
> >     anything in
> >      > the code for it. Shall this be a feature to implement? Thanks!
> >      >
> >      > - Alex Qiu
> >
>

[-- Attachment #2: Type: text/html, Size: 3005 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Configuring shunt_resistor in hwmon
  2020-01-06 21:16 Configuring shunt_resistor in hwmon Alex Qiu
  2020-01-06 21:21 ` James Feist
@ 2020-01-06 23:37 ` Vijay Khemka
  2020-01-06 23:40   ` Alex Qiu
  1 sibling, 1 reply; 9+ messages in thread
From: Vijay Khemka @ 2020-01-06 23:37 UTC (permalink / raw)
  To: Alex Qiu, openbmc
  Cc: Josh Lehan, Kais Belgaied, Devjit Gopalpur, Peter Lundgren

[-- Attachment #1: Type: text/plain, Size: 850 bytes --]

You should be able to define this value in device tree. Or you can calculate scale factor and use it in entity manager.

From: openbmc <openbmc-bounces+vijaykhemka=fb.com@lists.ozlabs.org> on behalf of Alex Qiu <xqiu@google.com>
Date: Monday, January 6, 2020 at 1:18 PM
To: "openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>
Cc: Josh Lehan <krellan@google.com>, Kais Belgaied <belgaied@google.com>, Devjit Gopalpur <devjitg@google.com>, Peter Lundgren <peterlundgren@google.com>
Subject: Configuring shunt_resistor in hwmon

Hi OpenBMC folks,

Is there a way to configure the shunt_resistor value for a hwmon with entity-manager or other modules? We need to configure this value to make the INA230 report correct voltage, but for now I don't find anything in the code for it. Shall this be a feature to implement? Thanks!

- Alex Qiu

[-- Attachment #2: Type: text/html, Size: 3194 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Configuring shunt_resistor in hwmon
  2020-01-06 23:37 ` Vijay Khemka
@ 2020-01-06 23:40   ` Alex Qiu
  0 siblings, 0 replies; 9+ messages in thread
From: Alex Qiu @ 2020-01-06 23:40 UTC (permalink / raw)
  To: Vijay Khemka
  Cc: openbmc, Josh Lehan, Kais Belgaied, Devjit Gopalpur, Peter Lundgren

[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]

Hi Vijay, I don't know about the device tree yet, and I will look for info
about it. Thanks!

- Alex Qiu


On Mon, Jan 6, 2020 at 3:37 PM Vijay Khemka <vijaykhemka@fb.com> wrote:

> You should be able to define this value in device tree. Or you can
> calculate scale factor and use it in entity manager.
>
>
>
> *From: *openbmc <openbmc-bounces+vijaykhemka=fb.com@lists.ozlabs.org> on
> behalf of Alex Qiu <xqiu@google.com>
> *Date: *Monday, January 6, 2020 at 1:18 PM
> *To: *"openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>
> *Cc: *Josh Lehan <krellan@google.com>, Kais Belgaied <belgaied@google.com>,
> Devjit Gopalpur <devjitg@google.com>, Peter Lundgren <
> peterlundgren@google.com>
> *Subject: *Configuring shunt_resistor in hwmon
>
>
>
> Hi OpenBMC folks,
>
>
>
> Is there a way to configure the shunt_resistor value for a hwmon with
> entity-manager or other modules? We need to configure this value to make
> the INA230 report correct voltage, but for now I don't find anything in the
> code for it. Shall this be a feature to implement? Thanks!
>
>
> - Alex Qiu
>

[-- Attachment #2: Type: text/html, Size: 2861 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Configuring shunt_resistor in hwmon
  2020-01-06 21:37     ` James Feist
  2020-01-06 21:44       ` Alex Qiu
@ 2020-01-07  3:20       ` Lei YU
  2020-01-07 17:11         ` Alex Qiu
  1 sibling, 1 reply; 9+ messages in thread
From: Lei YU @ 2020-01-07  3:20 UTC (permalink / raw)
  To: James Feist
  Cc: Alex Qiu, Josh Lehan, OpenBMC Maillist, Kais Belgaied,
	Devjit Gopalpur, Peter Lundgren

On Tue, Jan 7, 2020 at 5:38 AM James Feist <james.feist@linux.intel.com> wrote:
>
> On 1/6/20 1:29 PM, Alex Qiu wrote:
> > Hi James,
> >
> > Thanks for your quick reply and reviewing my code in the morning!
> >
> > That looks interesting, so this ScaleFactor will be used to multiply the
> > voltage value from hwmon without setting the shunt_resistor explicitly?
> > I do have a little concern on the resolution, because it's only
> > reporting 0.165V with default shunt_resistor setting, but we'll try and
> > see if this will work for our case. In the meantime, do you know any
> > other method that will work?
>
> That's all I'm aware of in dbus-sensors. We have a voltage divider
> in-front of our ADC channels, so we use this scale factor to calculate
> the actual voltage. Anything else I think you'd need to add as a new
> change if you're using dbus-sensors. I'm not sure if phosphor-hwmon
> offers anything you could use or not.

With phosphor-hwmon, you could define GAIN, OFFSET in the config file
to adjust the reading.
See details in
https://github.com/openbmc/docs/blob/master/architecture/sensor-architecture.md#my-sensors-are-not-defined-in-an-mrw

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Configuring shunt_resistor in hwmon
  2020-01-07  3:20       ` Lei YU
@ 2020-01-07 17:11         ` Alex Qiu
  0 siblings, 0 replies; 9+ messages in thread
From: Alex Qiu @ 2020-01-07 17:11 UTC (permalink / raw)
  To: Lei YU
  Cc: James Feist, Josh Lehan, OpenBMC Maillist, Kais Belgaied,
	Devjit Gopalpur, Peter Lundgren

[-- Attachment #1: Type: text/plain, Size: 1389 bytes --]

Hi Lei,

I'm not sure if we're using phosphor-hwmon, but I'll take a look. Thank you!

- Alex Qiu


On Mon, Jan 6, 2020 at 7:20 PM Lei YU <mine260309@gmail.com> wrote:

> On Tue, Jan 7, 2020 at 5:38 AM James Feist <james.feist@linux.intel.com>
> wrote:
> >
> > On 1/6/20 1:29 PM, Alex Qiu wrote:
> > > Hi James,
> > >
> > > Thanks for your quick reply and reviewing my code in the morning!
> > >
> > > That looks interesting, so this ScaleFactor will be used to multiply
> the
> > > voltage value from hwmon without setting the shunt_resistor explicitly?
> > > I do have a little concern on the resolution, because it's only
> > > reporting 0.165V with default shunt_resistor setting, but we'll try and
> > > see if this will work for our case. In the meantime, do you know any
> > > other method that will work?
> >
> > That's all I'm aware of in dbus-sensors. We have a voltage divider
> > in-front of our ADC channels, so we use this scale factor to calculate
> > the actual voltage. Anything else I think you'd need to add as a new
> > change if you're using dbus-sensors. I'm not sure if phosphor-hwmon
> > offers anything you could use or not.
>
> With phosphor-hwmon, you could define GAIN, OFFSET in the config file
> to adjust the reading.
> See details in
>
> https://github.com/openbmc/docs/blob/master/architecture/sensor-architecture.md#my-sensors-are-not-defined-in-an-mrw
>

[-- Attachment #2: Type: text/html, Size: 2256 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-01-07 17:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 21:16 Configuring shunt_resistor in hwmon Alex Qiu
2020-01-06 21:21 ` James Feist
2020-01-06 21:29   ` Alex Qiu
2020-01-06 21:37     ` James Feist
2020-01-06 21:44       ` Alex Qiu
2020-01-07  3:20       ` Lei YU
2020-01-07 17:11         ` Alex Qiu
2020-01-06 23:37 ` Vijay Khemka
2020-01-06 23:40   ` Alex Qiu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.