1. 30 4月, 2014 2 次提交
  2. 16 4月, 2014 1 次提交
  3. 15 4月, 2014 1 次提交
    • X
      of: Fix the section mismatch warnings. · 5b624118
      Xiubo Li 提交于
      In tag next-20140407, building with CONFIG_DEBUG_SECTION_MISMATCH
      enabled, the following WARNING is occured:
      
      WARNING: drivers/built-in.o(.text.unlikely+0x2220): Section mismatch
      in reference from the function __reserved_mem_check_root() to the
      function .init.text:of_get_flat_dt_prop()
      The function __reserved_mem_check_root() references
      the function __init of_get_flat_dt_prop().
      This is often because __reserved_mem_check_root lacks a __init
      annotation or the annotation of of_get_flat_dt_prop is wrong.
      
      WARNING: vmlinux.o(.text.unlikely+0xb9d0): Section mismatch in reference
      from the function __reserved_mem_check_root() to the (unknown reference)
      .init.data:(unknown)
      The function __reserved_mem_check_root() references
      the (unknown reference) __initdata (unknown).
      This is often because __reserved_mem_check_root lacks a __initdata
      annotation or the annotation of (unknown) is wrong.
      
      This is cause by :
      'drivers: of: add initialization code for dynamic reserved memory'.
      Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      5b624118
  4. 28 3月, 2014 1 次提交
  5. 21 3月, 2014 1 次提交
  6. 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
  7. 15 3月, 2014 1 次提交
  8. 12 3月, 2014 6 次提交
    • 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/selftest: Add self tests for manipulation of properties · 7e66c5c7
      Grant Likely 提交于
      Adds a few simple test cases to ensure that addition, update and removal
      of device tree node properties works correctly.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      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>
      7e66c5c7
    • 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
    • M
      drivers: of: add support for custom reserved memory drivers · f618c470
      Marek Szyprowski 提交于
      Add support for custom reserved memory drivers. Call their init() function
      for each reserved region and prepare for using operations provided by them
      with by the reserved_mem->ops array.
      
      Based on previous code provided by Josh Cartwright <joshc@codeaurora.org>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      f618c470
    • M
      drivers: of: add initialization code for dynamic reserved memory · 3f0c8206
      Marek Szyprowski 提交于
      This patch adds support for dynamically allocated reserved memory regions
      declared in device tree. Such regions are defined by 'size', 'alignment'
      and 'alloc-ranges' properties.
      
      Based on previous code provided by Josh Cartwright <joshc@codeaurora.org>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      3f0c8206
    • M
      drivers: of: add initialization code for static reserved memory · e8d9d1f5
      Marek Szyprowski 提交于
      This patch adds support for static (defined by 'reg' property) reserved
      memory regions declared in device tree.
      
      Memory blocks can be reliably reserved only during early boot. This must
      happen before the whole memory management subsystem is initialized,
      because we need to ensure that the given contiguous blocks are not yet
      allocated by kernel. Also it must happen before kernel mappings for the
      whole low memory are created, to ensure that there will be no mappings
      (for reserved blocks). Typically, all this happens before device tree
      structures are unflattened, so we need to get reserved memory layout
      directly from fdt.
      
      Based on previous code provided by Josh Cartwright <joshc@codeaurora.org>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      e8d9d1f5
  9. 11 3月, 2014 1 次提交
  10. 07 3月, 2014 5 次提交
  11. 04 3月, 2014 1 次提交
  12. 20 2月, 2014 4 次提交
    • G
      of: Allows to use the PCI translator without the PCI core · 25a31579
      Gregory CLEMENT 提交于
      Translating an address from a PCI node of the device-tree into a CPU
      physical address doesn't require the core PCI support. Those
      translations are just related to the device tree itself.
      
      The use case to translate an address from a PCI node without actually
      using the PCI core support is when one needs to access the PCI
      controller without accessing any PCI devices.
      
      Marvell SoCs, such as Kirkwood, Dove or Armada XP for instance, come
      with an IP of a PCI controller. In the registers of this controller
      are stored the ID and the revision of a SoC. With this patch it will
      be possible to read the SoC ID of a board without any PCI device and
      then without the PCI core support.
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Tested-by: NEzequiel Garcia <ezequiel.garcia@free-electrons.com>
      Reviewed-by: NEzequiel Garcia <ezequiel.garcia@free-electrons.com>
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      25a31579
    • G
      of: Add self test for of_match_node() · 1f42e5dd
      Grant Likely 提交于
      Adds a selftest function for the of_match_node function. of_match_node
      is supposed to handle precedence for the compatible property as well as
      the name and device_type values. This patch adds some test case data and
      a function that makes sure each test node matches against the correct
      entry of an of_device_id table.
      
      This code was written to verify the new of_match_node() implementation
      that is an earlier part of this series.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Cc: Kevin Hao <haokexin@gmail.com>
      1f42e5dd
    • G
      of: Move testcase FDT data into drivers/of · b5190516
      Grant Likely 提交于
      The testcase data is usable by any platform. This patch moves it into
      the drivers/of directory so it can be included by any architecture.
      
      Using the test cases requires manually adding #include <testcases.dtsi>
      to the end of the boards .dtsi file and enabling CONFIG_OF_SELFTEST. Not
      pretty though. A useful project would be to make the testcase code
      easier to execute.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      b5190516
    • K
      of: reimplement the matching method for __of_match_node() · 215a14cf
      Kevin Hao 提交于
      In the current implementation of __of_match_node(), it will compare
      each given match entry against all the node's compatible strings
      with of_device_is_compatible().
      
      To achieve multiple compatible strings per node with ordering from
      specific to generic, this requires given matches to be ordered from
      specific to generic. For most of the drivers this is not true and
      also an alphabetical ordering is more sane there.
      
      Therefore, we define a following priority order for the match, and
      then scan all the entries to find the best match.
        1. specific compatible && type && name
        2. specific compatible && type
        3. specific compatible && name
        4. specific compatible
        5. general compatible && type && name
        6. general compatible && type
        7. general compatible && name
        8. general compatible
        9. type && name
        10. type
        11. name
      
      v5: Fix nested locking bug
      v4: Short-circuit failure cases instead of mucking with score, and
          remove extra __of_device_is_compatible() wrapper stub.
          Move scoring logic directly into __of_device_is_compatible()
      v3: Also need to bail out when there does have a compatible member in match
          entry, but it doesn't match with the device node's compatible.
      v2: Fix the bug such as we get the same score for the following two match
          entries with the empty node 'name2 { };'
      	struct of_device_id matches[] = {
      		{.name = "name2", },
      		{.name = "name2", .type = "type1", },
      		{}
      	};
      Signed-off-by: NKevin Hao <haokexin@gmail.com>
      [grant.likely: added v4 changes]
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Tested-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Tested-by: NStephen Chivers <schivers@csc.com>
      Tested-by: NSachin Kamat <sachin.kamat@linaro.org>
      215a14cf
  13. 19 2月, 2014 2 次提交
    • B
      of_mdio: fix phy interrupt passing · f15c586d
      Ben Dooks 提交于
      The of_mdiobus_register_phy() is not setting phy->irq thus causing
      some drivers to incorrectly assume that the PHY does not have an
      IRQ associated with it. Not only do some drivers report no IRQ
      they do not install an interrupt handler for the PHY.
      
      Simplify the code setting irq and set the phy->irq at the same
      time so that we cover the following issues, which should cover
      all the cases the code will find:
      
      - Set phy->irq if node has irq property and mdio->irq is NULL
      - Set phy->irq if node has no irq and mdio->irq is not NULL
      - Leave phy->irq as PHY_POLL default if none of the above
      
      This fixes the issue:
       net eth0: attached PHY 1 (IRQ -1) to driver Micrel KSZ8041RNLI
      
      to the correct:
       net eth0: attached PHY 1 (IRQ 416) to driver Micrel KSZ8041RNLI
      Signed-off-by: NBen Dooks <ben.dooks@codethink.co.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f15c586d
    • K
      Revert "of: search the best compatible match first in __of_match_node()" · 71c5498e
      Kevin Hao 提交于
      This reverts commit 06b29e76.
      As pointed out by Grant Likely, we should also take the type and name
      into account when searching the best compatible match. That means the
      match with compatible, type and name should be better than the match
      just with the same compatible string. So revert this and we will
      implement another method to find the best match entry.
      Signed-off-by: NKevin Hao <haokexin@gmail.com>
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      71c5498e
  14. 16 2月, 2014 1 次提交
    • K
      of: search the best compatible match first in __of_match_node() · 06b29e76
      Kevin Hao 提交于
      Currently, of_match_node compares each given match against all node's
      compatible strings with of_device_is_compatible.
      
      To achieve multiple compatible strings per node with ordering from
      specific to generic, this requires given matches to be ordered from
      specific to generic. For most of the drivers this is not true and also
      an alphabetical ordering is more sane there.
      
      Therefore, this patch introduces a function to match each of the node's
      compatible strings against all given compatible matches without type and
      name first, before checking the next compatible string. This implies
      that node's compatibles are ordered from specific to generic while
      given matches can be in any order. If we fail to find such a match
      entry, then fall-back to the old method in order to keep compatibility.
      
      Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Signed-off-by: NKevin Hao <haokexin@gmail.com>
      Tested-by: NStephen Chivers <schivers@csc.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      06b29e76
  15. 15 2月, 2014 2 次提交
    • F
      net: of_mdio: fix of_set_phy_supported after driver probing · ce11c436
      Florian Fainelli 提交于
      Commit 8fdade4b ("net: of_mdio: parse "max-speed" property to set PHY
      supported features") introduced a typo in of_set_phy_supported for the
      first assignment of phydev->supported which will not effectively limit
      the PHY device supported features bits if the PHY driver contains
      "higher" features (e.g: max-speed = <100> and PHY driver has
      PHY_GBIT_FEATURES set).
      
      Fix this by making sure that the very first thing is to reset to sane
      defaults (PHY_BASIC_FEATURES) and then progressively add speed features
      as we parse them.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ce11c436
    • K
      Revert "OF: base: match each node compatible against all given matches first" · 4e8ca6ee
      Kevin Hao 提交于
      This reverts commit 10535314.
      Stephen Chivers reported this is broken as we will get a match
      entry '.type = "serial"' instead of the '.compatible = "ns16550"'
      in the following scenario:
      	serial0: serial@4500 {
      		compatible = "fsl,ns16550", "ns16550";
      	}
      
      	struct of_device_id of_platform_serial_table[] = {
      		{ .compatible = "ns8250",   .data = (void *)PORT_8250, },
      		{ .compatible = "ns16450",  .data = (void *)PORT_16450, },
      		{ .compatible = "ns16550a", .data = (void *)PORT_16550A, },
      		{ .compatible = "ns16550",  .data = (void *)PORT_16550, },
      		{ .compatible = "ns16750",  .data = (void *)PORT_16750, },
      		{ .compatible = "ns16850",  .data = (void *)PORT_16850, },
      		...
      		{ .type = "serial",         .data = (void *)PORT_UNKNOWN, },
      		{ /* end of list */ },
      	};
      
      So just revert this patch, we will use another implementation to find
      the best compatible match in a follow-on patch.
      Reported-by: NStephen N Chivers <schivers@csc.com.au>
      Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Signed-off-by: NKevin Hao <haokexin@gmail.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      4e8ca6ee
  16. 13 2月, 2014 1 次提交
    • F
      net: phy: re-design phy_modes to be self-contained · 8a2fe56e
      Florian Fainelli 提交于
      of_get_phy_mode() uses a local array to map phy_interface_t values from
      include/linux/net/phy.h to a string which is read from the 'phy-mode' or
      'phy-connection-type' property. In preparation for exposing the PHY
      interface mode through sysfs, perform the following:
      
      - mode phy_modes from drivers/of/of_net.c to include/linux/phy.h such
        that it is right below the phy_interface_t enum
      - make it a static inline function returning the string such that we can
        use it by just including include/linux/net/phy.h
      - add a PHY_INTERFACE_MODE_MAX enum value to guard the iteration in
        of_get_phy_mode()
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a2fe56e
  17. 12 2月, 2014 1 次提交
  18. 05 2月, 2014 3 次提交
  19. 03 2月, 2014 2 次提交
  20. 17 1月, 2014 2 次提交
    • Z
      platform: introduce OF style 'modalias' support for platform bus · b9f73067
      Zhang Rui 提交于
      Fix a problem that, the platform bus supports the OF style modalias
      in .uevent() call, but not in its device 'modalias' sysfs attribute.
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b9f73067
    • X
      of: Fix __of_device_is_available check · 42ccd781
      Xiubo Li 提交于
      From IEEE 1275, there defined a standard 'status' property indicating the
      operational status of one device. The 'status' property has four possible
      values: 'okay/ok', 'disabled', 'fail' and 'fail-xxx'.
      
      If it is absent, that means the status of the device is unknown or okay.
      
      The __of_device_is_available checks the state of the 'status' property of
      a device. If the property is absent or set to 'okay/ok', it returns 1.
      Otherwise it returns 0.
      
      While in __of_device_is_available:
       >	status = of_get_property(device, "status", &statlen);
       >	if (status == NULL)
       >		return 1;
      The status value returned from 'of_get_property()' will be NULL in two cases:
      Firstly: the 'device' value (device node) is NULL.
      Secondly: the 'status' property is actaully not exist.
      
      If the device node is NULL, the __of_device_is_available will return true,
      that will mean the absent state of the 'status' property.
      
      So this add the device node check before checking the 'status' property's
      state, and if the device node is not exist, 0 will be returned.
      Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com>
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      42ccd781
  21. 14 1月, 2014 1 次提交