Skip to contentSkip to conversation

Add Aspeed SSIF BMC driver

PATCH In review Quan Nguyen 1 participant 5 messages Mar 29, 2021

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover Add Aspeed SSIF BMC driver

This series add support for the Aspeed specific SSIF BMC driver which is to perform in-band IPMI communication with the host in management (BMC) side.

Quan Nguyen (3):
i2c: i2c-core-smbus: Expose PEC calculate function for generic use
drivers: char: ipmi: Add Aspeed SSIF BMC driver
bindings: ipmi: Add binding for Aspeed SSIF BMC driver

 .../bindings/ipmi/aspeed-ssif-bmc.txt         |  18 +
 drivers/char/ipmi/Kconfig                     |  22 +
 drivers/char/ipmi/Makefile                    |   2 +
 drivers/char/ipmi/ssif_bmc.c                  | 645 ++++++++++++++++++
 drivers/char/ipmi/ssif_bmc.h                  |  92 +++
 drivers/char/ipmi/ssif_bmc_aspeed.c           | 132 ++++
 drivers/i2c/i2c-core-smbus.c                  |  12 +-
 include/linux/i2c.h                           |   1 +
 8 files changed, 922 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/ipmi/aspeed-ssif-bmc.txt
 create mode 100644 drivers/char/ipmi/ssif_bmc.c
 create mode 100644 drivers/char/ipmi/ssif_bmc.h
 create mode 100644 drivers/char/ipmi/ssif_bmc_aspeed.c
Signature · 1 line
2.28.0
#1 lore raw

PATCH 1/3 i2c: i2c-core-smbus: Expose PEC calculate function for generic use

Expose the PEC calculation i2c_smbus_pec() for generic use.

---
 drivers/i2c/i2c-core-smbus.c | 12 ++++++++++--
 include/linux/i2c.h          |  1 +
 2 files changed, 11 insertions(+), 2 deletions(-)
drivers/i2c/i2c-core-smbus.c +10 -2
index d2d32c0fd8c3..e5b2d1465e7e 100644
@@ -37,8 +37,15 @@ static u8 crc8(u16 data)
 	return (u8)(data >> 8);
 }
 
-/* Incremental CRC8 over count bytes in the array pointed to by p */
-static u8 i2c_smbus_pec(u8 crc, u8 *p, size_t count)
+/**
+ * i2c_smbus_pec - Incremental CRC8 over the given input data array
+ * @crc: previous return crc8 value
+ * @p: pointer to data buffer.
+ * @count: number of bytes in data buffer.
+ *
+ * Incremental CRC8 over count bytes in the array pointed to by p
+ */
+u8 i2c_smbus_pec(u8 crc, u8 *p, size_t count)
 {
 	int i;
 
@@ -46,6 +53,7 @@ static u8 i2c_smbus_pec(u8 crc, u8 *p, size_t count)
 		crc = crc8((crc ^ p[i]) << 8);
 	return crc;
 }
+EXPORT_SYMBOL(i2c_smbus_pec);
 
 /* Assume a 7-bit address, which is reasonable for SMBus */
 static u8 i2c_smbus_msg_pec(u8 pec, struct i2c_msg *msg)
include/linux/i2c.h +1 -0
index 56622658b215..0d75e5bcdde6 100644
@@ -144,6 +144,7 @@ s32 __i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr,
 /* Now follow the 'nice' access routines. These also document the calling
    conventions of i2c_smbus_xfer. */
 
+u8 i2c_smbus_pec(u8 crc, u8 *p, size_t count);
 s32 i2c_smbus_read_byte(const struct i2c_client *client);
 s32 i2c_smbus_write_byte(const struct i2c_client *client, u8 value);
 s32 i2c_smbus_read_byte_data(const struct i2c_client *client, u8 command);
Signature · 1 line
2.28.0
#2 lore raw

PATCH 2/3 drivers: char: ipmi: Add Aspeed SSIF BMC driver

In reply to Quan Nguyen

The SMBus system interface (SSIF) IPMI BMC driver can be used to perform in-band IPMI communication with their host in management (BMC) side.

This commits adds support specifically for Aspeed AST2500 which commonly used as Board Management Controllers.

---
 drivers/char/ipmi/Kconfig           |  22 +
 drivers/char/ipmi/Makefile          |   2 +
 drivers/char/ipmi/ssif_bmc.c        | 645 ++++++++++++++++++++++++++++
 drivers/char/ipmi/ssif_bmc.h        |  92 ++++
 drivers/char/ipmi/ssif_bmc_aspeed.c | 132 ++++++
 5 files changed, 893 insertions(+)
 create mode 100644 drivers/char/ipmi/ssif_bmc.c
 create mode 100644 drivers/char/ipmi/ssif_bmc.h
 create mode 100644 drivers/char/ipmi/ssif_bmc_aspeed.c
