From 816d793003e93c1e5eec0a2e90fbd8b9dde9f7a5 Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Mon, 15 Apr 2019 13:42:44 -0700 Subject: Update 4-15-19 Signed-off-by: Ed Tanous --- .../recipes-utilities/lpc-cmds/files/lpc_cmds.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'meta-openbmc-mods/meta-common/recipes-utilities') diff --git a/meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files/lpc_cmds.c b/meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files/lpc_cmds.c index 2cdf66d88..467231372 100644 --- a/meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files/lpc_cmds.c +++ b/meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files/lpc_cmds.c @@ -302,6 +302,25 @@ static void SIOGetPWRBTNOverride(unsigned short clear) close(fd); } +static void SIOGetPFailStatus() +{ + int fd; + struct sio_ioctl_data sio_data; + + fd = open(SIO_DEVICE_NAME, O_RDWR | O_CLOEXEC); + if (fd < 0) { + printf("Error open %s\n", SIO_DEVICE_NAME); + exit(1); + } + + sio_data.sio_cmd = SIO_GET_PFAIL_STATUS; + + if (ioctl(fd, SIO_IOC_COMMAND, &sio_data) == 0) + printf("PFail status : %u\n", sio_data.data); + + close(fd); +} + /*********************************************************************************/ #if SUPPORT_MAILBOX @@ -370,6 +389,7 @@ static void usage(void) "\tlpc_cmds sio set_onctl_gpio_low\n" "\tlpc_cmds sio get_pwrbtn_override_status\n" "\tlpc_cmds sio get_pwrbtn_override_status_clear\n" + "\tlpc_cmds sio get_pfail_status\n" "\n" #if SUPPORT_KCS_ADDR_CMD "\tlpc_cmds kcs [1 ~ 4] (getaddr / setaddr / quiet)\n" @@ -423,6 +443,8 @@ int main(int argc, char** argv) SIOGetPWRBTNOverride(0); else if (strcmp(argv[2], "get_pwrbtn_override_status_clear") == 0) SIOGetPWRBTNOverride(1); + else if (strcmp(argv[2], "get_pfail_status") == 0) + SIOGetPFailStatus(); } else if (strcmp(cmd, "kcs") == 0) { int ifc; -- cgit v1.2.3