|
12 | 12 | #define RTMDIO_MAX_SMI_BUS 4 |
13 | 13 | #define RTMDIO_PAGE_SELECT 0x1f |
14 | 14 |
|
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 | | - |
20 | 15 | /* Register base */ |
21 | 16 | #define RTMDIO_SW_BASE ((volatile void *) 0xBB000000) |
22 | 17 |
|
|
74 | 69 | #define RTMDIO_931X_SERDES_INDRT_ACCESS_CTRL (0x5638) |
75 | 70 | #define RTMDIO_931X_SERDES_INDRT_DATA_CTRL (0x563C) |
76 | 71 |
|
77 | | -/* Other registers */ |
78 | | -#define RTMDIO_839X_MODEL_NAME_INFO_REG (0x0ff0) |
79 | | -#define RTMDIO_93XX_MODEL_NAME_INFO_REG (0x0004) |
80 | | - |
81 | 72 | #define sw_r32(reg) readl(RTMDIO_SW_BASE + reg) |
82 | 73 | #define sw_w32(val, reg) writel(val, RTMDIO_SW_BASE + reg) |
83 | 74 | #define sw_w32_mask(clear, set, reg) sw_w32((sw_r32(reg) & ~(clear)) | (set), reg) |
@@ -153,8 +144,6 @@ DEFINE_MUTEX(rtmdio_lock_sds); |
153 | 144 |
|
154 | 145 | struct rtmdio_bus_priv { |
155 | 146 | const struct rtmdio_config *cfg; |
156 | | - u16 id; |
157 | | - u16 family_id; |
158 | 147 | int page[RTMDIO_MAX_PORT]; |
159 | 148 | bool raw[RTMDIO_MAX_PORT]; |
160 | 149 | int smi_bus[RTMDIO_MAX_PORT]; |
@@ -1390,39 +1379,14 @@ static int rtmdio_reset(struct mii_bus *bus) |
1390 | 1379 | return priv->cfg->reset(bus); |
1391 | 1380 | } |
1392 | 1381 |
|
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 | | - |
1415 | 1382 | static int rtmdio_probe(struct platform_device *pdev) |
1416 | 1383 | { |
1417 | 1384 | struct device_node *dn, *mii_np, *pcs_node; |
1418 | 1385 | struct device *dev = &pdev->dev; |
1419 | 1386 | struct rtmdio_bus_priv *priv; |
1420 | 1387 | struct mii_bus *bus; |
1421 | | - int i, family; |
1422 | 1388 | u32 pn; |
1423 | | - |
1424 | | - family = rtmdio_get_family(); |
1425 | | - dev_info(dev, "probing RTL%04x family mdio bus\n", family); |
| 1389 | + int i; |
1426 | 1390 |
|
1427 | 1391 | mii_np = of_get_child_by_name(dev->of_node, "mdio-bus"); |
1428 | 1392 | if (!mii_np) |
|
0 commit comments