History log of /openbmc/phosphor-power/phosphor-power-supply/test/mock.hpp (Results 1 – 20 of 20)
Revision Date Author Comments
# fb0ccb8e 24-Apr-2024 Shawn McCarney <shawnmm@us.ibm.com>

Promote getPath() to PMBusBase

Promote the getPath() method from the PMBus class to the PMBusBase
parent class. This allows the method to be called from automated tests
using mock subclasses of PMB

Promote getPath() to PMBusBase

Promote the getPath() method from the PMBus class to the PMBusBase
parent class. This allows the method to be called from automated tests
using mock subclasses of PMBusBase.

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

show more ...


# 592bd27c 30-Aug-2023 Matt Spinler <spinler@us.ibm.com>

psu-ng: Add peak input power sensor for some PSs

Some models of the ibm-cffps power supplies support an 'input history'
command that reports 30 second maximum and average input power values.
The cod

psu-ng: Add peak input power sensor for some PSs

Some models of the ibm-cffps power supplies support an 'input history'
command that reports 30 second maximum and average input power values.
The code was currently putting those on an 'org.open_power' D-Bus
interface so that the history of those values could be captured in a
single D-Bus call.

Now that there is a real telemetry feature in Redfish that can capture
the history of a single sensor value, we can drop the custom D-Bus
interface and just use the normal Sensor.Value interface that contains
the most recent maximum value from the input history command, The sensor
name will be 'psX_input_power_peak' where X is the PS instance number.

The average input power telemetry will now just be obtained from the
psX_input_power sensor provided by phosphor-hwmon so an equivalent
sensor to the peak isn't needed here.

This commit will add support for putting the new sensor on D-Bus, and a
future one will remove the previous input history support.

Like sensors in other daemons, it will be set to not available when a PS
is removed, and not functional when it has an access problem. There
will be associations to the parent chassis and to the power supply so it
will show up in Redfish output with the other sensors.

This commit did remove one of the input history testcases, as trying to
get the right sequence of EXPECT_CALLs would get tricky when both the
old and new are running together.

Tested:
- New sensor shows up when PS is present and supports it.
- All interfaces on the object path are correct.
- Sensor value matches what org.open_power Max property had.
- Works correctly when:
- PS is missing on startup
- PS is removed
- Previously present PS is replaced.

Change-Id: Id9c33aa753c9af32880a0cc874b39c113222568f
Signed-off-by: Matt Spinler <spinler@us.ibm.com>

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 ...


# 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 ...


# 18a24d92 19-Apr-2022 Brandon Wyman <bjwyman@gmail.com>

psu-ng: INPUT_HISTORY syncHistory

Add in the function that syncs the power supply input history data
between all the installed power supplies.

Use the GPIO line name instead of gpiochip and number.

psu-ng: INPUT_HISTORY syncHistory

Add in the function that syncs the power supply input history data
between all the installed power supplies.

Use the GPIO line name instead of gpiochip and number. Use libgpiod via
helper utility. Create a toggleLowHigh() to use for synchronizing the
input history.

Add in indicator and helper functions to indicate a syncHistory is
needed if a power supply goes from missing to present.

Trace when syncHistory is called. This should be infrequent enough that
I do not think it would be a problem.

Initial testing on Rainier 2S2U did not need a lengthy delay between
lowering and raising the power-ffs-sync-history GPIO, but testing on
Rainier 2S4u required a longer delay.

Depends-On: Ib1ac2456f7f715360d089dfa4b6b379b516439ab

Change-Id: I022806155139d70fb4a42cc27eb9f279f6a3aedc
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>

show more ...


# c3324424 24-Mar-2022 Brandon Wyman <bjwyman@gmail.com>

psu-ng: Power supply class updates for input history

Update the meson files to include the record_manager with the
phosphor-psu-monitor application.

Since we do not want to blindly enable input his

psu-ng: Power supply class updates for input history

Update the meson files to include the record_manager with the
phosphor-psu-monitor application.

Since we do not want to blindly enable input history for all power
supplies, base the enablement of the feature off of the driver name.
Change the PowerSupply class to require the driver name be passed in,
and pass that down via the PSUManager during the configuration
determination.

Add a server manager to the PSUManager to handle the INPUT HISTORY data
that will be under /org/open_power/sensors.

The INPUT_HISTORY command is handled via a sysfs file in binary format,
so add in a readBinary() base function to allow for mock testing.

Change-Id: Iea163892d5482e6f2dacacfbfa746f605af52ed5
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>

show more ...


# ca1e9ea1 18-Feb-2022 Matt Spinler <spinler@us.ibm.com>

psu-ng: Handle health rollup based on availability

When a PSU is set to not available, create an association between the
power supply and its chassis as a way to 'roll up' the health status to
that

psu-ng: Handle health rollup based on availability

When a PSU is set to not available, create an association between the
power supply and its chassis as a way to 'roll up' the health status to
that chassis. It looks like:

<chassis>/critical
endpoints: <power supply>
<power supply>/health_rollup
endpoints: <chassis>

There is Redfish code that look at the endpoints in that chassis
association object to determine if the chassis health is OK or not.

