Fan PWM monitoring and control

rgrs rgrs at protonmail.com
Wed Sep 18 19:29:57 AEST 2019


Hi Patrick, Matt,

I tried instructions from this wiki: https://developer.ibm.com/linuxonpower/2019/01/07/how-to-port-openbmc/
There is no GPIO to detect presence of fans, so tach readings is used instead.

Here's what I did while trying to enable Fan control:

1. Added Fan tach sensor in hwmon (adt7462.conf) is in the form LABEL=FANx_RPM
2. "ipmi-sensor-inventory.yaml" has below config:

60: &fan_tach
  sensorType: 0x04
  path: /xyz/openbmc_project/sensors/fan_tach/FAN0_RPM
  sensorReadingType: 0x01
  multiplierM: 100
  offsetB: 0
  bExp: 0
  unit: xyz.openbmc_project.Sensor.Value.Unit.RPMS
  scale: 0
  rExp: 0
  serviceInterface: org.freedesktop.DBus.Properties
  readingType: readingData
  interfaces:
        xyz.openbmc_project.Sensor.Value:
            Value:
                Offsets:
                    0xFF:
                        type: int64_t

and FAN PWM as

89: &fanpwm
    sensorType: 0x04
    path: /xyz/openbmc_project/sensors/fan_tach/FAN0_RPM
    sensorReadingType: 0x01
    multiplierM: 1
    offsetB: 0
    bExp: 0
    mutability: Mutability::Write
    serviceInterface: org.freedesktop.DBus.Properties
    readingType: readingData
    interfaces:
        xyz.openbmc_project.Control.FanPwm:
            Target:
                Offsets:
                    0xFF:
                        type: uint64_t


3. I copied meta-romulus/recipes-phosphor/fans to my platform and changed FAN names from "fanx" to "FANx_RPM" in yaml files.

This is what get in busctl tree related to Fans:
(I expected to see FanPwm entries in busctl and I'm not sure why there are multiple entries in inventory).

Service xyz.openbmc_project.Hwmon-2429843755.Hwmon1:
`-/xyz
  `-/xyz/openbmc_project
    `-/xyz/openbmc_project/sensors
      |-/xyz/openbmc_project/sensors/fan_tach
      | |-/xyz/openbmc_project/sensors/fan_tach/FAN0_RPM
      | |-/xyz/openbmc_project/sensors/fan_tach/FAN1_RPM
      | |-/xyz/openbmc_project/sensors/fan_tach/FAN2_RPM
      | `-/xyz/openbmc_project/sensors/fan_tach/FAN3_RPM
      `-/xyz/openbmc_project/sensors/temperature
        `-/xyz/openbmc_project/sensors/temperature/BACKPLANE_TEMP

Service xyz.openbmc_project.Inventory.Manager:
`-/xyz
  `-/xyz/openbmc_project
    `-/xyz/openbmc_project/inventory
      `-/xyz/openbmc_project/inventory/system
        `-/xyz/openbmc_project/inventory/system/chassis
          `-/xyz/openbmc_project/inventory/system/chassis/motherboard
            |-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN0
            | `-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN0/FAN0
            |-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN0_RPM
            | `-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN0_RPM/FAN0_RPM
            |-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN1
            | `-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN1/FAN1
            |-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN1_RPM
            | `-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN1_RPM/FAN1_RPM
            |-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN2
            | `-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN2/FAN2
            |-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN2_RPM
            | `-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN2_RPM/FAN2_RPM
            |-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN3
            | `-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN3/FAN3
            |-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN3_RPM
            | `-/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN3_RPM/FAN3_RPM
            |-/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
            |-/xyz/openbmc_project/inventory/system/chassis/motherboard/fan1
            |-/xyz/openbmc_project/inventory/system/chassis/motherboard/fan2
            `-/xyz/openbmc_project/inventory/system/chassis/motherboard/fan3


Thanks,
Raj


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, September 17, 2019 9:18 PM, Patrick Venture <venture at google.com> wrote:

> On Tue, Sep 17, 2019 at 8:32 AM Matthew Barth msbarth at linux.ibm.com wrote:
>
> > On 9/17/19 5:40 AM, rgrs wrote:
> >
> > > Hi,
> > > I need some help with phosphor hwmon related to fan sensors.
> > > I'm trying to control Fans in a server motherboard using ADT7462
> > > controller. Hw mon porting is done and the sysfs interfaces are working
> > > as expected.
> > > While I am able to read RPM, i don't find pwm/target to control the fans
> > > exposed as dbus objects.
> > > Do you have the hwmon config set similar to this to denote the fan
> > > targets are of PWM type?
> >
> > https://github.com/openbmc/openbmc/blob/master/meta-ibm/meta-romulus/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-tacho-controller%401e786000.conf
> >
> > > busctl --no-page tree xyz.openbmc_project.FanSensor
> > >
> > > ====================================================
> > >
> > > Failed to introspect object / of service xyz.openbmc_project.FanSensor:
> > > The name is not activatable
> > > No objects discovered.
> > > That does not look like a hwmon service name. If you are using
> > > phosphor-objmgr, you can use `# mapper get-service /xyz/openbmc_project/sensors/fan_tach` otherwise you'll need to find the
> > > hwmon service name associated with your fan controller device.
>
> running`busctl tree --no-pager` will just list everything, and you
> should see your fans in there. You can use the mapper too. I was
> curious, are you using entity-manager/dbus-sensors? When you mention
> FanSensor as the service, that's what it sounds like.
>
> > > I came across this post, I think it is similar to my issue.
> > > (https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-hwmon/+/8353)
> > > Please someone point to latest documentation or reference Fan porting
> > > from openBMC repo?
> > > What are the exact fields in YAML that are used create FanPWM objects.
> > > The Romulus machine should be a good reference for PWM based fan control
> > > using phosphor-hwmon. It uses the
> > > phosphor-fan-presence/[control|monitor] apps for controlling and
> > > monitoring fans
> >
> > https://github.com/openbmc/openbmc/tree/master/meta-ibm/meta-romulus
> >
> > > (I'm using Feb release in my sandbox,
> > > https://github.com/openbmc/docs/blob/master/release/release-notes.md#26-feb-4-2019)
> > > Thanks,
> > > Raj
> >
> > Matt




More information about the openbmc mailing list