commit | 9456ffc9f21c92f890266be54a151bf59b413411 | [log] [tgz] |
---|---|---|
author | HuyLe <hule@amperecomputing.com> | Thu Jun 22 15:21:22 2023 +0700 |
committer | Thang Q. Nguyen <thang@os.amperecomputing.com> | Tue Jul 18 10:00:20 2023 +0700 |
tree | db2fffb457a2b7ef13778bf2af166ee9940386b0 | |
parent | 10bc3aeb25f0edceba19ca4f11ecb9799266030a [diff] |
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>
Phosphor-buttons has a collection of IO event handler interfaces for physical inputs which are typically part of some sort of panel.
It defines an individual dbus interface object for each physical button/switch inputs such as power button, reset button etc. Each button interface monitors its associated IO for event changes and emits signals that the button-handler application listens for.
All events occur when the button is released.
If the power is off, power on the host.
If the power is on, it depends on how long the press was and which options are enabled:
The 'power-button-profile' meson option can be used to select custom power button profiles that have different behaviors.
Available profiles are:
See this section below.
When released:
When released, toggles the 'enclosure_identify' LED group provided by the phosphor-led-manager repository. The group name can be changed using the 'id-led-group' meson option.
In order to monitor a button/input interface the respective gpio config details should be mentioned in the gpio defs json file - /etc/default/obmc/gpio/gpio_defs.json
{ "gpio_definitions": [ { "name": "POWER_BUTTON", "gpio_config" :[ { "pin": "D0", "direction": "both" } ] }, { "name": "RESET_BUTTON", "gpio_config" :[ { "pin": "AB0", "direction": "both" } ] }, { "name" : "HOST_SELECTOR", "group_gpio_config" : [ { "pin": "AA4", "direction": "both" }, { "pin": "AA5", "direction": "both" }, { "pin": "AA6", "direction": "both" }, { "pin": "AA7", "direction": "both" } ] }, }
This config is original config which can be used for configs with only single gpio such as power button,reset button, OCP debug card host select button.
{ "name": "POWER_BUTTON", "pin": "D0", "direction": "both" },
Note: this config is used by most of the other platforms so this format is kept as it is so that existing gpio configs do not get affected.
The following configs are related to multi-host bmc systems more info explained in the design: https://github.com/openbmc/docs/blob/master/designs/multihost-phosphor-buttons.md
The host selector has four gpios associated. So the related gpios are mentioned in a json array named group_gpio_config.
Example : The value of "7" derived from the 4 host select gpio lines are mapped to host position 1.
{ "name": "HOST_SELECTOR", "group_gpio_config": [ { "name": "host_select_0", "pin": "AA4", "direction": "both", "polarity": "active_high" }, { "name": "host_select_1", "pin": "AA5", "direction": "both", "polarity": "active_high" }, { "name": "host_select_2", "pin": "AA6", "direction": "both", "polarity": "active_high" }, { "name": "host_select_3", "pin": "AA7", "direction": "both", "polarity": "active_high" } ], "max_position": 4, "host_selector_map": { "6": 0, "7": 1, "8": 2, "9": 3, "10": 4, "11": 0, "12": 1, "13": 2, "14": 3, "15": 4 } }
There are also some systems that get the host selector selection from the CPLD, the configuration is provided below.
{ "cpld_definitions": [ { "name": "HOST_SELECTOR", "i2c_bus": 12, "i2c_address": 15, "register_name": "uart-selection-debug-card", "max_position": 4 } ] }
Similar to host selector there are multiple gpios associated with the serial uart mux. These gpio configs are specificed as part of json array "group_gpio_config".
Here the serial uart mux output is accessed via OCP debug card. SO the OCP debug card present gpio is mentioned part of the group_gpio_config. The debug card present gpio is identified by its name "debug_card_present".
The other gpios part of the group gpio config is serial uart MUX gpio select lines and serial_uart_rx line.
{ "name": "SERIAL_UART_MUX", "group_gpio_config": [ { "name": "serial_uart_sel_0", "pin": "E0", "direction": "out", "polarity": "active_high" }, { "name": "serial_uart_sel_1", "pin": "E1", "direction": "out", "polarity": "active_high" }, { "name": "serial_uart_sel_2", "pin": "E2", "direction": "out", "polarity": "active_high" }, { "name": "serial_uart_sel_3", "pin": "E3", "direction": "out", "polarity": "active_high" }, { "name": "serial_uart_rx", "pin": "E4", "direction": "out", "polarity": "active_high" }, { "name": "debug_card_present", "pin": "R3", "direction": "both", "polarity": "active_high" } ], "serial_uart_mux_map": { "0": 4, "1": 0, "2": 1, "3": 2, "4": 3 } }