test: dm: pmbus: add a sandbox PMBus chip emulator

Add a UCLASS_I2C_EMUL driver that emulates a PMBus 1.x compliant chip
behind the sandbox I2C bus, plus the test.dts wiring and sandbox
defconfig that bind it to the generic PMBus regulator
(compatible = "pmbus"). This design is a stub only: it lets the
follow-up dm unit test drive lib/pmbus.c, the generic regulator and
the pmbus CLI command with no real hardware.

The emulator models a flat per-command 16-bit register file and the
three identification block strings (MFR_ID / MFR_MODEL /
MFR_REVISION). READ_IIN and READ_POUT are deliberately left
unimplemented (the chip NAKs them) so the telemetry printer's
"(not supported)" path is exercised, mirroring a real buck that only
calibrates a subset of the sensor classes.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
Vincent Jardin
2026-07-13 11:24:40 +08:00
committed by Peng Fan
parent a5639a4d7b
commit 995cc3383b
6 changed files with 199 additions and 0 deletions
+1
View File
@@ -1541,6 +1541,7 @@ F: drivers/power/regulator/mpq8785.c
F: drivers/power/regulator/pmbus_generic.c
F: drivers/power/regulator/pmbus_helper.c
F: drivers/power/regulator/pmbus_helper.h
F: drivers/power/regulator/sandbox_pmbus.c
F: drivers/thermal/pmbus_thermal.c
F: include/pmbus.h
F: lib/pmbus.c