1. 15 2月, 2014 1 次提交
    • K
      Revert "OF: base: match each node compatible against all given matches first" · 4e8ca6ee
      Kevin Hao 提交于
      This reverts commit 10535314.
      Stephen Chivers reported this is broken as we will get a match
      entry '.type = "serial"' instead of the '.compatible = "ns16550"'
      in the following scenario:
      	serial0: serial@4500 {
      		compatible = "fsl,ns16550", "ns16550";
      	}
      
      	struct of_device_id of_platform_serial_table[] = {
      		{ .compatible = "ns8250",   .data = (void *)PORT_8250, },
      		{ .compatible = "ns16450",  .data = (void *)PORT_16450, },
      		{ .compatible = "ns16550a", .data = (void *)PORT_16550A, },
      		{ .compatible = "ns16550",  .data = (void *)PORT_16550, },
      		{ .compatible = "ns16750",  .data = (void *)PORT_16750, },
      		{ .compatible = "ns16850",  .data = (void *)PORT_16850, },
      		...
      		{ .type = "serial",         .data = (void *)PORT_UNKNOWN, },
      		{ /* end of list */ },
      	};
      
      So just revert this patch, we will use another implementation to find
      the best compatible match in a follow-on patch.
      Reported-by: NStephen N Chivers <schivers@csc.com.au>
      Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Signed-off-by: NKevin Hao <haokexin@gmail.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      4e8ca6ee
  2. 17 1月, 2014 1 次提交
    • X
      of: Fix __of_device_is_available check · 42ccd781
      Xiubo Li 提交于
      From IEEE 1275, there defined a standard 'status' property indicating the
      operational status of one device. The 'status' property has four possible
      values: 'okay/ok', 'disabled', 'fail' and 'fail-xxx'.
      
      If it is absent, that means the status of the device is unknown or okay.
      
      The __of_device_is_available checks the state of the 'status' property of
      a device. If the property is absent or set to 'okay/ok', it returns 1.
      Otherwise it returns 0.
      
      While in __of_device_is_available:
       >	status = of_get_property(device, "status", &statlen);
       >	if (status == NULL)
       >		return 1;
      The status value returned from 'of_get_property()' will be NULL in two cases:
      Firstly: the 'device' value (device node) is NULL.
      Secondly: the 'status' property is actaully not exist.
      
      If the device node is NULL, the __of_device_is_available will return true,
      that will mean the absent state of the 'status' property.
      
      So this add the device node check before checking the 'status' property's
      state, and if the device node is not exist, 0 will be returned.
      Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com>
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      42ccd781
  3. 05 12月, 2013 1 次提交
  4. 31 10月, 2013 1 次提交
  5. 24 10月, 2013 1 次提交
  6. 16 10月, 2013 2 次提交
    • G
      of: Fix iteration bug over CPU reg properties · f3cea45a
      Grant Likely 提交于
      The size of each hwid in a cpu nodes 'reg' property is defined by the
      parents #address-cells property in the normal way. The cpu parsing code
      has a bug where it will overrun the end of the property if
      address-cells is greater than one. This commit fixes the problem by
      adjusting the array size by the number of address cells. It also makes
      sure address-cells isn't zero for that would cause an infinite loop.
      
      v2: bail if #address-cells is zero instead of forcing to
          OF_ROOT_NODE_ADDR_CELLS_DEFAULT. Forcing it will cause the reg
          property to be parsed incorrectly.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      f3cea45a
    • D
      of: Make cpu node handling more portable. · d1cb9d1a
      David Miller 提交于
      Use for_each_node_by_type() to iterate all cpu nodes in the
      system.
      
      Provide and overridable function arch_find_n_match_cpu_physical_id,
      which sees if the given device node matches 'cpu' and if so sets
      '*thread' when non-NULL to the cpu thread number within the core.
      
      The default implementation behaves the same as the existing code.
      
      Add a sparc64 implementation.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Tested-by: NSudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      d1cb9d1a
  7. 14 10月, 2013 1 次提交
    • G
      of: fix unnecessary warning on missing /cpus node · 444c91e5
      Grant Likely 提交于
      Not all DT platforms have all the cpus collected under a /cpus node.
      That just happens to be a details of FDT, ePAPR and PowerPC platforms.
      Sparc does something different, but unfortunately the current code
      complains with a warning if /cpus isn't there. This became a problem
      with commit f86e4718, "driver/core cpu: initialize of_node in cpu's
      device structure", which caused the function to get called for all
      architectures.
      
      This commit is a temporary fix to fail silently if the cpus node isn't
      present. A proper fix will come later to allow arch code to provide a
      custom mechanism for decoding the CPU hwid if the 'reg' property isn't
      appropriate.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Cc: David Miller <davem@davemloft.net>
      Cc: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
      Cc: Rob Herring <rob.herring@calxeda.com>
      444c91e5
  8. 10 10月, 2013 1 次提交
  9. 30 8月, 2013 5 次提交
  10. 21 8月, 2013 1 次提交
    • S
      of: move of_get_cpu_node implementation to DT core library · 183912d3
      Sudeep KarkadaNagesha 提交于
      This patch moves the generalized implementation of of_get_cpu_node from
      PowerPC to DT core library, thereby adding support for retrieving cpu
      node for a given logical cpu index on any architecture.
      
      The CPU subsystem can now use this function to assign of_node in the
      cpu device while registering CPUs.
      
      It is recommended to use these helper function only in pre-SMP/early
      initialisation stages to retrieve CPU device node pointers in logical
      ordering. Once the cpu devices are registered, it can be retrieved easily
      from cpu device of_node which avoids unnecessary parsing and matching.
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Grant Likely <grant.likely@linaro.org>
      Acked-by: NRob Herring <rob.herring@calxeda.com>
      Signed-off-by: NSudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
      183912d3
  11. 13 8月, 2013 1 次提交
  12. 14 6月, 2013 1 次提交
  13. 12 6月, 2013 1 次提交
  14. 02 5月, 2013 1 次提交
  15. 17 4月, 2013 2 次提交
  16. 04 4月, 2013 2 次提交
  17. 13 2月, 2013 3 次提交
  18. 09 2月, 2013 1 次提交
  19. 06 2月, 2013 1 次提交
    • S
      of: Output devicetree alias names in uevent · ced4eec9
      Stepan Moskovchenko 提交于
      In some situations, userspace may want to resolve a
      device by function and logical number (ie, "serial0")
      rather than by the base address or full device path. Being
      able to resolve a device by alias frees userspace from the
      burden of otherwise having to maintain a mapping between
      device addresses and their logical assignments on each
      platform when multiple instances of the same hardware block
      are present in the system.
      
      Although the uevent device attribute contains devicetree
      compatible information and the full device path, the uevent
      does not list the alises that may have been defined for the
      device.
      Signed-off-by: NStepan Moskovchenko <stepanm@codeaurora.org>
      [grant.likely: Removed OF_ALIAS_N field; I don't think it's needed]
      [grant.likely: Added #ifndef _LINUX_OF_PRIVATE_H wrapper]
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      ced4eec9
  20. 28 1月, 2013 1 次提交
    • T
      OF: Fixup resursive locking code paths · 28d0e36b
      Thomas Gleixner 提交于
      There is no real reason to use a rwlock for devtree_lock. It even
      could be a mutex, but unfortunately it's locked from cpu hotplug
      paths which can't schedule :(
      
      So it needs to become a raw lock on rt as well.  The devtree_lock would
      be the only user of a raw_rw_lock, so we are better off cleaning up the
      recursive locking paths which allows us to convert devtree_lock to a
      read_lock.
      
      Here we do the standard thing of introducing __foo() as the "raw"
      version of foo(), so that we can take better control of the locking.
      The "raw" versions are not exported and are for internal use within
      the file itself.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      28d0e36b
  21. 21 1月, 2013 1 次提交
  22. 19 12月, 2012 1 次提交
  23. 12 12月, 2012 1 次提交
  24. 30 11月, 2012 2 次提交
  25. 29 11月, 2012 1 次提交
  26. 21 11月, 2012 2 次提交
  27. 15 11月, 2012 3 次提交