Skip to content

Commit 1bb24be

Browse files
committed
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/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 866e169 + c0397c8 commit 1bb24be

File tree

13 files changed

+1429
-148
lines changed

13 files changed

+1429
-148
lines changed

Documentation/devicetree/bindings/firmware/arm,scmi.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ properties:
3434
- description: SCMI compliant firmware with ARM SMC/HVC transport
3535
items:
3636
- const: arm,scmi-smc
37+
- description: SCMI compliant firmware with SCMI Virtio transport.
38+
The virtio transport only supports a single device.
39+
items:
40+
- const: arm,scmi-virtio
3741

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

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

196201
required:
197202
- compatible
198-
- shmem
199203

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

210214
required:
211215
- mboxes
216+
- shmem
212217

213218
else:
214219
if:
@@ -219,6 +224,7 @@ else:
219224
then:
220225
required:
221226
- arm,smc-id
227+
- shmem
222228

223229
examples:
224230
- |

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17959,6 +17959,7 @@ F: drivers/regulator/scmi-regulator.c
1795917959
F: drivers/reset/reset-scmi.c
1796017960
F: include/linux/sc[mp]i_protocol.h
1796117961
F: include/trace/events/scmi.h
17962+
F: include/uapi/linux/virtio_scmi.h
1796217963

1796317964
SYSTEM RESET/SHUTDOWN DRIVERS
1796417965
M: Sebastian Reichel <[email protected]>

drivers/firmware/Kconfig

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,7 @@
66

77
menu "Firmware Drivers"
88

9-
config ARM_SCMI_PROTOCOL
10-
tristate "ARM System Control and Management Interface (SCMI) Message Protocol"
11-
depends on ARM || ARM64 || COMPILE_TEST
12-
depends on MAILBOX || HAVE_ARM_SMCCC_DISCOVERY
13-
help
14-
ARM System Control and Management Interface (SCMI) protocol is a
15-
set of operating system-independent software interfaces that are
16-
used in system management. SCMI is extensible and currently provides
17-
interfaces for: Discovery and self-description of the interfaces
18-
it supports, Power domain management which is the ability to place
19-
a given device or domain into the various power-saving states that
20-
it supports, Performance management which is the ability to control
21-
the performance of a domain that is composed of compute engines
22-
such as application processors and other accelerators, Clock
23-
management which is the ability to set and inquire rates on platform
24-
managed clocks and Sensor management which is the ability to read
25-
sensor data, and be notified of sensor value.
26-
27-
This protocol library provides interface for all the client drivers
28-
making use of the features offered by the SCMI.
29-
30-
config ARM_SCMI_POWER_DOMAIN
31-
tristate "SCMI power domain driver"
32-
depends on ARM_SCMI_PROTOCOL || (COMPILE_TEST && OF)
33-
default y
34-
select PM_GENERIC_DOMAINS if PM
35-
help
36-
This enables support for the SCMI power domains which can be
37-
enabled or disabled via the SCP firmware
38-
39-
This driver can also be built as a module. If so, the module
40-
will be called scmi_pm_domain. Note this may needed early in boot
41-
before rootfs may be available.
9+
source "drivers/firmware/arm_scmi/Kconfig"
4210

4311
config ARM_SCPI_PROTOCOL
4412
tristate "ARM System Control and Power Interface (SCPI) Message Protocol"

