Lines Matching +full:route +full:- +full:avcp

1 // SPDX-License-Identifier: GPL-2.0-only
5 Copyright (C) 2007-2011 STMicroelectronics Ltd
26 * dwmac1000_validate_mcast_bins - validates the number of Multicast filter bins
57 * dwmac1000_validate_ucast_entries - validate the Unicast address entries
88 * stmmac_axi_setup - parse DT parameters for programming the AXI register
91 * if required, from device-tree the AXI internal register can be tuned
99 np = of_parse_phandle(pdev->dev.of_node, "snps,axi-config", 0); in stmmac_axi_setup()
103 axi = devm_kzalloc(&pdev->dev, sizeof(*axi), GFP_KERNEL); in stmmac_axi_setup()
106 return ERR_PTR(-ENOMEM); in stmmac_axi_setup()
109 axi->axi_lpi_en = of_property_read_bool(np, "snps,lpi_en"); in stmmac_axi_setup()
110 axi->axi_xit_frm = of_property_read_bool(np, "snps,xit_frm"); in stmmac_axi_setup()
111 axi->axi_kbbe = of_property_read_bool(np, "snps,kbbe"); in stmmac_axi_setup()
112 axi->axi_fb = of_property_read_bool(np, "snps,fb"); in stmmac_axi_setup()
113 axi->axi_mb = of_property_read_bool(np, "snps,mb"); in stmmac_axi_setup()
114 axi->axi_rb = of_property_read_bool(np, "snps,rb"); in stmmac_axi_setup()
116 if (of_property_read_u32(np, "snps,wr_osr_lmt", &axi->axi_wr_osr_lmt)) in stmmac_axi_setup()
117 axi->axi_wr_osr_lmt = 1; in stmmac_axi_setup()
118 if (of_property_read_u32(np, "snps,rd_osr_lmt", &axi->axi_rd_osr_lmt)) in stmmac_axi_setup()
119 axi->axi_rd_osr_lmt = 1; in stmmac_axi_setup()
120 of_property_read_u32_array(np, "snps,blen", axi->axi_blen, AXI_BLEN); in stmmac_axi_setup()
127 * stmmac_mtl_setup - parse DT parameters for multiple queues configuration
140 /* For backwards-compatibility with device trees that don't have any in stmmac_mtl_setup()
141 * snps,mtl-rx-config or snps,mtl-tx-config properties, we fall back in stmmac_mtl_setup()
144 plat->rx_queues_to_use = 1; in stmmac_mtl_setup()
145 plat->tx_queues_to_use = 1; in stmmac_mtl_setup()
151 plat->rx_queues_cfg[0].mode_to_use = MTL_QUEUE_DCB; in stmmac_mtl_setup()
152 plat->tx_queues_cfg[0].mode_to_use = MTL_QUEUE_DCB; in stmmac_mtl_setup()
154 rx_node = of_parse_phandle(pdev->dev.of_node, "snps,mtl-rx-config", 0); in stmmac_mtl_setup()
158 tx_node = of_parse_phandle(pdev->dev.of_node, "snps,mtl-tx-config", 0); in stmmac_mtl_setup()
165 if (of_property_read_u32(rx_node, "snps,rx-queues-to-use", in stmmac_mtl_setup()
166 &plat->rx_queues_to_use)) in stmmac_mtl_setup()
167 plat->rx_queues_to_use = 1; in stmmac_mtl_setup()
169 if (of_property_read_bool(rx_node, "snps,rx-sched-sp")) in stmmac_mtl_setup()
170 plat->rx_sched_algorithm = MTL_RX_ALGORITHM_SP; in stmmac_mtl_setup()
171 else if (of_property_read_bool(rx_node, "snps,rx-sched-wsp")) in stmmac_mtl_setup()
172 plat->rx_sched_algorithm = MTL_RX_ALGORITHM_WSP; in stmmac_mtl_setup()
174 plat->rx_sched_algorithm = MTL_RX_ALGORITHM_SP; in stmmac_mtl_setup()
178 if (queue >= plat->rx_queues_to_use) in stmmac_mtl_setup()
181 if (of_property_read_bool(q_node, "snps,dcb-algorithm")) in stmmac_mtl_setup()
182 plat->rx_queues_cfg[queue].mode_to_use = MTL_QUEUE_DCB; in stmmac_mtl_setup()
183 else if (of_property_read_bool(q_node, "snps,avb-algorithm")) in stmmac_mtl_setup()
184 plat->rx_queues_cfg[queue].mode_to_use = MTL_QUEUE_AVB; in stmmac_mtl_setup()
186 plat->rx_queues_cfg[queue].mode_to_use = MTL_QUEUE_DCB; in stmmac_mtl_setup()
188 if (of_property_read_u32(q_node, "snps,map-to-dma-channel", in stmmac_mtl_setup()
189 &plat->rx_queues_cfg[queue].chan)) in stmmac_mtl_setup()
190 plat->rx_queues_cfg[queue].chan = queue; in stmmac_mtl_setup()
194 &plat->rx_queues_cfg[queue].prio)) { in stmmac_mtl_setup()
195 plat->rx_queues_cfg[queue].prio = 0; in stmmac_mtl_setup()
196 plat->rx_queues_cfg[queue].use_prio = false; in stmmac_mtl_setup()
198 plat->rx_queues_cfg[queue].use_prio = true; in stmmac_mtl_setup()
202 if (of_property_read_bool(q_node, "snps,route-avcp")) in stmmac_mtl_setup()
203 plat->rx_queues_cfg[queue].pkt_route = PACKET_AVCPQ; in stmmac_mtl_setup()
204 else if (of_property_read_bool(q_node, "snps,route-ptp")) in stmmac_mtl_setup()
205 plat->rx_queues_cfg[queue].pkt_route = PACKET_PTPQ; in stmmac_mtl_setup()
206 else if (of_property_read_bool(q_node, "snps,route-dcbcp")) in stmmac_mtl_setup()
207 plat->rx_queues_cfg[queue].pkt_route = PACKET_DCBCPQ; in stmmac_mtl_setup()
208 else if (of_property_read_bool(q_node, "snps,route-up")) in stmmac_mtl_setup()
209 plat->rx_queues_cfg[queue].pkt_route = PACKET_UPQ; in stmmac_mtl_setup()
210 else if (of_property_read_bool(q_node, "snps,route-multi-broad")) in stmmac_mtl_setup()
211 plat->rx_queues_cfg[queue].pkt_route = PACKET_MCBCQ; in stmmac_mtl_setup()
213 plat->rx_queues_cfg[queue].pkt_route = 0x0; in stmmac_mtl_setup()
217 if (queue != plat->rx_queues_to_use) { in stmmac_mtl_setup()
218 ret = -EINVAL; in stmmac_mtl_setup()
219 dev_err(&pdev->dev, "Not all RX queues were configured\n"); in stmmac_mtl_setup()
224 if (of_property_read_u32(tx_node, "snps,tx-queues-to-use", in stmmac_mtl_setup()
225 &plat->tx_queues_to_use)) in stmmac_mtl_setup()
226 plat->tx_queues_to_use = 1; in stmmac_mtl_setup()
228 if (of_property_read_bool(tx_node, "snps,tx-sched-wrr")) in stmmac_mtl_setup()
229 plat->tx_sched_algorithm = MTL_TX_ALGORITHM_WRR; in stmmac_mtl_setup()
230 else if (of_property_read_bool(tx_node, "snps,tx-sched-wfq")) in stmmac_mtl_setup()
231 plat->tx_sched_algorithm = MTL_TX_ALGORITHM_WFQ; in stmmac_mtl_setup()
232 else if (of_property_read_bool(tx_node, "snps,tx-sched-dwrr")) in stmmac_mtl_setup()
233 plat->tx_sched_algorithm = MTL_TX_ALGORITHM_DWRR; in stmmac_mtl_setup()
235 plat->tx_sched_algorithm = MTL_TX_ALGORITHM_SP; in stmmac_mtl_setup()
241 if (queue >= plat->tx_queues_to_use) in stmmac_mtl_setup()
245 &plat->tx_queues_cfg[queue].weight)) in stmmac_mtl_setup()
246 plat->tx_queues_cfg[queue].weight = 0x10 + queue; in stmmac_mtl_setup()
248 if (of_property_read_bool(q_node, "snps,dcb-algorithm")) { in stmmac_mtl_setup()
249 plat->tx_queues_cfg[queue].mode_to_use = MTL_QUEUE_DCB; in stmmac_mtl_setup()
251 "snps,avb-algorithm")) { in stmmac_mtl_setup()
252 plat->tx_queues_cfg[queue].mode_to_use = MTL_QUEUE_AVB; in stmmac_mtl_setup()
256 &plat->tx_queues_cfg[queue].send_slope)) in stmmac_mtl_setup()
257 plat->tx_queues_cfg[queue].send_slope = 0x0; in stmmac_mtl_setup()
259 &plat->tx_queues_cfg[queue].idle_slope)) in stmmac_mtl_setup()
260 plat->tx_queues_cfg[queue].idle_slope = 0x0; in stmmac_mtl_setup()
262 &plat->tx_queues_cfg[queue].high_credit)) in stmmac_mtl_setup()
263 plat->tx_queues_cfg[queue].high_credit = 0x0; in stmmac_mtl_setup()
265 &plat->tx_queues_cfg[queue].low_credit)) in stmmac_mtl_setup()
266 plat->tx_queues_cfg[queue].low_credit = 0x0; in stmmac_mtl_setup()
268 plat->tx_queues_cfg[queue].mode_to_use = MTL_QUEUE_DCB; in stmmac_mtl_setup()
272 &plat->tx_queues_cfg[queue].prio)) { in stmmac_mtl_setup()
273 plat->tx_queues_cfg[queue].prio = 0; in stmmac_mtl_setup()
274 plat->tx_queues_cfg[queue].use_prio = false; in stmmac_mtl_setup()
276 plat->tx_queues_cfg[queue].use_prio = true; in stmmac_mtl_setup()
279 plat->tx_queues_cfg[queue].coe_unsupported = in stmmac_mtl_setup()
280 of_property_read_bool(q_node, "snps,coe-unsupported"); in stmmac_mtl_setup()
284 if (queue != plat->tx_queues_to_use) { in stmmac_mtl_setup()
285 ret = -EINVAL; in stmmac_mtl_setup()
286 dev_err(&pdev->dev, "Not all TX queues were configured\n"); in stmmac_mtl_setup()
299 * stmmac_of_get_mdio() - Gets the MDIO bus from the devicetree.
303 * 1. The compatible is "snps,dwc-qos-ethernet-4.10" && a "mdio" named
305 * 2. A child node with the "snps,dwmac-mdio" compatible is present
312 { .compatible = "snps,dwc-qos-ethernet-4.10" }, in stmmac_of_get_mdio()
321 * If snps,dwmac-mdio is passed from DT, always register in stmmac_of_get_mdio()
326 "snps,dwmac-mdio")) in stmmac_of_get_mdio()
335 * stmmac_mdio_setup() - Populate platform related MDIO structures.
341 * If an MDIO node is found, it's assigned to plat->mdio_node and
342 * plat->mdio_bus_data is allocated.
343 * If no connection can be determined, just plat->mdio_bus_data is allocated
347 * This expects that plat->phy_node has already been searched for.
356 plat->mdio_node = stmmac_of_get_mdio(np); in stmmac_mdio_setup()
357 if (plat->mdio_node) in stmmac_mdio_setup()
361 * the bus to be scanned for devices. If there's no phy or fixed-link in stmmac_mdio_setup()
365 legacy_mdio = !of_phy_is_fixed_link(np) && !plat->phy_node; in stmmac_mdio_setup()
369 if (plat->mdio_node || legacy_mdio) { in stmmac_mdio_setup()
370 plat->mdio_bus_data = devm_kzalloc(dev, in stmmac_mdio_setup()
371 sizeof(*plat->mdio_bus_data), in stmmac_mdio_setup()
373 if (!plat->mdio_bus_data) in stmmac_mdio_setup()
374 return -ENOMEM; in stmmac_mdio_setup()
376 plat->mdio_bus_data->needs_reset = true; in stmmac_mdio_setup()
383 * stmmac_of_get_mac_mode - retrieves the interface of the MAC
384 * @np: - device-tree node
387 * the device-tree) the interface mode on the MAC side. This assumes
388 * that there is mode converter in-between the MAC & PHY
389 * (e.g. GMII-to-RGMII).
396 err = of_property_read_string(np, "mac-mode", &pm); in stmmac_of_get_mac_mode()
405 return -ENODEV; in stmmac_of_get_mac_mode()
409 * stmmac_remove_config_dt - undo the effects of stmmac_probe_config_dt()
418 clk_disable_unprepare(plat->stmmac_clk); in stmmac_remove_config_dt()
419 clk_disable_unprepare(plat->pclk); in stmmac_remove_config_dt()
420 of_node_put(plat->phy_node); in stmmac_remove_config_dt()
421 of_node_put(plat->mdio_node); in stmmac_remove_config_dt()
425 * stmmac_probe_config_dt - parse device-tree driver parameters
429 * this function is to read the driver parameters from device-tree and
435 struct device_node *np = pdev->dev.of_node; in stmmac_probe_config_dt()
442 plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL); in stmmac_probe_config_dt()
444 return ERR_PTR(-ENOMEM); in stmmac_probe_config_dt()
448 if (rc == -EPROBE_DEFER) in stmmac_probe_config_dt()
454 phy_mode = device_get_phy_mode(&pdev->dev); in stmmac_probe_config_dt()
458 plat->phy_interface = phy_mode; in stmmac_probe_config_dt()
460 plat->mac_interface = rc < 0 ? plat->phy_interface : rc; in stmmac_probe_config_dt()
464 plat->phy_node = of_parse_phandle(np, "phy-handle", 0); in stmmac_probe_config_dt()
466 /* PHYLINK automatically parses the phy-handle property */ in stmmac_probe_config_dt()
467 plat->port_node = of_fwnode_handle(np); in stmmac_probe_config_dt()
470 of_property_read_u32(np, "max-speed", &plat->max_speed); in stmmac_probe_config_dt()
472 plat->bus_id = of_alias_get_id(np, "ethernet"); in stmmac_probe_config_dt()
473 if (plat->bus_id < 0) in stmmac_probe_config_dt()
474 plat->bus_id = 0; in stmmac_probe_config_dt()
476 /* Default to phy auto-detection */ in stmmac_probe_config_dt()
477 plat->phy_addr = -1; in stmmac_probe_config_dt()
482 plat->clk_csr = -1; in stmmac_probe_config_dt()
483 if (of_property_read_u32(np, "snps,clk-csr", &plat->clk_csr)) in stmmac_probe_config_dt()
484 of_property_read_u32(np, "clk_csr", &plat->clk_csr); in stmmac_probe_config_dt()
486 /* "snps,phy-addr" is not a standard property. Mark it as deprecated in stmmac_probe_config_dt()
489 if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0) in stmmac_probe_config_dt()
490 dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n"); in stmmac_probe_config_dt()
492 rc = stmmac_mdio_setup(plat, np, &pdev->dev); in stmmac_probe_config_dt()
496 of_property_read_u32(np, "tx-fifo-depth", &plat->tx_fifo_size); in stmmac_probe_config_dt()
498 of_property_read_u32(np, "rx-fifo-depth", &plat->rx_fifo_size); in stmmac_probe_config_dt()
500 plat->force_sf_dma_mode = in stmmac_probe_config_dt()
503 if (of_property_read_bool(np, "snps,en-tx-lpi-clockgating")) in stmmac_probe_config_dt()
504 plat->flags |= STMMAC_FLAG_EN_TX_LPI_CLOCKGATING; in stmmac_probe_config_dt()
509 plat->maxmtu = JUMBO_LEN; in stmmac_probe_config_dt()
512 plat->multicast_filter_bins = HASH_TABLE_SIZE; in stmmac_probe_config_dt()
515 plat->unicast_filter_entries = 1; in stmmac_probe_config_dt()
522 if (of_device_is_compatible(np, "st,spear600-gmac") || in stmmac_probe_config_dt()
523 of_device_is_compatible(np, "snps,dwmac-3.50a") || in stmmac_probe_config_dt()
524 of_device_is_compatible(np, "snps,dwmac-3.70a") || in stmmac_probe_config_dt()
526 /* Note that the max-frame-size parameter as defined in the in stmmac_probe_config_dt()
527 * ePAPR v1.1 spec is defined as max-frame-size, it's in stmmac_probe_config_dt()
530 * the definition is max-frame-size, but usage examples in stmmac_probe_config_dt()
533 of_property_read_u32(np, "max-frame-size", &plat->maxmtu); in stmmac_probe_config_dt()
534 of_property_read_u32(np, "snps,multicast-filter-bins", in stmmac_probe_config_dt()
535 &plat->multicast_filter_bins); in stmmac_probe_config_dt()
536 of_property_read_u32(np, "snps,perfect-filter-entries", in stmmac_probe_config_dt()
537 &plat->unicast_filter_entries); in stmmac_probe_config_dt()
538 plat->unicast_filter_entries = dwmac1000_validate_ucast_entries( in stmmac_probe_config_dt()
539 &pdev->dev, plat->unicast_filter_entries); in stmmac_probe_config_dt()
540 plat->multicast_filter_bins = dwmac1000_validate_mcast_bins( in stmmac_probe_config_dt()
541 &pdev->dev, plat->multicast_filter_bins); in stmmac_probe_config_dt()
542 plat->has_gmac = 1; in stmmac_probe_config_dt()
543 plat->pmt = 1; in stmmac_probe_config_dt()
546 if (of_device_is_compatible(np, "snps,dwmac-3.40a")) { in stmmac_probe_config_dt()
547 plat->has_gmac = 1; in stmmac_probe_config_dt()
548 plat->enh_desc = 1; in stmmac_probe_config_dt()
549 plat->tx_coe = 1; in stmmac_probe_config_dt()
550 plat->bugged_jumbo = 1; in stmmac_probe_config_dt()
551 plat->pmt = 1; in stmmac_probe_config_dt()
554 if (of_device_is_compatible(np, "snps,dwmac-4.00") || in stmmac_probe_config_dt()
555 of_device_is_compatible(np, "snps,dwmac-4.10a") || in stmmac_probe_config_dt()
556 of_device_is_compatible(np, "snps,dwmac-4.20a") || in stmmac_probe_config_dt()
557 of_device_is_compatible(np, "snps,dwmac-5.10a") || in stmmac_probe_config_dt()
558 of_device_is_compatible(np, "snps,dwmac-5.20")) { in stmmac_probe_config_dt()
559 plat->has_gmac4 = 1; in stmmac_probe_config_dt()
560 plat->has_gmac = 0; in stmmac_probe_config_dt()
561 plat->pmt = 1; in stmmac_probe_config_dt()
563 plat->flags |= STMMAC_FLAG_TSO_EN; in stmmac_probe_config_dt()
566 if (of_device_is_compatible(np, "snps,dwmac-3.610") || in stmmac_probe_config_dt()
567 of_device_is_compatible(np, "snps,dwmac-3.710")) { in stmmac_probe_config_dt()
568 plat->enh_desc = 1; in stmmac_probe_config_dt()
569 plat->bugged_jumbo = 1; in stmmac_probe_config_dt()
570 plat->force_sf_dma_mode = 1; in stmmac_probe_config_dt()
574 plat->has_xgmac = 1; in stmmac_probe_config_dt()
575 plat->pmt = 1; in stmmac_probe_config_dt()
577 plat->flags |= STMMAC_FLAG_TSO_EN; in stmmac_probe_config_dt()
580 dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg), in stmmac_probe_config_dt()
584 return ERR_PTR(-ENOMEM); in stmmac_probe_config_dt()
586 plat->dma_cfg = dma_cfg; in stmmac_probe_config_dt()
588 of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl); in stmmac_probe_config_dt()
589 if (!dma_cfg->pbl) in stmmac_probe_config_dt()
590 dma_cfg->pbl = DEFAULT_DMA_PBL; in stmmac_probe_config_dt()
591 of_property_read_u32(np, "snps,txpbl", &dma_cfg->txpbl); in stmmac_probe_config_dt()
592 of_property_read_u32(np, "snps,rxpbl", &dma_cfg->rxpbl); in stmmac_probe_config_dt()
593 dma_cfg->pblx8 = !of_property_read_bool(np, "snps,no-pbl-x8"); in stmmac_probe_config_dt()
595 dma_cfg->aal = of_property_read_bool(np, "snps,aal"); in stmmac_probe_config_dt()
596 dma_cfg->fixed_burst = of_property_read_bool(np, "snps,fixed-burst"); in stmmac_probe_config_dt()
597 dma_cfg->mixed_burst = of_property_read_bool(np, "snps,mixed-burst"); in stmmac_probe_config_dt()
599 plat->force_thresh_dma_mode = of_property_read_bool(np, "snps,force_thresh_dma_mode"); in stmmac_probe_config_dt()
600 if (plat->force_thresh_dma_mode && plat->force_sf_dma_mode) { in stmmac_probe_config_dt()
601 plat->force_sf_dma_mode = 0; in stmmac_probe_config_dt()
602 dev_warn(&pdev->dev, in stmmac_probe_config_dt()
606 of_property_read_u32(np, "snps,ps-speed", &plat->mac_port_sel_speed); in stmmac_probe_config_dt()
608 plat->axi = stmmac_axi_setup(pdev); in stmmac_probe_config_dt()
617 if (!of_device_is_compatible(np, "snps,dwc-qos-ethernet-4.10")) { in stmmac_probe_config_dt()
618 plat->stmmac_clk = devm_clk_get(&pdev->dev, in stmmac_probe_config_dt()
620 if (IS_ERR(plat->stmmac_clk)) { in stmmac_probe_config_dt()
621 dev_warn(&pdev->dev, "Cannot get CSR clock\n"); in stmmac_probe_config_dt()
622 plat->stmmac_clk = NULL; in stmmac_probe_config_dt()
624 clk_prepare_enable(plat->stmmac_clk); in stmmac_probe_config_dt()
627 plat->pclk = devm_clk_get_optional(&pdev->dev, "pclk"); in stmmac_probe_config_dt()
628 if (IS_ERR(plat->pclk)) { in stmmac_probe_config_dt()
629 ret = plat->pclk; in stmmac_probe_config_dt()
632 clk_prepare_enable(plat->pclk); in stmmac_probe_config_dt()
634 /* Fall-back to main clock in case of no PTP ref is passed */ in stmmac_probe_config_dt()
635 plat->clk_ptp_ref = devm_clk_get(&pdev->dev, "ptp_ref"); in stmmac_probe_config_dt()
636 if (IS_ERR(plat->clk_ptp_ref)) { in stmmac_probe_config_dt()
637 plat->clk_ptp_rate = clk_get_rate(plat->stmmac_clk); in stmmac_probe_config_dt()
638 plat->clk_ptp_ref = NULL; in stmmac_probe_config_dt()
639 dev_info(&pdev->dev, "PTP uses main clock\n"); in stmmac_probe_config_dt()
641 plat->clk_ptp_rate = clk_get_rate(plat->clk_ptp_ref); in stmmac_probe_config_dt()
642 dev_dbg(&pdev->dev, "PTP rate %d\n", plat->clk_ptp_rate); in stmmac_probe_config_dt()
645 plat->stmmac_rst = devm_reset_control_get_optional(&pdev->dev, in stmmac_probe_config_dt()
647 if (IS_ERR(plat->stmmac_rst)) { in stmmac_probe_config_dt()
648 ret = plat->stmmac_rst; in stmmac_probe_config_dt()
652 plat->stmmac_ahb_rst = devm_reset_control_get_optional_shared( in stmmac_probe_config_dt()
653 &pdev->dev, "ahb"); in stmmac_probe_config_dt()
654 if (IS_ERR(plat->stmmac_ahb_rst)) { in stmmac_probe_config_dt()
655 ret = plat->stmmac_ahb_rst; in stmmac_probe_config_dt()
662 clk_disable_unprepare(plat->pclk); in stmmac_probe_config_dt()
664 clk_disable_unprepare(plat->stmmac_clk); in stmmac_probe_config_dt()
694 ret = devm_add_action_or_reset(&pdev->dev, in devm_stmmac_probe_config_dt()
705 return ERR_PTR(-EINVAL); in devm_stmmac_probe_config_dt()
718 stmmac_res->irq = platform_get_irq_byname(pdev, "macirq"); in stmmac_get_platform_resources()
719 if (stmmac_res->irq < 0) in stmmac_get_platform_resources()
720 return stmmac_res->irq; in stmmac_get_platform_resources()
727 * so the driver will continue to use the mac irq (ndev->irq) in stmmac_get_platform_resources()
729 stmmac_res->wol_irq = in stmmac_get_platform_resources()
731 if (stmmac_res->wol_irq < 0) { in stmmac_get_platform_resources()
732 if (stmmac_res->wol_irq == -EPROBE_DEFER) in stmmac_get_platform_resources()
733 return -EPROBE_DEFER; in stmmac_get_platform_resources()
734 dev_info(&pdev->dev, "IRQ eth_wake_irq not found\n"); in stmmac_get_platform_resources()
735 stmmac_res->wol_irq = stmmac_res->irq; in stmmac_get_platform_resources()
738 stmmac_res->lpi_irq = in stmmac_get_platform_resources()
740 if (stmmac_res->lpi_irq < 0) { in stmmac_get_platform_resources()
741 if (stmmac_res->lpi_irq == -EPROBE_DEFER) in stmmac_get_platform_resources()
742 return -EPROBE_DEFER; in stmmac_get_platform_resources()
743 dev_info(&pdev->dev, "IRQ eth_lpi not found\n"); in stmmac_get_platform_resources()
746 stmmac_res->sfty_irq = in stmmac_get_platform_resources()
748 if (stmmac_res->sfty_irq < 0) { in stmmac_get_platform_resources()
749 if (stmmac_res->sfty_irq == -EPROBE_DEFER) in stmmac_get_platform_resources()
750 return -EPROBE_DEFER; in stmmac_get_platform_resources()
751 dev_info(&pdev->dev, "IRQ sfty not found\n"); in stmmac_get_platform_resources()
754 stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0); in stmmac_get_platform_resources()
756 return PTR_ERR_OR_ZERO(stmmac_res->addr); in stmmac_get_platform_resources()
772 if (plat->init) in stmmac_pltfr_init()
773 ret = plat->init(pdev, plat->bsp_priv); in stmmac_pltfr_init()
787 if (plat->exit) in stmmac_pltfr_exit()
788 plat->exit(pdev, plat->bsp_priv); in stmmac_pltfr_exit()
809 ret = stmmac_dvr_probe(&pdev->dev, plat, res); in stmmac_pltfr_probe()
844 return devm_add_action_or_reset(&pdev->dev, devm_stmmac_pltfr_remove, in devm_stmmac_pltfr_probe()
859 struct plat_stmmacenet_data *plat = priv->plat; in stmmac_pltfr_remove()
861 stmmac_dvr_remove(&pdev->dev); in stmmac_pltfr_remove()
881 stmmac_pltfr_exit(pdev, priv->plat); in stmmac_pltfr_suspend()
900 ret = stmmac_pltfr_init(pdev, priv->plat); in stmmac_pltfr_resume()
934 if (!device_may_wakeup(priv->device) || !priv->plat->pmt) { in stmmac_pltfr_noirq_suspend()
936 clk_disable_unprepare(priv->plat->clk_ptp_ref); in stmmac_pltfr_noirq_suspend()
955 if (!device_may_wakeup(priv->device) || !priv->plat->pmt) { in stmmac_pltfr_noirq_resume()
961 ret = clk_prepare_enable(priv->plat->clk_ptp_ref); in stmmac_pltfr_noirq_resume()
963 netdev_warn(priv->dev, in stmmac_pltfr_noirq_resume()