Skip to content

Commit 68422b5

Browse files
plappermaulhauke
authored andcommitted
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 <[email protected]> Link: openwrt/openwrt#21183 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent e8dba8f commit 68422b5

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ struct rtl838x_eth_priv {
193193
struct phylink *phylink;
194194
struct phylink_config phylink_config;
195195
struct phylink_pcs pcs;
196-
u16 id;
197196
const struct rtl838x_eth_reg *r;
198197
u8 cpu_port;
199198
u32 lastEvent;
@@ -1464,14 +1463,10 @@ static int rtl8380_init_mac(struct rtl838x_eth_priv *priv)
14641463
sw_w32(0x5001417, RTL838X_EEE_TX_TIMER_GELITE_CTRL);
14651464

14661465
/* Init VLAN. TODO: Understand what is being done, here */
1467-
if (priv->id == 0x8382) {
1466+
if (priv->r->family_id == RTL8380_FAMILY_ID) {
14681467
for (int i = 0; i <= 28; i++)
14691468
sw_w32(0, 0xd57c + i * 0x80);
14701469
}
1471-
if (priv->id == 0x8380) {
1472-
for (int i = 8; i <= 28; i++)
1473-
sw_w32(0, 0xd57c + i * 0x80);
1474-
}
14751470

14761471
return 0;
14771472
}
@@ -1701,14 +1696,7 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
17011696
dev->features = NETIF_F_RXCSUM | NETIF_F_HW_CSUM;
17021697
dev->hw_features = NETIF_F_RXCSUM;
17031698

1704-
priv->id = soc_info.id;
1705-
if (priv->id) {
1706-
pr_info("Found SoC ID: %4x: %s, family %x\n",
1707-
priv->id, soc_info.name, priv->r->family_id);
1708-
} else {
1709-
pr_err("Unknown chip id (%04x)\n", priv->id);
1710-
return -ENODEV;
1711-
}
1699+
pr_info("Found SoC family %x\n", priv->r->family_id);
17121700

17131701
switch (priv->r->family_id) {
17141702
case RTL8380_FAMILY_ID:

target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,4 @@ struct rtl838x_eth_reg {
469469
bool (*decode_tag)(struct p_hdr *h, struct dsa_tag *tag);
470470
};
471471

472-
/* TODO actually from arch/mips/rtl838x/prom.c */
473-
extern struct rtl83xx_soc_info soc_info;
474-
475472
#endif /* _RTL838X_ETH_H */

0 commit comments

Comments
 (0)