mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-03-14 23:09:45 +01:00
realtek: carve out mdio bus from ethernet driver
So much code was distributed between phy/ethernet/dsa drivers. A lot was already cleand up before. With this step the mdio bus gets its own space and is no longer hidden inside the ethernet driver. This commit is mostly a copy/paste that includes only minor changes. - define prefixes are renamed to RTMDIO - The driver is totally self contained (does not rely on SoC include) - The DTS structure (mdio node below ethernet node) was kept - The driver is added to the kernel config of all subtargets. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/19942 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
parent
3fae46d5cc
commit
fcd3ce6954
10 changed files with 1681 additions and 1666 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -454,20 +454,4 @@ struct rtl838x_eth_reg {
|
|||
bool (*decode_tag)(struct p_hdr *h, struct dsa_tag *tag);
|
||||
};
|
||||
|
||||
int phy_package_port_read_paged(struct phy_device *phydev, int port, int page, u32 regnum);
|
||||
int phy_package_port_write_paged(struct phy_device *phydev, int port, int page, u32 regnum, u16 val);
|
||||
int phy_package_read_paged(struct phy_device *phydev, int page, u32 regnum);
|
||||
int phy_package_write_paged(struct phy_device *phydev, int page, u32 regnum, u16 val);
|
||||
int phy_port_read_paged(struct phy_device *phydev, int port, int page, u32 regnum);
|
||||
int phy_port_write_paged(struct phy_device *phydev, int port, int page, u32 regnum, u16 val);
|
||||
|
||||
int rtmdio_838x_read_phy(u32 port, u32 page, u32 reg, u32 *val);
|
||||
int rtmdio_838x_write_phy(u32 port, u32 page, u32 reg, u32 val);
|
||||
|
||||
int rtmdio_930x_read_sds_phy(int sds, int page, int regnum);
|
||||
int rtmdio_930x_write_sds_phy(int sds, int page, int regnum, u16 val);
|
||||
|
||||
int rtmdio_931x_read_sds_phy_new(int sds, int page, int regnum);
|
||||
int rtmdio_931x_write_sds_phy_new(int sds, int page, int regnum, u16 val);
|
||||
|
||||
#endif /* _RTL838X_ETH_H */
|
||||
|
|
|
|||
1641
target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
Normal file
1641
target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
Normal file
File diff suppressed because it is too large
Load diff
34
target/linux/realtek/patches-6.12/806-add-mdio-driver.patch
Normal file
34
target/linux/realtek/patches-6.12/806-add-mdio-driver.patch
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
From 5b38f63ee59afd95c1d265b7e2097a0958db8a61 Mon Sep 01 00:00:00 2025
|
||||
From: Markus Stockhausen <markus.stockhausen@gmx.de>
|
||||
Date: Mon, 01 Sep 2025 20:13:21 +0200
|
||||
Subject: realtek: add support for mdio controller
|
||||
|
||||
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
|
||||
---
|
||||
|
||||
--- a/drivers/net/mdio/Makefile
|
||||
+++ b/drivers/net/mdio/Makefile
|
||||
@@ -20,6 +20,7 @@ obj-$(CONFIG_MDIO_MSCC_MIIM) += mdio-ms
|
||||
obj-$(CONFIG_MDIO_MVUSB) += mdio-mvusb.o
|
||||
obj-$(CONFIG_MDIO_OCTEON) += mdio-octeon.o
|
||||
obj-$(CONFIG_MDIO_REGMAP) += mdio-regmap.o
|
||||
+obj-$(CONFIG_MDIO_REALTEK_OTTO) += mdio-realtek-otto.o
|
||||
obj-$(CONFIG_MDIO_REALTEK_OTTO_AUX) += mdio-realtek-otto-aux.o
|
||||
obj-$(CONFIG_MDIO_SMBUS) += mdio-smbus.o
|
||||
obj-$(CONFIG_MDIO_SUN4I) += mdio-sun4i.o
|
||||
--- a/drivers/net/mdio/Kconfig
|
||||
+++ b/drivers/net/mdio/Kconfig
|
||||
@@ -207,6 +207,13 @@ config MDIO_REGMAP
|
||||
regmap. Users willing to use this driver must explicitly select
|
||||
REGMAP.
|
||||
|
||||
+config MDIO_REALTEK_OTTO
|
||||
+ tristate "Realtek Otto MDIO interface support"
|
||||
+ default MACH_REALTEK_RTL
|
||||
+ depends on MACH_REALTEK_RTL || COMPILE_TEST
|
||||
+ help
|
||||
+ This driver supports the MDIO bus on RTL83xx/RTL93xx SoCs.
|
||||
+
|
||||
config MDIO_REALTEK_OTTO_AUX
|
||||
tristate "Realtek Otto auxiliary MDIO interface support"
|
||||
default MACH_REALTEK_RTL
|
||||
|
|
@ -134,6 +134,7 @@ CONFIG_MDIO_DEVICE=y
|
|||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MDIO_GPIO=y
|
||||
CONFIG_MDIO_I2C=y
|
||||
CONFIG_MDIO_REALTEK_OTTO=y
|
||||
CONFIG_MDIO_REALTEK_OTTO_AUX=y
|
||||
CONFIG_MDIO_SMBUS=y
|
||||
CONFIG_MFD_CORE=y
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@ CONFIG_MDIO_BUS=y
|
|||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MDIO_I2C=y
|
||||
CONFIG_MDIO_REALTEK_OTTO=y
|
||||
CONFIG_MDIO_REALTEK_OTTO_AUX=y
|
||||
CONFIG_MDIO_SMBUS=y
|
||||
CONFIG_MFD_CORE=y
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ CONFIG_MDIO_BUS=y
|
|||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MDIO_I2C=y
|
||||
CONFIG_MDIO_REALTEK_OTTO=y
|
||||
CONFIG_MDIO_REALTEK_OTTO_AUX=y
|
||||
CONFIG_MDIO_SMBUS=y
|
||||
CONFIG_MFD_RTL8231=y
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ CONFIG_MDIO_BUS=y
|
|||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MDIO_I2C=y
|
||||
CONFIG_MDIO_REALTEK_OTTO=y
|
||||
CONFIG_MDIO_REALTEK_OTTO_AUX=y
|
||||
CONFIG_MDIO_SMBUS=y
|
||||
CONFIG_MFD_RTL8231=y
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@ CONFIG_MDIO_BUS=y
|
|||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MDIO_I2C=y
|
||||
CONFIG_MDIO_REALTEK_OTTO=y
|
||||
CONFIG_MDIO_REALTEK_OTTO_AUX=y
|
||||
CONFIG_MDIO_SMBUS=y
|
||||
CONFIG_MFD_RTL8231=y
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@ CONFIG_MDIO_BUS=y
|
|||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MDIO_I2C=y
|
||||
CONFIG_MDIO_REALTEK_OTTO=y
|
||||
CONFIG_MDIO_REALTEK_OTTO_AUX=y
|
||||
CONFIG_MDIO_SMBUS=y
|
||||
CONFIG_MFD_RTL8231=y
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue