| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | 2 | /* |
|---|
| 2 | | - * This file is subject to the terms and conditions of the GNU General Public |
|---|
| 3 | | - * License. See the file "COPYING" in the main directory of this archive |
|---|
| 4 | | - * for more details. |
|---|
| 5 | | - * |
|---|
| 6 | 3 | * Copyright (C) 2011 - 2012 Cavium, Inc. |
|---|
| 7 | 4 | */ |
|---|
| 8 | 5 | |
|---|
| .. | .. |
|---|
| 58 | 55 | u16 mask = be32_to_cpup(paddr++); |
|---|
| 59 | 56 | u16 val_bits = be32_to_cpup(paddr++); |
|---|
| 60 | 57 | int val; |
|---|
| 61 | | - u32 regnum = MII_ADDR_C45 | (devid << 16) | reg; |
|---|
| 58 | + u32 regnum = mdiobus_c45_addr(devid, reg); |
|---|
| 62 | 59 | val = 0; |
|---|
| 63 | 60 | if (mask) { |
|---|
| 64 | 61 | val = phy_read(phydev, regnum); |
|---|
| .. | .. |
|---|
| 84 | 81 | } |
|---|
| 85 | 82 | #endif /* CONFIG_OF_MDIO */ |
|---|
| 86 | 83 | |
|---|
| 84 | +static int bcm87xx_get_features(struct phy_device *phydev) |
|---|
| 85 | +{ |
|---|
| 86 | + linkmode_set_bit(ETHTOOL_LINK_MODE_10000baseR_FEC_BIT, |
|---|
| 87 | + phydev->supported); |
|---|
| 88 | + return 0; |
|---|
| 89 | +} |
|---|
| 90 | + |
|---|
| 87 | 91 | static int bcm87xx_config_init(struct phy_device *phydev) |
|---|
| 88 | 92 | { |
|---|
| 89 | | - phydev->supported = SUPPORTED_10000baseR_FEC; |
|---|
| 90 | | - phydev->advertising = ADVERTISED_10000baseR_FEC; |
|---|
| 91 | | - phydev->state = PHY_NOLINK; |
|---|
| 92 | | - phydev->autoneg = AUTONEG_DISABLE; |
|---|
| 93 | | - |
|---|
| 94 | | - bcm87xx_of_reg_init(phydev); |
|---|
| 95 | | - |
|---|
| 96 | | - return 0; |
|---|
| 93 | + return bcm87xx_of_reg_init(phydev); |
|---|
| 97 | 94 | } |
|---|
| 98 | 95 | |
|---|
| 99 | 96 | static int bcm87xx_config_aneg(struct phy_device *phydev) |
|---|
| .. | .. |
|---|
| 193 | 190 | .phy_id = PHY_ID_BCM8706, |
|---|
| 194 | 191 | .phy_id_mask = 0xffffffff, |
|---|
| 195 | 192 | .name = "Broadcom BCM8706", |
|---|
| 196 | | - .flags = PHY_HAS_INTERRUPT, |
|---|
| 193 | + .get_features = bcm87xx_get_features, |
|---|
| 197 | 194 | .config_init = bcm87xx_config_init, |
|---|
| 198 | 195 | .config_aneg = bcm87xx_config_aneg, |
|---|
| 199 | 196 | .read_status = bcm87xx_read_status, |
|---|
| .. | .. |
|---|
| 205 | 202 | .phy_id = PHY_ID_BCM8727, |
|---|
| 206 | 203 | .phy_id_mask = 0xffffffff, |
|---|
| 207 | 204 | .name = "Broadcom BCM8727", |
|---|
| 208 | | - .flags = PHY_HAS_INTERRUPT, |
|---|
| 205 | + .get_features = bcm87xx_get_features, |
|---|
| 209 | 206 | .config_init = bcm87xx_config_init, |
|---|
| 210 | 207 | .config_aneg = bcm87xx_config_aneg, |
|---|
| 211 | 208 | .read_status = bcm87xx_read_status, |
|---|
| .. | .. |
|---|
| 217 | 214 | |
|---|
| 218 | 215 | module_phy_driver(bcm87xx_driver); |
|---|
| 219 | 216 | |
|---|
| 220 | | -MODULE_LICENSE("GPL"); |
|---|
| 217 | +MODULE_LICENSE("GPL v2"); |
|---|