Devicetree
 help / color / mirror / Atom feed
From: "Junhui Liu" <junhui.liu@pigmoral.tech>
To: "Conor Dooley" <conor@kernel.org>,
	"Junhui Liu" <junhui.liu@pigmoral.tech>
Cc: "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Paul Walmsley" <pjw@kernel.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Alexandre Ghiti" <alex@ghiti.fr>, "Yixun Lan" <dlan@kernel.org>,
	"Vivian Wang" <wangruikang@iscas.ac.cn>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Guodong Xu" <guodong@riscstar.com>,
	"Yangyu Chen" <cyy@cyyself.name>, <devicetree@vger.kernel.org>,
	<linux-riscv@lists.infradead.org>, <spacemit@lists.linux.dev>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] riscv: dts: spacemit: k1: Split gmac_clk_ref into independent pinctrl groups
Date: Fri, 29 May 2026 10:38:38 +0800	[thread overview]
Message-ID: <DIUT907819JD.MG7B60VQLZ8L@pigmoral.tech> (raw)
In-Reply-To: <20260528-mushily-suffrage-5162d4ffdaf2@spud>

Hi Conor,

On Fri May 29, 2026 at 1:13 AM CST, Conor Dooley wrote:
> On Thu, May 28, 2026 at 01:22:48PM +0800, Junhui Liu wrote:
>> The gmac_clk_ref signal is optional for the GMAC controller and is not
>> strictly required for all hardware designs. The pins for gmac0_clk_ref
>> (GPIO 45) and gmac1_clk_ref (GPIO 46) may also be used as GPIOs for
>> other functions even when the Ethernet controller is active.
>> 
>> Split the refclk pins into independent pinctrl groups so boards can
>> request them only when the reference clock path is actually needed.
>> 
>> Among the already mainlined boards, BPI-F3, Jupiter and MusePi Pro have
>> optional hardware paths for the GMAC refclk pins. BPI-F3 and Jupiter
>> route both GMAC refclk pins to the PHYs through NC/0R option resistors,
>> while MusePi Pro only does so for GMAC0. Keep referencing the new
>> clk-ref pinctrl groups on these boards so the optional hardware paths
>> remain usable if the option resistors are populated.
>> 
>> OrangePi R2S has no publicly available schematic, so also keep the
>> clk-ref groups there to preserve the previous pinmux behavior.
>> 
>> Fixes: 60775f28cfb7 ("riscv: dts: spacemit: Add Ethernet support for K1")
>> Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
>
>> diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
>> index 4e9a62d0e85b..8c57ca05dabd 100644
>> --- a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
>> +++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
>> @@ -27,8 +27,16 @@ gmac0-pins {
>>  				 <K1_PADCONF(11, 1)>,	/* gmac0_tx_en */
>>  				 <K1_PADCONF(12, 1)>,	/* gmac0_mdc */
>>  				 <K1_PADCONF(13, 1)>,	/* gmac0_mdio */
>> -				 <K1_PADCONF(14, 1)>,	/* gmac0_int_n */
>> -				 <K1_PADCONF(45, 1)>;	/* gmac0_clk_ref */
>
> The point sashiko made here seems valid, odd that these aren't added to
> another group.

Do you mean Sashiko's point about not adding these groups to the
OrangePi RV2 board? That is because GPIO45 and GPIO46 are used as
TP_RST_1V8 and TP_INT_1V8 respectively on the OrangePi RV2. These are
the reset and interrupt signals for the touch panel, and are not
connected to the optional GMAC PHY refclk path. So with this patch,
GPIO45/46 can be properly used by the touch panel without pinmux
conflicts once display/tp support is added in the future.

I have added the new gmac_clk_ref groups to all boards where I found
these signals may actually be used.

Best regards,
Junhui Liu

>
>> +				 <K1_PADCONF(14, 1)>;	/* gmac0_int_n */
>> +
>> +			bias-pull-up = <0>;
>> +			drive-strength = <21>;
>> +		};
>> +	};
>> +
>> +	gmac0_clk_ref_cfg: gmac0-clk-ref-cfg {
>> +		gmac0-clk-ref-pins {
>> +			pinmux = <K1_PADCONF(45, 1)>;	/* gmac0_clk_ref */
>>  
>>  			bias-pull-up = <0>;
>>  			drive-strength = <21>;
>> @@ -51,8 +59,16 @@ gmac1-pins {
>>  				 <K1_PADCONF(40, 1)>,	/* gmac1_tx_en */
>>  				 <K1_PADCONF(41, 1)>,	/* gmac1_mdc */
>>  				 <K1_PADCONF(42, 1)>,	/* gmac1_mdio */
>> -				 <K1_PADCONF(43, 1)>,	/* gmac1_int_n */
>> -				 <K1_PADCONF(46, 1)>;	/* gmac1_clk_ref */
>> +				 <K1_PADCONF(43, 1)>;	/* gmac1_int_n */
>> +
>> +			bias-pull-up = <0>;
>> +			drive-strength = <21>;
>> +		};
>> +	};
>> +
>> +	gmac1_clk_ref_cfg: gmac1-clk-ref-cfg {
>> +		gmac1-clk-ref-pins {
>> +			pinmux = <K1_PADCONF(46, 1)>;	/* gmac1_clk_ref */
>>  
>>  			bias-pull-up = <0>;
>>  			drive-strength = <21>;
>> 
>> -- 
>> 2.54.0
>> 


  reply	other threads:[~2026-05-29  2:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28  5:22 [PATCH v2 0/3] spacemit: k1: Add support for Banana Pi BPI-CM6 IO board Junhui Liu
2026-05-28  5:22 ` [PATCH v2 1/3] dt-bindings: riscv: spacemit: Add Banana Pi BPI-CM6 compatible Junhui Liu
2026-05-28  5:22 ` [PATCH v2 2/3] riscv: dts: spacemit: k1: Split gmac_clk_ref into independent pinctrl groups Junhui Liu
2026-05-28  5:45   ` sashiko-bot
2026-05-28 17:13   ` Conor Dooley
2026-05-29  2:38     ` Junhui Liu [this message]
2026-05-29 16:06       ` Conor Dooley
2026-05-28  5:22 ` [PATCH v2 3/3] riscv: dts: spacemit: k1: Add Banana Pi BPI-CM6 IO board Junhui Liu
2026-05-28  6:19   ` sashiko-bot

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=DIUT907819JD.MG7B60VQLZ8L@pigmoral.tech \
    --to=junhui.liu@pigmoral.tech \
    --cc=alex@ghiti.fr \
    --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@kernel.org \
    --cc=guodong@riscstar.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=pabeni@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=robh@kernel.org \
    --cc=spacemit@lists.linux.dev \
    --cc=wangruikang@iscas.ac.cn \
    /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