Skip to content

hw/i2c: PMBus updates and adm1266 fixes

Titus Rwantare qemu-arm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 6 repliesIn review

Since v1 from the cover letter

- Added the adm1266 patches that fix accessing the MFR_* registers
- Fixed vout_mode handling to avoid values overflowing/being truncated by the adm1266 implementation.
- Added fix for PMBus vout_mode bug where guests accesses would break due to the bitfields being packed in the wrong order.
- Updated VMState to work around breaking migration while still storing the increased SMBus data.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8osdep: add DIV_ROUND_CLOSESTinclude/qemu/osdep.h+13 -01 reply
2/8hw/i2c: pmbus: add milliunits linear mode functionshw/i2c/pmbus_device.c include/hw/i2c/pmbus_device.h+57 -00 replies
3/8hw/i2c: smbus: increase MAX_DATA_LENhw/i2c/smbus_slave.c include/hw/i2c/smbus_slave.h+27 -21 reply
4/8hw/sensor: update adm1266 block transfershw/sensor/adm1266.c tests/qtest/adm1266-test.c+126 -231 reply
5/8hw/sensor: switch adm1266 to millivolts vouthw/sensor/adm1266.c tests/qtest/adm1266-test.c+167 -101 reply
6/8hw/i2c: fix VOUT_MODE representation on little-endian machinesinclude/hw/i2c/pmbus_device.h+7 -01 reply
7/8hw/sensor: adm1266: expose vout_mode over QMPhw/sensor/adm1266.c tests/qtest/adm1266-test.c+43 -01 reply
8/8hw/sensor: adm1266: set default VOUT modehw/sensor/adm1266.c tests/qtest/adm1266-test.c+13 -60 replies

Reviews trailers per patch

1 of 8 patches has a Reviewed-by or Acked-by.

PatchPeter Maydell
1/8
2/8
3/8R-b
4/8
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/8] hw/i2c: PMBus updates and adm1266 fixes

This series adds various fixes to PMBus and SMBus support.

Since v1:
- Added the adm1266 patches that fix accessing the MFR_* registers
- Fixed vout_mode handling to avoid values overflowing/being truncated by the adm1266 implementation.
- Added fix for PMBus vout_mode bug where guests accesses would break due to the bitfields being packed in the wrong order.
- Updated VMState to work around breaking migration while still storing the increased SMBus data.

The maximum SMBus data length is increased to 257 bytes, (payload is 255 bytes) to support SMBus 3.0 block transfers. SMBus devices don’t have to report their specification version, and this change allows us to enable newer PMBus devices that are based on top of SMBus 3.0.

Additionally, this series:
- Adds the DIV_ROUND_CLOSEST helper macro, lifted from the linux implementation, to match the rounding in linux drivers.
- Adds PMBus helper functions to convert sensor values in milliunits to/from linear mode format (Linear16).

Jason Fan (1):
hw/i2c: fix VOUT_MODE representation on little-endian machines

Titus Rwantare (7):
osdep: add DIV_ROUND_CLOSEST
hw/i2c: pmbus: add milliunits linear mode functions hw/i2c: smbus: increase MAX_DATA_LEN hw/sensor: update adm1266 block transfers hw/sensor: switch adm1266 to millivolts vout hw/sensor: adm1266: expose vout_mode over QMP hw/sensor: adm1266: set default VOUT mode

 hw/i2c/pmbus_device.c         |  39 +++++++
 hw/i2c/smbus_slave.c          |  27 ++++-
 hw/sensor/adm1266.c           | 176 +++++++++++++++++++++++-----
 include/hw/i2c/pmbus_device.h |  25 ++++
 include/hw/i2c/smbus_slave.h  |   2 +-
 include/qemu/osdep.h          |  13 +++
 tests/qtest/adm1266-test.c    | 210 ++++++++++++++++++++++++++++++++--
 7 files changed, 452 insertions(+), 40 deletions(-)
Signature · 1 line
2.55.0.508.g3f0d502094-goog