[PATCH v4 3/8] hw/i2c: pmbus: add fan support

2023-10-23 Thread titusr
PMBus devices may integrate fans whose operation is configurable over PMBus. This commit allows the driver to read and write the fan control registers but does not model the operation of fans. Reviewed-by: Stephen Longfield Acked-by: Corey Minyard Signed-off-by: Titus Rwantare --- hw/i2c/pmbus

[PATCH v4 7/8] hw/i2c: pmbus: immediately clear faults on request

2023-10-23 Thread titusr
The probing process of the generic pmbus driver generates faults to determine if functions are available. These faults were not always cleared resulting in probe failures. Reviewed-by: Patrick Venture Signed-off-by: Titus Rwantare --- hw/i2c/pmbus_device.c | 5 + 1 file changed, 5 insertion

[PATCH v4 2/8] hw/i2c: pmbus: add vout mode bitfields

2023-10-23 Thread titusr
The VOUT_MODE command is described in the PMBus Specification, Part II, Ver 1.3 Section 8.3 VOUT_MODE has a three bit mode and 4 bit parameter, the three bit mode determines whether voltages are formatted as uint16, uint16, VID, and Direct modes. VID and Direct modes use the remaining 5 bits to sc

[PATCH v4 4/8] hw/i2c: pmbus: add VCAP register

2023-10-23 Thread titusr
VCAP is a register for devices with energy storage capacitors. Reviewed-by: Benjamin Streb Acked-by: Corey Minyard Signed-off-by: Titus Rwantare --- hw/i2c/pmbus_device.c | 8 include/hw/i2c/pmbus_device.h | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/i2c/pmbus_devi

[PATCH v4 5/8] hw/sensor: add ADM1266 device model

2023-10-23 Thread titusr
The ADM1266 is a cascadable super sequencer with margin control and fault recording. This commit adds basic support for its PMBus commands and models the identification registers that can be modified in a firmware update. Reviewed-by: Hao Wu Acked-by: Corey Minyard Signed-off-by: Titus

[PATCH v4 8/8] hw/i2c: pmbus: reset page register for out of range reads

2023-10-23 Thread titusr
The linux pmbus driver scans all possible pages and does not reset the current page after the scan, making all future page reads fail as out of range on devices with a single page. This change resets out of range pages immediately on write. Also added a qtest for simultaneous writes to all pages.

[PATCH v4 1/8] hw/i2c: pmbus add support for block receive

2023-10-23 Thread titusr
PMBus devices can send and receive variable length data using the block read and write format, with the first byte in the payload denoting the length. This is mostly used for strings and on-device logs. Devices can respond to a block read with an empty string. Reviewed-by: Hao Wu Acked-by: Corey

[PATCH v4 0/8] PMBus fixes and new functions

2023-10-23 Thread titusr
This patch series contains fixes and improvements to PMBus support in QEMU. The following has been added: - Support for block receive - Support for devices with fans - Support for the VCAP register for devices with onboard energy storage - A bitfield struct for the vout mode register,

[PATCH v4 6/8] tests/qtest: add tests for ADM1266

2023-10-23 Thread titusr
The ADM1266 can have string fields written by the driver, so it's worth specifically testing. Reviewed-by: Hao Wu Acked-by: Corey Minyard Signed-off-by: Titus Rwantare --- tests/qtest/adm1266-test.c | 123 + tests/qtest/meson.build| 1 + 2