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>2020-02-28 02:57:13 +0300
committerJason M. Bills <jason.m.bills@linux.intel.com>2020-03-02 22:06:57 +0300
commit6c1caca70063aa707ba809a6b4695d0f0c5646f1 (patch)
tree84da2f29a60cb571686d3a4fb93f9d1f1189d989 /meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files/lpc_cmds.c
parent9600a7403ba2848c8751280077503a3e0f2f3481 (diff)
downloadopenbmc-6c1caca70063aa707ba809a6b4695d0f0c5646f1.tar.xz
Update to internal 2020-02-27
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 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;