diff options
author | Ed Tanous <ed.tanous@intel.com> | 2019-04-15 23:42:44 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2019-04-17 19:13:25 +0300 |
commit | 816d793003e93c1e5eec0a2e90fbd8b9dde9f7a5 (patch) | |
tree | 341534fed9a2de460ded7f8231ca1cbb178bb2ca /meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds | |
parent | a75bff085ba9443315222231c42692745e5781e9 (diff) | |
download | openbmc-816d793003e93c1e5eec0a2e90fbd8b9dde9f7a5.tar.xz |
Update 4-15-19
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds')
-rw-r--r-- | meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files/lpc_cmds.c | 22 |
1 files changed, 22 insertions, 0 deletions
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; |