1. 27 8月, 2013 1 次提交
  2. 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
  3. 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
  4. 09 1月, 2013 1 次提交
  5. 18 10月, 2012 1 次提交
  6. 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
  7. 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
  8. 14 6月, 2012 1 次提交
  9. 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
  10. 25 1月, 2012 1 次提交
  11. 13 12月, 2011 1 次提交
  12. 04 11月, 2011 1 次提交
  13. 08 7月, 2011 1 次提交
  14. 22 6月, 2011 4 次提交
  15. 24 3月, 2011 2 次提交
  16. 02 3月, 2011 1 次提交
  17. 28 2月, 2011 1 次提交
    • G
      dt/powerpc: move of_bus_type infrastructure to ibmebus · 710ac54b
      Grant Likely 提交于
      arch/powerpc/kernel/ibmebus.c is the only remaining user of the
      of_bus_type support code for initializing the bus and registering
      drivers.  All others have either been switched to the vanilla platform
      bus or already have their own infrastructure.
      
      This patch moves the functionality that ibmebus is using out of
      drivers/of/{platform,device}.c and into ibmebus.c where it is actually
      used.  Also renames the moved symbols from of_platform_* to
      ibmebus_bus_* to reflect the actual usage.
      
      This patch is part of moving all of the of_platform_bus_type users
      over to the platform_bus_type.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      710ac54b
  18. 04 1月, 2011 1 次提交
    • G
      of/device: Don't register disabled devices · cd1e6504
      Grant Likely 提交于
      Device nodes with the property status="disabled" are not usable and so
      don't register them when parsing the device tree for devices.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Hollis Blanchard <hollis_blanchard@mentor.com>
      Cc: Deepak Saxena <deepak_saxena@mentor.com>
      Cc: Scott Wood <scottwood@freescale.com>,
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      cd1e6504
  19. 22 10月, 2010 1 次提交
    • G
      of/device: Rework to use common platform_device_alloc() for allocating devices · 7096d042
      Grant Likely 提交于
      The current code allocates and manages platform_devices created from
      the device tree manually.  It also uses an unsafe shortcut for
      allocating the platform_device and the resource table at the same
      time. (which I added in the last rework; sorry).
      
      This patch refactors the code to use platform_device_alloc() for
      allocating new devices.  This reduces the amount of custom code
      implemented by of_platform, eliminates the unsafe alloc trick, and has
      the side benefit of letting the platform_bus code manage freeing the
      device data and resources when the device is freed.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Michal Simek <monstr@monstr.eu>
      7096d042
  20. 13 10月, 2010 1 次提交
  21. 01 8月, 2010 1 次提交
    • G
      of/platform: Register of_platform_drivers with an "of:" prefix · 7fb8f881
      Grant Likely 提交于
      Currently there are some drivers in tree which register both a
      platform_driver and an of_platform_driver with the same name.  This is
      a temporary situation until all the relevant of_platform_drivers are
      converted to be normal platform_drivers.  Until then, this patch gives
      all the of_platform_drivers an "of:" prefix to protect against bogus
      matches and namespace conflicts.
      7fb8f881
  22. 30 7月, 2010 1 次提交
  23. 24 7月, 2010 5 次提交
  24. 19 7月, 2010 2 次提交
  25. 15 7月, 2010 1 次提交
    • G
      drivers/of: fix build error when CONFIG_PPC_DCR is set · 596c955c
      Grant Likely 提交于
      Commit 94c09319 (of:
      Merge of_device_alloc() and of_device_make_bus_id()) moved code that
      does calls a dcr routine without including the correct header which
      causes the following build error on some powerpc configurations:
      
      drivers/of/platform.c: In function 'of_device_make_bus_id':
      drivers/of/platform.c:437: error: implicit declaration of function 'of_translate_dcr_address'
      
      This patch adds the appropriate header to drivers/of/platform.c
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      596c955c
  26. 06 7月, 2010 4 次提交
    • G
      of: Fix missing include · 50ef5284
      Grant Likely 提交于
      Fix a build failure on ARM
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      50ef5284
    • G
      of/device: populate platform_device (of_device) resource table on allocation · ac80a51e
      Grant Likely 提交于
      When allocating a platform_device to represent an OF node, also allocate
      space for the resource table and populate it with IRQ and reg property
      information.  This change is in preparation for merging the
      of_platform_bus_type with the platform_bus_type so that existing
      platform_driver code can retrieve base addresses and IRQs data.
      
      Background: a previous commit removed struct of_device and made it a
      #define alias for platform_device.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Grant Likely <grant.likely@secretlab.ca>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      CC: microblaze-uclinux@itee.uq.edu.au
      CC: linuxppc-dev@ozlabs.org
      CC: devicetree-discuss@lists.ozlabs.org
      ac80a51e
    • G
      of: Merge of_device_alloc() and of_device_make_bus_id() · 94c09319
      Grant Likely 提交于
      This patch merges the common routines of_device_alloc() and
      of_device_make_bus_id() from powerpc and microblaze.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Grant Likely <grant.likely@secretlab.ca>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      CC: microblaze-uclinux@itee.uq.edu.au
      CC: linuxppc-dev@ozlabs.org
      CC: devicetree-discuss@lists.ozlabs.org
      94c09319
    • G
      of/device: Merge of_platform_bus_probe() · 5fd200f3
      Grant Likely 提交于
      Merge common code between PowerPC and microblaze.  This patch merges
      the code that scans the tree and registers devices.  The functions
      merged are of_platform_bus_probe(), of_platform_bus_create(), and
      of_platform_device_create().
      
      This patch also move the of_default_bus_ids[] table out of a Microblaze
      header file and makes it non-static.  The device ids table isn't merged
      because powerpc and microblaze use different default data.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Grant Likely <grant.likely@secretlab.ca>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      CC: microblaze-uclinux@itee.uq.edu.au
      CC: linuxppc-dev@ozlabs.org
      5fd200f3
  27. 22 5月, 2010 2 次提交