ipmi: add an Aspeed KCS IPMI BMC driver
PATCH 1/1 ipmi: add an Aspeed KCS IPMI BMC driver
This patch adds a simple device driver to expose the KCS interface on Aspeed SOCs (AST2500) as a character device. Such SOCs are commonly used as BMC and this driver implements the BMC side of KCS interface.
Change-Id Iee4003dc817bbf50568e1cf0d254e648d112545d
Signed-off-by Haiyue Wang <[email protected]>
--- .../devicetree/bindings/mfd/aspeed-lpc.txt | 33 +- arch/arm/boot/dts/aspeed-g5.dtsi | 44 +- drivers/char/ipmi/Kconfig | 10 + drivers/char/ipmi/Makefile | 1 + drivers/char/ipmi/kcs-bmc.c | 833 +++++++++++++++++++++ include/uapi/linux/kcs-bmc.h | 19 + 6 files changed, 936 insertions(+), 4 deletions(-) create mode 100644 drivers/char/ipmi/kcs-bmc.c create mode 100644 include/uapi/linux/kcs-bmc.h
Documentation/devicetree/bindings/mfd/aspeed-lpc.txt +30 -3
@@ -62,12 +62,25 @@ BMC Node -------- - compatible: One of: - "aspeed,ast2400-lpc-bmc" - "aspeed,ast2500-lpc-bmc" + "aspeed,ast2400-lpc-bmc", "simple-mfd", "syscon" + "aspeed,ast2500-lpc-bmc", "simple-mfd", "syscon" - reg: contains the physical address and length values of the H8S/2168-compatible LPC controller memory region +BMC KCS Node +------------ + +- compatible: One of: + "aspeed,ast2500-kcs-bmc" + +- kcs_chan: The LPC channel number + +- kcs_regs: The KCS IDR,ODR,STR registers + +- kcs_addr: The host CPU IO map address + + Host Node ---------
@@ -94,8 +107,22 @@ lpc: lpc@1e789000 { ranges = <0x0 0x1e789000 0x1000>; lpc_bmc: lpc-bmc@0 { - compatible = "aspeed,ast2500-lpc-bmc"; + compatible = "aspeed,ast2500-lpc-bmc"; "simple-mfd", "syscon"; reg = <0x0 0x80>; + reg-io-width = <4>; + + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x0 0x80>; + + kcs3: kcs@3 { + compatible = "aspeed,ast2500-kcs-bmc"; + interrupts = <8>; + kcs_chan = <3>; + kcs_regs = <0x2C 0x38 0x44>; + kcs_addr = <0xCA2>; + status = "okay"; + }; }; lpc_host: lpc-host@80 {
arch/arm/boot/dts/aspeed-g5.dtsi +43 -1
57 lines not on this page · raw message
drivers/char/ipmi/Kconfig +10 -0
@@ -85,3 +85,13 @@ config ASPEED_BT_IPMI_BMC Provides a driver for the BT (Block Transfer) IPMI interface found on Aspeed SOCs (AST2400 and AST2500). The driver implements the BMC side of the BT interface. + +config ASPEED_KCS_IPMI_BMC + depends on ARCH_ASPEED || COMPILE_TEST + depends on REGMAP && REGMAP_MMIO && MFD_SYSCON + tristate "KCS IPMI bmc driver" + default n + help + Provides a driver for the KCS (Keyboard Controller Style) IPMI + interface found on Aspeed SOCs (AST2500). The driver implements + the BMC side of the KCS interface.
drivers/char/ipmi/Makefile +1 -0
@@ -12,3 +12,4 @@ obj-$(CONFIG_IPMI_POWERNV) += ipmi_powernv.o obj-$(CONFIG_IPMI_WATCHDOG) += ipmi_watchdog.o obj-$(CONFIG_IPMI_POWEROFF) += ipmi_poweroff.o obj-$(CONFIG_ASPEED_BT_IPMI_BMC) += bt-bmc.o +obj-$(CONFIG_ASPEED_KCS_IPMI_BMC) += kcs-bmc.o
drivers/char/ipmi/kcs-bmc.c new file +833 -0
833 lines not on this page · raw message
include/uapi/linux/kcs-bmc.h new file +19 -0
@@ -0,0 +1,19 @@ +/* +* Copyright (c) 2015-2017, Intel Corporation. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version +* 2 of the License, or (at your option) any later version. +*/ +#ifndef _UAPI_LINUX_KCS_BMC_H +#define _UAPI_LINUX_KCS_BMC_H + +#include <linux/ioctl.h> + +#define __KCS_BMC_IOCTL_MAGIC 'K' +#define KCS_BMC_IOCTL_SMS_ATN _IOW(__KCS_BMC_IOCTL_MAGIC, 1, unsigned long) +#define KCS_BMC_IOCTL_FORCE_ABORT _IO(__KCS_BMC_IOCTL_MAGIC, 2) + +#endif /* _UAPI_LINUX_KCS_BMC_H */ +
Signature · 1 line
2.7.4