History log of /openbmc/phosphor-power/tools/power-utils/test/test_updater.cpp (Results 1 – 6 of 6)
Revision Date Author Comments
# b1216b96 21-Jan-2020 Shawn McCarney <shawnmm@us.ibm.com>

Create libi2c_dev_mock.a to solve linker errors

The i2c::create() function is currently defined in
mocked_i2c_interface.hpp. This causes linker errors if that header file
is include

Create libi2c_dev_mock.a to solve linker errors

The i2c::create() function is currently defined in
mocked_i2c_interface.hpp. This causes linker errors if that header file
is included by multiple .cpp files in the same test executable.

Moved i2c::create() to mocked_i2c_interface.cpp so that it is only
defined once. Created the static library libi2c_dev_mock.a that
contains mocked_i2c_interface.o.

Test executables that need the mock version of i2c::create() should link
with libi2c_dev_mock.a.

Normal executables that need the real version of i2c::create() should
link with libi2c_dev.a as before. This has not changed.

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: Ic00203c5429c1a2162327905ba547602258c6b0d

show more ...


# 1d103428 29-Nov-2019 Lei YU <mine260309@gmail.com>

i2c: Add i2c block transaction support

The previous code always uses SMBus block read/write.
On some PSU (e.g. FP5280G2's PSU) the I2C block read/write is
required, so add that suppo

i2c: Add i2c block transaction support

The previous code always uses SMBus block read/write.
On some PSU (e.g. FP5280G2's PSU) the I2C block read/write is
required, so add that support.

Specifically, add a Mode enum class and add the parameter for block
read/write to indicate whether SMBus or I2C block read/write is to be
called.

Tested: Verify the code works on FP5280G2 with I2C block write.

Note: Currently there is no case for I2C block read, so that function is
not tested.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I5f77ffe6900d14f3703dae7241799a7b37c5a726

show more ...


# 34fb8bda 07-Nov-2019 Lei YU <mine260309@gmail.com>

i2c: Implement write function

Implement I2CDevice::write() by invoking i2c_smbus_write_xxx() APIs.
The code is referenced from i2c-tools' i2cset.c:

https://github.com/ev3dev/i2

i2c: Implement write function

Implement I2CDevice::write() by invoking i2c_smbus_write_xxx() APIs.
The code is referenced from i2c-tools' i2cset.c:

https://github.com/ev3dev/i2c-tools/blob/ev3dev-stretch/tools/i2cset.c

Tested: Verify on Witherspoon that it writes the PSU unlock upgrade
command and boot flag successfully.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I9fb014c787ef3ebb2f7793a0d012b1d652ef069f

show more ...


# 92e89eb5 06-Nov-2019 Lei YU <mine260309@gmail.com>

i2c: Implement read function

Implement I2CDevice::read() by invoking i2c_smbus_read_xxx() APIs.
The code is referenced from i2c-tools' i2cget.c:

https://github.com/ev3dev/i2c-t

i2c: Implement read function

Implement I2CDevice::read() by invoking i2c_smbus_read_xxx() APIs.
The code is referenced from i2c-tools' i2cget.c:

https://github.com/ev3dev/i2c-tools/blob/ev3dev-stretch/tools/i2cget.c

Tested: Verify on Witherspoon that it reads the PSU ppgrade mode status
register (1 byte) and CRC16 register (2 bytes) correctly.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I8759b6a35229f81120acf77f08429f7f79458b8b

show more ...


# 7c2fbbb6 06-Nov-2019 Lei YU <mine260309@gmail.com>

power-utils: Initially use i2c in updater

Create I2CDevice in updater and invoke read() in doUpdate(), that could
be used in future.
Use mocked I2CInterface in updater's unit test ca

power-utils: Initially use i2c in updater

Create I2CDevice in updater and invoke read() in doUpdate(), that could
be used in future.
Use mocked I2CInterface in updater's unit test case.

Tested: Manually verify on Witherspoon that the i2c device is opened
and closed during PSU code update.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: Ie3d9f0565a2ceb000f489647a58ca967a2ef0c38

show more ...


# 9ab6d750 28-Oct-2019 Lei YU <mine260309@gmail.com>

power-utils: Initially add Updater class

The Updater class is used to do PSU code update, initially add it that
does unbind/bind driver and set PSU present to false/true during the
u

power-utils: Initially add Updater class

The Updater class is used to do PSU code update, initially add it that
does unbind/bind driver and set PSU present to false/true during the
update.

Tested: Manually verify on Witherspoon that the driver is unbind/bind,
and the PSU present property is set to false/true during the PSU
update:
psutils --update \
/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0 \
/tmp/images/xxxxxxxx

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: Ic0a9df7687303caeb9a7f21ba00dc33ee76482db

show more ...