Skip to content

Commit c0c6d20

Browse files
committed
Merge tag 'for-linus-5.14-1' of git://github.com/cminyard/linux-ipmi
Pull IPMI driver updates from Corey Minyard: "Mostly a restructure of the kcs_bmc driver to make it easier to use with different types of devices, and just to clean things up and improve things. Also some bug fixes for the kcs_bmc driver. One fix to the IPMI watchdog to stop the timer when the action is none. Not a big deal, but it's the right thing to do" * tag 'for-linus-5.14-1' of git://github.com/cminyard/linux-ipmi: ipmi: kcs_bmc_aspeed: Fix less than zero comparison of a unsigned int ipmi: kcs_bmc_aspeed: Optionally apply status address ipmi: kcs_bmc_aspeed: Fix IBFIE typo from datasheet ipmi: kcs_bmc_aspeed: Implement KCS SerIRQ configuration dt-bindings: ipmi: Add optional SerIRQ property to ASPEED KCS devices dt-bindings: ipmi: Convert ASPEED KCS binding to schema ipmi: kcs_bmc: Add serio adaptor ipmi: kcs_bmc: Enable IBF on open ipmi: kcs_bmc: Allow clients to control KCS IRQ state ipmi: kcs_bmc: Decouple the IPMI chardev from the core ipmi: kcs_bmc: Strip private client data from struct kcs_bmc ipmi: kcs_bmc: Split headers into device and client ipmi: kcs_bmc: Turn the driver data-structures inside-out ipmi: kcs_bmc: Split out kcs_bmc_cdev_ipmi ipmi: kcs_bmc: Rename {read,write}_{status,data}() functions ipmi: kcs_bmc: Make status update atomic ipmi: kcs_bmc_aspeed: Use of match data to extract KCS properties ipmi/watchdog: Stop watchdog timer when the current action is 'none'
2 parents 007b350 + 5b32dd2 commit c0c6d20

File tree

13 files changed

+1598
-706
lines changed

13 files changed

+1598
-706
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: ASPEED BMC KCS Devices
8+
9+
maintainers:
10+
- Andrew Jeffery <[email protected]>
11+
12+
description: |
13+
The Aspeed BMC SoCs typically use the Keyboard-Controller-Style (KCS)
14+
interfaces on the LPC bus for in-band IPMI communication with their host.
15+
16+
properties:
17+
compatible:
18+
oneOf:
19+
- description: Channel ID derived from reg
20+
items:
21+
enum:
22+
- aspeed,ast2400-kcs-bmc-v2
23+
- aspeed,ast2500-kcs-bmc-v2
24+
- aspeed,ast2600-kcs-bmc
25+
26+
- description: Old-style with explicit channel ID, no reg
27+
deprecated: true
28+
items:
29+
enum:
30+
- aspeed,ast2400-kcs-bmc
31+
- aspeed,ast2500-kcs-bmc
32+
33+
interrupts:
34+
maxItems: 1
35+
36+
reg:
37+
# maxItems: 3
38+
items:
39+
- description: IDR register
40+
- description: ODR register
41+
- description: STR register
42+
43+
aspeed,lpc-io-reg:
44+
$ref: '/schemas/types.yaml#/definitions/uint32-array'
45+
minItems: 1
46+
maxItems: 2
47+
description: |
48+
The host CPU LPC IO data and status addresses for the device. For most
49+
channels the status address is derived from the data address, but the
50+
status address may be optionally provided.
51+
52+
aspeed,lpc-interrupts:
53+
$ref: "/schemas/types.yaml#/definitions/uint32-array"
54+
minItems: 2
55+
maxItems: 2
56+
description: |
57+
A 2-cell property expressing the LPC SerIRQ number and the interrupt
58+
level/sense encoding (specified in the standard fashion).
59+
60+
Note that the generated interrupt is issued from the BMC to the host, and
61+
thus the target interrupt controller is not captured by the BMC's
62+
devicetree.
63+
64+
kcs_chan:
65+
deprecated: true
66+
$ref: '/schemas/types.yaml#/definitions/uint32'
67+
description: The LPC channel number in the controller
68+
69+
kcs_addr:
70+
deprecated: true
71+
$ref: '/schemas/types.yaml#/definitions/uint32'
72+
description: The host CPU IO map address
73+
74+
required:
75+
- compatible
76+
- interrupts
77+
78+
additionalProperties: false
79+
80+
allOf:
81+
- if:
82+
properties:
83+
compatible:
84+
contains:
85+
enum:
86+
- aspeed,ast2400-kcs-bmc
87+
- aspeed,ast2500-kcs-bmc
88+
then:
89+
required:
90+
- kcs_chan
91+
- kcs_addr
92+
else:
93+
required:
94+
- reg
95+
- aspeed,lpc-io-reg
96+
97+
examples:
98+
- |
99+
#include <dt-bindings/interrupt-controller/irq.h>
100+
kcs3: kcs@24 {
101+
compatible = "aspeed,ast2600-kcs-bmc";
102+
reg = <0x24 0x1>, <0x30 0x1>, <0x3c 0x1>;
103+
aspeed,lpc-io-reg = <0xca2>;
104+
aspeed,lpc-interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
105+
interrupts = <8>;
106+
};

