summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Stockhausen2025-12-16 10:29:04 +0000
committerHauke Mehrtens2025-12-23 16:59:12 +0000
commit68422b59aedaf7e06214391737cb63f6a7938b6f (patch)
tree2844c791230fea915edc55a7482b0110bfea6ce9
parente8dba8fb170f67d2a3d7a4874d336bc2831efc88 (diff)
downloadopenwrt-68422b59aedaf7e06214391737cb63f6a7938b6f.tar.gz
realtek: ethernet: decouple from soc_info
The ethernet driver gets all the data from the DTS now. No need to access the shared soc_info structure any longer. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21183 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c16
-rw-r--r--target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h3
2 files changed, 2 insertions, 17 deletions
diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
index 26d6e72e41..0684f6c4d7 100644
--- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
@@ -193,7 +193,6 @@ struct rtl838x_eth_priv {
struct phylink *phylink;
struct phylink_config phylink_config;
struct phylink_pcs pcs;
- u16 id;
const struct rtl838x_eth_reg *r;
u8 cpu_port;
u32 lastEvent;
@@ -1464,14 +1463,10 @@ static int rtl8380_init_mac(struct rtl838x_eth_priv *priv)
sw_w32(0x5001417, RTL838X_EEE_TX_TIMER_GELITE_CTRL);
/* Init VLAN. TODO: Understand what is being done, here */
- if (priv->id == 0x8382) {
+ if (priv->r->family_id == RTL8380_FAMILY_ID) {
for (int i = 0; i <= 28; i++)
sw_w32(0, 0xd57c + i * 0x80);
}
- if (priv->id == 0x8380) {
- for (int i = 8; i <= 28; i++)
- sw_w32(0, 0xd57c + i * 0x80);
- }
return 0;
}
@@ -1701,14 +1696,7 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
dev->features = NETIF_F_RXCSUM | NETIF_F_HW_CSUM;
dev->hw_features = NETIF_F_RXCSUM;
- priv->id = soc_info.id;
- if (priv->id) {
- pr_info("Found SoC ID: %4x: %s, family %x\n",
- priv->id, soc_info.name, priv->r->family_id);
- } else {
- pr_err("Unknown chip id (%04x)\n", priv->id);
- return -ENODEV;
- }
+ pr_info("Found SoC family %x\n", priv->r->family_id);
switch (priv->r->family_id) {
case RTL8380_FAMILY_ID:
diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h
index 9b94140ca9..835bd742b4 100644
--- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h
+++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h
@@ -469,7 +469,4 @@ struct rtl838x_eth_reg {
bool (*decode_tag)(struct p_hdr *h, struct dsa_tag *tag);
};
-/* TODO actually from arch/mips/rtl838x/prom.c */
-extern struct rtl83xx_soc_info soc_info;
-
#endif /* _RTL838X_ETH_H */