mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Jisheng Zhang <jszhang@kernel.org>
Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 4/8] net: stmmac: Add glue layer for Synaptics SL2610 SoC
Date: Mon, 23 Nov 2026 16:08:23 +0100	[thread overview]
Message-ID: <c86cfa4a-5738-4b8d-bed5-4dd075f7cbf8@lunn.ch> (raw)
In-Reply-To: <awQ5raWYlMBpCqIl@xhacker>

> > > +#define CTL_PHY_INTF_SEL	GENMASK(4, 1)
> > > +#define CTL_PHY_INTF_RGMII	FIELD_PREP(CTL_PHY_INTF_SEL, 1)
> > > +#define CTL_PHY_INTF_RMII	FIELD_PREP(CTL_PHY_INTF_SEL, 4)
> > 
> > Please use PHY_INTF_SEL_RGMII and PHY_INTF_SEL_RMII from "common.h"
> 
> I read this as "use SYNA_PHY_INTF_SEL_RGMII and SYNA_PHY_INTF_SEL_RMII",
> correct me if there's misunderstanding.

https://elixir.bootlin.com/linux/v7.3.1/source/drivers/net/ethernet/stmicro/stmmac/common.h#L316

#define PHY_INTF_SEL_RGMII	1
#define PHY_INTF_SEL_SGMII	2
#define PHY_INTF_SEL_TBI	3
#define PHY_INTF_SEL_RMII	4

Which is easier to understand?

#define CTL_PHY_INTF_RGMII	FIELD_PREP(CTL_PHY_INTF_SEL, 1)
or
#define CTL_PHY_INTF_RGMII	FIELD_PREP(CTL_PHY_INTF_SEL, PHY_INTF_SEL_RGMII)

You should try to avoid magic numbers.

	Andrew

  reply	other threads:[~2026-11-23 15:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 13:54 [PATCH 0/8] net: stmmac: add SL2610 ethernet support Jisheng Zhang
2026-11-16 13:54 ` [PATCH 1/8] dt-bindings: net: Add MDIO demultiplexer Jisheng Zhang
2026-11-16 15:06   ` Andrew Lunn
2026-11-17  5:06     ` Jisheng Zhang
2026-11-17 13:24       ` Andrew Lunn
2026-11-17 14:13         ` Jisheng Zhang
2026-11-17 14:59           ` Andrew Lunn
2026-11-17 15:55             ` Jisheng Zhang
2026-11-17 16:20               ` Andrew Lunn
2026-11-17 16:18                 ` Jisheng Zhang
2026-11-17 17:02                   ` Andrew Lunn
2026-11-16 13:54 ` [PATCH 2/8] net: mdio: Add MDIO demultiplexer driver Jisheng Zhang
2026-11-16 13:54 ` [PATCH 3/8] dt-bindings: net: Add Synaptics SL2610 DWMAC Jisheng Zhang
2026-11-23 11:22   ` Krzysztof Kozlowski
2026-11-16 13:54 ` [PATCH 4/8] net: stmmac: Add glue layer for Synaptics SL2610 SoC Jisheng Zhang
2026-11-23 11:57   ` Maxime Chevallier
2026-11-23 13:03     ` Jisheng Zhang
2026-11-23 15:08       ` Andrew Lunn [this message]
2026-11-16 13:54 ` [PATCH 5/8] dt-bindings: soc: synaptics: Allow SL2610 mux controller children Jisheng Zhang
2026-11-23 11:20   ` Krzysztof Kozlowski
2026-11-16 13:54 ` [PATCH 6/8] soc: synaptics: Populate SL2610 system controller DT children Jisheng Zhang
2026-11-16 13:54 ` [PATCH 7/8] arm64: dts: synaptics: Add SL2610 Ethernet nodes Jisheng Zhang
2026-11-16 13:54 ` [PATCH 8/8] arm64: dts: synaptics: Enable Ethernet on SL2619 RDK Jisheng Zhang

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=c86cfa4a-5738-4b8d-bed5-4dd075f7cbf8@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=alexandre.torgue@foss.st.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=jszhang@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=sebastian.hesselbarth@gmail.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

all inboxes | Powered by JetHome®