Commit 270a5bbb authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

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

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

ARM SCMI updates for v5.11

Two main additions this time:
1. Support for SCMI v3.0 sensor extensions
2. Support for voltage domain management protocol added newly to SCMI v3.0

* tag 'scmi-updates-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
  firmware: arm_scmi: Remove residual _le structs naming
  firmware: arm_scmi: Add SCMI v3.0 sensor notifications
  firmware: arm_scmi: Add SCMI v3.0 sensor configuration support
  firmware: arm_scmi: Add SCMI v3.0 sensors timestamped reads
  hwmon: (scmi) Update hwmon internal scale data type
  firmware: arm_scmi: Add support to enumerated SCMI voltage domain device
  firmware: arm_scmi: Add voltage domain management protocol support
  dt-bindings: arm: Add support for SCMI Regulators
  firmware: arm_scmi: Add SCMI v3.0 sensors descriptors extensions
  firmware: arm_scmi: Add full list of sensor type enumeration
  firmware: arm_scmi: Rework scmi_sensors_protocol_init
  firmware: arm_scmi: Fix missing destroy_workqueue()

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


Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 718e43b5 f83eb664
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
@@ -62,6 +62,29 @@ Required properties:
 - #power-domain-cells : Should be 1. Contains the device or the power
			 domain ID value used by SCMI commands.

Regulator bindings for the SCMI Regulator based on SCMI Message Protocol
------------------------------------------------------------
An SCMI Regulator is permanently bound to a well defined SCMI Voltage Domain,
and should be always positioned as a root regulator.
It does not support any current operation.

SCMI Regulators are grouped under a 'regulators' node which in turn is a child
of the SCMI Voltage protocol node inside the desired SCMI instance node.

This binding uses the common regulator binding[6] but, due to SCMI abstractions,
supports only a subset of its properties as specified below amongst Optional
properties.

Required properties:
 - reg : shall identify an existent SCMI Voltage Domain.

Optional properties:
 - regulator-name
 - regulator-min-microvolt / regulator-max-microvolt
 - regulator-always-on / regulator-boot-on
 - regulator-max-step-microvolt
 - regulator-coupled-with / regulator-coupled-max-spread

Sensor bindings for the sensors based on SCMI Message Protocol
--------------------------------------------------------------
SCMI provides an API to access the various sensors on the SoC.
@@ -105,6 +128,7 @@ Required sub-node properties:
[3] Documentation/devicetree/bindings/thermal/thermal*.yaml
[4] Documentation/devicetree/bindings/sram/sram.yaml
[5] Documentation/devicetree/bindings/reset/reset.txt
[6] Documentation/devicetree/bindings/regulator/regulator.yaml

Example:

@@ -169,6 +193,25 @@ firmware {
			reg = <0x16>;
			#reset-cells = <1>;
		};

		scmi_voltage: protocol@17 {
			reg = <0x17>;

			regulators {
				regulator_devX: regulator@0 {
					reg = <0x0>;
					regulator-max-microvolt = <3300000>;
				};

				regulator_devY: regulator@9 {
					reg = <0x9>;
					regulator-min-microvolt = <500000>;
					regulator-max-microvolt = <4200000>;
				};

				...
			};
		};
	};
};

+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ 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-protocols-y = base.o clock.o perf.o power.o reset.o sensors.o system.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)
obj-$(CONFIG_ARM_SCMI_PROTOCOL) += scmi-module.o
+1 −0
Original line number Diff line number Diff line
@@ -169,6 +169,7 @@ DECLARE_SCMI_REGISTER_UNREGISTER(perf);
DECLARE_SCMI_REGISTER_UNREGISTER(power);
DECLARE_SCMI_REGISTER_UNREGISTER(reset);
DECLARE_SCMI_REGISTER_UNREGISTER(sensors);
DECLARE_SCMI_REGISTER_UNREGISTER(voltage);
DECLARE_SCMI_REGISTER_UNREGISTER(system);

#define DEFINE_SCMI_PROTOCOL_REGISTER_UNREGISTER(id, name) \
+3 −0
Original line number Diff line number Diff line
@@ -743,6 +743,7 @@ static struct scmi_prot_devnames devnames[] = {
	{ SCMI_PROTOCOL_CLOCK,  { "clocks" },},
	{ SCMI_PROTOCOL_SENSOR, { "hwmon" },},
	{ SCMI_PROTOCOL_RESET,  { "reset" },},
	{ SCMI_PROTOCOL_VOLTAGE,  { "regulator" },},
};

static inline void
@@ -946,6 +947,7 @@ static int __init scmi_driver_init(void)
	scmi_power_register();
	scmi_reset_register();
	scmi_sensors_register();
	scmi_voltage_register();
	scmi_system_register();

	return platform_driver_register(&scmi_driver);
@@ -961,6 +963,7 @@ static void __exit scmi_driver_exit(void)
	scmi_power_unregister();
	scmi_reset_unregister();
	scmi_sensors_unregister();
	scmi_voltage_unregister();
	scmi_system_unregister();

	platform_driver_unregister(&scmi_driver);
+5 −5
Original line number Diff line number Diff line
@@ -1474,17 +1474,17 @@ int scmi_notification_init(struct scmi_handle *handle)
	ni->gid = gid;
	ni->handle = handle;

	ni->registered_protocols = devm_kcalloc(handle->dev, SCMI_MAX_PROTO,
						sizeof(char *), GFP_KERNEL);
	if (!ni->registered_protocols)
		goto err;

	ni->notify_wq = alloc_workqueue(dev_name(handle->dev),
					WQ_UNBOUND | WQ_FREEZABLE | WQ_SYSFS,
					0);
	if (!ni->notify_wq)
		goto err;

	ni->registered_protocols = devm_kcalloc(handle->dev, SCMI_MAX_PROTO,
						sizeof(char *), GFP_KERNEL);
	if (!ni->registered_protocols)
		goto err;

	mutex_init(&ni->pending_mtx);
	hash_init(ni->pending_events_handlers);

Loading