Note that some systems, such as IBM's, have other code that will fill
in that association when it is called out in an event log, which is why
this code doesn't have to do it for every single fault.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I262dd738ebadb72aa207011941066fc282bfe4df

show more ...


# 0975eaf4 14-Feb-2022 Matt Spinler <spinler@us.ibm.com>

psu-ng: Add Availability support to power supplies

Add support for determining if a power supply is considered 'available'
or not, and set the Available D-Bus property on the
xyz.openbmc_project.Sta

psu-ng: Add Availability support to power supplies

Add support for determining if a power supply is considered 'available'
or not, and set the Available D-Bus property on the
xyz.openbmc_project.State.Decorator.Availability interface with the
result.

A power supply is considered unavailable if any of the following are
true:
- it isn't present
- there is a input fault active
- there is a Vin UV fault active
- there is a PS KILL fault active
- there is a Iout OC fault active

The latter four faults are the faults where it can't provide good
output power, hence the PS is unavailable. These faults also don't
call out the power supply directly, so the Functional property won't
get set to false, unlike other faults.

The Available D-Bus property is then able to be used in Redfish
responses for the heath and state properties in the power supply
schema.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I349eddb8c052cf238276c832af0dde9e49f6d3f0

show more ...


# 32453e9b 15-Dec-2021 Brandon Wyman <bjwyman@gmail.com>

psu-ng: Continue reading after readFail

Update the PMBus::read() function to allow for not creating journal
trace and elog, but default to continuing to trace and elog, the
previous behavior.

If we

psu-ng: Continue reading after readFail

Update the PMBus::read() function to allow for not creating journal
trace and elog, but default to continuing to trace and elog, the
previous behavior.

If we reach the limit of read failures that results in a communication
error log, continue to read, but stop logging failures.

If communication restores, we may be able to detect what caused the read
failure, or otherwise detect or clear new faults.

Change-Id: If59b86211ab54c31248ede78f8f117b607298923
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>

show more ...


# 6710ba2c 27-Oct-2021 Brandon Wyman <bjwyman@gmail.com>

psu-ng: Add code to detect VOUT_OV_FAULT

If the output voltage hits an overvoltage condition, the VOUT_OV_FAULT
bit (bit 5 of STATUS_WORD low byte) should turn on. The PMBus spec
ind

psu-ng: Add code to detect VOUT_OV_FAULT

If the output voltage hits an overvoltage condition, the VOUT_OV_FAULT
bit (bit 5 of STATUS_WORD low byte) should turn on. The PMBus spec
indicates that VOUT fault/warning (bit 7 high byte) and VOUT_OV_FAULT
are associated with status in the STATUS_VOUT command response.

Check for VOUT_OV_FAULT after check for VIN_UV_FAULT, create error if
the fault is indicated.

Change-Id: Ia68b4f986393f0ba0184401deb29b4f5d25a2ed0
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>

show more ...


# 52245b69 13-Sep-2021 Adriana Kobylak <anoo@us.ibm.com>

psu-ng: Implement gpio write function

Implement a gpio write function to allow writing to gpios via the
libgpiod bindings. The bindings allow to set the desired gpio value by
passing

psu-ng: Implement gpio write function

Implement a gpio write function to allow writing to gpios via the
libgpiod bindings. The bindings allow to set the desired gpio value by
passing it to the line request call.

Add the ability to pass flags as defined in gpiod.hpp so that the caller
can specify options such as FLAG_OPEN_DRAIN.

Change-Id: Ia7329a17c46f4f1fda0b66f795f123c8524a1be5
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>

show more ...


# 3ca062ae 20-Oct-2021 Adriana Kobylak <anoo@us.ibm.com>

psu-ng: Change the GPIOReader class to GPIOInterface

The GPIOReader class only contains a read function. A new write function
will be added so it makes sense for the class to be named In

psu-ng: Change the GPIOReader class to GPIOInterface

The GPIOReader class only contains a read function. A new write function
will be added so it makes sense for the class to be named Interface
instead of Reader.
Change GPIOReader to GPIOInterface, and change the base class from
GPIOInterface to GPIOInterfaceBase.

Tested: Ran CI.

Change-Id: I2a4abdabe0136a7f73337f0d054d2dd79712f53c
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>

show more ...


# d8b8cb15 15-Jul-2021 B. J. Wyman <bjwyman@gmail.com>

psu-ng: Add accessor to get GPIO line name

Update the utilities to give the line name for a GPIO.

Add accessor to power supply class to get the name of the presence GPIO
line.

psu-ng: Add accessor to get GPIO line name

Update the utilities to give the line name for a GPIO.

Add accessor to power supply class to get the name of the presence GPIO
line.

Signed-off-by: B. J. Wyman <bjwyman@gmail.com>
Change-Id: Ic10fd81c6de024dbcb27088c5935ac9947af9465

show more ...


# 681b2a36 20-Apr-2021 B. J. Wyman <bjwyman@gmail.com>

psu-ng: Add in ability to get presence via GPIO