Documentation/devicetree/bindings/ipmi/aspeed-kcs-bmc.txt

Lines changed: 0 additions & 33 deletions
This file was deleted.

drivers/char/ipmi/Kconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,33 @@ config NPCM7XX_KCS_IPMI_BMC
124124
This support is also available as a module. If so, the module
125125
will be called kcs_bmc_npcm7xx.
126126

127+
config IPMI_KCS_BMC_CDEV_IPMI
128+
depends on IPMI_KCS_BMC
129+
tristate "IPMI character device interface for BMC KCS devices"
130+
help
131+
Provides a BMC-side character device implementing IPMI
132+
semantics for KCS IPMI devices.
133+
134+
Say YES if you wish to expose KCS devices on the BMC for IPMI
135+
purposes.
136+
137+
This support is also available as a module. The module will be
138+
called kcs_bmc_cdev_ipmi.
139+
140+
config IPMI_KCS_BMC_SERIO
141+
depends on IPMI_KCS_BMC && SERIO
142+
tristate "SerIO adaptor for BMC KCS devices"
143+
help
144+
Adapts the BMC KCS device for the SerIO subsystem. This allows users
145+
to take advantage of userspace interfaces provided by SerIO where
146+
appropriate.
147+
148+
Say YES if you wish to expose KCS devices on the BMC via SerIO
149+
interfaces.
150+
151+
This support is also available as a module. The module will be
152+
called kcs_bmc_serio.
153+
127154
config ASPEED_BT_IPMI_BMC
128155
depends on ARCH_ASPEED || COMPILE_TEST
129156
depends on REGMAP && REGMAP_MMIO && MFD_SYSCON

drivers/char/ipmi/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ obj-$(CONFIG_IPMI_POWERNV) += ipmi_powernv.o
2323
obj-$(CONFIG_IPMI_WATCHDOG) += ipmi_watchdog.o
2424
obj-$(CONFIG_IPMI_POWEROFF) += ipmi_poweroff.o
2525
obj-$(CONFIG_IPMI_KCS_BMC) += kcs_bmc.o
26+
obj-$(CONFIG_IPMI_KCS_BMC_SERIO) += kcs_bmc_serio.o
27+
obj-$(CONFIG_IPMI_KCS_BMC_CDEV_IPMI) += kcs_bmc_cdev_ipmi.o
2628
obj-$(CONFIG_ASPEED_BT_IPMI_BMC) += bt-bmc.o
2729
obj-$(CONFIG_ASPEED_KCS_IPMI_BMC) += kcs_bmc_aspeed.o
2830
obj-$(CONFIG_NPCM7XX_KCS_IPMI_BMC) += kcs_bmc_npcm7xx.o

drivers/char/ipmi/ipmi_watchdog.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -371,16 +371,18 @@ static int __ipmi_set_timeout(struct ipmi_smi_msg *smi_msg,
371371
data[0] = 0;
372372
WDOG_SET_TIMER_USE(data[0], WDOG_TIMER_USE_SMS_OS);
373373

374-
if ((ipmi_version_major > 1)
375-
|| ((ipmi_version_major == 1) && (ipmi_version_minor >= 5))) {
376-
/* This is an IPMI 1.5-only feature. */
377-
data[0] |= WDOG_DONT_STOP_ON_SET;
378-
} else if (ipmi_watchdog_state != WDOG_TIMEOUT_NONE) {
379-
/*
380-
* In ipmi 1.0, setting the timer stops the watchdog, we
381-
* need to start it back up again.
382-
*/
383-
hbnow = 1;
374+
if (ipmi_watchdog_state != WDOG_TIMEOUT_NONE) {
375+
if ((ipmi_version_major > 1) ||
376+
((ipmi_version_major == 1) && (ipmi_version_minor >= 5))) {
377+
/* This is an IPMI 1.5-only feature. */
378+
data[0] |= WDOG_DONT_STOP_ON_SET;
379+
} else {
380+
/*
381+
* In ipmi 1.0, setting the timer stops the watchdog, we
382+
* need to start it back up again.
383+
*/
384+
hbnow = 1;
385+
}
384386
}
385387

386388
data[1] = 0;

0 commit comments

Comments
 (0)