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]. Until regmap API with bus support is available in U-boot, we introduced struct ksz_phy_ops to store low-level ksz bus operations (I2C or SPI). This series has been tested on the current master branch (after v2024.10 release). [1] https://source.denx.de/u-boot/u-boot/-/blob/v2024.10-rc5/drivers/core/Kconfig?ref_type=tags#L188 Best regards, Romain Romain Naour (9): net: ksz9477: move struct ksz_dsa_priv *priv declaration net: ksz9477: remove dev_set_parent_priv() call net: ksz9477: add KSZ9896 switch support net: ksz9477: rename udevice_id tab to ksz_ids net: ksz9477: set i2c bus offset length only when needed net: ksz9477: store ksz bus operations functions net: ksz9477: rename ksz_i2c_probe() to ksz_probe() net: ksz9477: prepare ksz9477 without I2C support net: ksz9477: add support for KSZ GbE switches using SPI bus drivers/net/Kconfig | 6 +- drivers/net/ksz9477.c | 241 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 223 insertions(+), 24 deletions(-) -- 2.45.0