diff options
Diffstat (limited to 'src/drivers/ipmi/ipmi_kcs_ops.c')
-rw-r--r-- | src/drivers/ipmi/ipmi_kcs_ops.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/drivers/ipmi/ipmi_kcs_ops.c b/src/drivers/ipmi/ipmi_kcs_ops.c index dd8f34c148..362f17ac2b 100644 --- a/src/drivers/ipmi/ipmi_kcs_ops.c +++ b/src/drivers/ipmi/ipmi_kcs_ops.c @@ -29,6 +29,9 @@ static u8 ipmi_revision_major = 0x1; static u8 ipmi_revision_minor = 0x0; +static u8 bmc_revision_major = 0x0; +static u8 bmc_revision_minor = 0x0; + static int ipmi_get_device_id(struct device *dev, struct ipmi_devid_rsp *rsp) { int ret; @@ -145,6 +148,9 @@ static void ipmi_kcs_init(struct device *dev) ipmi_revision_minor = IPMI_IPMI_VERSION_MINOR(rsp.ipmi_version); ipmi_revision_major = IPMI_IPMI_VERSION_MAJOR(rsp.ipmi_version); + bmc_revision_major = rsp.fw_rev1; + bmc_revision_minor = rsp.fw_rev2; + memcpy(&man_id, rsp.manufacturer_id, sizeof(rsp.manufacturer_id)); @@ -273,6 +279,18 @@ static void ipmi_ssdt(const struct device *dev) } #endif +void ipmi_bmc_version(uint8_t *ipmi_bmc_major_revision, uint8_t *ipmi_bmc_minor_revision) +{ + if (!bmc_revision_major || !bmc_revision_minor) { + printk(BIOS_ERR, "IPMI: BMC revision missing\n"); + *ipmi_bmc_major_revision = 0; + *ipmi_bmc_minor_revision = 0; + } else { + *ipmi_bmc_major_revision = bmc_revision_major; + *ipmi_bmc_minor_revision = bmc_revision_minor; + } +} + #if CONFIG(GENERATE_SMBIOS_TABLES) static int ipmi_smbios_data(struct device *dev, int *handle, unsigned long *current) |