Unverified Commit 1bb24be0 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'scmi-updates-5.15' of...

Merge tag 'scmi-updates-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/drivers

SCMI Updates for v5.15

The bulk of the addition this time is mainly refactoring to add support
for Virtio transport for SCMI and the addition of the support itself.
The refactoring includes allowing transport specific init/exit calls,
making each transport as compile time configurable, supporting
monotonically increasing tokens instead of using the next available
free buffer index as the token for scmi messages which eases handling
concurrent and out-of-order messages which is a must have for virtio
transport.

Virtio support itself is conformant to the virtio SCMI device spec [1].
Virtio device id 32 has been reserved for the SCMI device [2].

Other than the virtio support, there is one bug fix in the probe failure
clean up path.

[1] https://github.com/oasis-tcs/virtio-spec/blob/master/virtio-scmi.tex
[2] https://www.oasis-open.org/committees/ballot.php?id=3496

* tag 'scmi-updates-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
  firmware: arm_scmi: Use WARN_ON() to check configured transports
  firmware: arm_scmi: Fix boolconv.cocci warnings
  firmware: arm_scmi: Free mailbox channels if probe fails
  firmware: arm_scmi: Add virtio transport
  firmware: arm_scmi: Add priv parameter to scmi_rx_callback
  dt-bindings: arm: Add virtio transport for SCMI
  firmware: arm_scmi: Add optional link_supplier() transport op
  firmware: arm_scmi: Add message passing abstractions for transports
  firmware: arm_scmi: Add method to override max message number
  firmware: arm_scmi: Make shmem support optional for transports
  firmware: arm_scmi: Make SCMI transports configurable
  firmware: arm_scmi: Make polling mode optional
  firmware: arm_scmi: Make .clear_channel optional
  firmware: arm_scmi: Handle concurrent and out-of-order messages
  firmware: arm_scmi: Introduce monotonically increasing tokens
  firmware: arm_scmi: Add optional transport_init/exit support
  firmware: arm_scmi: Remove scmi_dump_header_dbg() helper
  firmware: arm_scmi: Add support for type handling in common functions

Link: https://lore.kernel.org/r/20210811075743.707961-1-sudeep.holla@arm.com


Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 866e1691 c0397c85
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -34,6 +34,10 @@ properties:
      - description: SCMI compliant firmware with ARM SMC/HVC transport
        items:
          - const: arm,scmi-smc
      - description: SCMI compliant firmware with SCMI Virtio transport.
                     The virtio transport only supports a single device.
        items:
          - const: arm,scmi-virtio

  interrupts:
    description:
@@ -172,6 +176,7 @@ patternProperties:
      Each sub-node represents a protocol supported. If the platform
      supports a dedicated communication channel for a particular protocol,
      then the corresponding transport properties must be present.
      The virtio transport does not support a dedicated communication channel.

    properties:
      reg:
@@ -195,7 +200,6 @@ patternProperties:

required:
  - compatible
  - shmem

if:
  properties:
@@ -209,6 +213,7 @@ then:

  required:
    - mboxes
    - shmem

else:
  if:
@@ -219,6 +224,7 @@ else:
  then:
    required:
      - arm,smc-id
      - shmem

examples:
  - |
+1 −0
Original line number Diff line number Diff line
@@ -17959,6 +17959,7 @@ F: drivers/regulator/scmi-regulator.c
F:	drivers/reset/reset-scmi.c
F:	include/linux/sc[mp]i_protocol.h
F:	include/trace/events/scmi.h
F:	include/uapi/linux/virtio_scmi.h
SYSTEM RESET/SHUTDOWN DRIVERS
M:	Sebastian Reichel <sre@kernel.org>
+1 −33
Original line number Diff line number Diff line
@@ -6,39 +6,7 @@

menu "Firmware Drivers"

config ARM_SCMI_PROTOCOL
	tristate "ARM System Control and Management Interface (SCMI) Message Protocol"
	depends on ARM || ARM64 || COMPILE_TEST
	depends on MAILBOX || HAVE_ARM_SMCCC_DISCOVERY
	help
	  ARM System Control and Management Interface (SCMI) protocol is a
	  set of operating system-independent software interfaces that are
	  used in system management. SCMI is extensible and currently provides
	  interfaces for: Discovery and self-description of the interfaces
	  it supports, Power domain management which is the ability to place
	  a given device or domain into the various power-saving states that
	  it supports, Performance management which is the ability to control
	  the performance of a domain that is composed of compute engines
	  such as application processors and other accelerators, Clock
	  management which is the ability to set and inquire rates on platform
	  managed clocks and Sensor management which is the ability to read
	  sensor data, and be notified of sensor value.

	  This protocol library provides interface for all the client drivers
	  making use of the features offered by the SCMI.

