devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Tristram.Ha@microchip.com
Cc: Woojung Huh <woojung.huh@microchip.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Simon Horman <horms@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Marek Vasut <marex@denx.de>,
	UNGLinuxDriver@microchip.com, devicetree@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v6 2/6] net: dsa: microchip: Add KSZ8463 switch support to KSZ DSA driver
Date: Fri, 25 Jul 2025 14:27:39 +0200	[thread overview]
Message-ID: <6fc3ef55-68f7-4b1a-aa8f-70dc8ffdba3e@lunn.ch> (raw)
In-Reply-To: <20250725001753.6330-3-Tristram.Ha@microchip.com>

> On Thu, Jul 24, 2025 at 05:17:49PM -0700, Tristram.Ha@microchip.com wrote:
> From: Tristram Ha <tristram.ha@microchip.com>
> 
> KSZ8463 switch is a 3-port switch based from KSZ8863.  Its major
> difference from other KSZ SPI switches is its register access is not a
> simple continual 8-bit transfer with automatic address increase but uses
> a byte-enable mechanism specifying 8-bit, 16-bit, or 32-bit access.  Its
> registers are also defined in 16-bit format because it shares a design
> with a MAC controller using 16-bit access.  As a result some common
> register accesses need to be re-arranged.
> 
> This patch adds the basic structure for using KSZ8463.  It cannot use the
> same regmap table for other KSZ switches as it interprets the 16-bit
> value as little-endian and its SPI commands are different.
> 
> KSZ8463 uses a byte-enable mechanism to specify 8-bit, 16-bit, and 32-bit
> access.  The register is first shifted right by 2 then left by 4.  Extra
> 4 bits are added.  If the access is 8-bit one of the 4 bits is set.  If
> the access is 16-bit two of the 4 bits are set.  If the access is 32-bit
> all 4 bits are set.  The SPI command for read or write is then added.
> 
> Because of this register transformation separate SPI read and write
> functions are provided for KSZ8463.
> 
> KSZ8463's internal PHYs use standard PHY register definitions so there is
> no need to remap things.  However, the hardware has a bug that the high
> word and low word of the PHY id are swapped.  In addition the port
> registers are arranged differently so KSZ8463 has its own mapping for
> port registers and PHY registers.  Therefore the PORT_CTRL_ADDR macro is
> replaced with the get_port_addr helper function.
> 
> Signed-off-by: Tristram Ha <tristram.ha@microchip.com>

Thanks for keeping working on regmap. The end result is a lot better,
smaller.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

  reply	other threads:[~2025-07-25 12:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-25  0:17 [PATCH net-next v6 0/6] net: dsa: microchip: Add KSZ8463 switch support Tristram.Ha
2025-07-25  0:17 ` [PATCH net-next v6 1/6] dt-bindings: " Tristram.Ha
2025-07-25  0:17 ` [PATCH net-next v6 2/6] net: dsa: microchip: Add KSZ8463 switch support to KSZ DSA driver Tristram.Ha
2025-07-25 12:27   ` Andrew Lunn [this message]
2025-07-25  0:17 ` [PATCH net-next v6 3/6] net: dsa: microchip: Use different registers for KSZ8463 Tristram.Ha
2025-07-25 12:29   ` Andrew Lunn
2025-07-25  0:17 ` [PATCH net-next v6 4/6] net: dsa: microchip: Write switch MAC address differently " Tristram.Ha
2025-07-25  0:17 ` [PATCH net-next v6 5/6] net: dsa: microchip: Setup fiber ports " Tristram.Ha
2025-07-25 12:32   ` Andrew Lunn
2025-07-25  0:17 ` [PATCH net-next v6 6/6] net: dsa: microchip: Disable PTP function of KSZ8463 Tristram.Ha
2025-07-25 12:31   ` Andrew Lunn
2025-07-26  0:30 ` [PATCH net-next v6 0/6] net: dsa: microchip: Add KSZ8463 switch support patchwork-bot+netdevbpf

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=6fc3ef55-68f7-4b1a-aa8f-70dc8ffdba3e@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Tristram.Ha@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=woojung.huh@microchip.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;
as well as URLs for NNTP newsgroup(s).