summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-15 12:00:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-15 12:00:47 -0400
commit6c373ca89399c5a3f7ef210ad8f63dc3437da345 (patch)
tree74d1ec65087df1da1021b43ac51acc1ee8601809 /drivers/net/phy
parentbb0fd7ab0986105765d11baa82e619c618a235aa (diff)
parent9f9151412dd7aae0e3f51a89ae4a1f8755fdb4d0 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: 1) Add BQL support to via-rhine, from Tino Reichardt. 2) Integrate SWITCHDEV layer support into the DSA layer, so DSA drivers can support hw switch offloading. From Floria Fainelli. 3) Allow 'ip address' commands to initiate multicast group join/leave, from Madhu Challa. 4) Many ipv4 FIB lookup optimizations from Alexander Duyck. 5) Support EBPF in cls_bpf classifier and act_bpf action, from Daniel Borkmann. 6) Remove the ugly compat support in ARP for ugly layers like ax25, rose, etc. And use this to clean up the neigh layer, then use it to implement MPLS support. All from Eric Biederman. 7) Support L3 forwarding offloading in switches, from Scott Feldman. 8) Collapse the LOCAL and MAIN ipv4 FIB tables when possible, to speed up route lookups even further. From Alexander Duyck. 9) Many improvements and bug fixes to the rhashtable implementation, from Herbert Xu and Thomas Graf. In particular, in the case where an rhashtable user bulk adds a large number of items into an empty table, we expand the table much more sanely. 10) Don't make the tcp_metrics hash table per-namespace, from Eric Biederman. 11) Extend EBPF to access SKB fields, from Alexei Starovoitov. 12) Split out new connection request sockets so that they can be established in the main hash table. Much less false sharing since hash lookups go direct to the request sockets instead of having to go first to the listener then to the request socks hashed underneath. From Eric Dumazet. 13) Add async I/O support for crytpo AF_ALG sockets, from Tadeusz Struk. 14) Support stable privacy address generation for RFC7217 in IPV6. From Hannes Frederic Sowa. 15) Hash network namespace into IP frag IDs, also from Hannes Frederic Sowa. 16) Convert PTP get/set methods to use 64-bit time, from Richard Cochran. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1816 commits) fm10k: Bump driver version to 0.15.2 fm10k: corrected VF multicast update fm10k: mbx_update_max_size does not drop all oversized messages fm10k: reset head instead of calling update_max_size fm10k: renamed mbx_tx_dropped to mbx_tx_oversized fm10k: update xcast mode before synchronizing multicast addresses fm10k: start service timer on probe fm10k: fix function header comment fm10k: comment next_vf_mbx flow fm10k: don't handle mailbox events in iov_event path and always process mailbox fm10k: use separate workqueue for fm10k driver fm10k: Set PF queues to unlimited bandwidth during virtualization fm10k: expose tx_timeout_count as an ethtool stat fm10k: only increment tx_timeout_count in Tx hang path fm10k: remove extraneous "Reset interface" message fm10k: separate PF only stats so that VF does not display them fm10k: use hw->mac.max_queues for stats fm10k: only show actual queues, not the maximum in hardware fm10k: allow creation of VLAN on default vid fm10k: fix unused warnings ...
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/Kconfig4
-rw-r--r--drivers/net/phy/amd-xgbe-phy.c98
-rw-r--r--drivers/net/phy/at803x.c11
-rw-r--r--drivers/net/phy/bcm7xxx.c1
-rw-r--r--drivers/net/phy/broadcom.c14
-rw-r--r--drivers/net/phy/dp83640.c19
-rw-r--r--drivers/net/phy/fixed_phy.c29
-rw-r--r--drivers/net/phy/mdio-bcm-unimac.c2
-rw-r--r--drivers/net/phy/mdio-gpio.c2
-rw-r--r--drivers/net/phy/mdio-mux-gpio.c2
-rw-r--r--drivers/net/phy/mdio-mux-mmioreg.c2
-rw-r--r--drivers/net/phy/mdio-octeon.c2
12 files changed, 126 insertions, 60 deletions
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 16adbc481772..8fadaa14b9f0 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -68,8 +68,8 @@ config SMSC_PHY
68config BROADCOM_PHY 68config BROADCOM_PHY
69 tristate "Drivers for Broadcom PHYs" 69 tristate "Drivers for Broadcom PHYs"
70 ---help--- 70 ---help---
71 Currently supports the BCM5411, BCM5421, BCM5461, BCM5464, BCM5481 71 Currently supports the BCM5411, BCM5421, BCM5461, BCM54616S, BCM5464,
72 and BCM5482 PHYs. 72 BCM5481 and BCM5482 PHYs.
73 73
74config BCM63XX_PHY 74config BCM63XX_PHY
75 tristate "Drivers for Broadcom 63xx SOCs internal PHY" 75 tristate "Drivers for Broadcom 63xx SOCs internal PHY"
diff --git a/drivers/net/phy/amd-xgbe-phy.c b/drivers/net/phy/amd-xgbe-phy.c
index 32efbd48f326..fb276f64cd64 100644
--- a/drivers/net/phy/amd-xgbe-phy.c
+++ b/drivers/net/phy/amd-xgbe-phy.c
@@ -78,6 +78,7 @@
78#include <linux/bitops.h> 78#include <linux/bitops.h>
79#include <linux/property.h> 79#include <linux/property.h>
80#include <linux/acpi.h> 80#include <linux/acpi.h>
81#include <linux/jiffies.h>
81 82
82MODULE_AUTHOR("Tom Lendacky <thomas.lendacky@amd.com>"); 83MODULE_AUTHOR("Tom Lendacky <thomas.lendacky@amd.com>");
83MODULE_LICENSE("Dual BSD/GPL"); 84MODULE_LICENSE("Dual BSD/GPL");
@@ -100,6 +101,8 @@ MODULE_DESCRIPTION("AMD 10GbE (amd-xgbe) PHY driver");
100#define XGBE_PHY_SPEED_2500 1 101#define XGBE_PHY_SPEED_2500 1
101#define XGBE_PHY_SPEED_10000 2 102#define XGBE_PHY_SPEED_10000 2
102 103
104#define XGBE_AN_MS_TIMEOUT 500
105
103#define XGBE_AN_INT_CMPLT 0x01 106#define XGBE_AN_INT_CMPLT 0x01
104#define XGBE_AN_INC_LINK 0x02 107#define XGBE_AN_INC_LINK 0x02
105#define XGBE_AN_PG_RCV 0x04 108#define XGBE_AN_PG_RCV 0x04
@@ -434,6 +437,7 @@ struct amd_xgbe_phy_priv {
434 unsigned int an_supported; 437 unsigned int an_supported;
435 unsigned int parallel_detect; 438 unsigned int parallel_detect;
436 unsigned int fec_ability; 439 unsigned int fec_ability;
440 unsigned long an_start;
437 441
438 unsigned int lpm_ctrl; /* CTRL1 for resume */ 442 unsigned int lpm_ctrl; /* CTRL1 for resume */
439}; 443};
@@ -902,8 +906,23 @@ static enum amd_xgbe_phy_an amd_xgbe_an_page_received(struct phy_device *phydev)
902{ 906{
903 struct amd_xgbe_phy_priv *priv = phydev->priv; 907 struct amd_xgbe_phy_priv *priv = phydev->priv;
904 enum amd_xgbe_phy_rx *state; 908 enum amd_xgbe_phy_rx *state;
909 unsigned long an_timeout;
905 int ret; 910 int ret;
906 911
912 if (!priv->an_start) {
913 priv->an_start = jiffies;
914 } else {
915 an_timeout = priv->an_start +
916 msecs_to_jiffies(XGBE_AN_MS_TIMEOUT);
917 if (time_after(jiffies, an_timeout)) {
918 /* Auto-negotiation timed out, reset state */
919 priv->kr_state = AMD_XGBE_RX_BPA;
920 priv->kx_state = AMD_XGBE_RX_BPA;
921
922 priv->an_start = jiffies;
923 }
924 }
925
907 state = amd_xgbe_phy_in_kr_mode(phydev) ? &priv->kr_state 926 state = amd_xgbe_phy_in_kr_mode(phydev) ? &priv->kr_state
908 : &priv->kx_state; 927 : &priv->kx_state;
909 928
@@ -932,8 +951,8 @@ static enum amd_xgbe_phy_an amd_xgbe_an_incompat_link(struct phy_device *phydev)
932 if (amd_xgbe_phy_in_kr_mode(phydev)) { 951 if (amd_xgbe_phy_in_kr_mode(phydev)) {
933 priv->kr_state = AMD_XGBE_RX_ERROR; 952 priv->kr_state = AMD_XGBE_RX_ERROR;
934 953
935 if (!(phydev->supported & SUPPORTED_1000baseKX_Full) && 954 if (!(phydev->advertising & SUPPORTED_1000baseKX_Full) &&
936 !(phydev->supported & SUPPORTED_2500baseX_Full)) 955 !(phydev->advertising & SUPPORTED_2500baseX_Full))
937 return AMD_XGBE_AN_NO_LINK; 956 return AMD_XGBE_AN_NO_LINK;
938 957
939 if (priv->kx_state != AMD_XGBE_RX_BPA) 958 if (priv->kx_state != AMD_XGBE_RX_BPA)
@@ -941,7 +960,7 @@ static enum amd_xgbe_phy_an amd_xgbe_an_incompat_link(struct phy_device *phydev)
941 } else { 960 } else {
942 priv->kx_state = AMD_XGBE_RX_ERROR; 961 priv->kx_state = AMD_XGBE_RX_ERROR;
943 962
944 if (!(phydev->supported & SUPPORTED_10000baseKR_Full)) 963 if (!(phydev->advertising & SUPPORTED_10000baseKR_Full))
945 return AMD_XGBE_AN_NO_LINK; 964 return AMD_XGBE_AN_NO_LINK;
946 965
947 if (priv->kr_state != AMD_XGBE_RX_BPA) 966 if (priv->kr_state != AMD_XGBE_RX_BPA)
@@ -1078,6 +1097,7 @@ again:
1078 priv->an_state = AMD_XGBE_AN_READY; 1097 priv->an_state = AMD_XGBE_AN_READY;
1079 priv->kr_state = AMD_XGBE_RX_BPA; 1098 priv->kr_state = AMD_XGBE_RX_BPA;
1080 priv->kx_state = AMD_XGBE_RX_BPA; 1099 priv->kx_state = AMD_XGBE_RX_BPA;
1100 priv->an_start = 0;
1081 } 1101 }
1082 1102
1083 if (cur_state != priv->an_state) 1103 if (cur_state != priv->an_state)
@@ -1101,7 +1121,7 @@ static int amd_xgbe_an_init(struct phy_device *phydev)
1101 if (ret < 0) 1121 if (ret < 0)
1102 return ret; 1122 return ret;
1103 1123
1104 if (phydev->supported & SUPPORTED_10000baseR_FEC) 1124 if (phydev->advertising & SUPPORTED_10000baseR_FEC)
1105 ret |= 0xc000; 1125 ret |= 0xc000;
1106 else 1126 else
1107 ret &= ~0xc000; 1127 ret &= ~0xc000;
@@ -1113,13 +1133,13 @@ static int amd_xgbe_an_init(struct phy_device *phydev)
1113 if (ret < 0) 1133 if (ret < 0)
1114 return ret; 1134 return ret;
1115 1135
1116 if (phydev->supported & SUPPORTED_10000baseKR_Full) 1136 if (phydev->advertising & SUPPORTED_10000baseKR_Full)
1117 ret |= 0x80; 1137 ret |= 0x80;
1118 else 1138 else
1119 ret &= ~0x80; 1139 ret &= ~0x80;
1120 1140
1121 if ((phydev->supported & SUPPORTED_1000baseKX_Full) || 1141 if ((phydev->advertising & SUPPORTED_1000baseKX_Full) ||
1122 (phydev->supported & SUPPORTED_2500baseX_Full)) 1142 (phydev->advertising & SUPPORTED_2500baseX_Full))
1123 ret |= 0x20; 1143 ret |= 0x20;
1124 else 1144 else
1125 ret &= ~0x20; 1145 ret &= ~0x20;
@@ -1131,12 +1151,12 @@ static int amd_xgbe_an_init(struct phy_device *phydev)
1131 if (ret < 0) 1151 if (ret < 0)
1132 return ret; 1152 return ret;
1133 1153
1134 if (phydev->supported & SUPPORTED_Pause) 1154 if (phydev->advertising & SUPPORTED_Pause)
1135 ret |= 0x400; 1155 ret |= 0x400;
1136 else 1156 else
1137 ret &= ~0x400; 1157 ret &= ~0x400;
1138 1158
1139 if (phydev->supported & SUPPORTED_Asym_Pause) 1159 if (phydev->advertising & SUPPORTED_Asym_Pause)
1140 ret |= 0x800; 1160 ret |= 0x800;
1141 else 1161 else
1142 ret &= ~0x800; 1162 ret &= ~0x800;
@@ -1212,38 +1232,14 @@ static int amd_xgbe_phy_config_init(struct phy_device *phydev)
1212 priv->an_irq_allocated = 1; 1232 priv->an_irq_allocated = 1;
1213 } 1233 }
1214 1234
1215 ret = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_PMA_10GBR_FEC_ABILITY);
1216 if (ret < 0)
1217 return ret;
1218 priv->fec_ability = ret & XGBE_PHY_FEC_MASK;
1219
1220 /* Initialize supported features */
1221 phydev->supported = SUPPORTED_Autoneg;
1222 phydev->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
1223 phydev->supported |= SUPPORTED_Backplane;
1224 phydev->supported |= SUPPORTED_10000baseKR_Full;
1225 switch (priv->speed_set) {
1226 case AMD_XGBE_PHY_SPEEDSET_1000_10000:
1227 phydev->supported |= SUPPORTED_1000baseKX_Full;
1228 break;
1229 case AMD_XGBE_PHY_SPEEDSET_2500_10000:
1230 phydev->supported |= SUPPORTED_2500baseX_Full;
1231 break;
1232 }
1233
1234 if (priv->fec_ability & XGBE_PHY_FEC_ENABLE)
1235 phydev->supported |= SUPPORTED_10000baseR_FEC;
1236
1237 phydev->advertising = phydev->supported;
1238
1239 /* Set initial mode - call the mode setting routines 1235 /* Set initial mode - call the mode setting routines
1240 * directly to insure we are properly configured 1236 * directly to insure we are properly configured
1241 */ 1237 */
1242 if (phydev->supported & SUPPORTED_10000baseKR_Full) 1238 if (phydev->advertising & SUPPORTED_10000baseKR_Full)
1243 ret = amd_xgbe_phy_xgmii_mode(phydev); 1239 ret = amd_xgbe_phy_xgmii_mode(phydev);
1244 else if (phydev->supported & SUPPORTED_1000baseKX_Full) 1240 else if (phydev->advertising & SUPPORTED_1000baseKX_Full)
1245 ret = amd_xgbe_phy_gmii_mode(phydev); 1241 ret = amd_xgbe_phy_gmii_mode(phydev);
1246 else if (phydev->supported & SUPPORTED_2500baseX_Full) 1242 else if (phydev->advertising & SUPPORTED_2500baseX_Full)
1247 ret = amd_xgbe_phy_gmii_2500_mode(phydev); 1243 ret = amd_xgbe_phy_gmii_2500_mode(phydev);
1248 else 1244 else
1249 ret = -EINVAL; 1245 ret = -EINVAL;
@@ -1315,10 +1311,10 @@ static int __amd_xgbe_phy_config_aneg(struct phy_device *phydev)
1315 disable_irq(priv->an_irq); 1311 disable_irq(priv->an_irq);
1316 1312
1317 /* Start auto-negotiation in a supported mode */ 1313 /* Start auto-negotiation in a supported mode */
1318 if (phydev->supported & SUPPORTED_10000baseKR_Full) 1314 if (phydev->advertising & SUPPORTED_10000baseKR_Full)
1319 ret = amd_xgbe_phy_set_mode(phydev, AMD_XGBE_MODE_KR); 1315 ret = amd_xgbe_phy_set_mode(phydev, AMD_XGBE_MODE_KR);
1320 else if ((phydev->supported & SUPPORTED_1000baseKX_Full) || 1316 else if ((phydev->advertising & SUPPORTED_1000baseKX_Full) ||
1321 (phydev->supported & SUPPORTED_2500baseX_Full)) 1317 (phydev->advertising & SUPPORTED_2500baseX_Full))
1322 ret = amd_xgbe_phy_set_mode(phydev, AMD_XGBE_MODE_KX); 1318 ret = amd_xgbe_phy_set_mode(phydev, AMD_XGBE_MODE_KX);
1323 else 1319 else
1324 ret = -EINVAL; 1320 ret = -EINVAL;
@@ -1746,6 +1742,29 @@ static int amd_xgbe_phy_probe(struct phy_device *phydev)
1746 sizeof(priv->serdes_dfe_tap_ena)); 1742 sizeof(priv->serdes_dfe_tap_ena));
1747 } 1743 }
1748 1744
1745 /* Initialize supported features */
1746 phydev->supported = SUPPORTED_Autoneg;
1747 phydev->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
1748 phydev->supported |= SUPPORTED_Backplane;
1749 phydev->supported |= SUPPORTED_10000baseKR_Full;
1750 switch (priv->speed_set) {
1751 case AMD_XGBE_PHY_SPEEDSET_1000_10000:
1752 phydev->supported |= SUPPORTED_1000baseKX_Full;
1753 break;
1754 case AMD_XGBE_PHY_SPEEDSET_2500_10000:
1755 phydev->supported |= SUPPORTED_2500baseX_Full;
1756 break;
1757 }
1758
1759 ret = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_PMA_10GBR_FEC_ABILITY);
1760 if (ret < 0)
1761 return ret;
1762 priv->fec_ability = ret & XGBE_PHY_FEC_MASK;
1763 if (priv->fec_ability & XGBE_PHY_FEC_ENABLE)
1764 phydev->supported |= SUPPORTED_10000baseR_FEC;
1765
1766 phydev->advertising = phydev->supported;
1767
1749 phydev->priv = priv; 1768 phydev->priv = priv;
1750 1769
1751 if (!priv->adev || acpi_disabled) 1770 if (!priv->adev || acpi_disabled)
@@ -1817,6 +1836,7 @@ static struct phy_driver amd_xgbe_phy_driver[] = {
1817 .phy_id_mask = XGBE_PHY_MASK, 1836 .phy_id_mask = XGBE_PHY_MASK,
1818 .name = "AMD XGBE PHY", 1837 .name = "AMD XGBE PHY",
1819 .features = 0, 1838 .features = 0,
1839 .flags = PHY_IS_INTERNAL,
1820 .probe = amd_xgbe_phy_probe, 1840 .probe = amd_xgbe_phy_probe,
1821 .remove = amd_xgbe_phy_remove, 1841 .remove = amd_xgbe_phy_remove,
1822 .soft_reset = amd_xgbe_phy_soft_reset, 1842 .soft_reset = amd_xgbe_phy_soft_reset,
diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index f80e19ac6704..fabf11d32d27 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -192,16 +192,17 @@ static int at803x_probe(struct phy_device *phydev)
192{ 192{
193 struct device *dev = &phydev->dev; 193 struct device *dev = &phydev->dev;
194 struct at803x_priv *priv; 194 struct at803x_priv *priv;
195 struct gpio_desc *gpiod_reset;
195 196
196 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); 197 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
197 if (!priv) 198 if (!priv)
198 return -ENOMEM; 199 return -ENOMEM;
199 200
200 priv->gpiod_reset = devm_gpiod_get(dev, "reset"); 201 gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
201 if (IS_ERR(priv->gpiod_reset)) 202 if (IS_ERR(gpiod_reset))
202 priv->gpiod_reset = NULL; 203 return PTR_ERR(gpiod_reset);
203 else 204
204 gpiod_direction_output(priv->gpiod_reset, 1); 205 priv->gpiod_reset = gpiod_reset;
205 206
206 phydev->priv = priv; 207 phydev->priv = priv;
207 208
diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
index 974ec4515269..64c74c6a4828 100644
--- a/drivers/net/phy/bcm7xxx.c
+++ b/drivers/net/phy/bcm7xxx.c
@@ -396,6 +396,7 @@ static struct phy_driver bcm7xxx_driver[] = {
396 BCM7XXX_28NM_GPHY(PHY_ID_BCM7364, "Broadcom BCM7364"), 396 BCM7XXX_28NM_GPHY(PHY_ID_BCM7364, "Broadcom BCM7364"),
397 BCM7XXX_28NM_GPHY(PHY_ID_BCM7366, "Broadcom BCM7366"), 397 BCM7XXX_28NM_GPHY(PHY_ID_BCM7366, "Broadcom BCM7366"),
398 BCM7XXX_28NM_GPHY(PHY_ID_BCM7439, "Broadcom BCM7439"), 398 BCM7XXX_28NM_GPHY(PHY_ID_BCM7439, "Broadcom BCM7439"),
399 BCM7XXX_28NM_GPHY(PHY_ID_BCM7439_2, "Broadcom BCM7439 (2)"),
399 BCM7XXX_28NM_GPHY(PHY_ID_BCM7445, "Broadcom BCM7445"), 400 BCM7XXX_28NM_GPHY(PHY_ID_BCM7445, "Broadcom BCM7445"),
400{ 401{
401 .phy_id = PHY_ID_BCM7425, 402 .phy_id = PHY_ID_BCM7425,
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index a52afb26421b..9c71295f2fef 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -549,6 +549,19 @@ static struct phy_driver broadcom_drivers[] = {
549 .config_intr = bcm54xx_config_intr, 549 .config_intr = bcm54xx_config_intr,
550 .driver = { .owner = THIS_MODULE }, 550 .driver = { .owner = THIS_MODULE },
551}, { 551}, {
552 .phy_id = PHY_ID_BCM54616S,
553 .phy_id_mask = 0xfffffff0,
554 .name = "Broadcom BCM54616S",
555 .features = PHY_GBIT_FEATURES |
556 SUPPORTED_Pause | SUPPORTED_Asym_Pause,
557 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
558 .config_init = bcm54xx_config_init,
559 .config_aneg = genphy_config_aneg,
560 .read_status = genphy_read_status,
561 .ack_interrupt = bcm54xx_ack_interrupt,
562 .config_intr = bcm54xx_config_intr,
563 .driver = { .owner = THIS_MODULE },
564}, {
552 .phy_id = PHY_ID_BCM5464, 565 .phy_id = PHY_ID_BCM5464,
553 .phy_id_mask = 0xfffffff0, 566 .phy_id_mask = 0xfffffff0,
554 .name = "Broadcom BCM5464", 567 .name = "Broadcom BCM5464",
@@ -660,6 +673,7 @@ static struct mdio_device_id __maybe_unused broadcom_tbl[] = {
660 { PHY_ID_BCM5411, 0xfffffff0 }, 673 { PHY_ID_BCM5411, 0xfffffff0 },
661 { PHY_ID_BCM5421, 0xfffffff0 }, 674 { PHY_ID_BCM5421, 0xfffffff0 },
662 { PHY_ID_BCM5461, 0xfffffff0 }, 675 { PHY_ID_BCM5461, 0xfffffff0 },
676 { PHY_ID_BCM54616S, 0xfffffff0 },
663 { PHY_ID_BCM5464, 0xfffffff0 }, 677 { PHY_ID_BCM5464, 0xfffffff0 },
664 { PHY_ID_BCM5482, 0xfffffff0 }, 678 { PHY_ID_BCM5482, 0xfffffff0 },
665 { PHY_ID_BCM5482, 0xfffffff0 }, 679 { PHY_ID_BCM5482, 0xfffffff0 },
diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index 4c2b5a80f17c..496e02f961d3 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -257,7 +257,7 @@ static void ext_write(int broadcast, struct phy_device *phydev,
257 257
258/* Caller must hold extreg_lock. */ 258/* Caller must hold extreg_lock. */
259static int tdr_write(int bc, struct phy_device *dev, 259static int tdr_write(int bc, struct phy_device *dev,
260 const struct timespec *ts, u16 cmd) 260 const struct timespec64 *ts, u16 cmd)
261{ 261{
262 ext_write(bc, dev, PAGE4, PTP_TDR, ts->tv_nsec & 0xffff);/* ns[15:0] */ 262 ext_write(bc, dev, PAGE4, PTP_TDR, ts->tv_nsec & 0xffff);/* ns[15:0] */
263 ext_write(bc, dev, PAGE4, PTP_TDR, ts->tv_nsec >> 16); /* ns[31:16] */ 263 ext_write(bc, dev, PAGE4, PTP_TDR, ts->tv_nsec >> 16); /* ns[31:16] */
@@ -411,12 +411,12 @@ static int ptp_dp83640_adjtime(struct ptp_clock_info *ptp, s64 delta)
411 struct dp83640_clock *clock = 411 struct dp83640_clock *clock =
412 container_of(ptp, struct dp83640_clock, caps); 412 container_of(ptp, struct dp83640_clock, caps);
413 struct phy_device *phydev = clock->chosen->phydev; 413 struct phy_device *phydev = clock->chosen->phydev;
414 struct timespec ts; 414 struct timespec64 ts;
415 int err; 415 int err;
416 416
417 delta += ADJTIME_FIX; 417 delta += ADJTIME_FIX;
418 418
419 ts = ns_to_timespec(delta); 419 ts = ns_to_timespec64(delta);
420 420
421 mutex_lock(&clock->extreg_lock); 421 mutex_lock(&clock->extreg_lock);
422 422
@@ -427,7 +427,8 @@ static int ptp_dp83640_adjtime(struct ptp_clock_info *ptp, s64 delta)
427 return err; 427 return err;
428} 428}
429 429
430static int ptp_dp83640_gettime(struct ptp_clock_info *ptp, struct timespec *ts) 430static int ptp_dp83640_gettime(struct ptp_clock_info *ptp,
431 struct timespec64 *ts)
431{ 432{
432 struct dp83640_clock *clock = 433 struct dp83640_clock *clock =
433 container_of(ptp, struct dp83640_clock, caps); 434 container_of(ptp, struct dp83640_clock, caps);
@@ -452,7 +453,7 @@ static int ptp_dp83640_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
452} 453}
453 454
454static int ptp_dp83640_settime(struct ptp_clock_info *ptp, 455static int ptp_dp83640_settime(struct ptp_clock_info *ptp,
455 const struct timespec *ts) 456 const struct timespec64 *ts)
456{ 457{
457 struct dp83640_clock *clock = 458 struct dp83640_clock *clock =
458 container_of(ptp, struct dp83640_clock, caps); 459 container_of(ptp, struct dp83640_clock, caps);
@@ -605,7 +606,7 @@ static void recalibrate(struct dp83640_clock *clock)
605{ 606{
606 s64 now, diff; 607 s64 now, diff;
607 struct phy_txts event_ts; 608 struct phy_txts event_ts;
608 struct timespec ts; 609 struct timespec64 ts;
609 struct list_head *this; 610 struct list_head *this;
610 struct dp83640_private *tmp; 611 struct dp83640_private *tmp;
611 struct phy_device *master = clock->chosen->phydev; 612 struct phy_device *master = clock->chosen->phydev;
@@ -697,7 +698,7 @@ static void recalibrate(struct dp83640_clock *clock)
697 diff = now - (s64) phy2txts(&event_ts); 698 diff = now - (s64) phy2txts(&event_ts);
698 pr_info("slave offset %lld nanoseconds\n", diff); 699 pr_info("slave offset %lld nanoseconds\n", diff);
699 diff += ADJTIME_FIX; 700 diff += ADJTIME_FIX;
700 ts = ns_to_timespec(diff); 701 ts = ns_to_timespec64(diff);
701 tdr_write(0, tmp->phydev, &ts, PTP_STEP_CLK); 702 tdr_write(0, tmp->phydev, &ts, PTP_STEP_CLK);
702 } 703 }
703 704
@@ -998,8 +999,8 @@ static void dp83640_clock_init(struct dp83640_clock *clock, struct mii_bus *bus)
998 clock->caps.pps = 0; 999 clock->caps.pps = 0;
999 clock->caps.adjfreq = ptp_dp83640_adjfreq; 1000 clock->caps.adjfreq = ptp_dp83640_adjfreq;
1000 clock->caps.adjtime = ptp_dp83640_adjtime; 1001 clock->caps.adjtime = ptp_dp83640_adjtime;
1001 clock->caps.gettime = ptp_dp83640_gettime; 1002 clock->caps.gettime64 = ptp_dp83640_gettime;
1002 clock->caps.settime = ptp_dp83640_settime; 1003 clock->caps.settime64 = ptp_dp83640_settime;
1003 clock->caps.enable = ptp_dp83640_enable; 1004 clock->caps.enable = ptp_dp83640_enable;
1004 clock->caps.verify = ptp_dp83640_verify; 1005 clock->caps.verify = ptp_dp83640_verify;
1005 /* 1006 /*
diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index a08a3c78ba97..1960b46add65 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -183,6 +183,35 @@ int fixed_phy_set_link_update(struct phy_device *phydev,
183} 183}
184EXPORT_SYMBOL_GPL(fixed_phy_set_link_update); 184EXPORT_SYMBOL_GPL(fixed_phy_set_link_update);
185 185
186int fixed_phy_update_state(struct phy_device *phydev,
187 const struct fixed_phy_status *status,
188 const struct fixed_phy_status *changed)
189{
190 struct fixed_mdio_bus *fmb = &platform_fmb;
191 struct fixed_phy *fp;
192
193 if (!phydev || !phydev->bus)
194 return -EINVAL;
195
196 list_for_each_entry(fp, &fmb->phys, node) {
197 if (fp->addr == phydev->addr) {
198#define _UPD(x) if (changed->x) \
199 fp->status.x = status->x
200 _UPD(link);
201 _UPD(speed);
202 _UPD(duplex);
203 _UPD(pause);
204 _UPD(asym_pause);
205#undef _UPD
206 fixed_phy_update_regs(fp);
207 return 0;
208 }
209 }
210
211 return -ENOENT;
212}
213EXPORT_SYMBOL(fixed_phy_update_state);
214
186int fixed_phy_add(unsigned int irq, int phy_addr, 215int fixed_phy_add(unsigned int irq, int phy_addr,
187 struct fixed_phy_status *status) 216 struct fixed_phy_status *status)
188{ 217{
diff --git a/drivers/net/phy/mdio-bcm-unimac.c b/drivers/net/phy/mdio-bcm-unimac.c
index 6deac6d32f57..414fdf1f343f 100644
--- a/drivers/net/phy/mdio-bcm-unimac.c
+++ b/drivers/net/phy/mdio-bcm-unimac.c
@@ -187,7 +187,7 @@ static int unimac_mdio_remove(struct platform_device *pdev)
187 return 0; 187 return 0;
188} 188}
189 189
190static struct of_device_id unimac_mdio_ids[] = { 190static const struct of_device_id unimac_mdio_ids[] = {
191 { .compatible = "brcm,genet-mdio-v4", }, 191 { .compatible = "brcm,genet-mdio-v4", },
192 { .compatible = "brcm,genet-mdio-v3", }, 192 { .compatible = "brcm,genet-mdio-v3", },
193 { .compatible = "brcm,genet-mdio-v2", }, 193 { .compatible = "brcm,genet-mdio-v2", },
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
index 0a0578a592b8..49ce7ece5af3 100644
--- a/drivers/net/phy/mdio-gpio.c
+++ b/drivers/net/phy/mdio-gpio.c
@@ -249,7 +249,7 @@ static int mdio_gpio_remove(struct platform_device *pdev)
249 return 0; 249 return 0;
250} 250}
251 251
252static struct of_device_id mdio_gpio_of_match[] = { 252static const struct of_device_id mdio_gpio_of_match[] = {
253 { .compatible = "virtual,mdio-gpio", }, 253 { .compatible = "virtual,mdio-gpio", },
254 { /* sentinel */ } 254 { /* sentinel */ }
255}; 255};
diff --git a/drivers/net/phy/mdio-mux-gpio.c b/drivers/net/phy/mdio-mux-gpio.c
index 320eb15315c8..1a87a585e74d 100644
--- a/drivers/net/phy/mdio-mux-gpio.c
+++ b/drivers/net/phy/mdio-mux-gpio.c
@@ -99,7 +99,7 @@ static int mdio_mux_gpio_remove(struct platform_device *pdev)
99 return 0; 99 return 0;
100} 100}
101 101
102static struct of_device_id mdio_mux_gpio_match[] = { 102static const struct of_device_id mdio_mux_gpio_match[] = {
103 { 103 {
104 .compatible = "mdio-mux-gpio", 104 .compatible = "mdio-mux-gpio",
105 }, 105 },
diff --git a/drivers/net/phy/mdio-mux-mmioreg.c b/drivers/net/phy/mdio-mux-mmioreg.c
index 0aa985c74014..2377c1341172 100644
--- a/drivers/net/phy/mdio-mux-mmioreg.c
+++ b/drivers/net/phy/mdio-mux-mmioreg.c
@@ -145,7 +145,7 @@ static int mdio_mux_mmioreg_remove(struct platform_device *pdev)
145 return 0; 145 return 0;
146} 146}
147 147
148static struct of_device_id mdio_mux_mmioreg_match[] = { 148static const struct of_device_id mdio_mux_mmioreg_match[] = {
149 { 149 {
150 .compatible = "mdio-mux-mmioreg", 150 .compatible = "mdio-mux-mmioreg",
151 }, 151 },
diff --git a/drivers/net/phy/mdio-octeon.c b/drivers/net/phy/mdio-octeon.c
index c81052486edc..c838ad6155f7 100644
--- a/drivers/net/phy/mdio-octeon.c
+++ b/drivers/net/phy/mdio-octeon.c
@@ -252,7 +252,7 @@ static int octeon_mdiobus_remove(struct platform_device *pdev)
252 return 0; 252 return 0;
253} 253}
254 254
255static struct of_device_id octeon_mdiobus_match[] = { 255static const struct of_device_id octeon_mdiobus_match[] = {
256 { 256 {
257 .compatible = "cavium,octeon-3860-mdio", 257 .compatible = "cavium,octeon-3860-mdio",
258 }, 258 },