Merge remote-tracking branch 'lsk/v3.10/topic/coresight' into linux-linaro-lsk
authorMark Brown <broonie@kernel.org>
Fri, 9 Jan 2015 18:22:45 +0000 (18:22 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 9 Jan 2015 18:22:45 +0000 (18:22 +0000)
Conflicts:
arch/arm/include/asm/hardware/coresight.h
drivers/Makefile
drivers/of/base.c

1  2 
MAINTAINERS
arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts
arch/arm/kernel/Makefile
arch/arm/kernel/hw_breakpoint.c
drivers/Makefile
drivers/of/base.c
include/linux/bitops.h
include/linux/device.h
mm/backing-dev.c

diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
index 092a62e79688da9b1a7466da63e52b9788f86ea0,ab7c7bb6183fde758124d871602154fd9635bdec..292d528e22f1813ccdf290ededb0491984c46464
@@@ -152,5 -152,9 +152,6 @@@ obj-$(CONFIG_IIO)          += iio
  obj-$(CONFIG_VME_BUS)         += vme/
  obj-$(CONFIG_IPACK_BUS)               += ipack/
  obj-$(CONFIG_NTB)             += ntb/
 -obj-$(CONFIG_FMC)             += fmc/
 -obj-$(CONFIG_POWERCAP)                += powercap/
 -obj-$(CONFIG_MCB)             += mcb/
 -obj-$(CONFIG_RAS)             += ras/
 -obj-$(CONFIG_THUNDERBOLT)     += thunderbolt/
 +
 +obj-$(CONFIG_GATOR)           += gator/
+ obj-$(CONFIG_CORESIGHT)               += coresight/
index eda24f54b863b980b4df6ae62a7eb9232d547bc4,c66ecf958b673cbc339b1fa3bdd96af4e81ce2bd..191b370b102e983f80152ae0df832fef994d295c
   *      2 of the License, or (at your option) any later version.
   */
  #include <linux/ctype.h>
 +#include <linux/cpu.h>
  #include <linux/module.h>
  #include <linux/of.h>
+ #include <linux/of_graph.h>
  #include <linux/spinlock.h>
  #include <linux/slab.h>
  #include <linux/proc_fs.h>
@@@ -1766,18 -1705,153 +1767,169 @@@ const char *of_prop_next_string(struct 
  }
  EXPORT_SYMBOL_GPL(of_prop_next_string);
  
 +/**
 + * of_device_is_stdout_path - check if a device node matches the
 + *                            linux,stdout-path property
 + *
 + * Check if this device node matches the linux,stdout-path property
 + * in the chosen node. return true if yes, false otherwise.
 + */
 +int of_device_is_stdout_path(struct device_node *dn)
 +{
 +      if (!of_stdout)
 +              return false;
 +
 +      return of_stdout == dn;
 +}
 +EXPORT_SYMBOL_GPL(of_device_is_stdout_path);
++
+ /**
+  * of_graph_parse_endpoint() - parse common endpoint node properties
+  * @node: pointer to endpoint device_node
+  * @endpoint: pointer to the OF endpoint data structure
+  *
+  * The caller should hold a reference to @node.
+  */
+ int of_graph_parse_endpoint(const struct device_node *node,
+                           struct of_endpoint *endpoint)
+ {
+       struct device_node *port_node = of_get_parent(node);
+       WARN_ONCE(!port_node, "%s(): endpoint %s has no parent node\n",
+                 __func__, node->full_name);
+       memset(endpoint, 0, sizeof(*endpoint));
+       endpoint->local_node = node;
+       /*
+        * It doesn't matter whether the two calls below succeed.
+        * If they don't then the default value 0 is used.
+        */
+       of_property_read_u32(port_node, "reg", &endpoint->port);
+       of_property_read_u32(node, "reg", &endpoint->id);
+       of_node_put(port_node);
+       return 0;
+ }
+ EXPORT_SYMBOL(of_graph_parse_endpoint);
+ /**
+  * of_graph_get_next_endpoint() - get next endpoint node
+  * @parent: pointer to the parent device node
+  * @prev: previous endpoint node, or NULL to get first
+  *
+  * Return: An 'endpoint' node pointer with refcount incremented. Refcount
+  * of the passed @prev node is not decremented, the caller have to use
+  * of_node_put() on it when done.
+  */
+ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
+                                       struct device_node *prev)
+ {
+       struct device_node *endpoint;
+       struct device_node *port;
+       if (!parent)
+               return NULL;
+       /*
+        * Start by locating the port node. If no previous endpoint is specified
+        * search for the first port node, otherwise get the previous endpoint
+        * parent port node.
+        */
+       if (!prev) {
+               struct device_node *node;
+               node = of_get_child_by_name(parent, "ports");
+               if (node)
+                       parent = node;
+               port = of_get_child_by_name(parent, "port");
+               of_node_put(node);
+               if (!port) {
+                       pr_err("%s(): no port node found in %s\n",
+                              __func__, parent->full_name);
+                       return NULL;
+               }
+       } else {
+               port = of_get_parent(prev);
+               if (WARN_ONCE(!port, "%s(): endpoint %s has no parent node\n",
+                             __func__, prev->full_name))
+                       return NULL;
+               /*
+                * Avoid dropping prev node refcount to 0 when getting the next
+                * child below.
+                */
+               of_node_get(prev);
+       }
+       while (1) {
+               /*
+                * Now that we have a port node, get the next endpoint by
+                * getting the next child. If the previous endpoint is NULL this
+                * will return the first child.
+                */
+               endpoint = of_get_next_child(port, prev);
+               if (endpoint) {
+                       of_node_put(port);
+                       return endpoint;
+               }
+               /* No more endpoints under this port, try the next one. */
+               prev = NULL;
+               do {
+                       port = of_get_next_child(parent, port);
+                       if (!port)
+                               return NULL;
+               } while (of_node_cmp(port->name, "port"));
+       }
+ }
+ EXPORT_SYMBOL(of_graph_get_next_endpoint);
+ /**
+  * of_graph_get_remote_port_parent() - get remote port's parent node
+  * @node: pointer to a local endpoint device_node
+  *
+  * Return: Remote device node associated with remote endpoint node linked
+  *       to @node. Use of_node_put() on it when done.
+  */
+ struct device_node *of_graph_get_remote_port_parent(
+                              const struct device_node *node)
+ {
+       struct device_node *np;
+       unsigned int depth;
+       /* Get remote endpoint node. */
+       np = of_parse_phandle(node, "remote-endpoint", 0);
+       /* Walk 3 levels up only if there is 'ports' node. */
+       for (depth = 3; depth && np; depth--) {
+               np = of_get_next_parent(np);
+               if (depth == 2 && of_node_cmp(np->name, "ports"))
+                       break;
+       }
+       return np;
+ }
+ EXPORT_SYMBOL(of_graph_get_remote_port_parent);
+ /**
+  * of_graph_get_remote_port() - get remote port node
+  * @node: pointer to a local endpoint device_node
+  *
+  * Return: Remote port node associated with remote endpoint node linked
+  *       to @node. Use of_node_put() on it when done.
+  */
+ struct device_node *of_graph_get_remote_port(const struct device_node *node)
+ {
+       struct device_node *np;
+       /* Get remote endpoint node. */
+       np = of_parse_phandle(node, "remote-endpoint", 0);
+       if (!np)
+               return NULL;
+       return of_get_next_parent(np);
+ }
+ EXPORT_SYMBOL(of_graph_get_remote_port);
Simple merge
Simple merge
Simple merge