mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Frank Wunderlich <linux@fw-web.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Sean Wang <sean.wang@kernel.org>
Cc: Frank Wunderlich <frank-w@public-files.de>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, daniel@makrotopia.org,
	john@phrozen.org, ansuelsmth@gmail.com, eladwf@gmail.com
Subject: Re: [PATCH v4 4/4] arm64: dts: mediatek: mt7988: add pinctrl support
Date: Thu, 10 Oct 2024 14:36:03 +0200	[thread overview]
Message-ID: <4ac4c8ab-4180-4fcc-9e48-6dede7448dee@collabora.com> (raw)
In-Reply-To: <20241009165222.5670-5-linux@fw-web.de>

Il 09/10/24 18:52, Frank Wunderlich ha scritto:
> From: Frank Wunderlich <frank-w@public-files.de>
> 
> Add mt7988a pinctrl node.
> 
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> ---
> v2:
> - fix wrong alignment of reg values
> ---
>   arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 241 ++++++++++++++++++++++
>   1 file changed, 241 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt7988a.dtsi b/arch/arm64/boot/dts/mediatek/mt7988a.dtsi
> index c9649b815276..7e15934efe0b 100644
> --- a/arch/arm64/boot/dts/mediatek/mt7988a.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt7988a.dtsi
> @@ -3,6 +3,7 @@
>   #include <dt-bindings/clock/mediatek,mt7988-clk.h>
>   #include <dt-bindings/interrupt-controller/arm-gic.h>
>   #include <dt-bindings/phy/phy.h>
> +#include <dt-bindings/pinctrl/mt65xx.h>
>   
>   / {
>   	compatible = "mediatek,mt7988a";
> @@ -105,6 +106,246 @@ clock-controller@1001e000 {
>   			#clock-cells = <1>;
>   		};
>   
> +		pio: pinctrl@1001f000 {
> +			compatible = "mediatek,mt7988-pinctrl";
> +			reg = <0 0x1001f000 0 0x1000>,
> +			      <0 0x11c10000 0 0x1000>,
> +			      <0 0x11d00000 0 0x1000>,
> +			      <0 0x11d20000 0 0x1000>,
> +			      <0 0x11e00000 0 0x1000>,
> +			      <0 0x11f00000 0 0x1000>,
> +			      <0 0x1000b000 0 0x1000>;
> +			reg-names = "gpio", "iocfg_tr",
> +				    "iocfg_br", "iocfg_rb",
> +				    "iocfg_lb", "iocfg_tl", "eint";
> +			gpio-controller;
> +			#gpio-cells = <2>;
> +			gpio-ranges = <&pio 0 0 84>;
> +			interrupt-controller;
> +			interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
> +			interrupt-parent = <&gic>;
> +			#interrupt-cells = <2>;
> +
> +			mdio0_pins: mdio0-pins {
> +				mux {
> +					function = "eth";
> +					groups = "mdc_mdio0";
> +				};
> +
> +				conf {
> +					pins = "SMI_0_MDC", "SMI_0_MDIO";
> +					drive-strength = <MTK_DRIVE_8mA>;

Please do *not* use the MTK_DRIVE_(x)mA definitions anymore.

Here it is `drive-strength = <8>`.

> +				};
> +			};
> +
> +			i2c0_pins: i2c0-g0-pins {
> +				mux {
> +					function = "i2c";
> +					groups = "i2c0_1";
> +				};
> +			};
> +
> +			i2c1_pins: i2c1-g0-pins {
> +				mux {
> +					function = "i2c";
> +					groups = "i2c1_0";
> +				};
> +			};

Whatever pin can be configured with one or multiple groups that can be different
must *not* be in the SoC dtsi, but rather in the *board* dts(i) file, as the wanted
configuration of those pins is *not* soc-specific but board-specific.

 From a fast look, I can see that at least the I2C pins can be assigned to different
functions: for example, pins 15+16 can be either of i2c0_1, *or* u30_phy_i2c0, *or*
u32_phy_i2c0, *or* xfi_phy0_i2c1 ... or others, even.

Finally - I think that *most* of the muxing that you're declaring here must instead
go to your board specific devicetree and not in mt7988a.dtsi.

Cheers,
Angelo




  reply	other threads:[~2024-10-10 12:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09 16:52 [PATCH v4 0/4] Add pinctrl support for mt7988 Frank Wunderlich
2024-10-09 16:52 ` [PATCH v4 1/4] pinctrl: mediatek: add support for MTK_PULL_PD_TYPE Frank Wunderlich
2024-10-10  9:42   ` AngeloGioacchino Del Regno
2024-10-09 16:52 ` [PATCH v4 2/4] pinctrl: mediatek: add MT7988 pinctrl driver Frank Wunderlich
2024-10-10 12:28   ` AngeloGioacchino Del Regno
2024-10-18 15:22     ` Aw: " Frank Wunderlich
2024-10-09 16:52 ` [PATCH v4 3/4] dt-bindings: pinctrl: add binding for MT7988 SoC Frank Wunderlich
2024-10-09 21:19   ` Rob Herring (Arm)
2024-10-11 14:39     ` Aw: " Frank Wunderlich
2024-10-09 16:52 ` [PATCH v4 4/4] arm64: dts: mediatek: mt7988: add pinctrl support Frank Wunderlich
2024-10-10 12:36   ` AngeloGioacchino Del Regno [this message]
2024-10-11 12:53     ` Aw: " Frank Wunderlich
2024-10-14  8:15       ` AngeloGioacchino Del Regno

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=4ac4c8ab-4180-4fcc-9e48-6dede7448dee@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=ansuelsmth@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=devicetree@vger.kernel.org \
    --cc=eladwf@gmail.com \
    --cc=frank-w@public-files.de \
    --cc=john@phrozen.org \
    --cc=krzk+dt@kernel.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=linux-mediatek@lists.infradead.org \
    --cc=linux@fw-web.de \
    --cc=matthias.bgg@gmail.com \
    --cc=robh@kernel.org \
    --cc=sean.wang@kernel.org \
    /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

all inboxes | Powered by JetHome®