1. 11 5月, 2015 1 次提交
  2. 04 3月, 2015 2 次提交
  3. 22 1月, 2015 2 次提交
  4. 14 1月, 2015 1 次提交
  5. 02 12月, 2014 2 次提交
  6. 25 11月, 2014 1 次提交
  7. 20 11月, 2014 1 次提交
    • G
      of: Properly set the OF_POPULATED_BUS flag on root node · 2d0747c4
      Grant Likely 提交于
      of_platform_populate() takes a subset of the device tree and turns it
      into a set of platform_devices. At the same time it sets the
      OF_POPULATED_BUS flag in each bus nodes so that of_platform_depopulate()
      can undo the operation at a later time. However, it doesn't set the flag
      on the root of the population tree which means that dynamic modifications
      of the device tree at runtime will not create/destroy devices correctly.
      
      Fix of_platform_populate() to set the OF_POPULATED_BUS flag on the node
      it is called with.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
      Cc: Pawel Moll <pawel.moll@arm.com>
      2d0747c4
  8. 05 11月, 2014 1 次提交
    • G
      of/platform: Move platform devices under /sys/devices/platform · 43c0767e
      Grant Likely 提交于
      Currently the devices created by drivers/of/platform.c get created at
      the root of /sys/devices. This goes against the typical pattern for
      sysfs where the top level /sys/devices structure contains categories of
      devices, and the structure of devices is placed below that. To fix this,
      make the code in drivers/of/platform.c follow the drivers/base/platform.c
      behaviour, and use &platform_bus as the default parent for all new
      platform_devices and amba_devices.
      
      This change has been discussed for a long time, but nobody has actually
      acted on it. Userspace code that expects to find devices under a fixed
      /sys/devices/... path will be affected. It isn't /supposed/ to do that,
      but if anyone complains then I'll add a default-off workaround option to
      put them back into the root.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      43c0767e
  9. 22 9月, 2014 1 次提交
  10. 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
  11. 17 6月, 2014 1 次提交
  12. 04 6月, 2014 1 次提交
  13. 23 5月, 2014 2 次提交
    • G
      of: Stop naming platform_device using dcr address · ba52464a
      Grant Likely 提交于
      There is now a way to ensure all platform devices get a unique name when
      populated from the device tree, and the DCR_NATIVE code path is broken
      anyway. PowerPC Cell (PS3) is the only platform that actually uses this
      path.  Most likely nobody will notice if it is killed. Remove the code
      and associated ugly #ifdef.
      
      The user-visible impact of this patch is that any DCR device on Cell
      will get a new name in the /sys/devices hierarchy.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      ba52464a
    • G
      of: Ensure unique names without sacrificing determinism · 07e461cd
      Grant Likely 提交于
      The way the driver core is implemented, every device using the same bus
      type is required to have a unique name because a symlink to each device
      is created in the appropriate /sys/bus/*/devices directory, and two
      identical names causes a collision.
      
      The current code handles the requirement by using an globally
      incremented counter that is appended to the device name. It works, but
      it means any change to device registration will change the assigned
      numbers. Instead, if we build up the name by using information from the
      parent nodes, then it can be guaranteed to be unique without adding a
      random number to the end of it.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
      Cc: Rob Herring <robh@kernel.org>
      07e461cd
  14. 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
  15. 14 5月, 2014 2 次提交
  16. 07 5月, 2014 1 次提交
    • S
      of: configure the platform device dma parameters · 591c1ee4
      Santosh Shilimkar 提交于
      Retrieve DMA configuration from DT and setup platform device's DMA
      parameters. The DMA configuration in DT has to be specified using
      "dma-ranges" and "dma-coherent" properties if supported.
      
      We setup dma_pfn_offset using "dma-ranges" and dma_coherent_ops
      using "dma-coherent" device tree properties.
      
      The set_arch_dma_coherent_ops macro has to be defined by arch if
      it supports coherent dma_ops. Otherwise, set_arch_dma_coherent_ops() is
      declared as nop.
      
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Reviewed-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      591c1ee4
  17. 25 4月, 2014 1 次提交
    • R
      of/irq: do irq resolution in platform_get_irq · 9ec36caf
      Rob Herring 提交于
      Currently we get the following kind of errors if we try to use interrupt
      phandles to irqchips that have not yet initialized:
      
      irq: no irq domain found for /ocp/pinmux@48002030 !
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 1 at drivers/of/platform.c:171 of_device_alloc+0x144/0x184()
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.0-00038-g42a9708 #1012
      (show_stack+0x14/0x1c)
      (dump_stack+0x6c/0xa0)
      (warn_slowpath_common+0x64/0x84)
      (warn_slowpath_null+0x1c/0x24)
      (of_device_alloc+0x144/0x184)
      (of_platform_device_create_pdata+0x44/0x9c)
      (of_platform_bus_create+0xd0/0x170)
      (of_platform_bus_create+0x12c/0x170)
      (of_platform_populate+0x60/0x98)
      
      This is because we're wrongly trying to populate resources that are not
      yet available. It's perfectly valid to create irqchips dynamically, so
      let's fix up the issue by resolving the interrupt resources when
      platform_get_irq is called.
      
      And then we also need to accept the fact that some irqdomains do not
      exist that early on, and only get initialized later on. So we can
      make the current WARN_ON into just into a pr_debug().
      
      We still attempt to populate irq resources when we create the devices.
      This allows current drivers which don't use platform_get_irq to continue
      to function. Once all drivers are fixed, this code can be removed.
      Suggested-by: NRussell King <linux@arm.linux.org.uk>
      Signed-off-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Tested-by: NTony Lindgren <tony@atomide.com>
      Cc: stable@vger.kernel.org # v3.10+
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      9ec36caf
  18. 04 11月, 2013 1 次提交
  19. 31 10月, 2013 1 次提交
  20. 15 10月, 2013 1 次提交
  21. 10 9月, 2013 1 次提交
  22. 27 8月, 2013 1 次提交
  23. 24 7月, 2013 1 次提交
  24. 18 2月, 2013 1 次提交
    • G
      Revert "of: use platform_device_add" · 02bbde78
      Grant Likely 提交于
      This reverts commit aac73f34. That
      commit causes two kinds of breakage; it breaks registration of AMBA
      devices when one of the parent nodes already contains overlapping
      resource regions, and it breaks calls to request_region() by device
      drivers in certain conditions where there are overlapping memory
      regions. Both of these problems can probably be fixed, but it is better
      to back out the commit and get a proper fix designed before trying again.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      02bbde78
  25. 06 2月, 2013 1 次提交
    • G
      of: use platform_device_add · aac73f34
      Grant Likely 提交于
      This allows platform_device_add a chance to call insert_resource on all
      of the resources from OF. At a minimum this fills in proc/iomem and
      presumably makes resource tracking and conflict detection work better.
      However, it has the side effect of moving all OF generated platform
      devices from /sys/devices to /sys/devices/platform/. It /shouldn't/
      break userspace because userspace is not supposed to depend on the full
      path (because userspace always does what it is supposed to, right?).
      
      This may cause breakage if either:
      1) any two nodes in a given device tree have overlapping & staggered
         regions (ie. 0x80..0xbf and 0xa0..0xdf; where one is not contained
         within the other). In this case one of the devices will fail to
         register and an exception will be needed in platform_device_add() to
         complain but not fail.
      2) any device calls request_mem_region() on a region larger than
         specified in the device tree. In this case the device node may be
         wrong, or the driver is overreaching. In either case I'd like to know
         about any problems and fix them.
      
      Please test. Despite the above, I'm still fairly confident that this
      patch is in good shape. I'd like to put it into linux-next, but would
      appreciate some bench testing from others before I do; particularly on
      PowerPC machines.
      
      v2: Remove powerpc special-case
      
      Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      aac73f34
  26. 09 1月, 2013 1 次提交
  27. 18 10月, 2012 1 次提交
  28. 03 8月, 2012 1 次提交
    • S
      of: Allow busses with #size-cells=0 · 5d61b165
      Stephen Warren 提交于
      It's quite legitimate for a DT node to specify #size-cells=0. One example
      is a node that's used to collect a number of non-memory-mapped devices.
      In that scenario, there may be multiple child nodes with the same name
      (type) thus necessitating the use of unit addresses in node names, and
      reg properties:
      
      / {
      	regulators {
      		compatible = "simple-bus";
      		#address-cells = <1>;
      		#size-cells = <0>;
      
      		regulator@0 {
      			compatible = "regulator-fixed";
      			reg = <0>;
      			...
      		};
      
      		regulator@1 {
      			compatible = "regulator-fixed";
      			reg = <1>;
      			...
      		};
      
      		...
      	};
      };
      
      However, #size-cells=0 prevents translation of reg property values into
      the parent node's address space. In turn, this triggers the kernel to
      emit error messages during boot, such as:
      
          prom_parse: Bad cell count for /regulators/regulator@0
      
      To prevent printing these error messages for legitimate DT content, a
      number of changes are made:
      
      1) of_get_address()/of_get_pci_address() are modified only to validate
         the value of #address-cells, and not #size-cells.
      
      2) of_can_translate_address() is added to indicate whether address
         translation is possible.
      
      3) of_device_make_bus_id() is modified to name devices based on the
         translated address only where possible, and otherwise fall back to
         using the (first cell of the) raw untranslated address.
      
      4) of_device_alloc() is modified to create memory resources for a device
         only if the address can be translated into the CPU's address space.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      5d61b165
  29. 07 7月, 2012 1 次提交
    • L
      of: address: Don't fail a lookup just because a node has no reg property · 84774e61
      Lee Jones 提交于
      Sometimes it doesn't make any sense for a node to have an address.
      In this case device lookup will always be unsuccessful because we
      currently assume every node will have a reg property. This patch
      changes the semantics so that the resource address and the lookup
      address will only be compared if one exists.
      
      Things like AUXDATA() rely on of_dev_lookup to return the lookup
      entry of a particular device in order to do things like apply
      platform_data to a device. However, this is currently broken for
      nodes which do not have a reg property, meaning that platform_data
      can not be passed in those cases.
      Acked-by: NRob Herring <rob.herring@calxeda.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      84774e61
  30. 14 6月, 2012 1 次提交
  31. 27 2月, 2012 1 次提交
    • G
      devicetree: Add empty of_platform_populate() for !CONFIG_OF_ADDRESS (sparc) · 964dba28
      Grant Likely 提交于
      Sparc has its own helpers for translating address ranges when the device
      tree is parsed at boot time, and it isn't able to use of_platform_populate().
      However, there are some device drivers that want to use that function on
      other DT enabled platforms (ie. TWL4030).  This patch adds an empty
      of_platform_populate() implementation that returns an error when
      CONFIG_OF_ADDRESS is not selected.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Samuel Ortiz <sameo@linux.intel.com>
      964dba28
  32. 25 1月, 2012 1 次提交
  33. 13 12月, 2011 1 次提交
  34. 04 11月, 2011 1 次提交
  35. 08 7月, 2011 1 次提交