From: Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>
To: "sudeep.holla@arm.com" <sudeep.holla@arm.com>
Cc: Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>,
Cristian Marussi <cristian.marussi@arm.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: [PATCH v3 0/4] firmware: arm_scmi: Add SCMI v3.2 pincontrol protocol basic support
Date: Tue, 6 Jun 2023 16:22:26 +0000 [thread overview]
Message-ID: <cover.1686063941.git.oleksii_moisieiev@epam.com> (raw)
This 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.
Also, sharing link to the ATF pinctrl driver I used for testing:
https://github.com/oleksiimoisieiev/arm-trusted-firmware/tree/pinctrl_rcar_m3_up
[0] https://developer.arm.com/documentation/den0056/latest
---
Changes v2 -> v3:
- update get_name calls as suggested by Cristian Marussi
- fixing comments
- refactoring of the dt_bindings according to the comments
Changes v1 -> v2:
- rebase patches to the latest kernel version
- use protocol helpers in the pinctrl scmi protocol driver implementation
- reworked pinctrl_ops. Removed similar calls to simplify the interface
- implementation of the .instance_deinit callback to properly clean resources
- add description of the pinctrl protocol to the device-tree schema
---
Oleksii Moisieiev (4):
firmware: arm_scmi: Add optional flags to extended names helper
firmware: arm_scmi: Add SCMI v3.2 pincontrol protocol basic support
pinctrl: Implementation of the generic scmi-pinctrl driver
dt-bindings: firmware: arm,scmi: Add support for pinctrl protocol
.../bindings/firmware/arm,scmi.yaml | 53 ++
MAINTAINERS | 7 +
drivers/firmware/arm_scmi/Makefile | 2 +-
drivers/firmware/arm_scmi/clock.c | 2 +-
drivers/firmware/arm_scmi/driver.c | 10 +-
drivers/firmware/arm_scmi/perf.c | 3 +-
drivers/firmware/arm_scmi/pinctrl.c | 836 ++++++++++++++++++
drivers/firmware/arm_scmi/power.c | 2 +-
drivers/firmware/arm_scmi/powercap.c | 2 +-
drivers/firmware/arm_scmi/protocols.h | 4 +-
drivers/firmware/arm_scmi/reset.c | 3 +-
drivers/firmware/arm_scmi/sensors.c | 2 +-
drivers/firmware/arm_scmi/voltage.c | 2 +-
drivers/pinctrl/Kconfig | 11 +
drivers/pinctrl/Makefile | 1 +
drivers/pinctrl/pinctrl-scmi.c | 554 ++++++++++++
include/linux/scmi_protocol.h | 47 +
17 files changed, 1530 insertions(+), 11 deletions(-)
create mode 100644 drivers/firmware/arm_scmi/pinctrl.c
create mode 100644 drivers/pinctrl/pinctrl-scmi.c
--
2.25.1
next reply other threads:[~2023-06-06 16:22 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 16:22 Oleksii Moisieiev [this message]
2023-06-06 16:22 ` [PATCH v3 1/4] firmware: arm_scmi: Add optional flags to extended names helper Oleksii Moisieiev
2023-06-07 6:33 ` andy.shevchenko
2023-06-30 11:33 ` Cristian Marussi
2023-06-06 16:22 ` [PATCH v3 2/4] firmware: arm_scmi: Add SCMI v3.2 pincontrol protocol basic support Oleksii Moisieiev
2023-06-07 7:10 ` andy.shevchenko
2023-06-30 16:02 ` Cristian Marussi
2023-07-03 21:27 ` andy.shevchenko
2023-07-06 10:55 ` Cristian Marussi
2023-07-06 14:49 ` Oleksii Moisieiev
2023-07-03 10:16 ` Cristian Marussi
2023-07-06 14:09 ` Oleksii Moisieiev
2023-07-06 14:42 ` Cristian Marussi
2023-07-06 15:06 ` Oleksii Moisieiev
2023-06-06 16:22 ` [PATCH v3 3/4] pinctrl: Implementation of the generic scmi-pinctrl driver Oleksii Moisieiev
2023-06-07 7:26 ` andy.shevchenko
2023-07-20 13:40 ` Oleksii Moisieiev
2023-07-20 16:11 ` Andy Shevchenko
2023-07-20 18:03 ` Oleksii Moisieiev
2023-07-03 10:49 ` Cristian Marussi
2023-06-06 16:22 ` [PATCH v3 4/4] dt-bindings: firmware: arm,scmi: Add support for pinctrl protocol Oleksii Moisieiev
2023-06-09 7:35 ` Linus Walleij
2023-06-14 22:36 ` Rob Herring
2023-06-30 10:38 ` [PATCH v3 0/4] firmware: arm_scmi: Add SCMI v3.2 pincontrol protocol basic support Cristian Marussi
2023-07-03 12:58 ` Oleksii Moisieiev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1686063941.git.oleksii_moisieiev@epam.com \
--to=oleksii_moisieiev@epam.com \
--cc=conor+dt@kernel.org \
--cc=cristian.marussi@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=sudeep.holla@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).