5c6a693e | 29-Nov-2023 |
Patrick Williams <patrick@stwcx.xyz> |
build: use allowed over enabled
Meson feature options are typically in a tri-state of enabled, disabled, or auto. The enabled and disabled functions on an option (from `get_option`) no longer retur
build: use allowed over enabled
Meson feature options are typically in a tri-state of enabled, disabled, or auto. The enabled and disabled functions on an option (from `get_option`) no longer return true for auto features. Instead, the expectation is to use `allowed()` which is true for both enabled and auto.
Switch all uses of `enabled` to `allowed`.
Change-Id: I37fcb391dcb215a86a60c26f7512f6ccb8312dc4 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
c0b9e9e4 | 17-Jul-2023 |
Matt Spinler <spinler@us.ibm.com> |
Fix standalone build fail in utils/version.cpp
Either the new compiler, C++ version, or nlohmann version starting giving an error when building with subprojects:
``` ../tools/power-utils/version.cp
Fix standalone build fail in utils/version.cpp
Either the new compiler, C++ version, or nlohmann version starting giving an error when building with subprojects:
``` ../tools/power-utils/version.cpp: In function ‘PsuVersionInfo utils::getVersionInfo(const std::string&)’: ../tools/power-utils/version.cpp:67:40: error: ambiguous overload for ‘operator=’ (operand types are ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} and ‘const nlohmann::basic_json<>::value_type’ {aka ‘const nlohmann::basic_json<>’}) 67 | versionStr = fru["fileName"]; ```
Change-Id: Ic0de80331a04110a279702b30bd7cf55ec8c083c Signed-off-by: Matt Spinler <spinler@us.ibm.com>
show more ...
|
888bebde | 31-May-2023 |
Patrick Williams <patrick@stwcx.xyz> |
meson: add necessary subprojects
Add subprojects for all the direct dependencies of the project such that the project can be built outside of a Yocto SDK on a typical Linux development system.
-
meson: add necessary subprojects
Add subprojects for all the direct dependencies of the project such that the project can be built outside of a Yocto SDK on a typical Linux development system.
- Update the .gitignore to ignore the subproject source directories. - Update the .gitignore to ignore alternative build subdirectory names as is typical with most projects in the openbmc organization. - Add wrap files for direct dependencies, copied from other repositories that already have the same dependencies. - Modify the meson.build dependency for libgpiod so that the C++ bindings are included. - Add many missing dependencies throughout. - Sort all dependencies alphabetically for consistency.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0feb6f0f175e6dba0b00a2c2b666eb0801575734
show more ...
|
48781aef | 10-May-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository.
Change-Id: If66f68c96df4baf8dc07abf8729a3cb7657e932d Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
b9cf0d2b | 27-Feb-2023 |
George Liu <liuxiwei@inspur.com> |
tools: Fix some warnings by cppcheck
Warning message: tools/i2c/i2c.hpp:30:9: performance: Variable 'busStr' is assigned in constructor body. Consider performing initialization in initialization lis
tools: Fix some warnings by cppcheck
Warning message: tools/i2c/i2c.hpp:30:9: performance: Variable 'busStr' is assigned in constructor body. Consider performing initialization in initialization list. [useInitializationList] busStr = "/dev/i2c-" + std::to_string(busId); ^
tools/power-utils/updater.cpp:213:18: style: Local variable 'devPath' shadows outer variable [shadowVariable] auto devPath = internal::getDevicePath(p); ^ tools/power-utils/updater.hpp:108:17: note: Shadowed declaration std::string devPath; ^ tools/power-utils/updater.cpp:213:18: note: Shadow variable auto devPath = internal::getDevicePath(p); ^
Tested: Verify that there are no such warnings in local CI.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ibc7536345ee40579256c398646ad00a05b686ab3
show more ...
|
7354ce62 | 22-Jul-2022 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are for: * bus_t * exception_t * manager_t * match_t * message_t * object_t * slot_t
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ief05bd757cffb1453e058a719ee4b060861752e7
show more ...
|
dc8e9312 | 14-Feb-2020 |
Brandon Wyman <bjwyman@gmail.com> |
Add OE-SDK option to Meson
Add option to enable oe-sdk which will setup linker arguments to allow for building and running tests with the x86 SDK.
Signed-off-by: Brandon Wyman <bjwyman@gmail.com> C
Add OE-SDK option to Meson
Add option to enable oe-sdk which will setup linker arguments to allow for building and running tests with the x86 SDK.
Signed-off-by: Brandon Wyman <bjwyman@gmail.com> Change-Id: I8279b7d862e29235d2d4eae39405cc35a51b762f
show more ...
|
ff481438 | 13-Feb-2020 |
Shawn McCarney <shawnmm@us.ibm.com> |
Only build tests if -Dtests=enabled specified
A meson build option named 'tests' is defined for this repository. It indicates whether gtest/gmock tests should be built.
However, some tests are cur
Only build tests if -Dtests=enabled specified
A meson build option named 'tests' is defined for this repository. It indicates whether gtest/gmock tests should be built.
However, some tests are currently always built even if -Dtests=enabled isn't specified. This causes build errors in some environments where gtest and gmock are not available.
Modify meson.build files to only descend into 'test' subdirectories and build test cases if -Dtests=enabled was specified.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com> Change-Id: Ic0da2326e3d9c273ff76d54b5ac27cbe00d78876
show more ...
|
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 included by multiple .c
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 ...
|
d1bc4cec | 13-Dec-2019 |
Brandon Wyman <bjwyman@gmail.com> |
Update .clang-format to latest version from docs
Signed-off-by: Brandon Wyman <bjwyman@gmail.com> Change-Id: Ie6e7f43e7554429704dca86b21320c90aed18791 |
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 support.
Specificall
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/i2c-tools/blob/ev3dev-
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-tools/blob/ev3dev-str
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 case.
Tested: Man
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 ...
|
e8c9cd64 | 04-Nov-2019 |
Lei YU <mine260309@gmail.com> |
power-utils: Implement isReadyToUpdate
Check other PSUs' status word and status vout, return false when the status has input/output fault.
Tested: Verify on Witherspoon that the update is not start
power-utils: Implement isReadyToUpdate
Check other PSUs' status word and status vout, return false when the status has input/output fault.
Tested: Verify on Witherspoon that the update is not started and log Unable to update PSU when other PSU has input/ouput fault when the other PSU has input/output error; And the update continues when the other PSU has no errors.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: Ia2a4a23a43c18a417b8a85fbd5339f487984e689
show more ...
|
575ed139 | 29-Oct-2019 |
Lei YU <mine260309@gmail.com> |
power-utils: Initially add isReadyToUpdate
Initially add isReadyToUpdate() that checks the pre-condition for PSU update. For now it only checks the power state and return false if power is on.
When
power-utils: Initially add isReadyToUpdate
Initially add isReadyToUpdate() that checks the pre-condition for PSU update. For now it only checks the power state and return false if power is on.
When it is not ready to update, there is no need to unbind/bind the driver, so move the unbind/bind calls into doUpdate() from ctor/dtor.
Tested: Verify it returns and logs "PSU not ready to update" when power is on, and continues the update when power is off.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I1cbb454baf735ceb3de883a7317753d46485696f
show more ...
|
cfc040c7 | 29-Oct-2019 |
Lei YU <mine260309@gmail.com> |
Refactor: Move isPoweredOn to utility
The check of power on will be used by other components, so move it to utility. There are several constexpr definitions are used by multiple components, move the
Refactor: Move isPoweredOn to utility
The check of power on will be used by other components, so move it to utility. There are several constexpr definitions are used by multiple components, move them into types.hpp so that we do not have duplicated constexprs.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I42ad142d6e7ae8da9c0cf6d8f5cb21dee229eba2
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 update.
Tested:
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 ...
|
d19df255 | 25-Oct-2019 |
Lei YU <mine260309@gmail.com> |
power-utils: Initially add --update option
This option is used to update the PSU firmware, usage:
psutils --update <psu-inventory-path> <image-dir>
Signed-off-by: Lei YU <mine260309@gmail.com> Ch
power-utils: Initially add --update option
This option is used to update the PSU firmware, usage:
psutils --update <psu-inventory-path> <image-dir>
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I3958e360f04bb0ace9eea41d9f81e4533432701c
show more ...
|
093b5917 | 22-Oct-2019 |
Lei YU <mine260309@gmail.com> |
power-utils: Add --compare option
This option is to get a latest version from a list of PSU versions.
Due to the --compare option requires a list of strings and only one option is supported at the
power-utils: Add --compare option
This option is to get a latest version from a list of PSU versions.
Due to the --compare option requires a list of strings and only one option is supported at the same time, it's easier to switch to CLI11 to parse the arguments.
Also add --raw option that outputs the text without linefeed.
Tested: Verify both --get-version and --compare works on Witherspoon.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: Idec75e3a5699eba8ba587e74824431993fe10c4c
show more ...
|
0bf1b782 | 29-Aug-2019 |
Lei YU <mine260309@gmail.com> |
Add power-utils
The power-utils is added to support psu code manager as vendor-specifc tool. In this commit, the util returns the PSU version based on the PSU inventory path, where the inventory pat
Add power-utils
The power-utils is added to support psu code manager as vendor-specifc tool. In this commit, the util returns the PSU version based on the PSU inventory path, where the inventory path are mapped to the PSU sysfs device directory based on a json config.
Tested: Verify the version is returned correctly on Witherspoon: $ ./psutils --getversion \ /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0 01100110 And it returns non-zero when it fails to get the version without throwing exception.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: Ib60f3aa50ce581d55fe4cd62642f30398e25be83
show more ...
|