Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33490
Change subject: mb/*: Use common IPMI KCS driver ......................................................................
mb/*: Use common IPMI KCS driver
Remove duplicated code and instead use the IPMI KCS driver, which provides the same functionality.
Change-Id: I419713c9bef02084cca1ff4cf11c33c2e3e8d3c1 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/mainboard/asus/kgpe-d16/Kconfig M src/mainboard/asus/kgpe-d16/devicetree.cb M src/mainboard/asus/kgpe-d16/dsdt.asl M src/mainboard/asus/kgpe-d16/mainboard.c M src/mainboard/ocp/monolake/Kconfig M src/mainboard/ocp/monolake/devicetree.cb M src/mainboard/ocp/monolake/dsdt.asl M src/mainboard/ocp/monolake/mainboard.c 8 files changed, 7 insertions(+), 171 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/33490/1
diff --git a/src/mainboard/asus/kgpe-d16/Kconfig b/src/mainboard/asus/kgpe-d16/Kconfig index 32c4dbc..64beaf0 100644 --- a/src/mainboard/asus/kgpe-d16/Kconfig +++ b/src/mainboard/asus/kgpe-d16/Kconfig @@ -33,6 +33,7 @@ select DRIVERS_ASPEED_AST2050 select MAINBOARD_FORCE_NATIVE_VGA_INIT select POWER_STATE_DEFAULT_ON_AFTER_FAILURE + select IPMI_KCS
config MAINBOARD_DIR string diff --git a/src/mainboard/asus/kgpe-d16/devicetree.cb b/src/mainboard/asus/kgpe-d16/devicetree.cb index 0ea4216..31bd3e3 100644 --- a/src/mainboard/asus/kgpe-d16/devicetree.cb +++ b/src/mainboard/asus/kgpe-d16/devicetree.cb @@ -217,7 +217,7 @@ chip drivers/pc80/tpm device pnp 4e.0 on end # TPM module end - chip drivers/generic/generic # BMC KCS + chip drivers/ipmi # BMC KCS device pnp ca2.0 on end end end diff --git a/src/mainboard/asus/kgpe-d16/dsdt.asl b/src/mainboard/asus/kgpe-d16/dsdt.asl index ea52488..efb67a5 100644 --- a/src/mainboard/asus/kgpe-d16/dsdt.asl +++ b/src/mainboard/asus/kgpe-d16/dsdt.asl @@ -53,9 +53,6 @@
#include <southbridge/amd/common/acpi/sleepstates.asl>
- /* IPMI KCS enable */ - Name (KCSE, 0x1) - /* The _PIC method is called by the OS to choose between interrupt * routing via the i8259 interrupt controller or the APIC. * @@ -489,13 +486,6 @@ Name (_HID, EisaId ("PNP0A05")) Name (_ADR, 0x00140003)
- OperationRegion (BMRG, SystemIO, 0xca2, 0x02) /* BMC KCS registers */ - Field (BMRG, AnyAcc, NoLock, Preserve) - { - BMRI, 8, /* Index */ - BMRD, 8, /* Data */ - } - /* Real Time Clock Device */ Device(RTC0) { Name(_HID, EISAID("PNP0B00")) /* AT Real Time Clock (not PIIX4 compatible) */ @@ -617,27 +607,6 @@ }) } } - - Device (KCS1) { /* IPMI KCS */ - Name (_HID, EISAID ("IPI0001")) /* ASpeed BMC */ - Method (_STA, 0, NotSerialized) { - If (KCSE) { /* Detection enabled */ - If (LNotEqual (BMRD, 0xff)) { - Return (0x0f) /* Device present */ - } - Return (Zero) - } - Return (Zero) - } - Method (_CRS, 0) { - Return (ResourceTemplate() { - IO(Decode16, 0x0ca2, 0x0ca2, 0x01, 0x02) - }) - } - Method (_IFT, 0, NotSerialized) { /* Interface type */ - Return (One) /* KCS interface */ - } - } }
/* High Precision Event Timer */ diff --git a/src/mainboard/asus/kgpe-d16/mainboard.c b/src/mainboard/asus/kgpe-d16/mainboard.c index 14bb986..a03953b 100644 --- a/src/mainboard/asus/kgpe-d16/mainboard.c +++ b/src/mainboard/asus/kgpe-d16/mainboard.c @@ -47,7 +47,6 @@ * enable the dedicated function in kgpe-d16 board. * This function is called earlier than sr5650_enable. *************************************************/ -#define BMC_KCS_BASE 0xca2
static void mainboard_enable(struct device *dev) { @@ -69,13 +68,6 @@
set_pcie_dereset(); /* get_ide_dma66(); */ - - /* 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; }
/* override the default SATA PHY setup */ diff --git a/src/mainboard/ocp/monolake/Kconfig b/src/mainboard/ocp/monolake/Kconfig index 037c322..7af4ae9 100644 --- a/src/mainboard/ocp/monolake/Kconfig +++ b/src/mainboard/ocp/monolake/Kconfig @@ -13,6 +13,7 @@ select MAINBOARD_USES_IFD_GBE_REGION select MAINBOARD_HAS_LPC_TPM select MAINBOARD_HAS_TPM1 + select IPMI_KCS
config INTEGRATED_UART def_bool n diff --git a/src/mainboard/ocp/monolake/devicetree.cb b/src/mainboard/ocp/monolake/devicetree.cb index 2d91b73..5b990db 100644 --- a/src/mainboard/ocp/monolake/devicetree.cb +++ b/src/mainboard/ocp/monolake/devicetree.cb @@ -11,8 +11,10 @@ chip drivers/pc80/tpm device pnp 0c31.0 on end end - chip drivers/generic/generic # BMC KCS - device pnp ca2.0 on end + chip drivers/ipmi # BMC KCS + device pnp ca2.0 on + register "bmc_i2c_address" = "0x20" + end end end # LPC Bridge device pci 1f.2 on end # SATA Controller diff --git a/src/mainboard/ocp/monolake/dsdt.asl b/src/mainboard/ocp/monolake/dsdt.asl index 72b1c3c..1248703 100644 --- a/src/mainboard/ocp/monolake/dsdt.asl +++ b/src/mainboard/ocp/monolake/dsdt.asl @@ -27,9 +27,6 @@ { #include "acpi/platform.asl"
- Name (IDTP, 0x0CA2) - Name (ICDP, 0x0CA6) - Name(_S0, Package() { 0x00, 0x00, 0x00, 0x00 }) Name(_S5, Package() { 0x07, 0x00, 0x00, 0x00 })
@@ -293,97 +290,5 @@ } }
- Scope (_SB.PCI0.LPC0) - { - Device (SPMI) - { - Name (_HID, EisaId ("IPI0001")) - Name (_STR, Unicode ("IPMI_KCS")) - Name (_UID, 0x00) - OperationRegion (IPST, SystemIO, ICDP, 0x01) - Field (IPST, ByteAcc, NoLock, Preserve) - { - STAS, 8 - } - Method (_STA, 0, NotSerialized) { - Return (0x0f) - } - Name (ICRS, ResourceTemplate () - { - IO (Decode16, - 0x0000, - 0x0000, - 0x00, - 0x00, - _Y01) - IO (Decode16, - 0x0000, - 0x0000, - 0x00, - 0x00, - _Y02) - - }) - Method (_CRS, 0, NotSerialized) - { - CreateWordField (ICRS, _SB.PCI0.LPC0.SPMI._Y01._MIN, IPDB) - CreateWordField (ICRS, _SB.PCI0.LPC0.SPMI._Y01._MAX, IPDH) - CreateByteField (ICRS, _SB.PCI0.LPC0.SPMI._Y01._LEN, IPDL) - CreateWordField (ICRS, _SB.PCI0.LPC0.SPMI._Y02._MIN, IPCB) - CreateWordField (ICRS, _SB.PCI0.LPC0.SPMI._Y02._MAX, IPCH) - CreateByteField (ICRS, _SB.PCI0.LPC0.SPMI._Y02._LEN, IPCL) - - IPDB = IDTP - IPDH = IDTP - IPDL = 0x01 - - IPCB = ICDP - IPCH = ICDP - IPCL = 0x01 - - Return (ICRS) - } - Method (_IFT, 0, NotSerialized) { - Return (0x01) - } - Method(_SRV, 0, NotSerialized) { - Return (0x0200) - } - } - - Device (SYSR) - { - Name (_HID, EisaId ("PNP0C02")) - - Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings - { - IO (Decode16, - 0x0CA2, - 0x0CA2, - 0x01, - 0x01, - ) - IO (Decode16, - 0x0CA6, - 0x0CA6, - 0x01, - 0x01, - ) - IO (Decode16, - 0x0CA8, - 0x0CA8, - 0x01, - 0x01, - ) - IO (Decode16, - 0x0CAC, - 0x0CAC, - 0x01, - 0x01, - ) - }) - } - } - #include "acpi/mainboard.asl" } diff --git a/src/mainboard/ocp/monolake/mainboard.c b/src/mainboard/ocp/monolake/mainboard.c index bbfeeaf..4395436 100644 --- a/src/mainboard/ocp/monolake/mainboard.c +++ b/src/mainboard/ocp/monolake/mainboard.c @@ -20,46 +20,12 @@ #include <x86emu/x86emu.h> #endif
-#define BMC_KCS_BASE 0xca2 -#define INTERFACE_IS_IO 0x1 - -#if 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 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 = {