mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Selvamani Rajagopal <Selvamani.Rajagopal@onsemi.com>
Cc: Piergiorgio Beruto <Pier.Beruto@onsemi.com>,
	"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v3 12/14] onsemi: s2500: Add driver support for TS2500 MAC-PHY
Date: Sun, 31 May 2026 17:16:24 +0200	[thread overview]
Message-ID: <8331c347-4d40-43ac-aa73-a22398ac76a6@lunn.ch> (raw)
In-Reply-To: <CY8PR02MB92499D69207F6CFA01C196BB83162@CY8PR02MB9249.namprd02.prod.outlook.com>

> +config S2500_MACPHY
> +	tristate "S2500 support"
> +	depends on SPI
> +	select NCN26000_PHY
> +	select OA_TC6
> +	help
> +	  Support for the onsemi TS2500 MACPHY Ethernet chip.
> +          It works under the framework that conform to OPEN Alliance
> +          10BASE-T1x Serial Interface specification.

tab vs spaces.

> +#define DRV_VERSION			"1.0.3.1"

Not used, and probably meaningless.

> +/* Definitions for MMS defined in Table 6 Open Alliance TC6 standard
> + * that not present in oa_tc6.h
> + */
> +#define S2500_OA_TC6_MACPHY_MMS0	0
> +#define S2500_OA_TC6_MAC_MMS1		1
> +#define S2500_OA_TC6_VS1_MMS12		12

Maybe these should be added to oa_tc6.h, if they are part of the
standard.

> +#define S2500_MMS_MII			(S2500_OA_TC6_MACPHY_MMS0 << 16)
> +#define S2500_MMS_MAC			(S2500_OA_TC6_MAC_MMS1 << 16)
> +#define S2500_MMS_PCS			(OA_TC6_PHY_C45_PCS_MMS2 << 16)
> +#define S2500_MMS_PMDPMA		(OA_TC6_PHY_C45_PMA_PMD_MMS3 << 16)
> +#define S2500_MMS_VS1			(S2500_OA_TC6_VS1_MMS12 << 16)
> +#define S2500_MMS_VS2			(OA_TC6_PHY_C45_VS_PLCA_MMS4 << 16)

This kind of suggests we should rethink the API for reading/writing
registers. It should be possible to pass MMS and register as seperate
values, and let the core combine them.

> +struct s2500_info;
> +
> +struct s2500_info {

???

> +/* Initializes the net device MAC address by reading the UID stored

Should that be OUI, not UID?

> +	/* Convert the OID in host byte order */
> +	for (i = 2; i >= 0; --i) {
> +		addr[i] = 0;
> +		for (j = 0; j < 8; ++j) {
> +			addr[i] |= (val & 1) << (7 - j);
> +			val >>= 1;
> +		}
> +	}

That seems pretty complex. What exactly is it doing?

	Andrew

  reply	other threads:[~2026-05-31 15:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-29 18:41 Selvamani Rajagopal
2026-05-31 15:16 ` Andrew Lunn [this message]
2026-06-02  2:30   ` Selvamani Rajagopal
2026-06-02 13:02     ` Andrew Lunn
2026-05-31 15:17 ` Andrew Lunn
2026-05-31 15:20 ` 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=8331c347-4d40-43ac-aa73-a22398ac76a6@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Pier.Beruto@onsemi.com \
    --cc=Selvamani.Rajagopal@onsemi.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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®