linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC v1 0/2] Introducing generic SCMI pinctrl driver implementation
@ 2023-04-07 10:18 Oleksii Moisieiev
  2023-04-07 10:18 ` [RFC v1 1/2] scmi: Introduce pinctrl SCMI protocol driver Oleksii Moisieiev
                   ` (4 more replies)
  0 siblings, 5 replies; 27+ messages in thread
From: Oleksii Moisieiev @ 2023-04-07 10:18 UTC (permalink / raw)
  To: sudeep.holla@arm.com
  Cc: Oleksii Moisieiev, Linus Walleij, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org

This RFC patch series is intended to introduce the potential generic driver for
pin controls over SCMI protocol, provided in the latest beta version of DEN0056 [0].

On ARM-based systems, a separate Cortex-M based System Control Processor (SCP)
provides control on pins, as well as with power, clocks, reset controllers. In this case,
kernel should use one of the possible transports, described in [0] to access SCP and
control clocks/power-domains etc. This driver is using SMC transport to communicate with SCP via
SCMI protocol and access to the Pin Control Subsystem.

The provided driver consists of 2 parts:
 - firmware/arm_scmi/pinctrl.c - the SCMI pinctrl protocol inmplementation
   responsible for the communication with SCP firmware.

 - drivers/pinctrl/pinctrl-scmi.c - pinctrl driver, which is using pinctrl
  protocol implementation to access all necessary data.

Configuration:
The scmi-pinctrl driver can be configured using DT bindings.
For example:
/ {
	cpu_scp_shm: scp-shmem@0x53FF0000 {
		compatible = "arm,scmi-shmem";
		reg = <0x0 0x53FF0000 0x0 0x1000>;
	};

	firmware {
		scmi {
			compatible = "arm,scmi-smc";
			arm,smc-id = <0x82000002>;
			shmem = <&cpu_scp_shm>;
			#address-cells = <1>;
			#size-cells = <0>;

			scmi_pinctrl: protocol@19 {
				reg = <0x18>;
				#pinctrl-cells = <0>;

				i2c2_pins: i2c2 {
					groups = "i2c2_a";
					function = "i2c2";
				};
			};
		};
	};
};

&pfc {
	/delete-node/i2c2;
};

So basically, it's enough to move pfc subnode, which configures pin group that should work through
SCMI protocol to scmi_pinctrl node. The current driver implementation is using generic pinctrl dt_node
format.

I've tested this driver on the Renesas H3ULCB Kingfisher board with pinctrl driver ported to the
Arm-trusted-firmware. Unfortunately, not all hardware was possible to test because the Renesas
pinctrl driver has gaps in pins and groups numeration, when Spec [0] requires pins, groups and
functions numerations to be 0..n without gaps.

This implementation still reqires some features, such as gpio support, but I've posted it as RFC to
start the discussion regarding the driver format.

[0] https://developer.arm.com/documentation/den0056/latest

Oleksii Moisieiev (2):
  scmi: Introduce pinctrl SCMI protocol driver
  pinctrl: Implementation of the generic scmi-pinctrl driver

 MAINTAINERS                         |   7 +
 drivers/firmware/arm_scmi/Makefile  |   2 +-
 drivers/firmware/arm_scmi/common.h  |   1 +
 drivers/firmware/arm_scmi/driver.c  |   3 +
 drivers/firmware/arm_scmi/pinctrl.c | 905 ++++++++++++++++++++++++++++
 drivers/pinctrl/Kconfig             |   9 +
 drivers/pinctrl/Makefile            |   1 +
 drivers/pinctrl/pinctrl-scmi.c      | 555 +++++++++++++++++
 include/linux/scmi_protocol.h       |  58 +-
 9 files changed, 1539 insertions(+), 2 deletions(-)
 create mode 100644 drivers/firmware/arm_scmi/pinctrl.c
 create mode 100644 drivers/pinctrl/pinctrl-scmi.c

-- 
2.25.1

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2023-04-26 13:29 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-07 10:18 [RFC v1 0/2] Introducing generic SCMI pinctrl driver implementation Oleksii Moisieiev
2023-04-07 10:18 ` [RFC v1 1/2] scmi: Introduce pinctrl SCMI protocol driver Oleksii Moisieiev
2023-04-12 22:04   ` Cristian Marussi
2023-04-17  2:55     ` Peng Fan
2023-04-21  8:40       ` Oleksii Moisieiev
2023-04-21  9:28         ` Linus Walleij
2023-04-21  9:47           ` Cristian Marussi
2023-04-21  9:53             ` Oleksii Moisieiev
2023-04-21  9:30         ` Cristian Marussi
2023-04-21  9:48           ` Oleksii Moisieiev
2023-04-21  9:54             ` Cristian Marussi
2023-04-24  2:12             ` Peng Fan
2023-04-24  1:52         ` Peng Fan
2023-04-24 10:33           ` Oleksii Moisieiev
2023-04-25  2:13             ` Peng Fan
2023-04-25  7:22               ` Oleksii Moisieiev
2023-04-20 17:05     ` Cristian Marussi
2023-04-20 17:23       ` Oleksii Moisieiev
2023-04-20 18:47         ` Cristian Marussi
2023-04-21  7:54           ` Oleksii Moisieiev
     [not found]     ` <71f48fcf-db04-b09f-2ab2-95e6562c8359@epam.com>
2023-04-26 11:19       ` Cristian Marussi
2023-04-26 13:28         ` Oleksii Moisieiev
2023-04-07 10:18 ` [RFC v1 2/2] pinctrl: Implementation of the generic scmi-pinctrl driver Oleksii Moisieiev
2023-04-11 12:27 ` [RFC v1 0/2] Introducing generic SCMI pinctrl driver implementation Linus Walleij
2023-04-11 13:25   ` Sudeep Holla
2023-04-12 18:44 ` Cristian Marussi
2023-04-26 12:06 ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).