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

Romain Naour romain.naour at smile.fr
Mon Sep 23 10:21:06 CEST 2024


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/Kconfig?ref_type=tags#L188
[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(+)

-- 
2.45.0



More information about the U-Boot mailing list