config ARM_SCMI_POWER_DOMAIN
	tristate "SCMI power domain driver"
	depends on ARM_SCMI_PROTOCOL || (COMPILE_TEST && OF)
	default y
	select PM_GENERIC_DOMAINS if PM
	help
	  This enables support for the SCMI power domains which can be
	  enabled or disabled via the SCP firmware

	  This driver can also be built as a module.  If so, the module
	  will be called scmi_pm_domain. Note this may needed early in boot
	  before rootfs may be available.
source "drivers/firmware/arm_scmi/Kconfig"

config ARM_SCPI_PROTOCOL
	tristate "ARM System Control and Power Interface (SCPI) Message Protocol"
+95 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
menu "ARM System Control and Management Interface Protocol"

config ARM_SCMI_PROTOCOL
	tristate "ARM System Control and Management Interface (SCMI) Message Protocol"
	depends on ARM || ARM64 || COMPILE_TEST
	help
	  ARM System Control and Management Interface (SCMI) protocol is a
	  set of operating system-independent software interfaces that are
	  used in system management. SCMI is extensible and currently provides
	  interfaces for: Discovery and self-description of the interfaces
	  it supports, Power domain management which is the ability to place
	  a given device or domain into the various power-saving states that
	  it supports, Performance management which is the ability to control
	  the performance of a domain that is composed of compute engines
	  such as application processors and other accelerators, Clock
	  management which is the ability to set and inquire rates on platform
	  managed clocks and Sensor management which is the ability to read
	  sensor data, and be notified of sensor value.

	  This protocol library provides interface for all the client drivers
	  making use of the features offered by the SCMI.

if ARM_SCMI_PROTOCOL

config ARM_SCMI_HAVE_TRANSPORT
	bool
	help
	  This declares whether at least one SCMI transport has been configured.
	  Used to trigger a build bug when trying to build SCMI without any
	  configured transport.

config ARM_SCMI_HAVE_SHMEM
	bool
	help
	  This declares whether a shared memory based transport for SCMI is
	  available.

config ARM_SCMI_HAVE_MSG
	bool
	help
	  This declares whether a message passing based transport for SCMI is
	  available.

config ARM_SCMI_TRANSPORT_MAILBOX
	bool "SCMI transport based on Mailbox"
	depends on MAILBOX
	select ARM_SCMI_HAVE_TRANSPORT
	select ARM_SCMI_HAVE_SHMEM
	default y
	help
	  Enable mailbox based transport for SCMI.

	  If you want the ARM SCMI PROTOCOL stack to include support for a
	  transport based on mailboxes, answer Y.

config ARM_SCMI_TRANSPORT_SMC
	bool "SCMI transport based on SMC"
	depends on HAVE_ARM_SMCCC_DISCOVERY
	select ARM_SCMI_HAVE_TRANSPORT
	select ARM_SCMI_HAVE_SHMEM
	default y
	help
	  Enable SMC based transport for SCMI.

	  If you want the ARM SCMI PROTOCOL stack to include support for a
	  transport based on SMC, answer Y.

config ARM_SCMI_TRANSPORT_VIRTIO
	bool "SCMI transport based on VirtIO"
	depends on VIRTIO
	select ARM_SCMI_HAVE_TRANSPORT
	select ARM_SCMI_HAVE_MSG
	help
	  This enables the virtio based transport for SCMI.

	  If you want the ARM SCMI PROTOCOL stack to include support for a
	  transport based on VirtIO, answer Y.

endif #ARM_SCMI_PROTOCOL

config ARM_SCMI_POWER_DOMAIN
	tristate "SCMI power domain driver"
	depends on ARM_SCMI_PROTOCOL || (COMPILE_TEST && OF)
	default y
	select PM_GENERIC_DOMAINS if PM
	help
	  This enables support for the SCMI power domains which can be
	  enabled or disabled via the SCP firmware

	  This driver can also be built as a module.  If so, the module
	  will be called scmi_pm_domain. Note this may needed early in boot
	  before rootfs may be available.

endmenu
+5 −3
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
scmi-bus-y = bus.o
scmi-driver-y = driver.o notify.o
scmi-transport-y = shmem.o
scmi-transport-$(CONFIG_MAILBOX) += mailbox.o
scmi-transport-$(CONFIG_HAVE_ARM_SMCCC_DISCOVERY) += smc.o
scmi-transport-$(CONFIG_ARM_SCMI_HAVE_SHMEM) = shmem.o
scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_MAILBOX) += mailbox.o
scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_SMC) += smc.o
scmi-transport-$(CONFIG_ARM_SCMI_HAVE_MSG) += msg.o
scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_VIRTIO) += virtio.o
scmi-protocols-y = base.o clock.o perf.o power.o reset.o sensors.o system.o voltage.o
scmi-module-objs := $(scmi-bus-y) $(scmi-driver-y) $(scmi-protocols-y) \
		    $(scmi-transport-y)
Loading