drivers/firmware/arm_scmi/Kconfig

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
menu "ARM System Control and Management Interface Protocol"
3+
4+
config ARM_SCMI_PROTOCOL
5+
tristate "ARM System Control and Management Interface (SCMI) Message Protocol"
6+
depends on ARM || ARM64 || COMPILE_TEST
7+
help
8+
ARM System Control and Management Interface (SCMI) protocol is a
9+
set of operating system-independent software interfaces that are
10+
used in system management. SCMI is extensible and currently provides
11+
interfaces for: Discovery and self-description of the interfaces
12+
it supports, Power domain management which is the ability to place
13+
a given device or domain into the various power-saving states that
14+
it supports, Performance management which is the ability to control
15+
the performance of a domain that is composed of compute engines
16+
such as application processors and other accelerators, Clock
17+
management which is the ability to set and inquire rates on platform
18+
managed clocks and Sensor management which is the ability to read
19+
sensor data, and be notified of sensor value.
20+
21+
This protocol library provides interface for all the client drivers
22+
making use of the features offered by the SCMI.
23+
24+
if ARM_SCMI_PROTOCOL
25+
26+
config ARM_SCMI_HAVE_TRANSPORT
27+
bool
28+
help
29+
This declares whether at least one SCMI transport has been configured.
30+
Used to trigger a build bug when trying to build SCMI without any
31+
configured transport.
32+
33+
config ARM_SCMI_HAVE_SHMEM
34+
bool
35+
help
36+
This declares whether a shared memory based transport for SCMI is
37+
available.
38+
39+
config ARM_SCMI_HAVE_MSG
40+
bool
41+
help
42+
This declares whether a message passing based transport for SCMI is
43+
available.
44+
45+
config ARM_SCMI_TRANSPORT_MAILBOX
46+
bool "SCMI transport based on Mailbox"
47+
depends on MAILBOX
48+
select ARM_SCMI_HAVE_TRANSPORT
49+
select ARM_SCMI_HAVE_SHMEM
50+
default y
51+
help
52+
Enable mailbox based transport for SCMI.
53+
54+
If you want the ARM SCMI PROTOCOL stack to include support for a
55+
transport based on mailboxes, answer Y.
56+
57+
config ARM_SCMI_TRANSPORT_SMC
58+
bool "SCMI transport based on SMC"
59+
depends on HAVE_ARM_SMCCC_DISCOVERY
60+
select ARM_SCMI_HAVE_TRANSPORT
61+
select ARM_SCMI_HAVE_SHMEM
62+
default y
63+
help
64+
Enable SMC based transport for SCMI.
65+
66+
If you want the ARM SCMI PROTOCOL stack to include support for a
67+
transport based on SMC, answer Y.
68+
69+
config ARM_SCMI_TRANSPORT_VIRTIO
70+
bool "SCMI transport based on VirtIO"
71+
depends on VIRTIO
72+
select ARM_SCMI_HAVE_TRANSPORT
73+
select ARM_SCMI_HAVE_MSG
74+
help
75+
This enables the virtio based transport for SCMI.
76+
77+
If you want the ARM SCMI PROTOCOL stack to include support for a
78+
transport based on VirtIO, answer Y.
79+
80+
endif #ARM_SCMI_PROTOCOL
81+
82+
config ARM_SCMI_POWER_DOMAIN
83+
tristate "SCMI power domain driver"
84+
depends on ARM_SCMI_PROTOCOL || (COMPILE_TEST && OF)
85+
default y
86+
select PM_GENERIC_DOMAINS if PM
87+
help
88+
This enables support for the SCMI power domains which can be
89+
enabled or disabled via the SCP firmware
90+
91+
This driver can also be built as a module. If so, the module
92+
will be called scmi_pm_domain. Note this may needed early in boot
93+
before rootfs may be available.
94+
95+
endmenu

drivers/firmware/arm_scmi/Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
scmi-bus-y = bus.o
33
scmi-driver-y = driver.o notify.o
4-
scmi-transport-y = shmem.o
5-
scmi-transport-$(CONFIG_MAILBOX) += mailbox.o
6-
scmi-transport-$(CONFIG_HAVE_ARM_SMCCC_DISCOVERY) += smc.o
4+
scmi-transport-$(CONFIG_ARM_SCMI_HAVE_SHMEM) = shmem.o
5+
scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_MAILBOX) += mailbox.o
6+
scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_SMC) += smc.o
7+
scmi-transport-$(CONFIG_ARM_SCMI_HAVE_MSG) += msg.o
8+
scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_VIRTIO) += virtio.o
79
scmi-protocols-y = base.o clock.o perf.o power.o reset.o sensors.o system.o voltage.o
810
scmi-module-objs := $(scmi-bus-y) $(scmi-driver-y) $(scmi-protocols-y) \
911
$(scmi-transport-y)

0 commit comments

Comments
 (0)