Patrick Rudolph has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/35152 )
Change subject: drivers/ipmi/ipmi_kcs_ops: Advertise correct register spacing ......................................................................
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 --- M src/drivers/ipmi/ipmi_kcs_ops.c 1 file changed, 37 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Philipp Deppenwiese: Looks good to me, approved
diff --git a/src/drivers/ipmi/ipmi_kcs_ops.c b/src/drivers/ipmi/ipmi_kcs_ops.c index 21102bb..baa72a8 100644 --- a/src/drivers/ipmi/ipmi_kcs_ops.c +++ b/src/drivers/ipmi/ipmi_kcs_ops.c @@ -128,8 +128,24 @@ .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 @@ 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 @@ 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 @@ 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 @@ i2c_address, // I2C address nv_storage, // NV storage dev->path.pnp.port | 1, // IO interface - 0, + register_spacing, 0); // no IRQ
return len;