1. 24 7月, 2014 3 次提交
    • P
      of: Transactional DT support. · 201c910b
      Pantelis Antoniou 提交于
      Introducing DT transactional support.
      
      A DT transaction is a method which allows one to apply changes
      in the live tree, in such a way that either the full set of changes
      take effect, or the state of the tree can be rolled-back to the
      state it was before it was attempted. An applied transaction
      can be rolled-back at any time.
      
      Documentation is in
      	Documentation/devicetree/changesets.txt
      Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com>
      [glikely: Removed device notifiers and reworked to be more consistent]
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      201c910b
    • G
      of: Reorder device tree changes and notifiers · 259092a3
      Grant Likely 提交于
      Currently, devicetree reconfig notifiers get emitted before the change
      is applied to the tree, but that behaviour is problematic if the
      receiver wants the determine the new state of the tree. The current
      users don't care, but the changeset code to follow will be making
      multiple changes at once. Reorder notifiers to get emitted after the
      change has been applied to the tree so that callbacks see the new tree
      state.
      
      At the same time, fixup the existing callbacks to expect the new order.
      There are a few callbacks that compare the old and new values of a
      changed property. Put both property pointers into the of_prop_reconfig
      structure.
      
      The current notifiers also allow the notifier callback to fail and
      cancel the change to the tree, but that feature isn't actually used.
      It really isn't valid to ignore a tree modification provided by firmware
      anyway, so remove the ability to cancel a change to the tree.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Cc: Nathan Fontenot <nfont@austin.ibm.com>
      259092a3
    • G
      of: Make devicetree sysfs update functions consistent. · 8a2b22a2
      Grant Likely 提交于
      All of the DT modification functions are split into two parts, the first
      part manipulates the DT data structure, and the second part updates
      sysfs, but the code isn't very consistent about how the second half is
      called. They don't all enforce the same rules about when it is valid to
      update sysfs, and there isn't any clarity on locking.
      
      The transactional DT modification feature that is coming also needs
      access to these functions so that it can perform all the structure
      changes together, and then all the sysfs updates as a second stage
      instead of doing each one at a time.
      
      Fix up the second have by creating a separate __of_*_sysfs() function
      for each of the helpers. The new functions have consistent naming (ie.
      of_node_add() becomes __of_attach_node_sysfs()) and all of them now
      defer if of_init hasn't been called yet.
      
      Callers of the new functions must hold the of_mutex to ensure there are
      no race conditions with of_init(). The mutex ensures that there will
      only ever be one writer to the tree at any given time. There can still
      be any number of readers and the raw_spin_lock is still used to make
      sure access to the data structure is still consistent.
      
      Finally, put the function prototypes into of_private.h so they are
      accessible to the transaction code.
      Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com>
      [grant.likely: Changed suffix from _post to _sysfs to match existing code]
      [grant.likely: Reorganized to eliminate trivial wrappers]
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      8a2b22a2
  2. 07 7月, 2014 1 次提交
    • G
      of/platform: Fix of_platform_device_destroy iteration of devices · 75f353b6
      Grant Likely 提交于
      of_platform_destroy does not work properly, since the tree
      population test was iterating on all devices having as its parent
      the given platform device.
      
      The check was intended to check whether any other platform or amba
      devices created by of_platform_populate were still populated, but
      instead checked for every kind of device. This is wrong, since platform
      devices typically create a subsystem regular device and set themselves
      as parents.
      
      Instead, go ahead and call the unregister functions for any devices
      created with of_platform_populate. The driver core will take care of
      unbinding drivers, and drivers are responsible for getting rid of any
      child devices that weren't created by of_platform_populate.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com>
      75f353b6
  3. 21 5月, 2014 1 次提交
  4. 16 5月, 2014 1 次提交
    • P
      of: Keep track of populated platform devices · c6e126de
      Pawel Moll 提交于
      In "Device Tree powered" systems, platform devices are usually massively
      populated with of_platform_populate() call, executed at some level of
      initcalls, either by generic architecture or by platform-specific code.
      
      There are situations though where certain devices must be created (and
      bound with drivers) before all the others. This presents a challenge,
      as devices created explicitly would be created again by
      of_platform_populate().
      
      This patch tries to solve that issue in a generic way, adding a
      "populated" flag for a DT node description. Subsequent
      of_platform_populate() will skip such nodes (and its children) in
      a similar way to the non-available ones.
      
      This patch also adds of_platform_depopulate() as an operation
      complementary to the _populate() one. It removes a platform or an amba
      device populated from the Device Tree, together with its all children
      (leaving, however, devices without associated of_node untouched)
      clearing the "populated" flag on the way.
      Signed-off-by: NPawel Moll <pawel.moll@arm.com>
      Reviewed-by: NRob Herring <robh@kernel.org>
      Acked-by: NGrant Likely <grant.likely@linaro.org>
      c6e126de
  5. 15 5月, 2014 1 次提交
  6. 18 4月, 2014 1 次提交
  7. 19 3月, 2014 1 次提交
    • P
      of: device_node kobject lifecycle fixes · 0829f6d1
      Pantelis Antoniou 提交于
      After the move to having device nodes be proper kobjects the lifecycle
      of the node needs to be controlled better.
      
      At first convert of_add_node() in the unflattened functions to
      of_init_node() which initializes the kobject so that of_node_get/put
      work correctly even before of_init is called.
      
      Afterwards introduce of_node_is_initialized & of_node_is_attached that
      query the underlying kobject about the state (attached means kobj
      is visible in sysfs)
      
      Using that make sure the lifecycle of the tree is correct at all
      times.
      Signed-off-by: NPantelis Antoniou <panto@antoniou-consulting.com>
      [grant.likely: moved of_node_init() calls, fixed up locking, and
                     dropped __of_populate() hunks]
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      0829f6d1
  8. 12 3月, 2014 2 次提交
    • G
      of: remove /proc/device-tree · 8357041a
      Grant Likely 提交于
      The same data is now available in sysfs, so we can remove the code
      that exports it in /proc and replace it with a symlink to the sysfs
      version.
      
      Tested on versatile qemu model and mpc5200 eval board. More testing
      would be appreciated.
      
      v5: Fixed up conflicts with mainline changes
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
      Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
      8357041a
    • G
      of: Make device nodes kobjects so they show up in sysfs · 75b57ecf
      Grant Likely 提交于
      Device tree nodes are already treated as objects, and we already want to
      expose them to userspace which is done using the /proc filesystem today.
      Right now the kernel has to do a lot of work to keep the /proc view in
      sync with the in-kernel representation. If device_nodes are switched to
      be kobjects then the device tree code can be a whole lot simpler. It
      also turns out that switching to using /sysfs from /proc results in
      smaller code and data size, and the userspace ABI won't change if
      /proc/device-tree symlinks to /sys/firmware/devicetree/base.
      
      v7: Add missing sysfs_bin_attr_init()
      v6: Add __of_add_property() early init fixes from Pantelis
      v5: Rename firmware/ofw to firmware/devicetree
          Fix updating property values in sysfs
      v4: Fixed build error on Powerpc
          Fixed handling of dynamic nodes on powerpc
      v3: Fixed handling of duplicate attribute and child node names
      v2: switch to using sysfs bin_attributes which solve the problem of
          reporting incorrect property size.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Tested-by: NSascha Hauer <s.hauer@pengutronix.de>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
      Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
      75b57ecf
  9. 12 2月, 2014 1 次提交
  10. 05 2月, 2014 2 次提交
  11. 03 2月, 2014 1 次提交
  12. 24 1月, 2014 1 次提交
  13. 04 11月, 2013 1 次提交
  14. 31 10月, 2013 1 次提交
  15. 26 10月, 2013 1 次提交
  16. 24 10月, 2013 1 次提交
  17. 10 10月, 2013 2 次提交
  18. 30 8月, 2013 1 次提交
  19. 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
  20. 13 8月, 2013 1 次提交
  21. 24 7月, 2013 1 次提交
  22. 02 5月, 2013 1 次提交
  23. 12 4月, 2013 1 次提交
  24. 10 4月, 2013 1 次提交
  25. 04 4月, 2013 1 次提交
  26. 13 2月, 2013 1 次提交
    • G
      of: Create function for counting number of phandles in a property · bd69f73f
      Grant Likely 提交于
      This patch creates of_count_phandle_with_args(), a new function for
      counting the number of phandle+argument tuples in a given property. This
      is better than the existing method of parsing each phandle individually
      until parsing fails which is a horribly slow way to do the count.
      
      Tested on ARM using the selftest code.
      
      v3: - Rebased on top of selftest code cleanup patch
      v2: - fix bug where of_parse_phandle_with_args() could behave like _count_.
          - made of_gpio_named_count() into a static inline regardless of CONFIG_OF_GPIO
      Tested-by: NAndreas Larsson <andreas@gaisler.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Rob Herring <rob.herring@calxeda.com>
      bd69f73f
  27. 09 2月, 2013 1 次提交
  28. 06 2月, 2013 1 次提交
  29. 12 12月, 2012 1 次提交
  30. 30 11月, 2012 2 次提交
  31. 21 11月, 2012 2 次提交
  32. 17 11月, 2012 1 次提交
  33. 15 11月, 2012 1 次提交