1. 08 9月, 2012 1 次提交
  2. 07 9月, 2012 1 次提交
  3. 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
  4. 11 7月, 2012 2 次提交
  5. 10 7月, 2012 1 次提交
    • A
      of: mtd: nuke useless const qualifier · e95d8aaf
      Artem Bityutskiy 提交于
      This patch does the following:
       -const int of_get_nand_ecc_mode(struct device_node *np)
       +int of_get_nand_ecc_mode(struct device_node *np)
      
      because:
      1. it is probably just a typo?
      2. it causes warnings like this when people assing the returned
         value to an 'int' variable:
         include/linux/of_mtd.h:14:18: warning: type qualifiers ignored on functi=
      on return type [-Wignored-qualifiers]
      
      Remove also the unnecessary "extern" qualifier to be consistent with other
      declarations in this file.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      e95d8aaf
  6. 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
  7. 06 7月, 2012 3 次提交
  8. 28 6月, 2012 2 次提交
    • D
      netdev/phy/of: Handle IEEE802.3 clause 45 Ethernet PHYs in of_mdiobus_register() · 6bd47ac2
      David Daney 提交于
      Define two new "compatible" values for Ethernet
      PHYs. "ethernet-phy-ieee802.3-c22" and "ethernet-phy-ieee802.3-c45"
      are used to indicate a PHY uses the corresponding protocol.
      
      If a PHY is "compatible" with "ethernet-phy-ieee802.3-c45", we
      indicate this so that get_phy_device() can properly probe the device.
      
      If get_phy_device() fails, it was probably due to failing the probe of
      the PHY identifier registers.  Since we have the device tree telling
      us the PHY exists, go ahead and add it anyhow with a phy_id of zero.
      There may be a driver match based on the "compatible" property.
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6bd47ac2
    • D
      netdev/phy: Handle IEEE802.3 clause 45 Ethernet PHYs · ac28b9f8
      David Daney 提交于
      The IEEE802.3 clause 45 MDIO bus protocol allows for directly
      addressing PHY registers using a 21 bit address, and is used by many
      10G Ethernet PHYS.  Already existing is the ability of MDIO bus
      drivers to use clause 45, with the MII_ADDR_C45 flag.  Here we add
      struct phy_c45_device_ids to hold the device identifier registers
      present in clause 45. struct phy_device gets a couple of new fields:
      c45_ids to hold the identifiers and is_c45 to signal that it is clause
      45.
      
      get_phy_device() gets a new parameter is_c45 to indicate that the PHY
      device should use the clause 45 protocol, and its callers are adjusted
      to pass false.  The follow-on patch to of_mdio.c will pass true where
      appropriate.
      
      EXPORT phy_device_create() so that the follow-on patch to of_mdio.c
      can use it to create phy devices for PHYs, that have non-standard
      device identifier registers, based on the device tree bindings.
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ac28b9f8
  9. 16 6月, 2012 1 次提交
    • G
      devicetree: add helper inline for retrieving a node's full name · efd68e72
      Grant Likely 提交于
      The pattern (np ? np->full_name : "<none>") is rather common in the
      kernel, but can also make for quite long lines.  This patch adds a new
      inline function, of_node_full_name() so that the test for a valid node
      pointer doesn't need to be open coded at all call sites.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      efd68e72
  10. 15 6月, 2012 1 次提交
  11. 14 6月, 2012 1 次提交
  12. 21 5月, 2012 1 次提交
  13. 12 5月, 2012 2 次提交
  14. 08 5月, 2012 1 次提交
    • D
      netdev/of/phy: New function: of_mdio_find_bus(). · 25106022
      David Daney 提交于
      Add of_mdio_find_bus() which allows an mii_bus to be located given its
      associated the device tree node.
      
      This is needed by the follow-on patch to add a driver for MDIO bus
      multiplexers.
      
      The of_mdiobus_register() function is modified so that the device tree
      node is recorded in the mii_bus.  Then we can find it again by
      iterating over all mdio_bus_class devices.
      
      Because the OF device tree has now become an integral part of the
      kernel, this can live in mdio_bus.c (which contains the needed
      mdio_bus_class structure) instead of of_mdio.c.
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      25106022
  15. 23 4月, 2012 1 次提交
    • A
      ARM: spear: remove most mach/*.h header contents · 5019f0b1
      Arnd Bergmann 提交于
      The register and irq definitions in mach/*.h for spear3xx and
      spear6xx are now mostly obsolete, after the platforms have been
      converted to device tree based probing and the data is now
      part of the device tree files.
      
      The misc_regs.h contents are moved into clock.c because that is
      the only user, aside from the DMA_CHN_CFG that should eventually
      get handled differently. Some of the contents of mach/spear.h
      still remain, because they are used to set up the static map table,
      timer, uart and auxdata tables, but almost everything got removed.
      We might remove everything but the map table as the DT conversion
      completes, but that is not a priority. I've also made sure to
      make both copies of spear.h more or less identical so we can
      eventually combine them.
      
      The spear3?0.h files were only used by the spear3?0.c files, so I
      merged the contents in there and removed the bits that were unused.
      This is something that should still be looked at.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NViresh Kumar <viresh.kumar@st.com>
      5019f0b1
  16. 18 4月, 2012 1 次提交
    • S
      dt: add property iteration helpers · c541adc6
      Stephen Warren 提交于
      This patch adds macros of_property_for_each_u32() and
      of_property_for_each_string(), which iterate over an array of values
      within a device-tree property. Usage is for example:
      
      struct property *prop;
      const __be32 *p;
      u32 u;
      of_property_for_each_u32(np, "propname", prop, p, u)
      	printk("U32 value: %x\n", u);
      
      struct property *prop;
      const char *s;
      of_property_for_each_string(np, "propname", prop, s)
      	printk("String value: %s\n", s);
      
      Based on work by Rob Herring <robherring2@gmail.com>
      
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NRob Herring <rob.herring@calxeda.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      c541adc6
  17. 14 4月, 2012 1 次提交
  18. 11 4月, 2012 1 次提交
  19. 08 4月, 2012 1 次提交
  20. 15 3月, 2012 1 次提交
  21. 03 3月, 2012 1 次提交
  22. 28 2月, 2012 2 次提交
  23. 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
  24. 22 2月, 2012 1 次提交
  25. 06 2月, 2012 1 次提交
  26. 02 2月, 2012 1 次提交
    • G
      drivercore: Output common devicetree information in uevent · 07d57a32
      Grant Likely 提交于
      When userspace needs to find a specific device, it currently isn't easy to
      resolve a /sys/devices/ path from a specific device tree node.  Nor is it
      easy to obtain the compatible list for devices.
      
      This patch generalizes the code that inserts OF_* values into the uevent
      device attribute so that any device that is attached to an OF node will
      have that information exported to userspace.  Without this patch only
      platform devices and some powerpc-specific busses have access to this
      data.
      
      The original function also creates a MODALIAS property for the compatible
      list, but that code has not been generalized into the common case because
      it has the potential to break module loading on a lot of bus types.  Bus
      types are still responsible for their own MODALIAS properties.
      
      Boot tested on ARM and compile tested on PowerPC and SPARC.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Tobias Klauser <tklauser@distanz.ch>
      Cc: Frederic Lambert <frdrc66@gmail.com>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Mark Brown <broonie@sirena.org.uk>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      07d57a32
  27. 29 1月, 2012 1 次提交
  28. 25 1月, 2012 1 次提交
  29. 10 1月, 2012 1 次提交
  30. 05 1月, 2012 1 次提交
    • F
      ARM: prom.h: Fix build error by removing unneeded header file · c89810ac
      Fabio Estevam 提交于
      Fix the following build error:
      
        CC [M]  fs/udf/balloc.o
      In file included from /home/fabio/next/linux-next/arch/arm/include/asm/prom.h:16,
                       from include/linux/of.h:140,
                       from include/asm-generic/gpio.h:7,
                       from arch/arm/plat-mxc/include/mach/irqs.h:14,
                       from /home/fabio/next/linux-next/arch/arm/include/asm/irq.h:4,
                       from /home/fabio/next/linux-next/arch/arm/include/asm/hardirq.h:6,
                       from include/linux/hardirq.h:7,
                       from include/linux/highmem.h:8,
                       from include/linux/pagemap.h:10,
                       from include/linux/buffer_head.h:13,
                       from fs/udf/udfdecl.h:11,
                       from fs/udf/balloc.c:22:
      /home/fabio/next/linux-next/arch/arm/include/asm/setup.h:146: error: redefinition of 'struct tag'
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      [grant.likely: fix build failure on drivers/of/fdt.c]
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      c89810ac
  31. 04 1月, 2012 2 次提交
  32. 28 12月, 2011 2 次提交