drivers/char/ipmi/Kconfig +22 -0
index 07847d9a459a..d67fd204409a 100644
@@ -133,6 +133,28 @@ config ASPEED_BT_IPMI_BMC
 	  found on Aspeed SOCs (AST2400 and AST2500). The driver
 	  implements the BMC side of the BT interface.
 
+config SSIF_IPMI_BMC
+	tristate "SSIF IPMI BMC driver"
+	help
+	  This enables the IPMI SMBus system interface (SSIF) at the
+	  management (BMC) side.
+
+	  The driver implements the BMC side of the SMBus system
+	  interface (SSIF).
+
+config ASPEED_SSIF_IPMI_BMC
+	depends on ARCH_ASPEED || COMPILE_TEST
+	depends on I2C
+	select SSIF_IPMI_BMC
+	select I2C_SLAVE
+	tristate "Aspeed SSIF IPMI BMC driver"
+	help
+	  Provides a driver for the SSIF IPMI interface found on
+	  Aspeed AST2500 SoC.
+
+	  The driver implements the BMC side of the SMBus system
+	  interface (SSIF), specific for Aspeed AST2500 SoC.
+
 config IPMB_DEVICE_INTERFACE
 	tristate 'IPMB Interface handler'
 	depends on I2C
drivers/char/ipmi/Makefile +2 -0
index 0822adc2ec41..05b993f7335b 100644
@@ -27,3 +27,5 @@ obj-$(CONFIG_ASPEED_BT_IPMI_BMC) += bt-bmc.o
 obj-$(CONFIG_ASPEED_KCS_IPMI_BMC) += kcs_bmc_aspeed.o
 obj-$(CONFIG_NPCM7XX_KCS_IPMI_BMC) += kcs_bmc_npcm7xx.o
 obj-$(CONFIG_IPMB_DEVICE_INTERFACE) += ipmb_dev_int.o
+obj-$(CONFIG_SSIF_IPMI_BMC) += ssif_bmc.o
+obj-$(CONFIG_ASPEED_SSIF_IPMI_BMC) += ssif_bmc_aspeed.o
drivers/char/ipmi/ssif_bmc.c new file +645 -0

645 lines not on this page · raw message

drivers/char/ipmi/ssif_bmc.h new file +92 -0

92 lines not on this page · raw message

drivers/char/ipmi/ssif_bmc_aspeed.c new file +132 -0

132 lines not on this page · raw message

Signature · 1 line
2.28.0
#3 lore raw

PATCH 3/3 bindings: ipmi: Add binding for Aspeed SSIF BMC driver

In reply to Quan Nguyen

Add device tree binding document for the Aspeed SSIF BMC driver.

---
 .../bindings/ipmi/aspeed-ssif-bmc.txt          | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ipmi/aspeed-ssif-bmc.txt
Documentation/devicetree/bindings/ipmi/aspeed-ssif-bmc.txt new file +18 -0
new file mode 100644
index 000000000000..1616f0188db9
@@ -0,0 +1,18 @@
+# Aspeed SSIF (SMBus system interface) IPMI BMC interface
+
+The Aspeed AST2500 are commonly used as BMCs (Baseboard Management Controllers)
+and the SSIF slave interface can be used to perform in-band IPMI communication
+with their host.
+
+Required properties:
+
+- compatible : should be
+       "aspeed,ast2500-ssif-bmc"
+- reg: I2C address the registers
+
+Example:
+
+       ssif-bmc at 10 {
+               compatible = "aspeed,ast2500-ssif-bmc";
+               reg = <0x10>;
+       };
Signature · 1 line
2.28.0
#4 lore raw
In reply to Quan Nguyen

Please ignore this series as I have missed an important audience.

Going to resend another series. My apology.
- Quan

Quoted 23 lines · Quan Nguyen

This series add support for the Aspeed specific SSIF BMC driver which is to perform in-band IPMI communication with the host in management (BMC) side.

Quan Nguyen (3):
i2c: i2c-core-smbus: Expose PEC calculate function for generic use
drivers: char: ipmi: Add Aspeed SSIF BMC driver
bindings: ipmi: Add binding for Aspeed SSIF BMC driver

  .../bindings/ipmi/aspeed-ssif-bmc.txt         |  18 +
  drivers/char/ipmi/Kconfig                     |  22 +
  drivers/char/ipmi/Makefile                    |   2 +
  drivers/char/ipmi/ssif_bmc.c                  | 645 ++++++++++++++++++
  drivers/char/ipmi/ssif_bmc.h                  |  92 +++
  drivers/char/ipmi/ssif_bmc_aspeed.c           | 132 ++++
  drivers/i2c/i2c-core-smbus.c                  |  12 +-
  include/linux/i2c.h                           |   1 +
  8 files changed, 922 insertions(+), 2 deletions(-)

create mode 100644 Documentation/devicetree/bindings/ipmi/aspeed-ssif-bmc.txt create mode 100644 drivers/char/ipmi/ssif_bmc.c
create mode 100644 drivers/char/ipmi/ssif_bmc.h
create mode 100644 drivers/char/ipmi/ssif_bmc_aspeed.c