Lines Matching +full:phosphor +full:- +full:dbus +full:- +full:interfaces

1 # Sensor Support for OpenBMC using phosphor-hwmon
3 This document describes sensors provided by [phosphor-hwmon][15]. An alternate
4 method is to use the suite of applications provided by [dbus-sensors][16]. While
5 the configuration details between the two methods differ, the D-Bus
10 map sensors to [D-Bus][1] objects. The D-Bus object will broadcast the
15 ## D-Bus
18 Service xyz.openbmc_project.Hwmon-<hash>.Hwmon1
20 Interfaces xyz.openbmc_project.Sensor.[*], others (see below)
27 - **<type\>** : The [HWMon class][2] name in lower case.
28 - Examples include `temperature, fan_tach, voltage`.
30 - **<label\>** : User defined name of the sensor.
31 - Examples include `ambient, cpu0, fan5`
33 **Note**: The label shall comply with "Valid Object Paths" of [D-Bus Spec][3],
34 that shall only contain the ASCII characters `[A-Z][a-z][0-9]\_`.
46 sensor information on D-Bus.
56 #### D-Bus object paths
58 The association links the following D-Bus object paths together:
60 - Chassis inventory item object path
61 - List of sensor object paths for sensors within the chassis
65 - "all_sensors"
66 - Contains the list of all sensors for this chassis
67 - "chassis"
68 - Contains the chassis associated with this sensor
72 - /xyz/openbmc_project/inventory/system/chassis/all_sensors
73 - "endpoints" property contains
74 - /xyz/openbmc_project/sensors/fan_tach/fan0_0
75 - /xyz/openbmc_project/sensors/fan_tach/fan0_1
76 - /xyz/openbmc_project/sensors/temperature/ambient
77 - /xyz/openbmc_project/sensors/voltage/p0_vdn_voltage
78 - /xyz/openbmc_project/sensors/fan_tach/fan0_0/chassis
79 - "endpoints" property contains
80 - /xyz/openbmc_project/inventory/system/chassis
82 ### Association Type #2: Linking a low-level hardware item to its sensors
84 A sensor is usually related to a low-level hardware item, such as a fan, power
88 - Presence ([Inventory.Item interface][12])
89 - Functional state ([OperationalStatus interface][13])
90 - Manufacturer, Model, PartNumber, SerialNumber ([Decorator.Asset
93 For this reason, an ObjectMapper association is used to link a low-level
95 temperature and output voltage sensors, or a dual-rotor fan could have two tach
98 #### D-Bus object paths
100 The association links the following D-Bus object paths together:
102 - Low-level hardware inventory item object path
103 - List of sensor object paths for sensors related to that hardware item
107 - "sensors"
108 - Contains the list of sensors for this low-level hardware item
109 - "inventory"
110 - Contains the low-level hardware inventory item for this sensor
114 - /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0/sensors
115 - "endpoints" property contains
116 - /xyz/openbmc_project/sensors/fan_tach/fan0_0
117 - /xyz/openbmc_project/sensors/fan_tach/fan0_1
118 - /xyz/openbmc_project/sensors/fan_tach/fan0_0/inventory
119 - "endpoints" property contains
120 - /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
126 sensor value. The [Sensor Interfaces][4] are described in their respective YAML
128 described below the [phosphor-dbus-interfaces][5] parent directory.
131 [openbmc/phosphor-dbus-interfaces/xyz/openbmc_project/Sensor/Threshold/Warning.yaml][6]
133 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Maps to D-Bus interface
136 Each 'name' property in the YAML file maps directly to D-Bus properties.
144 - name: WarningHigh
146 - name: WarningLow
148 - name: WarningAlarmHigh
150 - name: WarningAlarmLow
157 busctl --system introspect xyz.openbmc_project.Hwmon-3301914901.Hwmon1 \
161 .WarningAlarmHigh property b false emits-change writable
162 .WarningAlarmLow property b false emits-change writable
163 .WarningHigh property x 40000 emits-change writable
164 .WarningLow property x 10000 emits-change writable
173 "Scale": -3,
184 ### Other Interfaces
186 Aside from the `xyz.openbmc_project.Sensor` interfaces, the sensor D-Bus objects
187 may also expose the following interfaces:
190 - Provides a Target property to set a fan RPM value
192 - Provides a Target property to set a fan PWM value
194 - Provides a Functional property that tracks the state of any fault files
198 Any property value change broadcasts a signal on D-Bus. When a value trips past
199 a threshold, an additional D-Bus signal is sent.
204 | ---- | --- | ------------------------------------------------------------------------------------…
217 HWMon sensors are defined in the `recipes-phosphor/sensor/phosphor-hwmon%` path
231 recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@c0/tmp423@4c.conf
238 /sys/firmware/devicetree/base/ahb/apb/bus@1e78a000/i2c-bus@c0/tmp423@4c
244 for the OCC device on an OpenPOWER system. Note how a '--' replaces a ':' in the
248 recipes-phosphor/sensors/phosphor-hwmon%/obmc/hwmon/devices/platform/gpio-fsi/fsi0/slave@00--00/00-…
254 /sys/devices/platform/gpio-fsi/fsi0/slave@00:00/00:00:00:06/sbefifo1-dev0/occ-hwmon.1
255 /etc/default/obmc/hwmon/devices/platform/gpio-fsi/fsi0/slave@00--00/00--00--00--06/sbefifo1-dev0/oc…
258 In order for the sensor to be exposed to D-Bus, the configuration file must
266 # = Association number (i.e. 1-n)
272 | Attribute | Interfaces Added |
273 | -------------- | -------------------------------------- |
281 | ---------------------- | ---------------------------- |
290 values must be described in 10<sup>-3</sup> degrees Celsius.
300 The phosphor-hwmon code supports these additional config file entries:
355 reading the hardware, the corresponding sensor object will be removed from D-Bus
391 [example YAML](https://github.com/openbmc/phosphor-host-ipmid/blob/master/scripts/sensor-example.ya…
401 - y: the 'final value' as reported by IPMItool
402 - x: 8 bits, unsigned, reading data encoded in IPMI response packet
403 - M: 10 bits, signed integer multiplier, `multiplierM` in YAML
404 - B: 10 bits, signed additive offset, `offsetB` in YAML
405 - bExp: 4 bits, signed, `bExp` in YAML
406 - rExp: 4 bits, signed, `rExp` in YAML
408 In addition, phosphor-ipmi-host configuration also supports `scale` property,
409 which applies for analog sensors, meaning the value read over DBus should be
415 - Supported range: [0, 255 \* M \* 10^(scale - rExp)]
416 - Resolution: M \* 10^(scale - rExp)
419 hwmon sysfs scales the value by 1000, so the sensor value read over DBus is
426 rExp: -3
427 scale: -3
430 so for a DBus sensor value of 4986 meaning 4.986V, phosphor-ipmi-host would
436 rExp: -3
443 y = 20 * 249 * 10^-3 = 4.98 (V)
450 [1]: https://dbus.freedesktop.org/doc/dbus-tutorial.html
451 [2]: https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface
452 [3]: https://dbus.freedesktop.org/doc/dbus-specification.html#basic-types
454 https://github.com/openbmc/phosphor-dbus-interfaces/tree/master/yaml/xyz/openbmc_project/Sensor
455 [5]: https://github.com/openbmc/phosphor-dbus-interfaces
457 …https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Sensor/Th…
458 [7]: https://github.com/openbmc/openbmc/tree/master/meta-openbmc-machines
460 …nbmc/openbmc/blob/master/meta-ibm/meta-palmetto/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon…
461 [9]: https://lists.ozlabs.org/pipermail/openbmc/2016-November/005309.html
464 https://github.com/openbmc/docs/blob/master/architecture/object-mapper.md#associations
466 …https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Inventory…
468 …https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/State/Dec…
470 …https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Inventory…
471 [15]: https://github.com/openbmc/phosphor-hwmon
472 [16]: https://github.com/openbmc/dbus-sensors