Name of user not set #1002517 has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34835 )
Change subject: drivers/ipmi: make IPMI KCS status and command register offset configurable ......................................................................
drivers/ipmi: make IPMI KCS status and command register offset configurable
Add offset options for 1 (BYTE), 2 (WORD) and 4 (DWORD).
Tested on Mono Lake
Change-Id: I47412c32e6db8f58b4fde8150adcbce349ca18a7 Signed-off-by: Johnny Lin johnny_lin@wiwynn.com --- M src/drivers/ipmi/Kconfig M src/drivers/ipmi/ipmi_kcs.c 2 files changed, 33 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/34835/1
diff --git a/src/drivers/ipmi/Kconfig b/src/drivers/ipmi/Kconfig index 5851438..cb4d256 100644 --- a/src/drivers/ipmi/Kconfig +++ b/src/drivers/ipmi/Kconfig @@ -1,3 +1,34 @@ config IPMI_KCS bool default n + +choice + prompt "IPMI KCS register address offset" + default KCS_REGISTER_OFFSET_1 + +config KCS_REGISTER_OFFSET_1 + bool "IPMI KCS register address offset 1 (BYTE)" + help + Set IPMI KCS register address offset to 1 (BYTE). + +config KCS_REGISTER_OFFSET_2 + bool "IPMI KCS register address offset 2 (WORD)" + help + Set IPMI KCS register address offset to 2 (WORD). + +config KCS_REGISTER_OFFSET_4 + bool "IPMI KCS register address offset 4 (DWORD)" + help + Set IPMI KCS register address offset to 4 (DWORD). + +endchoice + +config KCS_REGISTER_OFFSET + int + default 1 if KCS_REGISTER_OFFSET_1 + default 2 if KCS_REGISTER_OFFSET_2 + default 4 if KCS_REGISTER_OFFSET_4 + depends on IPMI_KCS + help + KCS status and command register IO port address offset + diff --git a/src/drivers/ipmi/ipmi_kcs.c b/src/drivers/ipmi/ipmi_kcs.c index 397a800..8975f75 100644 --- a/src/drivers/ipmi/ipmi_kcs.c +++ b/src/drivers/ipmi/ipmi_kcs.c @@ -36,9 +36,9 @@ #define IPMI_KCS_STATE_WRITE 0x02 #define IPMI_KCS_STATE_ERROR 0x03
-#define IPMI_CMD(_x) ((_x) + 1) +#define IPMI_CMD(_x) ((_x) + CONFIG_KCS_REGISTER_OFFSET) #define IPMI_DATA(_x) ((_x)) -#define IPMI_STAT(_x) ((_x) + 1) +#define IPMI_STAT(_x) ((_x) + CONFIG_KCS_REGISTER_OFFSET)
static unsigned char ipmi_kcs_status(int port) {