devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivian Wang <wangruikang@iscas.ac.cn>
To: Troy Mitchell <troy.mitchell@linux.spacemit.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Jakub Kicinski <kuba@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Yixun Lan <dlan@gentoo.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>
Cc: Vivian Wang <uwu@dram.page>,
	Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	Junhui Liu <junhui.liu@pigmoral.tech>,
	Simon Horman <horms@kernel.org>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-riscv@lists.infradead.org, spacemit@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v8 2/5] net: spacemit: Add K1 Ethernet MAC
Date: Mon, 1 Sep 2025 08:15:41 +0800	[thread overview]
Message-ID: <ce7508df-f154-4fd7-a621-abe371c1cb4a@iscas.ac.cn> (raw)
In-Reply-To: <58E42B0649434EDA+aLEHlp1jfLVxVZWR@LT-Guozexi>


On 8/29/25 09:51, Troy Mitchell wrote:
> On Thu, Aug 28, 2025 at 04:47:50PM +0800, Vivian Wang wrote:
>> The Ethernet MACs found on SpacemiT K1 appears to be a custom design
>> that only superficially resembles some other embedded MACs. SpacemiT
>> refers to them as "EMAC", so let's just call the driver "k1_emac".
>>
>> Supports RGMII and RMII interfaces. Includes support for MAC hardware
>> statistics counters. PTP support is not implemented.
>>
>> Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
>> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
>> Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
>> Tested-by: Junhui Liu <junhui.liu@pigmoral.tech>
>> Tested-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
>> ---
> [...]
>> diff --git a/drivers/net/ethernet/spacemit/k1_emac.c b/drivers/net/ethernet/spacemit/k1_emac.c
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..49afe9312a742c27dd35a015d75a1de7ec5c7d15
>> --- /dev/null
> [...]
>> +
>> +static int emac_phy_interface_config(struct emac_priv *priv)
>> +{
>> +	u32 val = 0, mask = PHY_INTF_RGMII;
>> +
>> +	switch (priv->phy_interface) {
>> +	case PHY_INTERFACE_MODE_RMII:
>> +		mask |= REF_CLK_SEL;
> How about we move `val = 0` to here? 
> This makes it clearer that val should be 0 when PHY_INTERFACE_MODE_RMII,
> instead of being hidden in the initialization.

I'll probably just use phy_interface_mode_is_rgmii or something for val.

I will clean this up, but I'll wait for a few more changes to batch up
before sending the next version.

> Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>

Thank you!

Vivian "dramforever" Wang


  reply	other threads:[~2025-09-01  0:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-28  8:47 [PATCH net-next v8 0/5] Add Ethernet MAC support for SpacemiT K1 Vivian Wang
2025-08-28  8:47 ` [PATCH net-next v8 1/5] dt-bindings: net: Add " Vivian Wang
2025-08-28  8:47 ` [PATCH net-next v8 2/5] net: spacemit: Add K1 Ethernet MAC Vivian Wang
2025-08-29  1:51   ` Troy Mitchell
2025-09-01  0:15     ` Vivian Wang [this message]
2025-08-28  8:47 ` [PATCH net-next v8 3/5] riscv: dts: spacemit: Add Ethernet support for K1 Vivian Wang
2025-08-28  8:47 ` [PATCH net-next v8 4/5] riscv: dts: spacemit: Add Ethernet support for BPI-F3 Vivian Wang
2025-08-28  8:47 ` [PATCH net-next v8 5/5] riscv: dts: spacemit: Add Ethernet support for Jupiter Vivian Wang

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=ce7508df-f154-4fd7-a621-abe371c1cb4a@iscas.ac.cn \
    --to=wangruikang@iscas.ac.cn \
    --cc=alex@ghiti.fr \
    --cc=andrew+netdev@lunn.ch \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dlan@gentoo.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=junhui.liu@pigmoral.tech \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh@kernel.org \
    --cc=spacemit@lists.linux.dev \
    --cc=troy.mitchell@linux.spacemit.com \
    --cc=uwu@dram.page \
    --cc=vadim.fedorenko@linux.dev \
    /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).