From: Krzysztof Kozlowski <krzk@kernel.org>
To: Yixun Lan <dlan@gentoo.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Conor Dooley <conor@kernel.org>
Cc: Yangyu Chen <cyy@cyyself.name>, Jesse Taube <jesse@rivosinc.com>,
Jisheng Zhang <jszhang@kernel.org>,
Inochi Amaoto <inochiama@outlook.com>,
Icenowy Zheng <uwu@icenowy.me>,
Meng Zhang <zhangmeng.kevin@spacemit.com>,
Meng Zhang <kevin.z.m@hotmail.com>,
devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] riscv: dts: spacemit: add pinctrl support for K1 SoC
Date: Tue, 23 Jul 2024 16:24:58 +0200 [thread overview]
Message-ID: <b7a01cba-9f68-4a6f-9795-b9103ee81d8b@kernel.org> (raw)
In-Reply-To: <20240719-02-k1-pinctrl-v1-1-239ac5b77dd6@gentoo.org>
On 19/07/2024 14:21, Yixun Lan wrote:
> SpacemiT's K1 SoC has a pinctrl controller which can be
> modeled using the pinctrl-single driver.
>
> Signed-off-by: Yixun Lan <dlan@gentoo.org>
> ---
> arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 1746 ++++++++++++++++++++++++++
> arch/riscv/boot/dts/spacemit/k1-pinctrl.h | 220 ++++
> arch/riscv/boot/dts/spacemit/k1.dtsi | 14 +
> 3 files changed, 1980 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> new file mode 100644
> index 0000000000000..ad6f171d3ec1f
> --- /dev/null
> +++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> @@ -0,0 +1,1746 @@
> +// SPDX-License-Identifier: GPL-2.0 OR MIT
> +/*
> + * Copyright (c) 2022 SpacemiT (Hangzhou) Technology Co. Ltd
> + * Copyright (c) 2024 Yixun Lan <dlan@gentoo.org>
> + */
> +
> +#include "k1-pinctrl.h"
> +
> +&pinctrl {
> + camera0_pin: camera0-pin {
> + pinctrl-single,pins = <
> + K1_PADCONF0(53, 1) /* cam_mclk0 */
> + >;
> + pinctrl-single,bias-pullup = PINCTRL_PULLUP(0);
> + pinctrl-single,bias-pulldown = PINCTRL_PULLDN(1);
> + pinctrl-single,drive-strength = PINCTRL_1V8_DS(2);
> + };
> +
> + camera1_pin: camera1-pin {
> + pinctrl-single,pins = <
> + K1_PADCONF0(58, 1) /* cam_mclk1 */
> + >;
> + pinctrl-single,bias-pullup = PINCTRL_PULLUP(0);
> + pinctrl-single,bias-pulldown = PINCTRL_PULLDN(1);
> + pinctrl-single,drive-strength = PINCTRL_1V8_DS(2);
> + };
...
> +
> +#endif /* __DT_BINDINGS_K1_PINCTRL_H */
> diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
> index 0777bf9e01183..2f0c56b06d413 100644
> --- a/arch/riscv/boot/dts/spacemit/k1.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
> @@ -416,6 +416,20 @@ uart9: serial@d4017800 {
> status = "disabled";
> };
>
> + pinctrl: pinctrl@d401e000 {
> + compatible = "pinconf-single";
Please don't. This results in huge code in DTS mapping hardware
registers, basically what once SoC platform did some time ago for clocks
(one clock per node). That is not maintainable, not readable and does
not reduce amount of work. Quite contrary - due to nature of DTS
language, you have huge duplication of code.
Define proper pin controller driver.
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-07-23 14:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-19 12:21 [PATCH 0/2] riscv: spacemit: add pinctrl support to K1 SoC Yixun Lan
2024-07-19 12:21 ` [PATCH 1/2] riscv: dts: spacemit: add pinctrl support for " Yixun Lan
2024-07-20 0:30 ` Inochi Amaoto
2024-07-21 12:22 ` Yixun Lan
2024-07-22 0:37 ` Inochi Amaoto
2024-07-23 14:24 ` Krzysztof Kozlowski [this message]
2024-07-19 12:21 ` [PATCH 2/2] riscv: dts: spacemit: add pinctrl property to uart0 in BPI-F3 Yixun Lan
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=b7a01cba-9f68-4a6f-9795-b9103ee81d8b@kernel.org \
--to=krzk@kernel.org \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=conor@kernel.org \
--cc=cyy@cyyself.name \
--cc=devicetree@vger.kernel.org \
--cc=dlan@gentoo.org \
--cc=inochiama@outlook.com \
--cc=jesse@rivosinc.com \
--cc=jszhang@kernel.org \
--cc=kevin.z.m@hotmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh@kernel.org \
--cc=uwu@icenowy.me \
--cc=zhangmeng.kevin@spacemit.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).