From 2cb7044f79947164171d77340b2ac726dbff33df Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Thu, 14 Aug 2025 07:13:49 -0400 Subject: [PATCH] realtek: rtl8231-aux: add RTL931x support The auxiliary RTL8231 controller driver is missing RTL931x support. Add it by defining the proper register and matching compatible. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/19776 Signed-off-by: Hauke Mehrtens --- ...dio-Add-Realtek-Otto-auxiliary-controller.patch | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/target/linux/realtek/patches-6.12/723-net-mdio-Add-Realtek-Otto-auxiliary-controller.patch b/target/linux/realtek/patches-6.12/723-net-mdio-Add-Realtek-Otto-auxiliary-controller.patch index 7315899b3f3..ad11b907529 100644 --- a/target/linux/realtek/patches-6.12/723-net-mdio-Add-Realtek-Otto-auxiliary-controller.patch +++ b/target/linux/realtek/patches-6.12/723-net-mdio-Add-Realtek-Otto-auxiliary-controller.patch @@ -49,7 +49,7 @@ Signed-off-by: Sander Vanheule obj-$(CONFIG_MDIO_THUNDER) += mdio-thunder.o --- /dev/null +++ b/drivers/net/mdio/mdio-realtek-otto-aux.c -@@ -0,0 +1,175 @@ +@@ -0,0 +1,187 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include @@ -65,6 +65,7 @@ Signed-off-by: Sander Vanheule +#define RTL8380_EXT_GPIO_INDIRECT_ACCESS 0xA09C +#define RTL8390_EXT_GPIO_INDIRECT_ACCESS 0x0224 +#define RTL9300_EXT_GPIO_INDIRECT_ACCESS 0xC620 ++#define RTL9310_EXT_GPIO_INDIRECT_ACCESS 0x07F4 + +#define RTL83XX_AUX_MDIO_DATA_OFFSET 16 +#define RTL83XX_AUX_MDIO_RCMD_FAIL 0 @@ -106,6 +107,13 @@ Signed-off-by: Sander Vanheule + .timeout_us = 19000, +}; + ++static const struct realtek_aux_mdio_info info_rtl931x = { ++ .cmd_reg = RTL9310_EXT_GPIO_INDIRECT_ACCESS, ++ .data_offset = RTL93XX_AUX_MDIO_DATA_OFFSET, ++ .rcmd_fail_mask = RTL93XX_AUX_MDIO_RCMD_FAIL, ++ .timeout_us = 19000, ++}; ++ +struct realtek_aux_mdio_ctrl { + struct device *dev; + struct regmap *map; @@ -209,6 +217,10 @@ Signed-off-by: Sander Vanheule + .compatible = "realtek,rtl9300-aux-mdio", + .data = &info_rtl930x, + }, ++ { ++ .compatible = "realtek,rtl9310-aux-mdio", ++ .data = &info_rtl931x, ++ }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, realtek_aux_mdio_of_match); -- 2.47.3