The device tree and entity-manager (D-Bus) properties have the power
supply GPIO presence lines named, so we can use those GPIO line names

psu-ng: Add in ability to get presence via GPIO

The device tree and entity-manager (D-Bus) properties have the power
supply GPIO presence lines named, so we can use those GPIO line names to
find the GPIO device to read for determining power supply presence.

Some systems have the power supply presence lines in a gpio-keys section
(notably IBM Rainier). To facilitate continued function while running
with a device tree that has not removed those device tree entries, allow
for a fallback to the old inventory D-Bus propertiesChanged or
interfaceAdded matches for presence.

Change-Id: I5002aa62e5b460463cc26328c889a3786b467a3c
Signed-off-by: B. J. Wyman <bjwyman@gmail.com>

show more ...


# a1830a8d 12-Mar-2021 Brandon Wyman <bjwyman@gmail.com>

psu-ng: Move test getUtils and freeUtils to cpp

While debugging an SDK build issue regarding optimization and
_FORTIFY_SORUCE, it was discovered that the tests for
phosphor-power-sup

psu-ng: Move test getUtils and freeUtils to cpp

While debugging an SDK build issue regarding optimization and
_FORTIFY_SORUCE, it was discovered that the tests for
phosphor-power-supply fail to link if meson is run with --buildtype
debugoptimized.

Tested:
Builds with --buildtype debug
Builds with --buildtype debugoptimized
Builds with --buildtype plain

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: I095ecd83c85d5ed488f83cb3ede79c20701969a2

show more ...


# 9564e945 10-Nov-2020 Brandon Wyman <bjwyman@gmail.com>

psu-ng: Updates to allow PSU missing on startup

If the power supply is missing when the application starts up, the
created PMBus interface will log an INFO message about being unable to

psu-ng: Updates to allow PSU missing on startup

If the power supply is missing when the application starts up, the
created PMBus interface will log an INFO message about being unable to
read any of the sysfs files. Allow that informational message to occur,
but in the inventoryChange() interface, when the power supply goes
present, be sure to call the findHwmonDir() function to update the
directory/file changes that may occur when the device driver binds.

Tested:
Use simulator to verify no changes when both present and chassison.
Use simulator to mark 2nd PSU missing, restart application, mark 2nd
PSU as present and verify no PSU communication problems.
Use simulator to mark 1st PSU missing, restart application, mark 1st
PSU present and verify no PSU communication problems.
Use simulator to chassison with PSU missing, then change PSU
present, verify no errors.
Use simulator to chassison with PSUs present, mark PSU missing, then
PSU present, verify no errors.

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: Iba1c8296167519e7285eb680ab067bfb6046b4c7

show more ...


# 4176d6be 07-Oct-2020 Brandon Wyman <bjwyman@gmail.com>

psu-ng: Create error for communication fault

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: I3f147063759559bf2486e78d9873c6d464381ddd


# 1d7a7df8 26-Mar-2020 Brandon Wyman <bjwyman@gmail.com>

psu-ng: Updates to get VPD data to inventory

Add in code to retrieve the VPD data and populate that data to the D-Bus
inventory properties.

Use the PMBus utilities to retrieve t

psu-ng: Updates to get VPD data to inventory

Add in code to retrieve the VPD data and populate that data to the D-Bus
inventory properties.

Use the PMBus utilities to retrieve the model (CCIN for IBM power
supplies), part number, serial number, and firmware version information
from the sysfs "files" provided via the device driver.

Only build in IBM VPD data collection and reporting if meson ran with
-Dibm-vpd=true.

Tested:
Copied SDK build of phospor-psu-monitor with -Dibm-vpd=true to
Rainier hardware system, verified inventory properties updated/added.

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: I61688b154ead570e9d9390342596bf7d840f4dce

show more ...


# 59a35793 04-Jun-2020 Brandon Wyman <bjwyman@gmail.com>

psu-ng: Add code to set ON_OFF_CONFIG

Add code that sends the appropriate ON_OFF_CONFIG mask for the power
supply power on operation.

Tested:
Ran gtest using x86sdk

psu-ng: Add code to set ON_OFF_CONFIG

Add code that sends the appropriate ON_OFF_CONFIG mask for the power
supply power on operation.

Tested:
Ran gtest using x86sdk
Used simulator to change ON_OFF_CONFIG value, restarted service,
verified ON_OFF_CONFIG changed.
Used i2cget on hardware to change ON_OFF_CONFIG, restarted service,
verified ON_OFF_CONFIG changed.

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: Ifd9d63fcd2e86a62b7358e08958b5e2dbd21db9f

show more ...


# 3f1242f3 28-Jan-2020 Brandon Wyman <bjwyman@gmail.com>

Update analyze function to check STATUS_WORD

The STATUS_WORD PMBus command response will be the start of the power
supply fault analysis. Update the analyze() function to read its value

Update analyze function to check STATUS_WORD

The STATUS_WORD PMBus command response will be the start of the power
supply fault analysis. Update the analyze() function to read its value
and process (select) fault bits.

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: If7274ad237c0604a56008676ae64804a5fd2854e

show more ...