gc2: es: Implement GPIO Get/Set config OEM IPMI commands #2646
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[Task Description]
This patch implements two OEM IPMI commands (OEM_1S_GET_GPIO_CONFIG, OEM_1S_SET_GPIO_CONFIG) for GPIO configuration and control on the BIC. These commands are defined as weak functions in common code and overridden by platform-specific implementations in gc2.
[Motivation]
BMC needs to dynamically query and control BIC GPIO configurations for system management and debugging purposes. The bic_util tool on BMC requires IPMI interface to access BIC GPIOs without firmware modification. This implementation provides standardized OEM commands to fulfill two requirements by overriding the weak function stubs in common code with actual platform-specific implementations.
[Design]
[Test Log]
root@bmc-oob:~# bic_util slot1 --get_gpio_config gpio_config for pin#0 (FM_BMC_PCH_SCI_LPC_R_N): Direction: Input, Interrupt: Disabled, Trigger: Edge Trigger, Edge: Falling Edge gpio_config for pin#1 (FM_BIOS_POST_CMPLT_BMC_N): Direction: Input, Interrupt: Enabled, Trigger: Edge Trigger, Edge: Both Edges gpio_config for pin#2 (FM_SLPS3_PLD_N): Direction: Input, Interrupt: Enabled, Trigger: Edge Trigger, Edge: Both Edges ... gpio_config for pin#69 (SGPIO_BMC_CLK_R): Direction: Input, Interrupt: Disabled, Trigger: Edge Trigger, Edge: Falling Edge gpio_config for pin#70 (SGPIO_BMC_LD_R_N): Direction: Input, Interrupt: Disabled, Trigger: Edge Trigger, Edge: Falling Edge gpio_config for pin#71 (SGPIO_BMC_DOUT_R): Direction: Input, Interrupt: Enabled, Trigger: Edge Trigger, Edge: Falling Edge gpio_config for pin#72 (SGPIO_BMC_DIN): Direction: Input, Interrupt: Enabled, Trigger: Edge Trigger, Edge: Falling Edgeroot@bmc-oob:~# bic-util server --get_gpio_config ... gpio_config for pin#52 (BMC_JTAG_SEL_R): Direction: Output, Interrupt: Disabled, Trigger: Edge Trigger, Edge: Falling Edge ... root@bmc-oob:~# bic-util server --set_gpio_config 52 0x12 Setting GPIO [52]BMC_JTAG_SEL_R config to 0x12 root@bmc-oob:~# bic-util server --get_gpio_config ... gpio_config for pin#52 (BMC_JTAG_SEL_R): Direction: Input, Interrupt: Enabled, Trigger: Edge Trigger, Edge: Both Edges ...```