aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-09-03 11:08:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-03 11:08:17 -0400
commitdd5cdb48edfd34401799056a9acf61078d773f90 (patch)
tree8e251fb4a4c196540fe9b6a6d8b13275f93a057c /drivers/of
parent1e1a4e8f439113b7820bc7150569f685e1cc2b43 (diff)
parent62da98656b62a5ca57f22263705175af8ded5aa1 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: "Another merge window, another set of networking changes. I've heard rumblings that the lightweight tunnels infrastructure has been voted networking change of the year. But what do I know? 1) Add conntrack support to openvswitch, from Joe Stringer. 2) Initial support for VRF (Virtual Routing and Forwarding), which allows the segmentation of routing paths without using multiple devices. There are some semantic kinks to work out still, but this is a reasonably strong foundation. From David Ahern. 3) Remove spinlock fro act_bpf fast path, from Alexei Starovoitov. 4) Ignore route nexthops with a link down state in ipv6, just like ipv4. From Andy Gospodarek. 5) Remove spinlock from fast path of act_gact and act_mirred, from Eric Dumazet. 6) Document the DSA layer, from Florian Fainelli. 7) Add netconsole support to bcmgenet, systemport, and DSA. Also from Florian Fainelli. 8) Add Mellanox Switch Driver and core infrastructure, from Jiri Pirko. 9) Add support for "light weight tunnels", which allow for encapsulation and decapsulation without bearing the overhead of a full blown netdevice. From Thomas Graf, Jiri Benc, and a cast of others. 10) Add Identifier Locator Addressing support for ipv6, from Tom Herbert. 11) Support fragmented SKBs in iwlwifi, from Johannes Berg. 12) Allow perf PMUs to be accessed from eBPF programs, from Kaixu Xia. 13) Add BQL support to 3c59x driver, from Loganaden Velvindron. 14) Stop using a zero TX queue length to mean that a device shouldn't have a qdisc attached, use an explicit flag instead. From Phil Sutter. 15) Use generic geneve netdevice infrastructure in openvswitch, from Pravin B Shelar. 16) Add infrastructure to avoid re-forwarding a packet in software that was already forwarded by a hardware switch. From Scott Feldman. 17) Allow AF_PACKET fanout function to be implemented in a bpf program, from Willem de Bruijn" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1458 commits) netfilter: nf_conntrack: make nf_ct_zone_dflt built-in netfilter: nf_dup{4, 6}: fix build error when nf_conntrack disabled net: fec: clear receive interrupts before processing a packet ipv6: fix exthdrs offload registration in out_rt path xen-netback: add support for multicast control bgmac: Update fixed_phy_register() sock, diag: fix panic in sock_diag_put_filterinfo flow_dissector: Use 'const' where possible. flow_dissector: Fix function argument ordering dependency ixgbe: Resolve "initialized field overwritten" warnings ixgbe: Remove bimodal SR-IOV disabling ixgbe: Add support for reporting 2.5G link speed ixgbe: fix bounds checking in ixgbe_setup_tc for 82598 ixgbe: support for ethtool set_rxfh ixgbe: Avoid needless PHY access on copper phys ixgbe: cleanup to use cached mask value ixgbe: Remove second instance of lan_id variable ixgbe: use kzalloc for allocating one thing flow: Move __get_hash_from_flowi{4,6} into flow_dissector.c ixgbe: Remove unused PCI bus types ...
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/of_mdio.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index fdc60db60829..1350fa25cdb0 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -16,6 +16,7 @@
16#include <linux/phy.h> 16#include <linux/phy.h>
17#include <linux/phy_fixed.h> 17#include <linux/phy_fixed.h>
18#include <linux/of.h> 18#include <linux/of.h>
19#include <linux/of_gpio.h>
19#include <linux/of_irq.h> 20#include <linux/of_irq.h>
20#include <linux/of_mdio.h> 21#include <linux/of_mdio.h>
21#include <linux/module.h> 22#include <linux/module.h>
@@ -266,7 +267,8 @@ EXPORT_SYMBOL(of_phy_attach);
266bool of_phy_is_fixed_link(struct device_node *np) 267bool of_phy_is_fixed_link(struct device_node *np)
267{ 268{
268 struct device_node *dn; 269 struct device_node *dn;
269 int len; 270 int len, err;
271 const char *managed;
270 272
271 /* New binding */ 273 /* New binding */
272 dn = of_get_child_by_name(np, "fixed-link"); 274 dn = of_get_child_by_name(np, "fixed-link");
@@ -275,6 +277,10 @@ bool of_phy_is_fixed_link(struct device_node *np)
275 return true; 277 return true;
276 } 278 }
277 279
280 err = of_property_read_string(np, "managed", &managed);
281 if (err == 0 && strcmp(managed, "auto") != 0)
282 return true;
283
278 /* Old binding */ 284 /* Old binding */
279 if (of_get_property(np, "fixed-link", &len) && 285 if (of_get_property(np, "fixed-link", &len) &&
280 len == (5 * sizeof(__be32))) 286 len == (5 * sizeof(__be32)))
@@ -289,8 +295,19 @@ int of_phy_register_fixed_link(struct device_node *np)
289 struct fixed_phy_status status = {}; 295 struct fixed_phy_status status = {};
290 struct device_node *fixed_link_node; 296 struct device_node *fixed_link_node;
291 const __be32 *fixed_link_prop; 297 const __be32 *fixed_link_prop;
292 int len; 298 int link_gpio;
299 int len, err;
293 struct phy_device *phy; 300 struct phy_device *phy;
301 const char *managed;
302
303 err = of_property_read_string(np, "managed", &managed);
304 if (err == 0) {
305 if (strcmp(managed, "in-band-status") == 0) {
306 /* status is zeroed, namely its .link member */
307 phy = fixed_phy_register(PHY_POLL, &status, -1, np);
308 return IS_ERR(phy) ? PTR_ERR(phy) : 0;
309 }
310 }
294 311
295 /* New binding */ 312 /* New binding */
296 fixed_link_node = of_get_child_by_name(np, "fixed-link"); 313 fixed_link_node = of_get_child_by_name(np, "fixed-link");
@@ -303,8 +320,13 @@ int of_phy_register_fixed_link(struct device_node *np)
303 status.pause = of_property_read_bool(fixed_link_node, "pause"); 320 status.pause = of_property_read_bool(fixed_link_node, "pause");
304 status.asym_pause = of_property_read_bool(fixed_link_node, 321 status.asym_pause = of_property_read_bool(fixed_link_node,
305 "asym-pause"); 322 "asym-pause");
323 link_gpio = of_get_named_gpio_flags(fixed_link_node,
324 "link-gpios", 0, NULL);
306 of_node_put(fixed_link_node); 325 of_node_put(fixed_link_node);
307 phy = fixed_phy_register(PHY_POLL, &status, np); 326 if (link_gpio == -EPROBE_DEFER)
327 return -EPROBE_DEFER;
328
329 phy = fixed_phy_register(PHY_POLL, &status, link_gpio, np);
308 return IS_ERR(phy) ? PTR_ERR(phy) : 0; 330 return IS_ERR(phy) ? PTR_ERR(phy) : 0;
309 } 331 }
310 332
@@ -316,7 +338,7 @@ int of_phy_register_fixed_link(struct device_node *np)
316 status.speed = be32_to_cpu(fixed_link_prop[2]); 338 status.speed = be32_to_cpu(fixed_link_prop[2]);
317 status.pause = be32_to_cpu(fixed_link_prop[3]); 339 status.pause = be32_to_cpu(fixed_link_prop[3]);
318 status.asym_pause = be32_to_cpu(fixed_link_prop[4]); 340 status.asym_pause = be32_to_cpu(fixed_link_prop[4]);
319 phy = fixed_phy_register(PHY_POLL, &status, np); 341 phy = fixed_phy_register(PHY_POLL, &status, -1, np);
320 return IS_ERR(phy) ? PTR_ERR(phy) : 0; 342 return IS_ERR(phy) ? PTR_ERR(phy) : 0;
321 } 343 }
322 344