summaryrefslogtreecommitdiff
path: root/src/mainboard/ocp/monolake/mainboard.c
diff options
context:
space:
mode:
authorLukasz Siudut <lsiudut@fb.com>2019-04-24 12:00:10 +0100
committerPhilipp Deppenwiese <zaolin.daisuki@gmail.com>2019-04-28 00:26:38 +0000
commite54c15aa729d2b9ae2978e1aedf4fd7bc92cf97d (patch)
tree5430d6115020f844ce44e43add3c16defd1975cc /src/mainboard/ocp/monolake/mainboard.c
parente7168edeb8dead2699d0bddf98006a8e86823244 (diff)
mb/ocp/monolake: add TPM and IPMI support
Changes includes: - enable TPM1 + add entry in devicetree - configure LPC IO to make IPMI work + add entry in devicetree - introduce DSDT and SMBIOS entries for IPMI to make it detectable by ipmi_si driver Signed-off-by: Lukasz Siudut <lsiudut@fb.com> Change-Id: Ia975643064075f1f861f4ead6f24ed71f345ea04 Reviewed-on: https://review.coreboot.org/c/coreboot/+/32443 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Diffstat (limited to 'src/mainboard/ocp/monolake/mainboard.c')
-rw-r--r--src/mainboard/ocp/monolake/mainboard.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/mainboard/ocp/monolake/mainboard.c b/src/mainboard/ocp/monolake/mainboard.c
index 93c2a58f74..d457859d44 100644
--- a/src/mainboard/ocp/monolake/mainboard.c
+++ b/src/mainboard/ocp/monolake/mainboard.c
@@ -15,17 +15,51 @@
*/
#include <device/device.h>
+#include <smbios.h>
#if CONFIG(VGA_ROM_RUN)
#include <x86emu/x86emu.h>
#endif
+#define BMC_KCS_BASE 0xca2
+#define INTERFACE_IS_IO 0x1
+
+#if IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLES)
+static int mainboard_smbios_data(struct device *dev, int *handle,
+ unsigned long *current)
+{
+ int len = 0;
+
+ // add IPMI Device Information
+ len += smbios_write_type38(
+ current, handle,
+ SMBIOS_BMC_INTERFACE_KCS,
+ 0x20, // IPMI Version
+ 0x20, // I2C address
+ 0xff, // no NV storage
+ BMC_KCS_BASE | INTERFACE_IS_IO, // IO port interface address
+ 0x40,
+ 0); // no IRQ
+
+ return len;
+}
+#endif
+
/*
* mainboard_enable is executed as first thing after enumerate_buses().
* This is the earliest point to add customization.
*/
static void mainboard_enable(struct device *dev)
{
+#if IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLES)
+ dev->ops->get_smbios_data = mainboard_smbios_data;
+#endif
+ /* Enable access to the BMC IPMI via KCS */
+ struct device *lpc_sio_dev = dev_find_slot_pnp(BMC_KCS_BASE, 0);
+ struct resource *res = new_resource(lpc_sio_dev, BMC_KCS_BASE);
+ res->base = BMC_KCS_BASE;
+ res->size = 1;
+ res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
}
struct chip_operations mainboard_ops = {