OpenCloudOS-Kernel/drivers/net/dsa/microchip
Lukasz Majewski 8d7ae22ae9 net: dsa: microchip: KSZ9477 register regmap alignment to 32 bit boundaries
The commit (SHA1: 5c844d57aa) provided code
to apply "Module 6: Certain PHY registers must be written as pairs instead
of singly" errata for KSZ9477 as this chip for certain PHY registers
(0xN120 to 0xN13F, N=1,2,3,4,5) must be accesses as 32 bit words instead
of 16 or 8 bit access.
Otherwise, adjacent registers (no matter if reserved or not) are
overwritten with 0x0.

Without this patch some registers (e.g. 0x113c or 0x1134) required for 32
bit access are out of valid regmap ranges.

As a result, following error is observed and KSZ9477 is not properly
configured:

ksz-switch spi1.0: can't rmw 32bit reg 0x113c: -EIO
ksz-switch spi1.0: can't rmw 32bit reg 0x1134: -EIO
ksz-switch spi1.0 lan1 (uninitialized): failed to connect to PHY: -EIO
ksz-switch spi1.0 lan1 (uninitialized): error -5 setting up PHY for tree 0, switch 0, port 0

The solution is to modify regmap_reg_range to allow accesses with 4 bytes
boundaries.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-07-29 17:00:40 +01:00
..
Kconfig net: dsa: microchip: ptp: fix up PTP dependency 2023-01-31 13:21:38 +01:00
Makefile net: dsa: microchip: ptp: add the posix clock support 2023-01-13 08:40:40 +00:00
ksz8.h net: dsa: microchip: Make ksz8_w_sta_mac_table() static 2023-04-06 11:34:45 +02:00
ksz8795.c net: dsa: microchip: correct KSZ8795 static MAC table access 2023-07-17 07:43:11 +01:00
ksz8795_reg.h net: dsa: microchip: ksz8: add MTU configuration support 2022-12-07 11:57:58 +01:00
ksz8863_smi.c net: dsa: microchip: ksz8: Prepare ksz8863_smi for regmap register access validation 2023-05-30 09:48:17 +02:00
ksz9477.c net: dsa: microchip: fix writes to phy registers >= 0x10 2023-06-22 19:48:37 -07:00
ksz9477.h net: dsa: microchip: add support for credit based shaper 2023-01-23 22:12:35 -08:00
ksz9477_i2c.c net: dsa: Switch i2c drivers back to use .probe() 2023-05-31 09:52:55 +01:00
ksz9477_reg.h net: dsa: microchip: add support for credit based shaper 2023-01-23 22:12:35 -08:00
ksz_common.c net: dsa: microchip: KSZ9477 register regmap alignment to 32 bit boundaries 2023-07-29 17:00:40 +01:00
ksz_common.h net: dsa: microchip: correct KSZ8795 static MAC table access 2023-07-17 07:43:11 +01:00
ksz_ptp.c net: dsa: microchip: ptp: Fix error code in ksz_hwtstamp_set() 2023-01-19 18:57:16 -08:00
ksz_ptp.h net: dsa: microchip: ptp: add support for perout programmable pins 2023-01-13 08:40:41 +00:00
ksz_ptp_reg.h net: dsa: microchip: ptp: lan937x: Enable periodic output in LED pins 2023-01-13 08:40:41 +00:00
ksz_spi.c net: dsa: microchip: add an enum for regmap widths 2023-05-30 09:48:17 +02:00
lan937x.h net: dsa: microchip: add support for credit based shaper 2023-01-23 22:12:35 -08:00
lan937x_main.c net: dsa: microchip: add an enum for regmap widths 2023-05-30 09:48:17 +02:00
lan937x_reg.h net: dsa: microchip: add support for credit based shaper 2023-01-23 22:12:35 -08:00