Netdev List
 help / color / mirror / Atom feed
From: "Alvin Šipraga" <alvin.sipraga@analog.com>
To: Iustin Stolniceanu <iustin.stolniceanu@analog.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	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>,
	Parthiban Veerasooran <parthiban.veerasooran@microchip.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Marcelo Schmitt <marcelo.schmitt@analog.com>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Ciprian Regus <ciprian.regus@analog.com>
Subject: Re: [PATCH net-next 2/5] net: ethernet: oa_tc6: Add support for MDIO indirect access
Date: Wed, 4 Nov 2026 15:08:21 +0100	[thread overview]
Message-ID: <aus8GQ-Xut5XBNwU@analog.com> (raw)
In-Reply-To: <20261103160918.409701-3-iustin.stolniceanu@analog.com>

On Tue, Nov 03, 2026 at 06:09:15PM +0200, Iustin Stolniceanu wrote:
> From: Ciprian Regus <ciprian.regus@analog.com>
> 
> The OPEN Alliance TC6 specification defines two ways for the SPI host
> to access the registers of the PHY integrated in a MAC-PHY: direct
> access, where the PHY registers are mapped into the MAC-PHY register
> space, and indirect access, through the MDIOACC registers. A MAC-PHY
> reports support for direct access through the DPRAC bit in the STDCAP
> register.
> 
> The framework currently supports only direct access and fails to
> register the MDIO bus when DPRAC is not set.
> 
> Read STDCAP when registering the MDIO bus and, if direct access is not
> supported, implement the Clause 22 and Clause 45 MDIO operations as
> indirect transactions through MDIOACC: for Clause 45, write the
> address command to MDIOACC0 and the read or write command to
> MDIOACC1; for Clause 22, write the command to MDIOACC1. Then poll
> for TRDONE.
> 
> If TAERR (turnaround error) is set, no PHY answered at that address
> and the DATA field must be ignored. Return 0xffff in that case, as
> for an empty address on an MDIO bus, so that the PHY bus scan skips
> the address instead of failing. Return -EIO for a write.
> 
> Signed-off-by: Ciprian Regus <ciprian.regus@analog.com>
> Signed-off-by: Iustin Stolniceanu <iustin.stolniceanu@analog.com>

Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com>

Just a small comment below.

> ---
>  drivers/net/ethernet/oa_tc6.c | 171 +++++++++++++++++++++++++++++++---
>  include/linux/oa_tc6.h        |  15 +++
>  2 files changed, 171 insertions(+), 15 deletions(-)
> 
[...]

> @@ -534,8 +674,16 @@ EXPORT_SYMBOL_GPL(oa_tc6_mdiobus_write_c45);
>  
>  static int oa_tc6_mdiobus_register(struct oa_tc6 *tc6)
>  {
> +	u32 regval;
>  	int ret;
>  
> +	ret = oa_tc6_read_register(tc6, OA_TC6_REG_STDCAP, &regval);
> +	if (ret)
> +		return ret;
> +
> +	tc6->mdio_indirect_mode = !(OA_TC6_STDCAP_DIRECT_PHY_REG_ACCESS &
> +				    regval);

Maybe just if (xxx) tc6->mdio_indirect_mode = true?

Kind regards,
Alvin

  reply	other threads:[~2026-11-04 14:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 16:09 [PATCH net-next 0/5] net: ethernet: adi: adin1110: Add OPEN Alliance TC6 support Iustin Stolniceanu
2026-11-03 16:09 ` [PATCH net-next 1/5] net: ethernet: oa_tc6: Allow custom reset settle time values Iustin Stolniceanu
2026-11-04 14:10   ` Alvin Šipraga
2026-11-03 16:09 ` [PATCH net-next 2/5] net: ethernet: oa_tc6: Add support for MDIO indirect access Iustin Stolniceanu
2026-11-04 14:08   ` Alvin Šipraga [this message]
2026-11-03 16:09 ` [PATCH net-next 3/5] dt-bindings: net: adi,adin1110: Add adi,spi-oa-tc6 Iustin Stolniceanu
2026-11-04 14:12   ` Alvin Šipraga
2026-11-03 16:09 ` [PATCH net-next 4/5] net: ethernet: adi: adin1110: Add OA TC6 protocol support for ADIN1110 Iustin Stolniceanu
2026-11-04 14:26   ` Alvin Šipraga
2026-11-03 16:09 ` [PATCH net-next 5/5] net: phy: adin1100: Skip the soft reset on ADIN1110/ADIN2111 Iustin Stolniceanu
2026-11-04 14:29   ` Alvin Šipraga
2026-11-03 20:49 ` [PATCH net-next 0/5] net: ethernet: adi: adin1110: Add OPEN Alliance TC6 support Andrew Lunn
2026-11-04  8:06   ` Stolniceanu, Iustin
2026-11-04 14:59     ` Andrew Lunn
2026-11-04 15:14       ` Stolniceanu, Iustin
2026-11-03 20:54 ` Andrew Lunn

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=aus8GQ-Xut5XBNwU@analog.com \
    --to=alvin.sipraga@analog.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ciprian.regus@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=iustin.stolniceanu@analog.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=marcelo.schmitt@analog.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=parthiban.veerasooran@microchip.com \
    --cc=robh@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