Lines Matching refs:prueth
58 struct prueth *prueth = emac->prueth; in emac_get_tx_ts() local
62 addr = icssg_queue_pop(prueth, slice == 0 ? in emac_get_tx_ts()
67 memcpy_fromio(rsp, prueth->shram.va + addr, sizeof(*rsp)); in emac_get_tx_ts()
69 icssg_queue_push(prueth, slice == 0 ? in emac_get_tx_ts()
104 hi_sw = readl(emac->prueth->shram.va + in tx_ts_work()
145 static int prueth_emac_start(struct prueth *prueth) in prueth_emac_start() argument
148 struct device *dev = prueth->dev; in prueth_emac_start()
151 if (prueth->is_switch_mode) in prueth_emac_start()
152 firmwares = prueth->icssg_switch_firmwares; in prueth_emac_start()
153 else if (prueth->is_hsr_offload_mode && HSR_V1 == prueth->hsr_prp_version) in prueth_emac_start()
154 firmwares = prueth->icssg_hsr_firmwares; in prueth_emac_start()
155 else if (prueth->is_hsr_offload_mode && PRP_V1 == prueth->hsr_prp_version) in prueth_emac_start()
156 firmwares = prueth->icssg_prp_firmwares; in prueth_emac_start()
158 firmwares = prueth->icssg_emac_firmwares; in prueth_emac_start()
161 ret = prueth_start(prueth->pru[slice], firmwares[slice].pru); in prueth_emac_start()
167 ret = prueth_start(prueth->rtu[slice], firmwares[slice].rtu); in prueth_emac_start()
170 rproc_shutdown(prueth->pru[slice]); in prueth_emac_start()
174 ret = prueth_start(prueth->txpru[slice], firmwares[slice].txpru); in prueth_emac_start()
177 rproc_shutdown(prueth->rtu[slice]); in prueth_emac_start()
178 rproc_shutdown(prueth->pru[slice]); in prueth_emac_start()
187 prueth_shutdown(prueth->txpru[slice]); in prueth_emac_start()
188 prueth_shutdown(prueth->rtu[slice]); in prueth_emac_start()
189 prueth_shutdown(prueth->pru[slice]); in prueth_emac_start()
195 static void prueth_emac_stop(struct prueth *prueth) in prueth_emac_stop() argument
200 prueth_shutdown(prueth->txpru[slice]); in prueth_emac_stop()
201 prueth_shutdown(prueth->rtu[slice]); in prueth_emac_stop()
202 prueth_shutdown(prueth->pru[slice]); in prueth_emac_stop()
206 static int prueth_emac_common_start(struct prueth *prueth) in prueth_emac_common_start() argument
212 if (!prueth->emac[ICSS_SLICE0] && !prueth->emac[ICSS_SLICE1]) in prueth_emac_common_start()
216 memset_io(prueth->msmcram.va, 0, prueth->msmcram.size); in prueth_emac_common_start()
217 memset_io(prueth->shram.va, 0, ICSSG_CONFIG_OFFSET_SLICE1 * PRUETH_NUM_MACS); in prueth_emac_common_start()
219 icssg_class_default(prueth->miig_rt, ICSS_SLICE0, 0, false); in prueth_emac_common_start()
220 icssg_class_default(prueth->miig_rt, ICSS_SLICE1, 0, false); in prueth_emac_common_start()
222 if (prueth->is_switch_mode || prueth->is_hsr_offload_mode) in prueth_emac_common_start()
223 icssg_init_fw_offload_mode(prueth); in prueth_emac_common_start()
225 icssg_init_emac_mode(prueth); in prueth_emac_common_start()
228 emac = prueth->emac[slice]; in prueth_emac_common_start()
231 ret = icssg_config(prueth, emac, slice); in prueth_emac_common_start()
240 ret = prueth_emac_start(prueth); in prueth_emac_common_start()
244 emac = prueth->emac[ICSS_SLICE0] ? prueth->emac[ICSS_SLICE0] : in prueth_emac_common_start()
245 prueth->emac[ICSS_SLICE1]; in prueth_emac_common_start()
249 dev_err(prueth->dev, "Failed to initialize IEP module\n"); in prueth_emac_common_start()
256 prueth_emac_stop(prueth); in prueth_emac_common_start()
259 icssg_class_disable(prueth->miig_rt, ICSS_SLICE0); in prueth_emac_common_start()
260 icssg_class_disable(prueth->miig_rt, ICSS_SLICE1); in prueth_emac_common_start()
265 static int prueth_emac_common_stop(struct prueth *prueth) in prueth_emac_common_stop() argument
269 if (!prueth->emac[ICSS_SLICE0] && !prueth->emac[ICSS_SLICE1]) in prueth_emac_common_stop()
272 icssg_class_disable(prueth->miig_rt, ICSS_SLICE0); in prueth_emac_common_stop()
273 icssg_class_disable(prueth->miig_rt, ICSS_SLICE1); in prueth_emac_common_stop()
275 prueth_emac_stop(prueth); in prueth_emac_common_stop()
277 emac = prueth->emac[ICSS_SLICE0] ? prueth->emac[ICSS_SLICE0] : in prueth_emac_common_stop()
278 prueth->emac[ICSS_SLICE1]; in prueth_emac_common_stop()
289 struct prueth *prueth = emac->prueth; in emac_adjust_link() local
328 icssg_update_rgmii_cfg(prueth->miig_rt, emac); in emac_adjust_link()
363 struct prueth *prueth = emac->prueth; in emac_phy_connect() local
370 dev_err(prueth->dev, "couldn't connect to phy %s\n", in emac_phy_connect()
376 dev_dbg(prueth->dev, "half duplex mode is not supported\n"); in emac_phy_connect()
396 struct prueth *prueth = emac->prueth; in prueth_iep_gettime() local
404 fw_count_hi_addr = prueth->shram.va + TIMESYNC_FW_WC_COUNT_HI_SW_OFFSET_OFFSET; in prueth_iep_gettime()
405 fw_hi_r_count_addr = prueth->shram.va + TIMESYNC_FW_WC_HI_ROLLOVER_COUNT_OFFSET; in prueth_iep_gettime()
438 sc_descp = emac->prueth->shram.va + TIMESYNC_FW_WC_SETCLOCK_DESC_OFFSET; in prueth_iep_settime()
463 dev_err(emac->prueth->dev, "settime timeout\n"); in prueth_iep_settime()
510 writel(reduction_factor, emac->prueth->shram.va + in prueth_perout_enable()
513 current_cycle = icssg_read_time(emac->prueth->shram.va + in prueth_perout_enable()
519 hi_lo_writeq(start_offset, emac->prueth->shram.va + in prueth_perout_enable()
680 if (emac->prueth->is_hsr_offload_mode) in icssg_update_vlan_mcast()
705 struct prueth *prueth = emac->prueth; in emac_ndo_open() local
707 struct device *dev = prueth->dev; in emac_ndo_open()
714 icssg_class_set_mac_addr(prueth->miig_rt, slice, emac->mac_addr); in emac_ndo_open()
715 icssg_ft1_set_mac_addr(prueth->miig_rt, slice, emac->mac_addr); in emac_ndo_open()
752 if (!prueth->emacs_initialized) { in emac_ndo_open()
753 ret = prueth_emac_common_start(prueth); in emac_ndo_open()
767 icssg_mii_update_mtu(prueth->mii_rt, slice, ndev->max_mtu); in emac_ndo_open()
801 prueth->emacs_initialized++; in emac_ndo_open()
819 if (!prueth->emacs_initialized) in emac_ndo_open()
820 prueth_emac_common_stop(prueth); in emac_ndo_open()
844 struct prueth *prueth = emac->prueth; in emac_ndo_stop() local
856 if (emac->prueth->is_hsr_offload_mode) in emac_ndo_stop()
894 if (prueth->emacs_initialized == 1) in emac_ndo_stop()
895 prueth_emac_common_stop(prueth); in emac_ndo_stop()
905 prueth->emacs_initialized--; in emac_ndo_stop()
935 if (emac->prueth->is_hsr_offload_mode) { in emac_ndo_set_rx_mode_work()
939 vlan_for_each(emac->prueth->hsr_dev, in emac_ndo_set_rx_mode_work()
994 struct prueth *prueth = emac->prueth; in emac_ndo_vlan_rx_add_vid() local
998 if (prueth->is_hsr_offload_mode) in emac_ndo_vlan_rx_add_vid()
1006 icssg_set_pvid(emac->prueth, vid, emac->port_id); in emac_ndo_vlan_rx_add_vid()
1015 struct prueth *prueth = emac->prueth; in emac_ndo_vlan_rx_del_vid() local
1019 if (prueth->is_hsr_offload_mode) in emac_ndo_vlan_rx_del_vid()
1134 static int prueth_netdev_init(struct prueth *prueth, in prueth_netdev_init() argument
1157 emac->prueth = prueth; in prueth_netdev_init()
1171 ret = pruss_request_mem_region(prueth->pruss, in prueth_netdev_init()
1176 dev_err(prueth->dev, "unable to get DRAM: %d\n", ret); in prueth_netdev_init()
1186 emac->tx_ts_irq = platform_get_irq_byname_optional(prueth->pdev, irq_name); in prueth_netdev_init()
1188 ret = dev_err_probe(prueth->dev, emac->tx_ts_irq, "could not get tx_ts_irq\n"); in prueth_netdev_init()
1192 SET_NETDEV_DEV(ndev, prueth->dev); in prueth_netdev_init()
1198 dev_err(prueth->dev, "couldn't find phy-handle\n"); in prueth_netdev_init()
1204 ret = dev_err_probe(prueth->dev, ret, in prueth_netdev_init()
1214 dev_err(prueth->dev, "could not get phy-mode property\n"); in prueth_netdev_init()
1220 dev_err(prueth->dev, "PHY mode unsupported %s\n", phy_modes(emac->phy_if)); in prueth_netdev_init()
1239 dev_err(prueth->dev, "RGMII mode without TX delay is not supported"); in prueth_netdev_init()
1250 dev_warn(prueth->dev, "port %d: using random MAC addr: %pM\n", in prueth_netdev_init()
1271 prueth->emac[mac] = emac; in prueth_netdev_init()
1276 pruss_release_mem_region(prueth->pruss, &emac->dram); in prueth_netdev_init()
1281 prueth->emac[mac] = NULL; in prueth_netdev_init()
1292 return emac->prueth->is_switch_mode; in prueth_dev_check()
1298 static void prueth_offload_fwd_mark_update(struct prueth *prueth) in prueth_offload_fwd_mark_update() argument
1303 if (prueth->br_members == (BIT(PRUETH_PORT_MII0) | BIT(PRUETH_PORT_MII1))) in prueth_offload_fwd_mark_update()
1306 dev_dbg(prueth->dev, "set offload_fwd_mark %d\n", set_val); in prueth_offload_fwd_mark_update()
1309 struct prueth_emac *emac = prueth->emac[i]; in prueth_offload_fwd_mark_update()
1318 static int prueth_emac_restart(struct prueth *prueth) in prueth_emac_restart() argument
1320 struct prueth_emac *emac0 = prueth->emac[PRUETH_MAC0]; in prueth_emac_restart()
1321 struct prueth_emac *emac1 = prueth->emac[PRUETH_MAC1]; in prueth_emac_restart()
1337 ret = prueth_emac_common_stop(prueth); in prueth_emac_restart()
1339 dev_err(prueth->dev, "Failed to stop the firmwares"); in prueth_emac_restart()
1344 ret = prueth_emac_common_start(prueth); in prueth_emac_restart()
1346 dev_err(prueth->dev, "Failed to start the firmwares"); in prueth_emac_restart()
1361 static void icssg_change_mode(struct prueth *prueth) in icssg_change_mode() argument
1366 ret = prueth_emac_restart(prueth); in icssg_change_mode()
1368 dev_err(prueth->dev, "Failed to restart the firmwares, aborting the process"); in icssg_change_mode()
1373 emac = prueth->emac[mac]; in icssg_change_mode()
1374 if (prueth->is_hsr_offload_mode) { in icssg_change_mode()
1382 icssg_fdb_add_del(emac, eth_stp_addr, prueth->default_vlan, in icssg_change_mode()
1392 if (prueth->is_hsr_offload_mode) in icssg_change_mode()
1396 icssg_set_pvid(prueth, emac->port_vlan, emac->port_id); in icssg_change_mode()
1397 if (prueth->is_switch_mode) in icssg_change_mode()
1408 struct prueth *prueth = emac->prueth; in prueth_netdevice_port_link() local
1411 if (!prueth->br_members) { in prueth_netdevice_port_link()
1412 prueth->hw_bridge_dev = br_ndev; in prueth_netdevice_port_link()
1417 if (prueth->hw_bridge_dev != br_ndev) in prueth_netdevice_port_link()
1422 &prueth->prueth_switchdev_nb, in prueth_netdevice_port_link()
1423 &prueth->prueth_switchdev_bl_nb, in prueth_netdevice_port_link()
1428 prueth->br_members |= BIT(emac->port_id); in prueth_netdevice_port_link()
1430 if (!prueth->is_switch_mode) { in prueth_netdevice_port_link()
1431 if (prueth->br_members & BIT(PRUETH_PORT_MII0) && in prueth_netdevice_port_link()
1432 prueth->br_members & BIT(PRUETH_PORT_MII1)) { in prueth_netdevice_port_link()
1433 prueth->is_switch_mode = true; in prueth_netdevice_port_link()
1434 prueth->default_vlan = PRUETH_DFLT_VLAN_SW; in prueth_netdevice_port_link()
1435 emac->port_vlan = prueth->default_vlan; in prueth_netdevice_port_link()
1436 icssg_change_mode(prueth); in prueth_netdevice_port_link()
1440 prueth_offload_fwd_mark_update(prueth); in prueth_netdevice_port_link()
1448 struct prueth *prueth = emac->prueth; in prueth_netdevice_port_unlink() local
1451 prueth->br_members &= ~BIT(emac->port_id); in prueth_netdevice_port_unlink()
1453 if (prueth->is_switch_mode) { in prueth_netdevice_port_unlink()
1454 prueth->is_switch_mode = false; in prueth_netdevice_port_unlink()
1456 ret = prueth_emac_restart(prueth); in prueth_netdevice_port_unlink()
1458 dev_err(prueth->dev, "Failed to restart the firmwares, aborting the process"); in prueth_netdevice_port_unlink()
1463 prueth_offload_fwd_mark_update(prueth); in prueth_netdevice_port_unlink()
1465 if (!prueth->br_members) in prueth_netdevice_port_unlink()
1466 prueth->hw_bridge_dev = NULL; in prueth_netdevice_port_unlink()
1472 struct prueth *prueth = emac->prueth; in prueth_hsr_port_link() local
1476 emac0 = prueth->emac[PRUETH_MAC0]; in prueth_hsr_port_link()
1477 emac1 = prueth->emac[PRUETH_MAC1]; in prueth_hsr_port_link()
1479 if (prueth->is_switch_mode) in prueth_hsr_port_link()
1482 prueth->hsr_members |= BIT(emac->port_id); in prueth_hsr_port_link()
1483 if (!prueth->is_hsr_offload_mode) { in prueth_hsr_port_link()
1484 if (prueth->hsr_members & BIT(PRUETH_PORT_MII0) && in prueth_hsr_port_link()
1485 prueth->hsr_members & BIT(PRUETH_PORT_MII1)) { in prueth_hsr_port_link()
1491 prueth->is_hsr_offload_mode = true; in prueth_hsr_port_link()
1492 prueth->default_vlan = PRUETH_DFLT_VLAN_HSR; in prueth_hsr_port_link()
1493 emac0->port_vlan = prueth->default_vlan; in prueth_hsr_port_link()
1494 emac1->port_vlan = prueth->default_vlan; in prueth_hsr_port_link()
1495 icssg_change_mode(prueth); in prueth_hsr_port_link()
1506 struct prueth *prueth = emac->prueth; in prueth_hsr_port_unlink() local
1511 emac0 = prueth->emac[PRUETH_MAC0]; in prueth_hsr_port_unlink()
1512 emac1 = prueth->emac[PRUETH_MAC1]; in prueth_hsr_port_unlink()
1514 prueth->hsr_members &= ~BIT(emac->port_id); in prueth_hsr_port_unlink()
1515 if (prueth->is_hsr_offload_mode) { in prueth_hsr_port_unlink()
1516 prueth->is_hsr_offload_mode = false; in prueth_hsr_port_unlink()
1519 prueth->hsr_dev = NULL; in prueth_hsr_port_unlink()
1520 ret = prueth_emac_restart(prueth); in prueth_hsr_port_unlink()
1522 dev_err(prueth->dev, "Failed to restart the firmwares, aborting the process"); in prueth_hsr_port_unlink()
1537 struct prueth *prueth = emac->prueth; in prueth_netdevice_event() local
1553 prueth->hsr_prp_version = hsr_ndev_version; in prueth_netdevice_event()
1556 if (!prueth->hsr_dev) { in prueth_netdevice_event()
1557 prueth->hsr_dev = info->upper_dev; in prueth_netdevice_event()
1558 icssg_class_set_host_mac_addr(prueth->miig_rt, in prueth_netdevice_event()
1559 prueth->hsr_dev->dev_addr); in prueth_netdevice_event()
1561 if (prueth->hsr_dev != info->upper_dev) { in prueth_netdevice_event()
1586 static int prueth_register_notifiers(struct prueth *prueth) in prueth_register_notifiers() argument
1590 prueth->prueth_netdevice_nb.notifier_call = &prueth_netdevice_event; in prueth_register_notifiers()
1591 ret = register_netdevice_notifier(&prueth->prueth_netdevice_nb); in prueth_register_notifiers()
1593 dev_err(prueth->dev, "can't register netdevice notifier\n"); in prueth_register_notifiers()
1597 ret = prueth_switchdev_register_notifiers(prueth); in prueth_register_notifiers()
1599 unregister_netdevice_notifier(&prueth->prueth_netdevice_nb); in prueth_register_notifiers()
1604 static void prueth_unregister_notifiers(struct prueth *prueth) in prueth_unregister_notifiers() argument
1606 prueth_switchdev_unregister_notifiers(prueth); in prueth_unregister_notifiers()
1607 unregister_netdevice_notifier(&prueth->prueth_netdevice_nb); in prueth_unregister_notifiers()
1701 struct prueth *prueth; in prueth_probe() local
1711 prueth = devm_kzalloc(dev, sizeof(*prueth), GFP_KERNEL); in prueth_probe()
1712 if (!prueth) in prueth_probe()
1715 dev_set_drvdata(dev, prueth); in prueth_probe()
1716 prueth->pdev = pdev; in prueth_probe()
1717 prueth->pdata = *(const struct prueth_pdata *)device_get_match_data(dev); in prueth_probe()
1719 prueth->dev = dev; in prueth_probe()
1768 prueth->eth_node[PRUETH_MAC0] = eth0_node; in prueth_probe()
1769 prueth->eth_node[PRUETH_MAC1] = eth1_node; in prueth_probe()
1771 prueth->miig_rt = syscon_regmap_lookup_by_phandle(np, "ti,mii-g-rt"); in prueth_probe()
1772 if (IS_ERR(prueth->miig_rt)) { in prueth_probe()
1777 prueth->mii_rt = syscon_regmap_lookup_by_phandle(np, "ti,mii-rt"); in prueth_probe()
1778 if (IS_ERR(prueth->mii_rt)) { in prueth_probe()
1783 prueth->pa_stats = syscon_regmap_lookup_by_phandle(np, "ti,pa-stats"); in prueth_probe()
1784 if (IS_ERR(prueth->pa_stats)) { in prueth_probe()
1786 prueth->pa_stats = NULL; in prueth_probe()
1790 ret = prueth_get_cores(prueth, ICSS_SLICE0, false); in prueth_probe()
1793 ret = prueth_get_cores(prueth, ICSS_SLICE1, false); in prueth_probe()
1799 prueth->pru[ICSS_SLICE0] : prueth->pru[ICSS_SLICE1]); in prueth_probe()
1806 prueth->pruss = pruss; in prueth_probe()
1809 &prueth->shram); in prueth_probe()
1815 prueth->sram_pool = of_gen_pool_get(np, "sram", 0); in prueth_probe()
1816 if (!prueth->sram_pool) { in prueth_probe()
1823 prueth->is_switchmode_supported = prueth->pdata.switch_mode; in prueth_probe()
1824 if (prueth->pdata.banked_ms_ram) { in prueth_probe()
1829 if (prueth->is_switchmode_supported) in prueth_probe()
1834 prueth->msmcram.va = in prueth_probe()
1835 (void __iomem *)gen_pool_alloc_algo(prueth->sram_pool, in prueth_probe()
1840 if (!prueth->msmcram.va) { in prueth_probe()
1845 prueth->msmcram.pa = gen_pool_virt_to_phys(prueth->sram_pool, in prueth_probe()
1846 (unsigned long)prueth->msmcram.va); in prueth_probe()
1847 prueth->msmcram.size = msmc_ram_size; in prueth_probe()
1848 memset_io(prueth->msmcram.va, 0, msmc_ram_size); in prueth_probe()
1849 dev_dbg(dev, "sram: pa %llx va %p size %zx\n", prueth->msmcram.pa, in prueth_probe()
1850 prueth->msmcram.va, prueth->msmcram.size); in prueth_probe()
1852 prueth->iep0 = icss_iep_get_idx(np, 0); in prueth_probe()
1853 if (IS_ERR(prueth->iep0)) { in prueth_probe()
1854 ret = dev_err_probe(dev, PTR_ERR(prueth->iep0), "iep0 get failed\n"); in prueth_probe()
1855 prueth->iep0 = NULL; in prueth_probe()
1859 prueth->iep1 = icss_iep_get_idx(np, 1); in prueth_probe()
1860 if (IS_ERR(prueth->iep1)) { in prueth_probe()
1861 ret = dev_err_probe(dev, PTR_ERR(prueth->iep1), "iep1 get failed\n"); in prueth_probe()
1865 if (prueth->pdata.quirk_10m_link_issue) { in prueth_probe()
1869 icss_iep_init_fw(prueth->iep1); in prueth_probe()
1873 icssg_read_firmware_names(np, prueth->icssg_emac_firmwares); in prueth_probe()
1876 icssg_mode_firmware_names(dev, prueth->icssg_emac_firmwares, in prueth_probe()
1877 prueth->icssg_switch_firmwares, "eth", "sw"); in prueth_probe()
1878 icssg_mode_firmware_names(dev, prueth->icssg_emac_firmwares, in prueth_probe()
1879 prueth->icssg_hsr_firmwares, "eth", "hsr"); in prueth_probe()
1880 icssg_mode_firmware_names(dev, prueth->icssg_emac_firmwares, in prueth_probe()
1881 prueth->icssg_prp_firmwares, "eth", "prp"); in prueth_probe()
1883 spin_lock_init(&prueth->vtbl_lock); in prueth_probe()
1884 spin_lock_init(&prueth->stats_lock); in prueth_probe()
1887 ret = prueth_netdev_init(prueth, eth0_node); in prueth_probe()
1894 prueth->emac[PRUETH_MAC0]->half_duplex = in prueth_probe()
1897 prueth->emac[PRUETH_MAC0]->iep = prueth->iep0; in prueth_probe()
1901 ret = prueth_netdev_init(prueth, eth1_node); in prueth_probe()
1908 prueth->emac[PRUETH_MAC1]->half_duplex = in prueth_probe()
1911 prueth->emac[PRUETH_MAC1]->iep = prueth->iep0; in prueth_probe()
1916 ret = register_netdev(prueth->emac[PRUETH_MAC0]->ndev); in prueth_probe()
1922 prueth->registered_netdevs[PRUETH_MAC0] = prueth->emac[PRUETH_MAC0]->ndev; in prueth_probe()
1924 ret = emac_phy_connect(prueth->emac[PRUETH_MAC0]); in prueth_probe()
1930 phy_attached_info(prueth->emac[PRUETH_MAC0]->ndev->phydev); in prueth_probe()
1934 ret = register_netdev(prueth->emac[PRUETH_MAC1]->ndev); in prueth_probe()
1940 prueth->registered_netdevs[PRUETH_MAC1] = prueth->emac[PRUETH_MAC1]->ndev; in prueth_probe()
1941 ret = emac_phy_connect(prueth->emac[PRUETH_MAC1]); in prueth_probe()
1947 phy_attached_info(prueth->emac[PRUETH_MAC1]->ndev->phydev); in prueth_probe()
1950 if (prueth->is_switchmode_supported) { in prueth_probe()
1951 ret = prueth_register_notifiers(prueth); in prueth_probe()
1955 sprintf(prueth->switch_id, "%s", dev_name(dev)); in prueth_probe()
1969 if (!prueth->registered_netdevs[i]) in prueth_probe()
1971 if (prueth->emac[i]->ndev->phydev) { in prueth_probe()
1972 phy_disconnect(prueth->emac[i]->ndev->phydev); in prueth_probe()
1973 prueth->emac[i]->ndev->phydev = NULL; in prueth_probe()
1975 unregister_netdev(prueth->registered_netdevs[i]); in prueth_probe()
1980 eth_node = prueth->eth_node[i]; in prueth_probe()
1984 prueth_netdev_exit(prueth, eth_node); in prueth_probe()
1988 if (prueth->pdata.quirk_10m_link_issue) in prueth_probe()
1989 icss_iep_exit_fw(prueth->iep1); in prueth_probe()
1990 icss_iep_put(prueth->iep1); in prueth_probe()
1993 icss_iep_put(prueth->iep0); in prueth_probe()
1994 prueth->iep0 = NULL; in prueth_probe()
1995 prueth->iep1 = NULL; in prueth_probe()
1998 gen_pool_free(prueth->sram_pool, in prueth_probe()
1999 (unsigned long)prueth->msmcram.va, in prueth_probe()
2000 prueth->msmcram.size); in prueth_probe()
2003 pruss_release_mem_region(prueth->pruss, &prueth->shram); in prueth_probe()
2006 pruss_put(prueth->pruss); in prueth_probe()
2010 prueth_put_cores(prueth, ICSS_SLICE0); in prueth_probe()
2013 prueth_put_cores(prueth, ICSS_SLICE1); in prueth_probe()
2022 struct prueth *prueth = platform_get_drvdata(pdev); in prueth_remove() local
2026 prueth_unregister_notifiers(prueth); in prueth_remove()
2029 if (!prueth->registered_netdevs[i]) in prueth_remove()
2031 phy_stop(prueth->emac[i]->ndev->phydev); in prueth_remove()
2032 phy_disconnect(prueth->emac[i]->ndev->phydev); in prueth_remove()
2033 prueth->emac[i]->ndev->phydev = NULL; in prueth_remove()
2034 unregister_netdev(prueth->registered_netdevs[i]); in prueth_remove()
2038 eth_node = prueth->eth_node[i]; in prueth_remove()
2042 prueth_netdev_exit(prueth, eth_node); in prueth_remove()
2045 if (prueth->pdata.quirk_10m_link_issue) in prueth_remove()
2046 icss_iep_exit_fw(prueth->iep1); in prueth_remove()
2048 icss_iep_put(prueth->iep1); in prueth_remove()
2049 icss_iep_put(prueth->iep0); in prueth_remove()
2051 gen_pool_free(prueth->sram_pool, in prueth_remove()
2052 (unsigned long)prueth->msmcram.va, in prueth_remove()
2053 prueth->msmcram.size); in prueth_remove()
2055 pruss_release_mem_region(prueth->pruss, &prueth->shram); in prueth_remove()
2057 pruss_put(prueth->pruss); in prueth_remove()
2059 if (prueth->eth_node[PRUETH_MAC1]) in prueth_remove()
2060 prueth_put_cores(prueth, ICSS_SLICE1); in prueth_remove()
2062 if (prueth->eth_node[PRUETH_MAC0]) in prueth_remove()
2063 prueth_put_cores(prueth, ICSS_SLICE0); in prueth_remove()