| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2006-2009 Freescale Semicondutor, Inc. All rights reserved. |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Description: |
|---|
| 8 | 9 | * QE UCC Gigabit Ethernet Driver |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 11 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 12 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 13 | | - * option) any later version. |
|---|
| 14 | 10 | */ |
|---|
| 15 | 11 | |
|---|
| 16 | 12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
|---|
| .. | .. |
|---|
| 30 | 26 | #include <linux/dma-mapping.h> |
|---|
| 31 | 27 | #include <linux/mii.h> |
|---|
| 32 | 28 | #include <linux/phy.h> |
|---|
| 29 | +#include <linux/phy_fixed.h> |
|---|
| 33 | 30 | #include <linux/workqueue.h> |
|---|
| 34 | 31 | #include <linux/of_address.h> |
|---|
| 35 | 32 | #include <linux/of_irq.h> |
|---|
| .. | .. |
|---|
| 45 | 42 | #include <soc/fsl/qe/ucc.h> |
|---|
| 46 | 43 | #include <soc/fsl/qe/ucc_fast.h> |
|---|
| 47 | 44 | #include <asm/machdep.h> |
|---|
| 48 | | -#include <net/sch_generic.h> |
|---|
| 49 | 45 | |
|---|
| 50 | 46 | #include "ucc_geth.h" |
|---|
| 51 | 47 | |
|---|
| .. | .. |
|---|
| 1352 | 1348 | switch (ugeth->max_speed) { |
|---|
| 1353 | 1349 | case SPEED_10: |
|---|
| 1354 | 1350 | upsmr |= UCC_GETH_UPSMR_R10M; |
|---|
| 1355 | | - /* FALLTHROUGH */ |
|---|
| 1351 | + fallthrough; |
|---|
| 1356 | 1352 | case SPEED_100: |
|---|
| 1357 | 1353 | if (ugeth->phy_interface != PHY_INTERFACE_MODE_RTBI) |
|---|
| 1358 | 1354 | upsmr |= UCC_GETH_UPSMR_RMM; |
|---|
| .. | .. |
|---|
| 1362 | 1358 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { |
|---|
| 1363 | 1359 | upsmr |= UCC_GETH_UPSMR_TBIM; |
|---|
| 1364 | 1360 | } |
|---|
| 1365 | | - if ((ugeth->phy_interface == PHY_INTERFACE_MODE_SGMII)) |
|---|
| 1361 | + if (ugeth->phy_interface == PHY_INTERFACE_MODE_SGMII) |
|---|
| 1366 | 1362 | upsmr |= UCC_GETH_UPSMR_SGMM; |
|---|
| 1367 | 1363 | |
|---|
| 1368 | 1364 | out_be32(&uf_regs->upsmr, upsmr); |
|---|
| .. | .. |
|---|
| 1743 | 1739 | if (priv->phy_interface == PHY_INTERFACE_MODE_SGMII) |
|---|
| 1744 | 1740 | uec_configure_serdes(dev); |
|---|
| 1745 | 1741 | |
|---|
| 1746 | | - phydev->supported &= (SUPPORTED_MII | |
|---|
| 1747 | | - SUPPORTED_Autoneg | |
|---|
| 1748 | | - ADVERTISED_10baseT_Half | |
|---|
| 1749 | | - ADVERTISED_10baseT_Full | |
|---|
| 1750 | | - ADVERTISED_100baseT_Half | |
|---|
| 1751 | | - ADVERTISED_100baseT_Full); |
|---|
| 1752 | | - |
|---|
| 1753 | | - if (priv->max_speed == SPEED_1000) |
|---|
| 1754 | | - phydev->supported |= ADVERTISED_1000baseT_Full; |
|---|
| 1755 | | - |
|---|
| 1756 | | - phydev->advertising = phydev->supported; |
|---|
| 1742 | + phy_set_max_speed(phydev, priv->max_speed); |
|---|
| 1757 | 1743 | |
|---|
| 1758 | 1744 | priv->phydev = phydev; |
|---|
| 1759 | 1745 | |
|---|
| .. | .. |
|---|
| 3559 | 3545 | * ucc_geth_timeout gets called when a packet has not been |
|---|
| 3560 | 3546 | * transmitted after a set amount of time. |
|---|
| 3561 | 3547 | */ |
|---|
| 3562 | | -static void ucc_geth_timeout(struct net_device *dev) |
|---|
| 3548 | +static void ucc_geth_timeout(struct net_device *dev, unsigned int txqueue) |
|---|
| 3563 | 3549 | { |
|---|
| 3564 | 3550 | struct ucc_geth_private *ugeth = netdev_priv(dev); |
|---|
| 3565 | 3551 | |
|---|
| .. | .. |
|---|
| 3689 | 3675 | .ndo_stop = ucc_geth_close, |
|---|
| 3690 | 3676 | .ndo_start_xmit = ucc_geth_start_xmit, |
|---|
| 3691 | 3677 | .ndo_validate_addr = eth_validate_addr, |
|---|
| 3678 | + .ndo_change_carrier = fixed_phy_change_carrier, |
|---|
| 3692 | 3679 | .ndo_set_mac_address = ucc_geth_set_mac_addr, |
|---|
| 3693 | 3680 | .ndo_set_rx_mode = ucc_geth_set_multi, |
|---|
| 3694 | 3681 | .ndo_tx_timeout = ucc_geth_timeout, |
|---|
| .. | .. |
|---|
| 3920 | 3907 | } |
|---|
| 3921 | 3908 | |
|---|
| 3922 | 3909 | mac_addr = of_get_mac_address(np); |
|---|
| 3923 | | - if (mac_addr) |
|---|
| 3924 | | - memcpy(dev->dev_addr, mac_addr, ETH_ALEN); |
|---|
| 3910 | + if (!IS_ERR(mac_addr)) |
|---|
| 3911 | + ether_addr_copy(dev->dev_addr, mac_addr); |
|---|
| 3925 | 3912 | |
|---|
| 3926 | 3913 | ugeth->ug_info = ug_info; |
|---|
| 3927 | 3914 | ugeth->dev = device; |
|---|
| .. | .. |
|---|
| 4004 | 3991 | |
|---|
| 4005 | 3992 | MODULE_AUTHOR("Freescale Semiconductor, Inc"); |
|---|
| 4006 | 3993 | MODULE_DESCRIPTION(DRV_DESC); |
|---|
| 4007 | | -MODULE_VERSION(DRV_VERSION); |
|---|
| 4008 | 3994 | MODULE_LICENSE("GPL"); |
|---|