summaryrefslogtreecommitdiffstats
path: root/src/drivers/ipmi
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2019-08-29 19:44:32 +0200
committerPatrick Rudolph <siro@das-labor.org>2019-09-02 05:30:18 +0000
commita96c4a1340ea0c48f0f2bf318a06176562799efa (patch)
tree00daaffbc62e64edcbda943bc209c027d400ca87 /src/drivers/ipmi
parent5fffb5e30d0d0caa5bd3256fdce3f337bbef1d0f (diff)
downloadcoreboot-a96c4a1340ea0c48f0f2bf318a06176562799efa.tar.gz
coreboot-a96c4a1340ea0c48f0f2bf318a06176562799efa.tar.bz2
coreboot-a96c4a1340ea0c48f0f2bf318a06176562799efa.zip
drivers/ipmi/ipmi_kcs_ops: Advertise correct register spacing
Advertise the register spacing used by the BMC as set by the Kconfig. Tested on OCP Monolake. Change-Id: Ib926d30f6a0e78fbf613a6f71f765c5f51eee77d Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/35152 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Diffstat (limited to 'src/drivers/ipmi')
-rw-r--r--src/drivers/ipmi/ipmi_kcs_ops.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/src/drivers/ipmi/ipmi_kcs_ops.c b/src/drivers/ipmi/ipmi_kcs_ops.c
index 21102bb74ec6..baa72a82c5f3 100644
--- a/src/drivers/ipmi/ipmi_kcs_ops.c
+++ b/src/drivers/ipmi/ipmi_kcs_ops.c
@@ -128,8 +128,24 @@ ipmi_write_acpi_tables(struct device *dev, unsigned long current,
.space_id = ACPI_ADDRESS_SPACE_IO,
.access_size = ACPI_ACCESS_SIZE_BYTE_ACCESS,
.addrl = dev->path.pnp.port,
+ .bit_width = 8,
};
+ switch (CONFIG_IPMI_KCS_REGISTER_SPACING) {
+ case 4:
+ addr.bit_offset = 32;
+ break;
+ case 16:
+ addr.bit_offset = 128;
+ break;
+ default:
+ printk(BIOS_ERR, "IPMI: Unsupported register spacing for SPMI\n");
+ /* fall through */
+ case 1:
+ addr.bit_offset = 8;
+ break;
+ }
+
current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * SPMI at %lx\n", current);
spmi = (struct acpi_spmi *)current;
@@ -183,7 +199,9 @@ static void ipmi_ssdt(struct device *dev)
acpigen_write_STA(0xf);
acpigen_write_name("_CRS");
acpigen_write_resourcetemplate_header();
- acpigen_write_io16(dev->path.pnp.port, dev->path.pnp.port, 1, 2, 1);
+ acpigen_write_io16(dev->path.pnp.port, dev->path.pnp.port, 1, 1, 1);
+ acpigen_write_io16(dev->path.pnp.port + CONFIG_IPMI_KCS_REGISTER_SPACING,
+ dev->path.pnp.port + CONFIG_IPMI_KCS_REGISTER_SPACING, 1, 1, 1);
if (conf) {
// FIXME: is that correct?
@@ -214,6 +232,8 @@ static int ipmi_smbios_data(struct device *dev, int *handle,
struct drivers_ipmi_config *conf = NULL;
u8 nv_storage = 0xff;
u8 i2c_address = 0;
+ u8 register_spacing;
+
int len = 0;
if (dev->chip_info)
@@ -225,6 +245,21 @@ static int ipmi_smbios_data(struct device *dev, int *handle,
i2c_address = conf->bmc_i2c_address;
}
+ switch (CONFIG_IPMI_KCS_REGISTER_SPACING) {
+ case 4:
+ register_spacing = 1 << 6;
+ break;
+ case 16:
+ register_spacing = 2 << 6;
+ break;
+ default:
+ printk(BIOS_ERR, "IPMI: Unsupported register spacing for SMBIOS\n");
+ /* fall through */
+ case 1:
+ register_spacing = 0 << 6;
+ break;
+ }
+
// add IPMI Device Information
len += smbios_write_type38(
current, handle,
@@ -233,7 +268,7 @@ static int ipmi_smbios_data(struct device *dev, int *handle,
i2c_address, // I2C address
nv_storage, // NV storage
dev->path.pnp.port | 1, // IO interface
- 0,
+ register_spacing,
0); // no IRQ
return len;