1. 19 11月, 2014 1 次提交
    • A
      of/fdt: export fdt blob as /sys/firmware/fdt · 08d53aa5
      Ard Biesheuvel 提交于
      Create a new /sys entry '/sys/firmware/fdt' to export the FDT blob
      that was passed to the kernel by the bootloader. This allows userland
      applications such as kexec to access the raw binary.
      
      The fact that this node does not reside under /sys/firmware/device-tree
      is deliberate: FDT is also used on arm64 UEFI/ACPI systems to
      communicate just the UEFI and ACPI entry points, but the FDT is never
      unflattened and used to configure the system.
      
      A CRC32 checksum is calculated over the entire FDT blob, and verified
      at late_initcall time. The sysfs entry is instantiated only if the
      checksum is valid, i.e., if the FDT blob has not been modified in the
      mean time. Otherwise, a warning is printed.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      08d53aa5
  2. 05 11月, 2014 2 次提交
  3. 04 11月, 2014 1 次提交
    • G
      of: Eliminate of_allnodes list · 5063e25a
      Grant Likely 提交于
      The device tree structure is composed of two lists; the 'allnodes' list
      which is a singly linked list containing every node in the tree, and the
      child->parent structure where each parent node has a singly linked list
      of children. All of the data in the allnodes list can be easily
      reproduced with the parent-child lists, so of_allnodes is actually
      unnecessary. Remove it entirely which saves a bit of memory and
      simplifies the data structure quite a lot.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Gaurav Minocha <gaurav.minocha.os@gmail.com>
      Cc: Pantelis Antoniou <pantelis@pantelis.antoniou@konsulko.com>
      5063e25a
  4. 25 9月, 2014 1 次提交
    • S
      of/fdt: fix memory range check · 9aacd602
      Srinivas Kandagatla 提交于
      In cases where board has below memory DT node
      
      memory{
      	device_type = "memory";
      	reg = <0x80000000 0x80000000>;
      };
      
      Check on the memory range in fdt.c will always fail because it is
      comparing MAX_PHYS_ADDR with base + size, in fact it should compare
      it with base + size - 1.
      
      This issue was originally noticed on Qualcomm IFC6410 board.
      Without this patch kernel shows up noticed unnecessary warnings
      
      [    0.000000] Machine model: Qualcomm APQ8064/IFC6410
      [    0.000000] Ignoring memory range 0xffffffff - 0x100000000
      [    0.000000] cma: Reserved 64 MiB at ab800000
      
      as a result the size get reduced to 0x7fffffff which looks wrong.
      
      This patch fixes the check involved in generating this warning and
      as a result it also fixes the wrong size calculation.
      Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      [grant.likely: adjust new size calculation also]
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      9aacd602
  5. 08 9月, 2014 1 次提交
  6. 16 8月, 2014 1 次提交
    • A
      of: Allow mem_reserve of memory with a base address of zero · b5f2a8c0
      Al Cooper 提交于
      __reserved_mem_reserve_reg() won't reserve memory if the base address
      is zero. This change removes the check for a base address of zero and
      allows it to be reserved.
      
      Allowing the first 4K of memory to be reserved will help solve a
      problem on some ARM systems where the the first 16K of memory is
      unused and becomes allocable memory. This will prevent this memory
      from being used for DMA by drivers like the USB OHCI driver which
      consider a physical address of zero to be illegal.
      
      Cc: stable@vger.kernel.org # 3.15+
      Signed-off-by: NAl Cooper <alcooperx@gmail.com>
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      b5f2a8c0
  7. 02 8月, 2014 1 次提交
  8. 30 7月, 2014 2 次提交
  9. 27 6月, 2014 1 次提交
  10. 23 5月, 2014 2 次提交
  11. 21 5月, 2014 1 次提交
  12. 30 4月, 2014 10 次提交
  13. 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
  14. 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
  15. 15 3月, 2014 1 次提交
  16. 12 3月, 2014 3 次提交
    • 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 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
  17. 11 12月, 2013 1 次提交
  18. 14 10月, 2013 1 次提交
    • G
      Revert "of: Feed entire flattened device tree into the random pool" · b920ecc8
      Grant Likely 提交于
      This reverts commit 109b6236.
      
      Tim Bird expressed concern that this will have a bad effect on boot
      time, and while simple tests have shown it to be okay with simple tree,
      a device tree blob can potentially be quite large and
      add_device_randomness() is not a fast function. Rather than do this for
      all platforms unconditionally, I'm reverting this patch and would like
      to see it revisited. Instead of feeding the entire tree into the random
      pool, it would probably be appropriate to hash the tree and feed the
      hash result into the pool. There really isn't a lot of randomness in a
      device tree anyway. In the majority of cases only a handful of
      properties are going to be different between machines with the same
      baseboard.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      b920ecc8
  19. 10 10月, 2013 5 次提交
  20. 30 8月, 2013 3 次提交