[PATCH 0/1] add KSZ9896 switch support with spi interface

Hello,
We are using a custom board where an ethernet switch device KSZ9896 is available. This family of devices can use several types of serial bus as management interface: mdio, i2c or SPI. Due to board design constraints and because we initially planned to use this device only from Linux, the SPI bus was used.
Luckily we are using a recent enough u-boot release where KSZ9477 driver is available... but only for the i2c interface. Indeed, unlike the kernel driver, the KSZ9477 driver doesn't use the regmap API to access the underlying bus since the regmap API is limited to direct memory access [1].
As a workaround, we duplicated the existing code to a new driver (KSZ9896_SPI) where all i2c related calls were replaced by SPI.
So far so good, we are able to use the KSZ9896 ethernet switch using SPI bus as the management interface on top of u-boot 2024.10-rc5 (and after fixing issues with the ethernet controller driver with fixed-link). dhcp and ping commands are working using one of the lan interface (lan1).
In order to upstream the KSZ9896 with SPI interface support and avoid any code duplication or #if#else... it seems u-boot needs regmap with (i2c, SPI, ...) bus support as explained in the first attempt [2] back in 2018.
Is there any pending patch series about regmap I could use to test with the KSZ9896 SPI driver?
[1] https://source.denx.de/u-boot/u-boot/-/blob/v2024.10-rc5/drivers/core/Kconfi... [2] https://lists.denx.de/pipermail/u-boot/2018-May/329392.html
Best regards, Romain
Romain Naour (1): net: ksz9477: add KSZ9896 switch support
drivers/net/ksz9477.c | 3 +++ 1 file changed, 3 insertions(+)

Add support for the KSZ9896 6-port Gigabit Ethernet Switch to the ksz9477 driver.
The KSZ9896 is similar to KSZ9897 but has only one configurable MII/RMII/RGMII/GMII cpu port.
Signed-off-by: Romain Naour romain.naour@smile.fr --- drivers/net/ksz9477.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/net/ksz9477.c b/drivers/net/ksz9477.c index 43baa699619..42befb1af07 100644 --- a/drivers/net/ksz9477.c +++ b/drivers/net/ksz9477.c @@ -543,6 +543,9 @@ static int ksz_i2c_probe(struct udevice *dev) case 0x00956700: puts("KSZ9567R: "); break; + case 0x00989600: + puts("KSZ9896C: "); + break; case 0x00989700: puts("KSZ9897S: "); break;
participants (1)
-
Romain Naour