[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZVIejw2O6on8QMYy@xhacker>
Date: Mon, 13 Nov 2023 21:03:11 +0800
From: Jisheng Zhang <jszhang@...nel.org>
To: Samuel Holland <samuel.holland@...ive.com>,
Tony Lindgren <tony@...mide.com>
Cc: devicetree@...r.kernel.org, Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Chao Wei <chao.wei@...hgo.com>,
Chen Wang <unicorn_wang@...look.com>
Subject: Re: [PATCH 1/2] riscv: dts: cv1800b: add pinctrl node for cv1800b
On Sun, Nov 12, 2023 at 08:51:20PM -0500, Samuel Holland wrote:
> On 2023-11-12 6:57 PM, Jisheng Zhang wrote:
> > Add the reset device tree node to cv1800b SoC reusing the
> ^^^^^
> I assume you mean pinctrl here?
oops copy and paste the commit msg ;) thanks
>
> > pinctrl-single driver.
> >
> > Signed-off-by: Jisheng Zhang <jszhang@...nel.org>
> > ---
> > arch/riscv/boot/dts/sophgo/cv-pinctrl.h | 19 +++++++++++++++++++
> > arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 10 ++++++++++
> > 2 files changed, 29 insertions(+)
> > create mode 100644 arch/riscv/boot/dts/sophgo/cv-pinctrl.h
> >
> > diff --git a/arch/riscv/boot/dts/sophgo/cv-pinctrl.h b/arch/riscv/boot/dts/sophgo/cv-pinctrl.h
> > new file mode 100644
> > index 000000000000..ed78b6fb3142
> > --- /dev/null
> > +++ b/arch/riscv/boot/dts/sophgo/cv-pinctrl.h
>
> A couple of questions: Should this go in include/dt-bindings? And is it worth
When I cooked this series two weeks ago, I did put it in dt-binding, but
then I found commit fe49f2d776f799 ("arm64: dts: ti: Use local header for
pinctrl register values"), "These definitions were previously put in the
bindings header to avoid code duplication and to provide some context
meaning (name), but they do not fit the purpose of bindings." which is
suggested and acked by Krzysztof, so I just want to follow the style
here.
> including macros for the actual function mappings, like in the vendor source[1]?
Do you want something as the following?
#define UART0_TX 0
#define CAM_MCLK1 1
...
#define REG_UART0_TX 0x24
...
pinctrl-single,pins = <REG_UART0_TX UART0_TX>;
Other pinctl-single users just uses the register value directly, I have
no preference. But I'd like to get suggestions from DT and pinctl-single
maintainers. Hi Rob, Krzysztof, Conor, Tony, what's your opinion?
>
> [1]:
> https://github.com/milkv-duo/duo-buildroot-sdk/blob/develop/linux_5.10/drivers/pinctrl/cvitek/cv180x_pinlist_swconfig.h
>
> > @@ -0,0 +1,19 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +/*
> > + * This header provides constants for pinctrl bindings for Sophgo CV* SoC.
> > + *
> > + * Copyright (C) 2023 Jisheng Zhang <jszhang@...nel.org>
> > + */
> > +#ifndef _DTS_RISCV_SOPHGO_CV_PINCTRL_H
> > +#define _DTS_RISCV_SOPHGO_CV_PINCTRL_H
> > +
> > +#define MUX_M0 0
> > +#define MUX_M1 1
> > +#define MUX_M2 2
> > +#define MUX_M3 3
> > +#define MUX_M4 4
> > +#define MUX_M5 5
> > +#define MUX_M6 6
> > +#define MUX_M7 7
> > +
> > +#endif
> > diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi
> > index e04df04a91c0..7a44d8e8672b 100644
> > --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi
> > +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi
> > @@ -6,6 +6,8 @@
> > #include <dt-bindings/interrupt-controller/irq.h>
> > #include <dt-bindings/reset/sophgo,cv1800b-reset.h>
> >
> > +#include "cv-pinctrl.h"
> > +
> > / {
> > compatible = "sophgo,cv1800b";
> > #address-cells = <1>;
> > @@ -55,6 +57,14 @@ soc {
> > dma-noncoherent;
> > ranges;
> >
> > + pinctrl0: pinctrl@...1000 {
> > + compatible = "pinctrl-single";
> > + reg = <0x3001000 0x130>;
> > + #pinctrl-cells = <1>;
> > + pinctrl-single,register-width = <32>;
> > + pinctrl-single,function-mask = <0x00000007>;
> > + };
>
> From the vendor driver[2], it looks like this peripheral block only handles
> pinmuxing, so indeed this looks like a good use of pinctrl-single.
This is deffinitely pinctrl-single style pinmux controller ;)
>
> [2]:
> https://github.com/milkv-duo/duo-buildroot-sdk/blob/develop/linux_5.10/drivers/pinctrl/cvitek/pinctrl-cv180x.h
>
> > +
> > rst: reset-controller@...3000 {
> > compatible = "sophgo,cv1800b-reset";
> > reg = <0x03003000 0x1000>;
>
Powered by blists - more mailing lists