summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files/lpc_cmds.c
diff options
context:
space:
mode:
authorJason M. Bills <jason.m.bills@linux.intel.com>2021-09-28 22:04:51 +0300
committerJason M. Bills <jason.m.bills@linux.intel.com>2021-09-28 23:07:19 +0300
commitffe6d597d9e3d4407cf8062b5d6505a80ce08f41 (patch)
tree8019999b0ca042482e5193d6cabc06220c71d776 /meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files/lpc_cmds.c
parentd73e39703a0260c8911cb439b579e1c2bada4b20 (diff)
downloadopenbmc-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/lpc_cmds.c')
-rw-r--r--meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files/lpc_cmds.c27
1 files changed, 27 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;