d36b6b1d | 16-Aug-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda forma
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda formatting also changed, so we have made changes to the organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style. See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: Ic25904c3a6dc2d09cc28cabff14e4ba4c8dc8397 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
010035ee | 17-Jun-2024 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Fix spelling mistakes using codespell
This commit corrects various spelling mistakes throughout the repository. The corrections were made automatically using `codespell`[1] tool.
[1]: https://githu
Fix spelling mistakes using codespell
This commit corrects various spelling mistakes throughout the repository. The corrections were made automatically using `codespell`[1] tool.
[1]: https://github.com/codespell-project/codespell
Change-Id: I7ddcf61ed2d596171384fdb5f0fc1e2feb4240bf Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
971312ab | 12-Apr-2024 |
Patrick Williams <patrick@stwcx.xyz> |
button: convert long-press time to std::chrono
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ia97dc229b43e32a30e4e57881628ab408896dcfb |
15c60e2f | 12-Apr-2024 |
Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com> |
meson: switch config.h to config.hpp
Enable a transition of this file from C to C++ so that we can use C++ constants instead of #defines in future commits.
Change-Id: I1149ebdaaeb99b7e7974ca846b9b0
meson: switch config.h to config.hpp
Enable a transition of this file from C to C++ so that we can use C++ constants instead of #defines in future commits.
Change-Id: I1149ebdaaeb99b7e7974ca846b9b07a3399edea0 Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
3610608c | 26-Feb-2024 |
Patrick Williams <patrick@stwcx.xyz> |
lg2: use direct enum conversion
lg2 now has the ability to directly convert enums for which there is not any other conversion. Leverage that to simplify the code.
Signed-off-by: Patrick Williams <
lg2: use direct enum conversion
lg2 now has the ability to directly convert enums for which there is not any other conversion. Leverage that to simplify the code.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I22004dacf7171882d8219aa3dd09d87044da4db6
show more ...
|
cb418b0d | 16-Jan-2024 |
Jonico Eustaquio <jonico.eustaquio@fii-na.com> |
Adding num key parsing
Currently there is only support for an alphanumeric references that is decoded into a pin number. The "num" keyword supports using the pin number directly (integer). The JSON
Adding num key parsing
Currently there is only support for an alphanumeric references that is decoded into a pin number. The "num" keyword supports using the pin number directly (integer). The JSON key field determines the parsing.
It matches the support for the "num" keyword for the gpio_defs.json seen in skeleton/libobmc_intf. If added along with:
https://gerrit.openbmc.org/c/openbmc/skeleton/+/68883
then "num" could be used for systems that have numerically labeled GPIO pins and have multiple GPIO banks.
Change-Id: Ibf3e432a36c60b650c7f245ee12e5af3a8359664 Signed-off-by: Jonico Eustaquio <jonico.eustaquio@fii-na.com>
show more ...
|
9c276560 | 19-Jan-2024 |
Patrick Williams <patrick@stwcx.xyz> |
State.Chassis: update service name
Both phosphor-state-manager and x86-power-control have code that exposes both the Chassis and Chassis0 bus names as a backwards compatibility when multi-chassis su
State.Chassis: update service name
Both phosphor-state-manager and x86-power-control have code that exposes both the Chassis and Chassis0 bus names as a backwards compatibility when multi-chassis support was added. Switch to the numbered bus name, which is expected to be the non-deprecated one.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ic20cddf51ced0a47fa8b754ec6bda6be5781412e
show more ...
|
0d6d74c8 | 17-Aug-2023 |
Patrick Williams <patrick@stwcx.xyz> |
serial-uart-mux: use non-deprecated sdbusplus-client names
The generated sdbus++ bindings have SDBUSPP_REMOVE_DEPRECATED_NAMESPACE as a guard around the type that was previously used. Use the non-d
serial-uart-mux: use non-deprecated sdbusplus-client names
The generated sdbus++ bindings have SDBUSPP_REMOVE_DEPRECATED_NAMESPACE as a guard around the type that was previously used. Use the non-deprecated name to future-proof this code.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I47ed9660284c67c618224d034120063dfb86c6d0
show more ...
|
9456ffc9 | 22-Jun-2023 |
HuyLe <hule@amperecomputing.com> |
Add warm-reboot option support for reset button
Pressing reset button currently issues a reboot transion. However, some platforms might expect to have force warm reboot instead. This commit adds new
Add warm-reboot option support for reset button
Pressing reset button currently issues a reboot transion. However, some platforms might expect to have force warm reboot instead. This commit adds new reset-button-do-warm-reboot option to configure the expected action for reset button on those platforms.
Tested: - By default, on release of reset button, the Host is powered cycle. - Enable reset-button-do-warm-reboot meson option. On release of reset button, the Host is reset while Host power does not change.
Change-Id: I5d5f754f8b848fa0faef97354ef0dab7c47645f4 Signed-off-by: HuyLe <hule@amperecomputing.com>
show more ...
|
1a309f77 | 04-Apr-2023 |
Matt Spinler <spinler@us.ibm.com> |
Create a custom power button handler
IBM has specific requirements on how the power button must behave, which are different than what the button handler currently does.
These requirements are: If
Create a custom power button handler
IBM has specific requirements on how the power button must behave, which are different than what the button handler currently does.
These requirements are: If power is off: - A button press will power on as long as the BMC is in the ready state.
If power is on: - A button press less than 4s won't do anything. - At 4s, issue a host power off and start a 10s timer. - If the button is released within that 10s and not pressed again, continue with the host power off. - If the button is released within that 10s and also pressed again in that 10s, do a hard power (chassis) off. - If the button is pressed throughout that 10s issue a hard power off.
Instead of trying to integrate this behavior into the main button handler code using even more #ifdefs in various spots, this commit creates the concept of custom power button handlers, and then implements one. This makes it less likely it could subtly break when changes are made to the default code.
A 'power-button-handler' meson option is used to select the handler, where the default uses the current behavior. A PowerButtonHandlerFactory then creates the appropriate instance of the handler selected by that option. If a handler is found, then the default matches/callbacks won't be done and the handler can deal with them as it sees fit.
Handlers are derived from a PowerButtonHandler abstract base class that has 2 pure virtual functions: - void pressed(); - void released(uint64_t pressTimeMS);
It will register for the power button pressed/released signals and then call these overridden functions appropriately.
This new handler is implemented in a HostThenChassisPowerOff class.
Change-Id: I3a1df688c4393b4643d42e91c075379f9a266eef Signed-off-by: Matt Spinler <spinler@us.ibm.com>
show more ...
|
9479b06c | 04-Apr-2023 |
Matt Spinler <spinler@us.ibm.com> |
button-handler: use sdeventplus loop
Use the sdeventplus event loop so that an upcoming commit can make use of sdeventplus timers.
Change-Id: I596ee36141f16ceb5e95078bad9fbe6a12c832a6 Signed-off-by
button-handler: use sdeventplus loop
Use the sdeventplus event loop so that an upcoming commit can make use of sdeventplus timers.
Change-Id: I596ee36141f16ceb5e95078bad9fbe6a12c832a6 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
show more ...
|
ccd7db05 | 09-Feb-2023 |
Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com> |
Support host selector using cpld definitions
Description: - Support host selector using cpld definitions
Design: - Because the current structure only supports config defined by GPIO (Yosemite V2)
Support host selector using cpld definitions
Description: - Support host selector using cpld definitions
Design: - Because the current structure only supports config defined by GPIO (Yosemite V2), but there are also have the system (Yosemite V3.5) gets the host-selector's selection from CPLD.
- So this commit is to extend the current configuration to use CPLD definitions. Also, support adding event io from the register file which was exported from the CLD driver.
- For example with config json below: { "cpld_definitions": [ { "name": "HOST_SELECTOR", "i2c_address": 15, "i2c_bus": 12, "register_name": "uart-selection-debug-card", "max_position": 4 } ] }
Dependency: - CLD driver is required (link: https://lore.kernel.org/lkml/20230117094425.19004-1-Delphine_CC_Chiu@Wiwynn.com/)
Test Case: - When ocp debug card uart button is pressed the position property on dbus is correct.
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com> Change-Id: I6746afa6d905bd3c681e2921c643b3cd4cb9944c
show more ...
|
0d038f58 | 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: Iad285e60cad29e025a02d0c0cabcb76fe593b5cf Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
395c764c | 18-Apr-2023 |
DelphineCCChiu <Delphine_CC_Chiu@wiwynn.com> |
Remove power button long-press
So far, counting power button's pressing duration is supported. There's no need to handle redundant case for button long-press.
Tested: Press buttons and check corres
Remove power button long-press
So far, counting power button's pressing duration is supported. There's no need to handle redundant case for button long-press.
Tested: Press buttons and check corresponding behaviors.
Change-Id: I96d9160a10de6d4572148c55e2b7c2a9221d42e2 Signed-off-by: DelphineCCChiu <Delphine_CC_Chiu@wiwynn.com>
show more ...
|
149452b0 | 12-Apr-2023 |
Patrick Williams <patrick@stwcx.xyz> |
power-button: fix released signal to include duration
The latest dbus interface requires a duration in microseconds for the PowerButton.Released signal. Add it in now so that the code successfully
power-button: fix released signal to include duration
The latest dbus interface requires a duration in microseconds for the PowerButton.Released signal. Add it in now so that the code successfully compiles.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ib82db55b9c7e50cc018f5e3a5b1f0c71b9d4c7c7
show more ...
|
c0fee46e | 23-Dec-2022 |
Potin Lai <potin.lai@quantatw.com> |
button_handler: use CurrentHostState for powered on checking
Current poweredOn() function is based on chassis CurrentPowerState, so it does not turn on the host when chassis is powered on and host s
button_handler: use CurrentHostState for powered on checking
Current poweredOn() function is based on chassis CurrentPowerState, so it does not turn on the host when chassis is powered on and host state is off. Switch to use CurrentHostState property for system powered on checking.
Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: Ife184a718944f6f318fad4494d077251c250b7c8
show more ...
|
e2d0f426 | 19-Dec-2022 |
Potin Lai <potin.lai@quantatw.com> |
button_handler: fix invalid power event error
Current power button handler handles longPowerReleased event, which should be longPowerPressed. revert back to longPowerPressed to avoid error of invali
button_handler: fix invalid power event error
Current power button handler handles longPowerReleased event, which should be longPowerPressed. revert back to longPowerPressed to avoid error of invalid power event.
Tested on Bletchley:
- Before ``` root@bletchley:~# journalctl -u phosphor-button-handler Dec 19 21:52:53 bletchley button-handler[521]: Multi-host system detected : 6 Dec 19 21:52:53 bletchley button-handler[521]: 1 is invalid power event. skipping... ```
- After ``` root@bletchley:~# journalctl -u phosphor-button-handler Dec 19 21:34:58 bletchley button-handler[418]: Multi-host system detected : 6 Dec 19 21:34:58 bletchley button-handler[418]: handlePowerEvent : handle long power button press ```
Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I77977f23f9e669cd4a8785608f1cb3ca4d148bed
show more ...
|
e3b4e11f | 26-Nov-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
Change-Id: I32e5f22829c03325295b180504ab5e3b5745dc95 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
d219fa3c | 19-Jul-2022 |
Naveen Moses <naveen.mosess@hcl.com> |
Add serial uart mux interface class
1. This change adds the multi-host serial uart mux interface class.
In a multi-host system when the host position is changed, then the serial uart mux is configu
Add serial uart mux interface class
1. This change adds the multi-host serial uart mux interface class.
In a multi-host system when the host position is changed, then the serial uart mux is configured to enable the respective host's serial console which is accessed via OCP debug card.
2. Introduced two new methods in gpio.cpp setGpioState - set state for gpio fd based on polarity getGpiostate - get state for gpio fd based on polarity
3. Updated the readme file about details on the new gpio configs
design : https://github.com/openbmc/docs/blob/master/designs/multihost-phosphor-buttons.md
Testing : This change is verified in yosemiteV2 platform.
Signed-off-by: Naveen Moses <naveen.mosess@hcl.com> Change-Id: I861d70570650d7dfcab842a35bdcf63a9fdd3bd0
show more ...
|
42507857 | 11-Aug-2022 |
Thang Q. Nguyen <thang@os.amperecomputing.com> |
Fix getService fail on single host platform
Add exception handling in the getService() function to so that the isMultiHost() function returns correct value for single and multi-host platform.
Teste
Fix getService fail on single host platform
Add exception handling in the getService() function to so that the isMultiHost() function returns correct value for single and multi-host platform.
Tested: check on single host platform 1. Press power button and check if it works properly 2. Press reset button and check if it work properly
Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com> Change-Id: I5c7019fb27b6ccb795ada9c63e591ce8561ff70c
show more ...
|
a6d4e65d | 13-Apr-2022 |
Naveen Moses <naveen.mosess@hcl.com> |
Add OCP debug card host selector button interface
A new button interface class definition is added for handling OCP debug card host selector button events. In case of the button release event, The h
Add OCP debug card host selector button interface
A new button interface class definition is added for handling OCP debug card host selector button events. In case of the button release event, The host selector property is increased up to the max host position.
Design : https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/45544
Signed-off-by: Naveen Moses <naveen.mosess@hcl.com> Change-Id: Iec8fabb00d1daa10f587981a9c77df8a62e3c373
show more ...
|
9a529a69 | 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: I91502c85799b7d3be22b7d05659ff26bea08c32b
show more ...
|
ab8dac51 | 15-Jul-2022 |
Naveen Moses <naveen.mosess@hcl.com> |
Rename handler methods to match dbus signal type
The button handler process has multiple handlers which monitors for "Released" dbus signal but has handlers named "pressed". Such handlers has been r
Rename handler methods to match dbus signal type
The button handler process has multiple handlers which monitors for "Released" dbus signal but has handlers named "pressed". Such handlers has been renamed to match the signal type.
Signed-off-by: Naveen Moses <naveen.mosess@hcl.com> Change-Id: Iff77569259df620dba2b04ed64ffc029fd9dee46
show more ...
|
9fb15970 | 20-Jun-2022 |
George Liu <liuxiwei@inspur.com> |
logging: switch to lg2
After switching to C++20, it is recommended to use `phosphor::lg2` to format log, and the correct `CODE_LINE` and `CODE_FUNC` values can be used in log tracking.
Signed-off-b
logging: switch to lg2
After switching to C++20, it is recommended to use `phosphor::lg2` to format log, and the correct `CODE_LINE` and `CODE_FUNC` values can be used in log tracking.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I7983e39c9afdd455b21923f860f827cf9a9c257c
show more ...
|
d6a1bae7 | 20-Jun-2022 |
George Liu <liuxiwei@inspur.com> |
meson: Add meson build
The intent behind this commit is build obmc-phosphor-buttons with meson, and then remove files related to cmake.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ie
meson: Add meson build
The intent behind this commit is build obmc-phosphor-buttons with meson, and then remove files related to cmake.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Iedf8c49224032e016fed3471e6e41f6055b09065
show more ...
|