diff options
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 | 27 | ||||
-rw-r--r-- | meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files/lpc_drv.h | 1 |
2 files changed, 28 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 467231372..bc215f60b 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 @@ -321,6 +321,27 @@ static void SIOGetPFailStatus() close(fd); } +static void SIOSetBMCSCIEvent(unsigned short set) +{ + 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_SET_BMC_SCI_EVENT; + sio_data.param = set; + + if (ioctl(fd, SIO_IOC_COMMAND, &sio_data) == 0) + printf("BMC SCI event is %s\n", + sio_data.data ? "set" : "cleared"); + + close(fd); +} + /*********************************************************************************/ #if SUPPORT_MAILBOX @@ -390,6 +411,8 @@ static void usage(void) "\tlpc_cmds sio get_pwrbtn_override_status\n" "\tlpc_cmds sio get_pwrbtn_override_status_clear\n" "\tlpc_cmds sio get_pfail_status\n" + "\tlpc_cmds sio set_bmc_sci_event\n" + "\tlpc_cmds sio clear_bmc_sci_event\n" "\n" #if SUPPORT_KCS_ADDR_CMD "\tlpc_cmds kcs [1 ~ 4] (getaddr / setaddr / quiet)\n" @@ -445,6 +468,10 @@ int main(int argc, char** argv) SIOGetPWRBTNOverride(1); else if (strcmp(argv[2], "get_pfail_status") == 0) SIOGetPFailStatus(); + else if (strcmp(argv[2], "set_bmc_sci_event") == 0) + SIOSetBMCSCIEvent(1); + else if (strcmp(argv[2], "clear_bmc_sci_event") == 0) + SIOSetBMCSCIEvent(0); } else if (strcmp(cmd, "kcs") == 0) { int ifc; diff --git a/meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files/lpc_drv.h b/meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files/lpc_drv.h index 56c79d1c1..793e8b49c 100644 --- a/meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files/lpc_drv.h +++ b/meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files/lpc_drv.h @@ -55,6 +55,7 @@ enum SIO_CMD { SIO_SET_ONCTL_GPIO, SIO_GET_PWRBTN_OVERRIDE, SIO_GET_PFAIL_STATUS, /* Start from AC Loss */ + SIO_SET_BMC_SCI_EVENT, SIO_MAX_CMD }; |