1. 06 8月, 2016 1 次提交
  2. 19 7月, 2016 1 次提交
  3. 24 6月, 2016 2 次提交
    • K
      Revert "of/platform: export of_default_bus_match_table" · e1bcbee6
      Kefeng Wang 提交于
      This reverts commit b80443c2.
      
      After covering to use helper of_platform_default_populate() to populate
      the default bus, no need to export of_default_bus_match_table anymore.
      Reviewed-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Signed-off-by: NKefeng Wang <wangkefeng.wang@huawei.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      e1bcbee6
    • K
      of/platform: Add common method to populate default bus · 44a7185c
      Kefeng Wang 提交于
      The arch code calls of_platform_populate() with default match table
      when it wants to populate default bus.
      
      This patch introduce a new of_platform_default_populate_init() and make it
      arch_initcall_sync(it should be later than some iommu configration, eg,
      of_iommu_init() and swiotlb_late_init in arm64), then we can finish above
      job in common method.
      
      In order to avoid the default bus being populated twice, simply checking
      the flag of bus node whether has be set OF_POPULATED_BUS or not.
      
      After that, we can safely remove the caller in arch code.
      
      Btw, add debug print in of_platform_populate(), and use __func__ to
      print function's name of of_platform_bus_create().
      
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Signed-off-by: NKefeng Wang <wangkefeng.wang@huawei.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      44a7185c
  4. 15 4月, 2016 1 次提交
    • T
      of/platform: Allow secondary compatible match in of_dev_lookup · fc5cf80a
      Tony Lindgren 提交于
      We currently try to match of_dev_auxdata based on compatible,
      IO address, and device name. But in some cases we have multiple
      instances of drivers that can use the same auxdata.
      
      Let's add an additional secondary lookup for generic compatible
      match for auxdata if no device specific match is found. This does
      not change the existing matching, and still allows adding device
      specific auxdata.
      
      This simplifies things as specifying the IO address and device
      name is prone errors as it requires maintaining an in kernel
      database for each SoC.
      
      To specify a generic match, all that is needed is to add a
      OF_DEV_AUXDATA entry with no device instance specified:
      
      OF_DEV_AUXDATA("pinctrl-single", 0, NULL, &pcs_pdata),
      
      As the auxdata is already initialized only for the booted SoC,
      there's not much of a chance of getting things wrong.
      
      Let's also fix two checkpatch warnings while at it to add a
      space before parenthesis in the for loop, and remove a comparison
      to NULL by using !auxdata->compatible.
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      fc5cf80a
  5. 05 1月, 2016 1 次提交
  6. 22 10月, 2015 1 次提交
  7. 26 8月, 2015 1 次提交
  8. 30 7月, 2015 1 次提交
  9. 10 6月, 2015 1 次提交
  10. 01 6月, 2015 1 次提交
  11. 11 5月, 2015 1 次提交
  12. 04 3月, 2015 2 次提交
  13. 22 1月, 2015 2 次提交
  14. 14 1月, 2015 1 次提交
  15. 02 12月, 2014 2 次提交
  16. 25 11月, 2014 1 次提交
  17. 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
  18. 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
  19. 22 9月, 2014 1 次提交
  20. 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
  21. 17 6月, 2014 1 次提交
  22. 04 6月, 2014 1 次提交
  23. 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
  24. 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
  25. 14 5月, 2014 2 次提交
  26. 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
  27. 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
  28. 04 11月, 2013 1 次提交
  29. 31 10月, 2013 1 次提交
  30. 15 10月, 2013 1 次提交
  31. 10 9月, 2013 1 次提交
  32. 27 8月, 2013 1 次提交
  33. 24 7月, 2013 1 次提交
  34. 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