Skip to content

Commit b8a596e

Browse files
plappermaulrobimarko
authored andcommitted
realtek: mdio: drop family leftovers
Now that the bus is completely configured by the dts compatible, drop the hard coded family detection. Signed-off-by: Markus Stockhausen <[email protected]> Link: openwrt/openwrt#21274 Signed-off-by: Robert Marko <[email protected]>
1 parent 96bcabe commit b8a596e

File tree

1 file changed

+1
-37
lines changed

1 file changed

+1
-37
lines changed

target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212
#define RTMDIO_MAX_SMI_BUS 4
1313
#define RTMDIO_PAGE_SELECT 0x1f
1414

15-
#define RTMDIO_838X_FAMILY_ID 0x8380
16-
#define RTMDIO_839X_FAMILY_ID 0x8390
17-
#define RTMDIO_930X_FAMILY_ID 0x9300
18-
#define RTMDIO_931X_FAMILY_ID 0x9310
19-
2015
/* Register base */
2116
#define RTMDIO_SW_BASE ((volatile void *) 0xBB000000)
2217

@@ -74,10 +69,6 @@
7469
#define RTMDIO_931X_SERDES_INDRT_ACCESS_CTRL (0x5638)
7570
#define RTMDIO_931X_SERDES_INDRT_DATA_CTRL (0x563C)
7671

77-
/* Other registers */
78-
#define RTMDIO_839X_MODEL_NAME_INFO_REG (0x0ff0)
79-
#define RTMDIO_93XX_MODEL_NAME_INFO_REG (0x0004)
80-
8172
#define sw_r32(reg) readl(RTMDIO_SW_BASE + reg)
8273
#define sw_w32(val, reg) writel(val, RTMDIO_SW_BASE + reg)
8374
#define sw_w32_mask(clear, set, reg) sw_w32((sw_r32(reg) & ~(clear)) | (set), reg)
@@ -153,8 +144,6 @@ DEFINE_MUTEX(rtmdio_lock_sds);
153144

154145
struct rtmdio_bus_priv {
155146
const struct rtmdio_config *cfg;
156-
u16 id;
157-
u16 family_id;
158147
int page[RTMDIO_MAX_PORT];
159148
bool raw[RTMDIO_MAX_PORT];
160149
int smi_bus[RTMDIO_MAX_PORT];
@@ -1390,39 +1379,14 @@ static int rtmdio_reset(struct mii_bus *bus)
13901379
return priv->cfg->reset(bus);
13911380
}
13921381

1393-
/*
1394-
* TODO: This is a tiny leftover from the central SoC include. For now try to detect the
1395-
* Realtek SoC automatically. This needs to be changed to a proper DTS compatible in a
1396-
* future driver version.
1397-
*/
1398-
static int rtmdio_get_family(void)
1399-
{
1400-
unsigned int val;
1401-
1402-
val = sw_r32(RTMDIO_93XX_MODEL_NAME_INFO_REG);
1403-
if ((val & 0xfffc0000) == 0x93000000)
1404-
return RTMDIO_930X_FAMILY_ID;
1405-
if ((val & 0xfffc0000) == 0x93100000)
1406-
return RTMDIO_931X_FAMILY_ID;
1407-
1408-
val = sw_r32(RTMDIO_839X_MODEL_NAME_INFO_REG);
1409-
if ((val & 0xfff80000) == 0x83900000)
1410-
return RTMDIO_839X_FAMILY_ID;
1411-
1412-
return RTMDIO_838X_FAMILY_ID;
1413-
}
1414-
14151382
static int rtmdio_probe(struct platform_device *pdev)
14161383
{
14171384
struct device_node *dn, *mii_np, *pcs_node;
14181385
struct device *dev = &pdev->dev;
14191386
struct rtmdio_bus_priv *priv;
14201387
struct mii_bus *bus;
1421-
int i, family;
14221388
u32 pn;
1423-
1424-
family = rtmdio_get_family();
1425-
dev_info(dev, "probing RTL%04x family mdio bus\n", family);
1389+
int i;
14261390

14271391
mii_np = of_get_child_by_name(dev->of_node, "mdio-bus");
14281392
if (!mii_np)

0 commit comments

Comments
 (0)