diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-09-28 22:04:51 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-09-28 23:07:19 +0300 |
commit | ffe6d597d9e3d4407cf8062b5d6505a80ce08f41 (patch) | |
tree | 8019999b0ca042482e5193d6cabc06220c71d776 /meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files | |
parent | d73e39703a0260c8911cb439b579e1c2bada4b20 (diff) | |
download | openbmc-ffe6d597d9e3d4407cf8062b5d6505a80ce08f41.tar.xz |
Update to internal 0.75
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files')
-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 bc215f60b..ff9498696 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 @@ -342,6 +342,27 @@ static void SIOSetBMCSCIEvent(unsigned short set) close(fd); } +static void SIOSetBMCSMIEvent(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_SMI_EVENT; + sio_data.param = set; + + if (ioctl(fd, SIO_IOC_COMMAND, &sio_data) == 0) + printf("BMC SMI event is %s\n", + sio_data.data ? "set" : "cleared"); + + close(fd); +} + /*********************************************************************************/ #if SUPPORT_MAILBOX @@ -413,6 +434,8 @@ static void usage(void) "\tlpc_cmds sio get_pfail_status\n" "\tlpc_cmds sio set_bmc_sci_event\n" "\tlpc_cmds sio clear_bmc_sci_event\n" + "\tlpc_cmds sio set_bmc_smi_event\n" + "\tlpc_cmds sio clear_bmc_smi_event\n" "\n" #if SUPPORT_KCS_ADDR_CMD "\tlpc_cmds kcs [1 ~ 4] (getaddr / setaddr / quiet)\n" @@ -472,6 +495,10 @@ int main(int argc, char** argv) SIOSetBMCSCIEvent(1); else if (strcmp(argv[2], "clear_bmc_sci_event") == 0) SIOSetBMCSCIEvent(0); + else if (strcmp(argv[2], "set_bmc_smi_event") == 0) + SIOSetBMCSMIEvent(1); + else if (strcmp(argv[2], "clear_bmc_smi_event") == 0) + SIOSetBMCSMIEvent(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 793e8b49c..354210c8b 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 @@ -56,6 +56,7 @@ enum SIO_CMD { SIO_GET_PWRBTN_OVERRIDE, SIO_GET_PFAIL_STATUS, /* Start from AC Loss */ SIO_SET_BMC_SCI_EVENT, + SIO_SET_BMC_SMI_EVENT, SIO_MAX_CMD }; |