Commit c0c6d209 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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'
parents 007b350a 5b32dd28
Loading
Loading
Loading
Loading
+106 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ASPEED BMC KCS Devices

maintainers:
  - Andrew Jeffery <andrew@aj.id.au>

description: |
  The Aspeed BMC SoCs typically use the Keyboard-Controller-Style (KCS)
  interfaces on the LPC bus for in-band IPMI communication with their host.

properties:
  compatible:
    oneOf:
      - description: Channel ID derived from reg
        items:
          enum:
            - aspeed,ast2400-kcs-bmc-v2
            - aspeed,ast2500-kcs-bmc-v2
            - aspeed,ast2600-kcs-bmc

      - description: Old-style with explicit channel ID, no reg
        deprecated: true
        items:
          enum:
            - aspeed,ast2400-kcs-bmc
            - aspeed,ast2500-kcs-bmc

  interrupts:
    maxItems: 1

  reg:
    # maxItems: 3
    items:
      - description: IDR register
      - description: ODR register
      - description: STR register

  aspeed,lpc-io-reg:
    $ref: '/schemas/types.yaml#/definitions/uint32-array'
    minItems: 1
    maxItems: 2
    description: |
      The host CPU LPC IO data and status addresses for the device. For most
      channels the status address is derived from the data address, but the
      status address may be optionally provided.

  aspeed,lpc-interrupts:
    $ref: "/schemas/types.yaml#/definitions/uint32-array"
    minItems: 2
    maxItems: 2
    description: |
      A 2-cell property expressing the LPC SerIRQ number and the interrupt
      level/sense encoding (specified in the standard fashion).

      Note that the generated interrupt is issued from the BMC to the host, and
      thus the target interrupt controller is not captured by the BMC's
      devicetree.

  kcs_chan:
    deprecated: true
    $ref: '/schemas/types.yaml#/definitions/uint32'
    description: The LPC channel number in the controller

  kcs_addr:
    deprecated: true
    $ref: '/schemas/types.yaml#/definitions/uint32'
    description: The host CPU IO map address

required:
  - compatible
  - interrupts

additionalProperties: false

allOf:
  - if:
      properties:
        compatible:
          contains:
            enum:
              - aspeed,ast2400-kcs-bmc
              - aspeed,ast2500-kcs-bmc
    then:
      required:
        - kcs_chan
        - kcs_addr
    else:
      required:
        - reg
        - aspeed,lpc-io-reg

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    kcs3: kcs@24 {
        compatible = "aspeed,ast2600-kcs-bmc";
        reg = <0x24 0x1>, <0x30 0x1>, <0x3c 0x1>;
        aspeed,lpc-io-reg = <0xca2>;
        aspeed,lpc-interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
        interrupts = <8>;
    };
+0 −33
Original line number Diff line number Diff line
# Aspeed KCS (Keyboard Controller Style) IPMI interface

The Aspeed SOCs (AST2400 and AST2500) are commonly used as BMCs
(Baseboard Management Controllers) and the KCS interface can be
used to perform in-band IPMI communication with their host.

## v1
Required properties:
- compatible : should be one of
    "aspeed,ast2400-kcs-bmc"
    "aspeed,ast2500-kcs-bmc"
- interrupts : interrupt generated by the controller
- kcs_chan : The LPC channel number in the controller
- kcs_addr : The host CPU IO map address

## v2
Required properties:
- compatible : should be one of
    "aspeed,ast2400-kcs-bmc-v2"
    "aspeed,ast2500-kcs-bmc-v2"
- reg : The address and size of the IDR, ODR and STR registers
- interrupts : interrupt generated by the controller
- aspeed,lpc-io-reg : The host CPU LPC IO address for the device

Example:

    kcs3: kcs@24 {
        compatible = "aspeed,ast2500-kcs-bmc-v2";
        reg = <0x24 0x1>, <0x30 0x1>, <0x3c 0x1>;
        aspeed,lpc-reg = <0xca2>;
        interrupts = <8>;
        status = "okay";
    };
+27 −0
Original line number Diff line number Diff line
@@ -124,6 +124,33 @@ config NPCM7XX_KCS_IPMI_BMC
	  This support is also available as a module.  If so, the module
	  will be called kcs_bmc_npcm7xx.

config IPMI_KCS_BMC_CDEV_IPMI
	depends on IPMI_KCS_BMC
	tristate "IPMI character device interface for BMC KCS devices"
	help
	  Provides a BMC-side character device implementing IPMI
	  semantics for KCS IPMI devices.

	  Say YES if you wish to expose KCS devices on the BMC for IPMI
	  purposes.

	  This support is also available as a module. The module will be
	  called kcs_bmc_cdev_ipmi.

config IPMI_KCS_BMC_SERIO
	depends on IPMI_KCS_BMC && SERIO
	tristate "SerIO adaptor for BMC KCS devices"
	help
	  Adapts the BMC KCS device for the SerIO subsystem. This allows users
	  to take advantage of userspace interfaces provided by SerIO where
	  appropriate.

	  Say YES if you wish to expose KCS devices on the BMC via SerIO
	  interfaces.

	  This support is also available as a module. The module will be
	  called kcs_bmc_serio.

config ASPEED_BT_IPMI_BMC
	depends on ARCH_ASPEED || COMPILE_TEST
	depends on REGMAP && REGMAP_MMIO && MFD_SYSCON
+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ obj-$(CONFIG_IPMI_POWERNV) += ipmi_powernv.o
obj-$(CONFIG_IPMI_WATCHDOG) += ipmi_watchdog.o
obj-$(CONFIG_IPMI_POWEROFF) += ipmi_poweroff.o
obj-$(CONFIG_IPMI_KCS_BMC) += kcs_bmc.o
obj-$(CONFIG_IPMI_KCS_BMC_SERIO) += kcs_bmc_serio.o
obj-$(CONFIG_IPMI_KCS_BMC_CDEV_IPMI) += kcs_bmc_cdev_ipmi.o
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
+12 −10
Original line number Diff line number Diff line
@@ -371,17 +371,19 @@ static int __ipmi_set_timeout(struct ipmi_smi_msg *smi_msg,
	data[0] = 0;
	WDOG_SET_TIMER_USE(data[0], WDOG_TIMER_USE_SMS_OS);

	if ((ipmi_version_major > 1)
	    || ((ipmi_version_major == 1) && (ipmi_version_minor >= 5))) {
	if (ipmi_watchdog_state != WDOG_TIMEOUT_NONE) {
		if ((ipmi_version_major > 1) ||
		    ((ipmi_version_major == 1) && (ipmi_version_minor >= 5))) {
			/* This is an IPMI 1.5-only feature. */
			data[0] |= WDOG_DONT_STOP_ON_SET;
	} else if (ipmi_watchdog_state != WDOG_TIMEOUT_NONE) {
		} else {
			/*
			 * In ipmi 1.0, setting the timer stops the watchdog, we
			 * need to start it back up again.
			 */
			hbnow = 1;
		}
	}

	data[1] = 0;
	WDOG_SET_TIMEOUT_ACT(data[1], ipmi_watchdog_state);
Loading