From ffe6d597d9e3d4407cf8062b5d6505a80ce08f41 Mon Sep 17 00:00:00 2001 From: "Jason M. Bills" Date: Tue, 28 Sep 2021 12:04:51 -0700 Subject: Update to internal 0.75 Signed-off-by: Jason M. Bills --- .../recipes-utilities/lpc-cmds/files/lpc_cmds.c | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'meta-openbmc-mods/meta-common/recipes-utilities/lpc-cmds/files/lpc_cmds.c') 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; -- cgit v1.2.3