mirror-linux/drivers/net/dsa/microchip
Tristram Ha 84c47bfc5b net: dsa: microchip: Add KSZ8463 switch support to KSZ DSA driver
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>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20250725001753.6330-3-Tristram.Ha@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-07-25 17:01:56 -07:00
..
Kconfig net: dsa: microchip: Add SGMII port support to KSZ9477 switch 2025-05-26 17:15:51 +02:00
Makefile net: dsa: microchip: rename ksz8 series files 2024-09-06 08:41:35 +01:00
ksz8.c net: dsa: microchip: Add KSZ8463 switch support to KSZ DSA driver 2025-07-25 17:01:56 -07:00
ksz8.h net: dsa: microchip: Add KSZ8463 switch support to KSZ DSA driver 2025-07-25 17:01:56 -07:00
ksz8_reg.h net: dsa: microchip: Add KSZ8463 switch support to KSZ DSA driver 2025-07-25 17:01:56 -07:00
ksz8863_smi.c net: dsa: microchip: replace unclear KSZ8830 strings 2024-09-06 08:41:35 +01:00
ksz9477.c net: dsa: microchip: Add SGMII port support to KSZ9477 switch 2025-05-26 17:15:51 +02:00
ksz9477.h net: dsa: microchip: Add SGMII port support to KSZ9477 switch 2025-05-26 17:15:51 +02:00
ksz9477_acl.c
ksz9477_i2c.c net: dsa: microchip: Add suspend/resume support to KSZ DSA driver 2024-12-19 18:05:57 -08:00
ksz9477_reg.h net: dsa: microchip: Fix KSZ9477 set_ageing_time function 2024-12-19 18:04:04 -08:00
ksz9477_tc_flower.c net: dsa: microchip: ksz9477: flower: validate control flags 2024-04-15 10:33:14 +01:00
ksz_common.c net: dsa: microchip: Add KSZ8463 switch support to KSZ DSA driver 2025-07-25 17:01:56 -07:00
ksz_common.h net: dsa: microchip: Add KSZ8463 switch support to KSZ DSA driver 2025-07-25 17:01:56 -07:00
ksz_dcb.c net: dsa: microchip: fix DCB apptrust configuration on KSZ88x3 2025-03-25 10:40:54 -07:00
ksz_dcb.h net: dsa: microchip: add support DSCP priority mapping 2024-05-08 10:35:11 +01:00
ksz_ptp.c net: Use dev_fwnode() 2025-06-12 18:46:37 -07:00
ksz_ptp.h net: dsa: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() 2025-05-09 16:34:09 -07:00
ksz_ptp_reg.h
ksz_spi.c net: dsa: microchip: Add KSZ8463 switch support to KSZ DSA driver 2025-07-25 17:01:56 -07:00
lan937x.h net: dsa: microchip: add support for side MDIO interface in LAN937x 2024-11-11 16:04:32 -08:00
lan937x_main.c net: dsa: microchip: Fix LAN937X set_ageing_time function 2024-12-19 18:04:04 -08:00
lan937x_reg.h net: dsa: microchip: Fix LAN937X set_ageing_time function 2024-12-19 18:04:04 -08:00