1. 12 2月, 2018 2 次提交
    • S
      of: unittest: Add phandle remapping test · 357aa4b6
      Stephen Boyd 提交于
      Test the functionality of of_parse_phandle_with_args_map().
      
      Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Mark Brown <broonie@kernel.org>
      Signed-off-by: NStephen Boyd <stephen.boyd@linaro.org>
      Signed-off-by: NRob Herring <robh@kernel.org>
      357aa4b6
    • S
      of: Support parsing phandle argument lists through a nexus node · bd6f2fd5
      Stephen Boyd 提交于
      Platforms like 96boards have a standardized connector/expansion
      slot that exposes signals like GPIOs to expansion boards in an
      SoC agnostic way. We'd like the DT overlays for the expansion
      boards to be written once without knowledge of the SoC on the
      other side of the connector. This avoids the unscalable
      combinatorial explosion of a different DT overlay for each
      expansion board and SoC pair.
      
      We need a way to describe the GPIOs routed through the connector
      in an SoC agnostic way. Let's introduce nexus property parsing
      into the OF core to do this. This is largely based on the
      interrupt nexus support we already have. This allows us to remap
      a phandle list in a consumer node (e.g. reset-gpios) through a
      connector in a generic way (e.g. via gpio-map). Do this in a
      generic routine so that we can remap any sort of variable length
      phandle list.
      
      Taking GPIOs as an example, the connector would be a GPIO nexus,
      supporting the remapping of a GPIO specifier space to multiple
      GPIO providers on the SoC. DT would look as shown below, where
      'soc_gpio1' and 'soc_gpio2' are inside the SoC, 'connector' is an
      expansion port where boards can be plugged in, and
      'expansion_device' is a device on the expansion board.
      
      	soc {
      		soc_gpio1: gpio-controller1 {
      			#gpio-cells = <2>;
      		};
      
      		soc_gpio2: gpio-controller2 {
      			#gpio-cells = <2>;
      		};
      	};
      
      	connector: connector {
      		#gpio-cells = <2>;
      		gpio-map = <0 0 &soc_gpio1 1 0>,
      			   <1 0 &soc_gpio2 4 0>,
      			   <2 0 &soc_gpio1 3 0>,
      			   <3 0 &soc_gpio2 2 0>;
      		gpio-map-mask = <0xf 0x0>;
      		gpio-map-pass-thru = <0x0 0x1>
      	};
      
      	expansion_device {
      		reset-gpios = <&connector 2 GPIO_ACTIVE_LOW>;
      	};
      
      The GPIO core would use of_parse_phandle_with_args_map() instead
      of of_parse_phandle_with_args() and arrive at the same type of
      result, a phandle and argument list. The difference is that the
      phandle and arguments will be remapped through the nexus node to
      the underlying SoC GPIO controller node. In the example above,
      we would remap 'reset-gpios' from <&connector 2 GPIO_ACTIVE_LOW>
      to <&soc_gpio1 3 GPIO_ACTIVE_LOW>.
      
      Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Mark Brown <broonie@kernel.org>
      Signed-off-by: NStephen Boyd <stephen.boyd@linaro.org>
      Signed-off-by: NRob Herring <robh@kernel.org>
      bd6f2fd5
  2. 23 1月, 2018 1 次提交
  3. 18 1月, 2018 1 次提交
  4. 16 1月, 2018 1 次提交
  5. 11 1月, 2018 1 次提交
  6. 09 1月, 2018 1 次提交
  7. 08 1月, 2018 2 次提交
    • R
      of/fdt: use memblock_virt_alloc for early alloc · 0fa1c579
      Rob Herring 提交于
      memblock_virt_alloc() works for both memblock and bootmem, so use it and
      make early_init_dt_alloc_memory_arch a static function. The arches using
      bootmem define early_init_dt_alloc_memory_arch as either:
      
      __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS))
      
      or:
      
      alloc_bootmem_align(size, align)
      
      Both of these evaluate to the same thing as does memblock_virt_alloc for
      bootmem. So we can disable the arch specific functions by making
      early_init_dt_alloc_memory_arch static and they can be removed in
      subsequent commits.
      
      Cc: Frank Rowand <frowand.list@gmail.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      0fa1c579
    • R
      of: Use SPDX license tag for DT files · af6074fc
      Rob Herring 提交于
      Convert remaining DT files to use SPDX-License-Identifier tags.
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
      Reviewed-by: NFrank Rowand <frank.rowand@sony.com>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      af6074fc
  8. 05 1月, 2018 1 次提交
  9. 03 1月, 2018 1 次提交
  10. 28 12月, 2017 1 次提交
  11. 14 12月, 2017 2 次提交
  12. 13 12月, 2017 3 次提交
  13. 08 12月, 2017 2 次提交
  14. 07 12月, 2017 5 次提交
  15. 21 11月, 2017 1 次提交
  16. 17 11月, 2017 3 次提交
  17. 09 11月, 2017 2 次提交
  18. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  19. 24 10月, 2017 1 次提交
  20. 22 10月, 2017 4 次提交
    • B
      soc: qcom: Remote filesystem memory driver · d1de6d6c
      Bjorn Andersson 提交于
      The Qualcomm remote file system protocol is used by certain remoteprocs,
      in particular the modem, to read and write persistent storage in
      platforms where only the application CPU has physical storage access.
      
      The protocol is based on a set of QMI-encoded control-messages and a
      shared memory buffer for exchaning the data. This driver implements the
      latter, providing the user space service access to the carved out chunk
      of memory.
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: NAndy Gross <andy.gross@linaro.org>
      d1de6d6c
    • B
      of: reserved_mem: Accessor for acquiring reserved_mem · eb297bc7
      Bjorn Andersson 提交于
      In some cases drivers referencing a reserved-memory region might want to
      remap the entire region, but when defining the reserved-memory by "size"
      the client driver has no means to know the associated base address of
      the reserved memory region.
      
      This patch adds an accessor for such drivers to acquire a handle to
      their associated reserved-memory for this purpose.
      
      A complicating factor for the implementation is that the reserved_mem
      objects are created from the flattened DeviceTree, as such we can't
      use the device_node address for comparison. Fortunately the name of the
      node will be used as "name" of the reserved_mem and will be used when
      building the full_name, so we can compare the "name" with the basename
      of the full_name to find the match.
      Reviewed-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: NAndy Gross <andy.gross@linaro.org>
      eb297bc7
    • B
      of/platform: Generalize /reserved-memory handling · a50ff19d
      Bjorn Andersson 提交于
      By iterating over all /reserved-memory child nodes and match each one to
      a list of compatibles that we want to treat specially, we can easily
      extend the list of compatibles to handle - without having to resort to
      of_platform_populate() that would create unnecessary platform_devices.
      Reviewed-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: NAndy Gross <andy.gross@linaro.org>
      a50ff19d
    • G
      of_mdio: Fix broken PHY IRQ in case of probe deferral · 66bdede4
      Geert Uytterhoeven 提交于
      If an Ethernet PHY is initialized before the interrupt controller it is
      connected to, a message like the following is printed:
      
          irq: no irq domain found for /interrupt-controller@e61c0000 !
      
      However, the actual error is ignored, leading to a non-functional (POLL)
      PHY interrupt later:
      
          Micrel KSZ8041RNLI ee700000.ethernet-ffffffff:01: attached PHY driver [Micrel KSZ8041RNLI] (mii_bus:phy_addr=ee700000.ethernet-ffffffff:01, irq=POLL)
      
      Depending on whether the PHY driver will fall back to polling, Ethernet
      may or may not work.
      
      To fix this:
        1. Switch of_mdiobus_register_phy() from irq_of_parse_and_map() to
           of_irq_get().
           Unlike the former, the latter returns -EPROBE_DEFER if the
           interrupt controller is not yet available, so this condition can be
           detected.
           Other errors are handled the same as before, i.e. use the passed
           mdio->irq[addr] as interrupt.
        2. Propagate and handle errors from of_mdiobus_register_phy() and
           of_mdiobus_register_device().
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      66bdede4
  21. 20 10月, 2017 2 次提交
  22. 19 10月, 2017 1 次提交
    • R
      drivers: flag buses which demand DMA configuration · d89e2378
      Robin Murphy 提交于
      We do not want the common dma_configure() pathway to apply
      indiscriminately to all devices, since there are plenty of buses which
      do not have DMA capability, and if their child devices were used for
      DMA API calls it would only be indicative of a driver bug. However,
      there are a number of buses for which DMA is implicitly expected even
      when not described by firmware - those we whitelist with an automatic
      opt-in to dma_configure(), assuming that the DMA address space and the
      physical address space are equivalent if not otherwise specified.
      
      Commit 72328883 ("of: restrict DMA configuration") introduced a
      short-term fix by comparing explicit bus types, but this approach is far
      from pretty, doesn't scale well, and fails to cope at all with bus
      drivers which may be built as modules, like host1x. Let's refine things
      by making that opt-in a property of the bus type, which neatly addresses
      those problems and lets the decision of whether firmware description of
      DMA capability should be optional or mandatory stay internal to the bus
      drivers themselves.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Acked-by: NRob Herring <robh@kernel.org>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      d89e2378
  23. 18 10月, 2017 1 次提交