> -----Original Message----- > From: Intel-wired-lan <[email protected]> On Behalf Of > Konrad Knitter > Sent: Tuesday, October 24, 2023 4:31 PM > To: [email protected] > Cc: [email protected]; [email protected]; Knitter, Konrad > <[email protected]>; Joyner, Eric <[email protected]>; Marcin > Szycik <[email protected]>; Marcin Domagala > <[email protected]>; Kitszel, Przemyslaw > <[email protected]>; [email protected] > Subject: [Intel-wired-lan] [PATCH iwl-next v5] ice: read internal temperature > sensor > > Since 4.30 firmware exposes internal thermal sensor reading via admin > queue commands. Expose those readouts via hwmon API when supported. > > Datasheet: > > Get Sensor Reading Command (Opcode: 0x0632) > > +--------------------+--------+--------------------+-------------------------+ > | Name | Bytes | Value | Remarks | > +--------------------+--------+--------------------+-------------------------+ > | Flags | 1-0 | | | > | Opcode | 2-3 | 0x0632 | Command opcode | > | Datalen | 4-5 | 0 | No external buffer. | > | Return value | 6-7 | | Return value. | > | Cookie High | 8-11 | Cookie | | > | Cookie Low | 12-15 | Cookie | | > | Sensor | 16 | | 0x00: Internal temp | > | | | | 0x01-0xFF: Reserved. | > | Format | 17 | Requested response | Only 0x00 is supported. | > | | | format | 0x01-0xFF: Reserved. | > | Reserved | 18-23 | | | > | Data Address high | 24-27 | Response buffer | | > | | | address | | > | Data Address low | 28-31 | Response buffer | | > | | | address | | > +--------------------+--------+--------------------+-------------------------+ > > Get Sensor Reading Response (Opcode: 0x0632) > > +--------------------+--------+--------------------+-------------------------+ > | Name | Bytes | Value | Remarks | > +--------------------+--------+--------------------+-------------------------+ > | Flags | 1-0 | | | > | Opcode | 2-3 | 0x0632 | Command opcode | > | Datalen | 4-5 | 0 | No external buffer | > | Return value | 6-7 | | Return value. | > | | | | EINVAL: Invalid | > | | | | parameters | > | | | | ENOENT: Unsupported | > | | | | sensor | > | | | | EIO: Sensor access | > | | | | error | > | Cookie High | 8-11 | Cookie | | > | Cookie Low | 12-15 | Cookie | | > | Sensor Reading | 16-23 | | Format of the reading | > | | | | is dependent on request | > | Data Address high | 24-27 | Response buffer | | > | | | address | | > | Data Address low | 28-31 | Response buffer | | > | | | address | | > +--------------------+--------+--------------------+-------------------------+ > > Sensor Reading for Sensor 0x00 (Internal Chip Temperature): > > +--------------------+--------+--------------------+-------------------------+ > | Name | Bytes | Value | Remarks | > +--------------------+--------+--------------------+-------------------------+ > | Thermal Sensor | 0 | | Reading in degrees | > | reading | | | Celsius. Signed int8 | > | Warning High | 1 | | Warning High threshold | > | threshold | | | in degrees Celsius. | > | | | | Unsigned int8. | > | | | | 0xFF when unsupported | > | Critical High | 2 | | Critical High threshold | > | threshold | | | in degrees Celsius. | > | | | | Unsigned int8. | > | | | | 0xFF when unsupported | > | Fatal High | 3 | | Fatal High threshold | > | threshold | | | in degrees Celsius. | > | | | | Unsigned int8. | > | | | | 0xFF when unsupported | > | Reserved | 4-7 | | | > +--------------------+--------+--------------------+-------------------------+ > > Driver provides current reading from HW as well as device specific > thresholds for thermal alarm (Warning, Critical, Fatal) events. > > $ sensors > > Output > ========================================================= > ice-pci-b100 > Adapter: PCI adapter > temp1: +62.0°C (high = +95.0°C, crit = +105.0°C) > (emerg = +115.0°C) > > Tested on Intel Corporation Ethernet Controller E810-C for SFP > > Co-developed-by: Marcin Domagala <[email protected]> > Signed-off-by: Marcin Domagala <[email protected]> > Co-developed-by: Eric Joyner <[email protected]> > Signed-off-by: Eric Joyner <[email protected]> > Reviewed-by: Marcin Szycik <[email protected]> > Reviewed-by: Przemek Kitszel <[email protected]> > Signed-off-by: Konrad Knitter <[email protected]> > --- > v5: additional documentation, fix CONFIG_ICE=y, CONFIG_HWMON=m > v4: added dependency config_hwmon, cleanups > v3: add SPDX identification to ice_hwmon files > v2: fix formmating issues, added hwmon maintainers to Cc > --- > drivers/net/ethernet/intel/Kconfig | 11 ++ > drivers/net/ethernet/intel/ice/Makefile | 1 + > drivers/net/ethernet/intel/ice/ice.h | 1 + > .../net/ethernet/intel/ice/ice_adminq_cmd.h | 28 ++++ > drivers/net/ethernet/intel/ice/ice_common.c | 54 +++++++- > drivers/net/ethernet/intel/ice/ice_common.h | 2 + > drivers/net/ethernet/intel/ice/ice_hwmon.c | 126 ++++++++++++++++++ > drivers/net/ethernet/intel/ice/ice_hwmon.h | 15 +++ > drivers/net/ethernet/intel/ice/ice_main.c | 5 + > drivers/net/ethernet/intel/ice/ice_type.h | 7 + > 10 files changed, 249 insertions(+), 1 deletion(-) > create mode 100644 drivers/net/ethernet/intel/ice/ice_hwmon.c > create mode 100644 drivers/net/ethernet/intel/ice/ice_hwmon.h >
Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel) _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
