1. 13 Dec, 2018 1 commit
    • Rob Herring's avatar
      kbuild: Add support for DT binding schema checks · 4f0e3a57
      Rob Herring authored
      This adds the build infrastructure for checking DT binding schema
      documents and validating dts files using the binding schema.
      Check DT binding schema documents:
      make dt_binding_check
      Build dts files and check using DT binding schema:
      make dtbs_check
      Optionally, DT_SCHEMA_FILES can be passed in with a schema file(s) to
      use for validation. This makes it easier to find and fix errors
      generated by a specific schema.
      Currently, the validation targets are separate from a normal build to
      avoid a hard dependency on the external DT schema project and because
      there are lots of warnings generated.
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Michal Marek <michal.lkml@markovi.net>
      Cc: linux-doc@vger.kernel.org
      Cc: devicetree@vger.kernel.org
      Cc: linux-kbuild@vger.kernel.org
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  2. 29 Nov, 2018 1 commit
    • Rob Herring's avatar
      scripts/dtc: Update to upstream version v1.4.7-57-gf267e674d145 · c2e7075c
      Rob Herring authored
      This adds the following commits from upstream:
      f267e674d145 checks: Fix crash with multiple source annotations
      3616b9a811b6 checks: Use source position information for check failures
      2bdbd07a1223 checks: Make each message output atomic
      a1eff70c02cf util: Add xa{v}sprintf_append functions
      82a52ce4573b libfdt: Add a test for fdt_getprop_by_offset()
      607b8586b383 PEP8 / Flake8 cleanups for setup.py
      f9c0a425b648 Remove broken objdir / srcdir support
      5182b5e6f28c pylibfdt: Use common PREFIX variable
      d45bf1f5f2a6 Refine make tests_clean target
      99284c4db9cb Refine pylibfdt_clean target
      a4629cfaedfb Refine libfdt_clean target
      08380fc43aa2 tests: Use modern octal literals for Python
      8113c00b99d3 pylibfdt: Allow switch to Python 3 via environment variable PYTHON
      11738cf01f15 libfdt: Don't use memcpy to handle unaligned reads on ARM
      86a288a73670 checks: Restructure check_msg to decrease indentation
      5667e7ef9a9a annotations: add the annotation functionality
      8e20ccf52f90 annotations: add positions
      ca930e20bb54 tests: Don't lose errors from make checkm
      43366bb4eeee tests: Property count valgrind errors in wrapped tests
      5062516fb8cb srcpos: Remove srcpos_empty
      a3143fafbf83 Revert "annotations: add positions"
      403cc79f06a1 checks: Update SPI bus check for 'spi-slave'
      baa1d2cf7894 annotations: add positions
      ff2ad38f6a5a Merge remote-tracking branch 'origin/pr/18'
      aa7254d9cb17 libfdt: return correct value if #size-cells property is not present
      49903aed7783 use ptrdiff_t modifier for printing pointer differences
      da2b691ccf68 treesource: Fix dts output for phandles in middle of a sequence of ints
      8f8b77a0d62d tests: Wrap check_align() calls with base_run_test()
      522d81d572f2 Fix dts output with a REF_PATH marker
      e45198c98359 Added test cases for target references
      0fcffda15e9f Merge nodes with local target label references
      1e4a0928f3b3 pylibfdt: Don't have setup.py depend on where it's invoked from
      ca399b14956f pylibfdt: Eliminate run_setup make function
      98972f1b3e33 pylibfdt: Improved version extraction
      7ba2be6cda5f pylibfdt: Don't silence setup.py when V=1
      7691f9d39301 pylibfdt: Make SETUP make variable
      855b9963def9 pylibfdt: Simpler CFLAGS handling
      47cafbeeb977 pylibfdt: Link extension module with libfdt rather than rebuilding
      dd695d6afb19 pylibfdt: Correctly set build output directory
      59327523d0d8 pylibfdt: We don't need include files from the base directory
      e84742aa7b93 checks: fix simple-bus compatible matching
      8c59a97ce096 Fix missing labels when emitting dts format
      d448f9a5fd94 Revert dts output formatting changes of spaces around brackets
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  3. 02 Oct, 2018 1 commit
    • Rob Herring's avatar
      kbuild: consolidate Devicetree dtb build rules · 37c8a5fa
      Rob Herring authored
      There is nothing arch specific about building dtb files other than their
      location under /arch/*/boot/dts/. Keeping each arch aligned is a pain.
      The dependencies and supported targets are all slightly different.
      Also, a cross-compiler for each arch is needed, but really the host
      compiler preprocessor is perfectly fine for building dtbs. Move the
      build rules to a common location and remove the arch specific ones. This
      is done in a single step to avoid warnings about overriding rules.
      The build dependencies had been a mixture of 'scripts' and/or 'prepare'.
      These pull in several dependencies some of which need a target compiler
      (specifically devicetable-offsets.h) and aren't needed to build dtbs.
      All that is really needed is dtc, so adjust the dependencies to only be
      This change enables support 'dtbs_install' on some arches which were
      missing the target.
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Acked-by: default avatarPaul Burton <paul.burton@mips.com>
      Acked-by: default avatarLey Foon Tan <ley.foon.tan@intel.com>
      Acked-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Michal Marek <michal.lkml@markovi.net>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: linux-kbuild@vger.kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: uclinux-h8-devel@lists.sourceforge.jp
      Cc: linux-mips@linux-mips.org
      Cc: nios2-dev@lists.rocketboards.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-xtensa@linux-xtensa.org
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  4. 20 Sep, 2018 1 commit
    • Rob Herring's avatar
      scripts/dtc: Update to upstream version v1.4.7-14-gc86da84d30e4 · f858927f
      Rob Herring authored
      Major changes are I2C and SPI bus checks, YAML output format (for
      future validation), some new libfdt functions, and more libfdt
      validation of dtbs.
      The YAML addition adds an optional dependency on libyaml. pkg-config is
      used to test for it and pkg-config became a kconfig dependency in 4.18.
      This adds the following commits from upstream:
      c86da84d30e4 Add support for YAML encoded output
      361b5e7d8067 Make type_marker_length helper public
      bfbfab047e45 pylibfdt: Add a means to add and delete notes
      9005f4108e7c pylibfdt: Allow delprop() to return errors
      b94c056b137e Make valgrind optional
      fd06c54d4711 tests: Better testing of dtc -I fs mode
      c3f50c9a86d9 tests: Allow dtbs_equal_unordered to ignore mem reserves
      0ac9fdee37c7 dtc: trivial '-I fs -O dts' test
      0fd1c8c783f3 pylibfdt: fdt_get_mem_rsv returns 2 uint64_t values
      04853cad18f4 pylibfdt: Don't incorrectly / unnecessarily override uint64_t typemap
      9619c8619c37 Kill bogus TYPE_BLOB marker type
      ac68ff92ae20 parser: add TYPE_STRING marker to path references
      90a190eb04d9 checks: add SPI bus checks
      53a1bd546905 checks: add I2C bus checks
      88f18909db73 dtc: Bump version to v1.4.7
      85bce8b2f06d tests: Correction to vg_prepare_blob()
      57f7f9e7bc7c tests: Don't call memcmp() with NULL arguments
      c12b2b0c20eb libfdt: fdt_address_cells() and fdt_size_cells()
      3fe0eeda0b7f livetree: Set phandle properties type to uint32
      853649acceba pylibfdt: Support the sequential-write interface
      9b0e4fe26093 tests: Improve fdt_resize() tests
      1087504bb3e8 libfdt: Add necessary header padding in fdt_create()
      c72fa777e613 libfdt: Copy the struct region in fdt_resize()
      32b9c6130762 Preserve datatype markers when emitting dts format
      6dcb8ba408ec libfdt: Add helpers for accessing unaligned words
      42607f21d43e tests: Fix incorrect check name 'prop_name_chars'
      9d78c33bf8a1 tests: fix grep for checks error messages
      b770f3d1c13f pylibfdt: Support setting the name of a node
      2f0d07e678e0 pylibfdt: Add functions to set and get properties as strings
      354d3dc55939 pylibfdt: Update the bytearray size with pack()
      3c374d46acce pylibfdt: Allow reading integer values from properties
      49d32ce40bb4 pylibfdt: Use an unsigned type for fdt32_t
      481246a0c13a pylibfdt: Avoid accessing the internal _fdt member in tests
      9aafa33d99ed pylibfdt: Add functions to update properties
      5a598671fdbf pylibfdt: Support device-tree creation/expansion
      483e170625e1 pylibfdt: Add support for reading the memory reserve map
      29bb05aa4200 pylibfdt: Add support for the rest of the header functions
      582a7159a5d0 pylibfdt: Add support for fdt_next_node()
      f0f8c9169819 pylibfdt: Reorder functions to match libfdt.h
      64a69d123935 pylibfdt: Return string instead of bytearray from getprop()
      4d09a83420df fdtput: Add documentation
      e617cbe1bd67 fdtget: Add documentation
      180a93924014 Use <inttypes.h> format specifiers in a bunch of places we should
      b9af3b396576 scripts/dtc: Fixed format mismatch in fprintf
      4b8fcc3d015c libfdt: Add fdt_check_full() function
      c14223fb2292 tests: Use valgrind client requests for better checking
      5b67d2b955a3 tests: Better handling of valgrind errors saving blobs
      e2556aaeb506 tests: Remove unused #define
      fb9c6abddaa8 Use size_t for blob lengths in utilfdt_read*
      0112fda03bf6 libfdt: Add fdt_header_size()
      6473a21d8bfe Consolidate utilfdt_read_len() variants
      d5db5382c5e5 libfdt: Safer access to memory reservations
      719d582e98ec libfdt: Propagate name errors in fdt_getprop_by_offset()
      70166d62a27f libfdt: Safer access to strings section
      eb890c0f77dc libfdt: Make fdt_check_header() more thorough
      899d6fad93f3 libfdt: Improve sequential write state checking
      04b5b4062ccd libfdt: Clean up header checking functions
      44d3efedc816 Preserve datatype information when parsing dts
      f0be81bd8de0 Make Property a subclass of bytearray
      24b1f3f064d4 pylibfdt: Add a method to access the device tree directly
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  5. 19 Sep, 2018 1 commit
  6. 22 Aug, 2018 1 commit
  7. 15 May, 2018 1 commit
    • Rob Herring's avatar
      scripts/dtc: Update to upstream version v1.4.6-21-g84e414b0b5bc · 50aafd60
      Rob Herring authored
      This adds the following commits from upstream:
      84e414b0b5bc tests: Add a test case for the omit-if-no-ref keyword
      4038fd90056e dtc: add ability to make nodes conditional on them being referenced
      e1f139ea4900 checks: drop warning for missing PCI bridge bus-range
      f4eba68d89ee checks: Print duplicate node name instead of parent name
      46df1fb1b211 .travis.yml: Run valgrind checks via Travis
      14a3002a1aee tests: Update valgrind suppressions for sw_tree1
      02c5fe9debc0 tests: Remove valgrind error from tests/get_path
      df536831d02c checks: add graph binding checks
      2347c96edcbe checks: add a check for duplicate unit-addresses of child nodes
      8f1b35f88395 Correct overlay syntactic sugar for generating target-path fragments
      afbddcd418fb Suppress warnings on overlay fragments
      119e27300359 Improve tests for dtc overlay generation
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  8. 24 Apr, 2018 1 commit
    • Rob Herring's avatar
      dtc: checks: drop warning for missing PCI bridge bus-range · 970f04c8
      Rob Herring authored
      Cherry-picked from dtc upstream commit e1f139ea4900fd0324c646822b4061fec6e08321.
      Having a 'bus-range' property for PCI bridges should not be required,
      so remove the warning when missing. There was some confusion with the
      Linux kernel printing a message that no property is present and the OS
      assigned the bus number. This message was intended to be informational
      rather than a warning.
      When the firmware doesn't enumerate the PCI bus and leaves it up to the
      OS to do, then it is perfectly fine for the OS to assign bus numbers
      and bus-range is not necessary.
      There are a few cases where bus-range is needed or useful as Arnd
      Bergmann summarized:
      - Traditionally Linux avoided using multiple PCI domains, but instead
        configured separate PCI host bridges to have non-overlapping
        bus ranges so we can present them to user space as a single
        domain, and run the kernel without CONFIG_PCI_DOMAINS.
        Specifying the bus ranges this way would and give stable bus
        numbers across boots when the probe order is not fixed.
      - On certain ARM64 systems, we must only use the first
        128 bus numbers based on the way the IOMMU identifies
        the device with truncated bus/dev/fn number. There are probably
        others like this, with various limitations.
      - To leave some room for hotplugged devices, each slot on
        a host bridge can in theory get a range of bus numbers
        that are available when assigning bus numbers at boot time
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
  9. 07 Apr, 2018 3 commits
  10. 06 Apr, 2018 1 commit
  11. 06 Mar, 2018 2 commits
    • Rob Herring's avatar
      scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987 · 9130ba88
      Rob Herring authored
      This adds the following commits from upstream:
      aadd0b65c987 checks: centralize printing of property names in failure messages
      88960e398907 checks: centralize printing of node path in check_msg
      f1879e1a50eb Add limited read-only support for older (V2 and V3) device tree to libfdt.
      37dea76e9700 srcpos: drop special handling of tab
      65893da4aee0 libfdt: overlay: Add missing license
      962a45ca034d Avoid installing pylibfdt when dependencies are missing
      cd6ea1b2bea6 Makefile: Split INSTALL out into INSTALL_{PROGRAM,LIB,DATA,SCRIPT}
      51b3a16338df Makefile.tests: Add LIBDL make(1) variable for portability sake
      333d533a8f4d Attempt to auto-detect stat(1) being used if not given proper invocation
      e54388015af1 dtc: Bump version to v1.4.6
      a1fe86f380cb fdtoverlay: Switch from using alloca to malloc
      c8d5472de3ff tests: Improve compatibility with other platforms
      c81d389a10cc checks: add chosen node checks
      e671852042a7 checks: add aliases node checks
      d0c44ebe3f42 checks: check for #{size,address}-cells without child nodes
      18a3d84bb802 checks: add string list check for *-names properties
      8fe94fd6f19f checks: add string list check
      6c5730819604 checks: add a string check for 'label' property
      a384191eba09 checks: fix sound-dai phandle with arg property check
      b260c4f610c0 Fix ambiguous grammar for devicetree rule
      fe667e382bac tests: Add some basic tests for the pci_bridge checks
      7975f6422260 Fix widespread incorrect use of strneq(), replace with new strprefixeq()
      fca296445eab Add strstarts() helper function
      cc392f089007 tests: Check non-matching cases for fdt_node_check_compatible()
      bba26a5291c8 livetree: avoid assertion of orphan phandles with overlays
      c8f8194d76cc implement strnlen for systems that need it
      c8b38f65fdec libfdt: Remove leading underscores from identifiers
      3b62fdaebfe5 Remove leading underscores from identifiers
      2d45d1c5c65e Replace FDT_VERSION() with stringify()
      2e6fe5a107b5 Fix some errors in comments
      b0ae9e4b0ceb tests: Correct warning in sw_tree1.c
      Commit c8b38f65fdec upstream ("libfdt: Remove leading underscores from
      identifiers") changed the multiple inclusion define protection, so the
      kernel's libfdt_env.h needs the corresponding update.
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
    • Rob Herring's avatar
      scripts/dtc: generate lexer and parser during build instead of shipping · e039139b
      Rob Herring authored
      Now that the kernel build supports flex and bison, remove the _shipped
      files and generate them during the build instead.
      Based on Masahiro's original patch.
      Reviewed-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  12. 02 Nov, 2017 1 commit
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      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
      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: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: default avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
  13. 25 Oct, 2017 1 commit
  14. 03 Oct, 2017 2 commits
    • Rob Herring's avatar
      scripts/dtc: Update to upstream version v1.4.5-3-gb1a60033c110 · 4201d057
      Rob Herring authored
      This adds the following commits from upstream:
      b1a60033c110 tests: Add a test for overlays syntactic sugar
      737b2df39cc8 overlay: Add syntactic sugar version of overlays
      497432fd2131 checks: Use proper format modifier for size_t
      22a65c5331c2 dtc: Bump version to v1.4.5
      c575d8059fff Add fdtoverlay to .gitignore
      b6a6f9490d19 fdtoverlay: Sanity check blob size
      8c1eb1526d2d pylibfdt: Use Python2 explicitly
      ee3d26f6960b checks: add interrupts property check
      c1e7738988f5 checks: add gpio binding properties check
      b3bbac02d5e3 checks: add phandle with arg property checks
      fe50bd1ecc1d fdtget: Split out cell list display into a new function
      62d812308d11 README: Add a note about test_tree1.dts
      5bed86aee9e8 pylibfdt: Add support for fdt_subnode_offset()
      46f31b65b3b3 pylibfdt: Add support for fdt_node_offset_by_phandle()
      a3ae43723687 pylibfdt: Add support for fdt_parent_offset()
      a198af80344c pylibfdt: Add support for fdt_get_phandle()
      b9eba92ea50f tests: Return a failure code when any tests fail
      155faf6cc209 pylibfdt: Use local pylibfdt module
      50e5cd07f325 pylibfdt: Add a test for use of uint32_t
      ab78860f09f5 pylibfdt: Add stdint include to fix uint32_t
      36f511fb1113 tests: Add stacked overlay tests on fdtoverlay
      1bb00655d3e5 fdt: Allow stacked overlays phandle references
      a33c2247ac8d Introduce fdt_setprop_placeholder() method
      0016f8c2aa32 dtc: change default phandles to ePAPR style instead of both
      e3b9a9588a35 tests: fdtoverlay unit test
      42409146f2db fdtoverlay: A tool that applies overlays
      aae22722fc8d manual: Document missing options
      13ce6e1c2fc4 dtc: fix sprintf() format string error, again
      d990b8013889 Makefile: Fix build on MSYS2 and Cygwin
      51f56dedf8ea Clean up shared library compile/link options
      21a2bc896e3d Suppress expected error message in fdtdump test
      2a42b14d0d03 dtc: check.c fix compile error
      a10cb3c818d3 Fix get_node_by_path string equality check
      548aea2c436a fdtdump: Discourage use of fdtdump
      c2258841a785 fdtdump: Fix over-zealous version check
      9067ee4be0e6 Fix a few whitespace and style nits
      e56f2b07be38 pylibfdt: Use setup.py to build the swig file
      896f1c133265 pylibfdt: Use Makefile constructs to implement NO_PYTHON
      90db6d9989ca pylibfdt: Allow setup.py to operate stand-alone
      e20d9658cd8f Add Coverity Scan support
      b04a2cf08862 pylibfdt: Fix code style in setup.py
      1c5170d3a466 pylibfdt: Rename libfdt.swig to libfdt.i
      580a9f6c2880 Add a libfdt function to write a property placeholder
      ab15256d8d02 pylibfdt: Use the call function to simplify the Makefile
      9f2e3a3a1f19 pylibfdt: Use the correct libfdt version in the module
      e91c652af215 pylibfdt: Enable installation of Python module
      8a892fd85d94 pylibfdt: Allow building to be disabled
      741cdff85d3e .travis.yml: Add builds with and without Python library prerequisites
      14c4171f4f9a pylibfdt: Use package_dir to set the package directory
      89a5062ab231 pylibfdt: Use environment to pass C flags and files
      4e0e0d049757 pylibfdt: Allow pkg-config to be supplied in the environment
      6afd7d9688f5 Correct typo: s/pylibgfdt/pylibfdt/
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
    • Rob Herring's avatar
      scripts/dtc: add fdt_overlay.c and fdt_addresses.c to sync script · 43223230
      Rob Herring authored
      libfdt has gained some new files. We need to include them in the
      kernel's copy.
      Reported-by: default avatarKyle Yan <kyan@codeaurora.org>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  15. 20 Sep, 2017 1 commit
    • Frank Rowand's avatar
      scripts/dtc: dtx_diff - 2nd update of include dts paths to match build · 35f3c984
      Frank Rowand authored
      Update dtx_diff include paths in the same manner as:
      commit b12869a8 ("of: remove drivers/of/testcase-data from
      include search path for CPP"), commit 5ffa2aed ("of: remove
      arch/$(SRCARCH)/boot/dts from include search path for CPP"), and
      commit 50f9ddaf ("of: search scripts/dtc/include-prefixes path
      for both CPP and DTC").
      Remove proposed include path kernel/dts/, which was never implemented
      for the dtb build.
      For the diff case, each source file is compiled separately.  For
      each of those compiles, provide the location of the source file
      as an include path, not the location of both source files.
      Signed-off-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  16. 31 Aug, 2017 1 commit
    • Russell King's avatar
      scripts/dtc: fix '%zx' warning · e6618692
      Russell King authored
      dtc uses an incorrect format specifier for printing a uint64_t value.
      uint64_t may be either 'unsigned long' or 'unsigned long long' depending
      on the host architecture.
      Fix this by using %llx and casting to unsigned long long, which ensures
      that we always have a wide enough variable to print 64 bits of hex.
          HOSTCC  scripts/dtc/checks.o
        scripts/dtc/checks.c: In function 'check_simple_bus_reg':
        scripts/dtc/checks.c:876:2: warning: format '%zx' expects argument of type 'size_t', but argument 4 has type 'uint64_t' [-Wformat=]
          snprintf(unit_addr, sizeof(unit_addr), "%zx", reg);
        scripts/dtc/checks.c:876:2: warning: format '%zx' expects argument of type 'size_t', but argument 4 has type 'uint64_t' [-Wformat=]
      Link: http://lkml.kernel.org/r/20170829222034.GJ20805@n2100.armlinux.org.uk
      Fixes: 828d4cdd ("dtc: check.c fix compile error")
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Michal Marek <mmarek@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  17. 20 Jul, 2017 1 commit
  18. 22 Jun, 2017 1 commit
    • Geert Uytterhoeven's avatar
      scripts/dtc: dtx_diff - Show real file names in diff header · 7782b144
      Geert Uytterhoeven authored
      As the comparison uses process substitution to pass files after
      conversion to DTS format, the diff header doesn't show the real
      filenames, but the names of the file descriptors used:
          --- /dev/fd/63  2017-06-22 11:21:47.531637188 +0200
          +++ /dev/fd/62  2017-06-22 11:21:47.531637188 +0200
      This is especially annoying when comparing a bunch of DT files in a
      loop, as the output doesn't show a clue about which files it refers to.
      Fix this by explicitly passing the original file names to the diff
      command using the --label option, giving e.g.:
          --- arch/arm/boot/dts/r8a7791-koelsch.dtb
          +++ arch/arm/boot/dts/r8a7791-porter.dtb
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Reviewed-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  19. 19 May, 2017 1 commit
    • Olof Johansson's avatar
      devicetree: Move include prefixes from arch to separate directory · d5d332d3
      Olof Johansson authored
      We use a directory under arch/$ARCH/boot/dts as an include path
      that has links outside of the subtree to find dt-bindings from under
      include/dt-bindings. That's been working well, but new DT architectures
      haven't been adding them by default.
      Recently there's been a desire to share some of the DT material between
      arm and arm64, which originally caused developers to create symlinks or
      relative includes between the subtrees. This isn't ideal -- it breaks
      if the DT files aren't stored in the exact same hierarchy as the kernel
      tree, and generally it's just icky.
      As a somewhat cleaner solution we decided to add a $ARCH/ prefix link
      once, and allow DTS files to reference dtsi (and dts) files in other
      architectures that way.
      Original approach was to create these links under each architecture,
      but it lead to the problem of recursive symlinks.
      As a remedy, move the include link directories out of the architecture
      trees into a common location. At the same time, they can now share one
      directory and one dt-bindings/ link as well.
      Fixes: 4027494a ('ARM: dts: add arm/arm64 include symlinks')
      Reported-by: default avatarRussell King <linux@armlinux.org.uk>
      Reported-by: default avatarOmar Sandoval <osandov@osandov.com>
      Reviewed-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Reviewed-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Tested-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Cc: Heiko Stuebner <heiko@sntech.de>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: linux-arch <linux-arch@vger.kernel.org>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
  20. 17 May, 2017 1 commit
    • Shuah Khan's avatar
      dtc: check.c fix compile error · 828d4cdd
      Shuah Khan authored
      Fix the following compile error found on odroid-xu4:
      checks.c: In function ‘check_simple_bus_reg’:
      checks.c:876:41: error: format ‘%lx’ expects argument of type
      ‘long unsigned int’, but argument 4 has type
      ‘uint64_t{aka long long unsigned int}’ [-Werror=format=]
        snprintf(unit_addr, sizeof(unit_addr), "%lx", reg);
      checks.c:876:41: error: format ‘%lx’ expects argument of type
      ‘long unsigned int’, but argument 4 has type
      ‘uint64_t {aka long long unsigned int}’ [-Werror=format=]
      cc1: all warnings being treated as errors
      Makefile:304: recipe for target 'checks.o' failed
      make: *** [checks.o] Error 1
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      [dwg: Correct new format to be correct in general]
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      [robh: cherry-picked from upstream dtc commit 2a42b14d0d03]
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  21. 14 May, 2017 1 commit
    • Kamil Rytarowski's avatar
      scripts: Switch to more portable Perl shebang · cb77f0d6
      Kamil Rytarowski authored
      The default NetBSD package manager is pkgsrc and it installs Perl
      along other third party programs under custom and configurable prefix.
      The default prefix for binary prebuilt packages is /usr/pkg, and the
      Perl executable lands in /usr/pkg/bin/perl.
      This change switches "/usr/bin/perl" to "/usr/bin/env perl" as it's
      the most portable solution that should work for almost everybody.
      Perl's executable is detected automatically.
      This change switches -w option passed to the executable with more
      modern "use warnings;" approach. There is no functional change to the
      default behavior.
      While there, drop "require 5" from scripts/namespace.pl (Perl from 1994?).
      Signed-off-by: default avatarKamil Rytarowski <n54@gmx.com>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
  22. 29 Mar, 2017 1 commit
  23. 22 Mar, 2017 2 commits
    • Rob Herring's avatar
      scripts/dtc: Update to upstream version v1.4.4-8-g756ffc4f52f6 · 89d12310
      Rob Herring authored
      This adds the following commits from upstream:
      756ffc4f52f6 Build pylibfdt as part of the normal build process
      8cb3896358e9 Adjust libfdt.h to work with swig
      b40aa8359aff Mention pylibfdt in the documentation
      12cfb740cc76 Add tests for pylibfdt
      50f250701631 Add an initial Python library for libfdt
      cdbb2b6c7a3a checks: Warn on node name unit-addresses with '0x' or leading 0s
      4c15d5da17cc checks: Add bus checks for simple-bus buses
      33c3985226d3 checks: Add bus checks for PCI buses
      558cd81bdd43 dtc: Bump version to v1.4.4
      c17a811c62eb fdtput: Remove star from value_len documentation
      194d5caaefcb fdtget: Use @return to document the return value
      d922ecdd017b tests: Make realloc_fdt() really allocate *fdt
      921cc17fec29 libfdt: overlay: Check the value of the right variable
      9ffdf60bf463 dtc: Simplify asm_emit_string() implementation
      881012e44386 libfdt: Change names of sparse helper macros
      bad5b28049e5 Fix assorted sparse warnings
      672ac09ea04d Clean up gcc attributes
      49300f2ade6a dtc: Don't abuse struct fdt_reserve_entry
      fa8bc7f928ac dtc: Bump version to v1.4.3
      34a9886a177f Add printf format attributes
      f72508e2b6ca Correct some broken printf() like format mismatches
      397d5ef0203c libfdt: Add fdt_setprop_empty()
      69a1bd6ad3f9 libfdt: Remove undefined behaviour setting empty properties
      acd1b534a592 Print output filename as part of warning messages
      120775eb1cf3 dtc: Use streq() in preference to strcmp()
      852e9ecbe197 checks: Add Warning for stricter node name character checking
      ef0e8f061534 checks: Add Warning for stricter property name character checking
      00d7bb1f4b0e dtc: pos parameter to srcpos_string() can't be NULL
      95d57726bca4 livetree.c: Fix memory leak
      3b9c97093d6e dtc: Fix NULL pointer use in dtlabel + dtref case
      43eb551426ea manual: Fix typo it -> in
      4baf15f7f13f Makefile: Add tags rule
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
    • Rob Herring's avatar
      scripts/dtc: automate getting dtc version and log in update script · 86cef614
      Rob Herring authored
      Further automate the dtc update script to fill in the dtc version and
      commit log.
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  24. 04 Jan, 2017 1 commit
    • Rob Herring's avatar
      scripts/dtc: Update to upstream version 0931cea3ba20 · 6f05afcb
      Rob Herring authored
      Sync to upstream dtc commit 0931cea3ba20 ("dtc: fdtdump: check fdt if
      not in scanning mode"). In particular, this pulls in dtc overlay
      This adds the following commits from upstream:
      f88865469b65 dtc: Fix memory leak in character literal parsing
      00fbb8696b66 Rename boot_info
      1ef86ad2c24f dtc: Clean up /dts-v1/ and /plugin/ handling in grammar
      e3c769aa9c16 dtc: Don't always generate __symbols__ for plugins
      c96cb3c0169e tests: Don't use -@ on plugin de/recompile tests
      66381538ce24 tests: Remove "suppression of fixups" tests
      ba765b273f0f tests: Clarify dtc overlay tests
      6ea8cd944fcd tests: More thorough tests of libfdt overlay application without dtc
      7d8ef6e1db97 tests: Correct fdt handling of overlays without fixups and base trees without symbols
      b4dc0ed8b127 tests: Fix double expansion bugs in test code
      3ea879dc0c8f tests: Split overlay tests into those with do/don't exercise dtc plugin generation
      47b4d66a2f11 tests: Test auto-alias generation on base tree, not overlay
      72e1ad811523 tests: Make overlay/plugin tests unconditional
      e7b3c3b5951b tests: Add overlay tests
      9637e3f772a9 tests: Add check_path test
      20f29d8d41f6 dtc: Plugin and fixup support
      a2c92cac53f8 dtc: Document the dynamic plugin internals
      8f70ac39801d checks: Pass boot_info instead of root node
      ea10f953878f libfdt: add missing errors to fdt_strerror()
      daa75e8fa594 libfdt: fix fdt_stringlist_search()
      e28eff5b787a libfdt: fix fdt_stringlist_count()
      ae97c7722840 tests: overlay: Rename the device tree blobs to be more explicit
      96162d2bd9cb tests: overlay: Add test suffix to the compiled blobs
      5ce8634733b7 libfdt: Add fdt_overlay_apply to the exported symbols
      804a9db90ad2 fdt: strerr: Remove spurious BADOVERLAY
      e8c3a1a493fa tests: overlay: Move back the bad fixup tests
      7a72d89d3f81 libfdt: overlay: Fix symbols and fixups nodes condition
      cabbaa972cdd libfdt: overlay: Report a bad overlay for mismatching local fixups
      deb0a5c1aeaa libfdt: Add BADPHANDLE error string
      7b7a6be9ba15 libfdt: Don't use 'index' as a local variable name
      aea8860d831e tests: Add tests cases for the overlay code
      0cdd06c5135b libfdt: Add overlay application function
      39240cc865cf libfdt: Extend the reach of FDT_ERR_BADPHANDLE
      4aa3a6f5e6d9 libfdt: Add new errors for the overlay code
      6d1832c9e64b dtc: Remove "home page" link
      45fd440a9561 Fix some typing errors in libfdt.h and livetree.c
      a59be4939c13 Merge tag 'v1.4.2'
      a34bb721caca dtc: Fix assorted problems in the testcases for the -a option
      874f40588d3e Implement the -a option to pad dtb aligned
      ec02b34c05be dtc: Makefile improvements for release uploading
      1ed45d40a137 dtc: Bump version to 1.4.2
      36fd7331fb11 libfdt: simplify fdt_del_mem_rsv()
      d877364e4a0f libfdt: Add fdt_setprop_inplace_namelen_partial
      3e9037aaad44 libfdt: Add fdt_getprop_namelen_w
      84e0e1346c68 libfdt: Add max phandle retrieval function
      d29126c90acb libfdt: Add iterator over properties
      902d0f0953d0 libfdt: Add a subnodes iterator macro
      c539075ba8ba fdtput.c: Fix memory leak.
      f79ddb83e185 fdtget.c: Fix memory leak
      1074ee54b63f convert-dtsv0-lexer.l: fix memory leak
      e24d39a024e6 fdtdump.c: make sure size_t argument to memchr is always unsigned.
      44a59713cf05 Remove unused srcpos_dump() function
      cb9241ae3453 DTC: Fix memory leak on flatname.
      1ee0ae24ea09 Simplify check field and macro names
      9d97527a8621 Remove property check functions
      2e709d158e11 Remove tree check functions
      c4cb12e193e3 Alter grammar to allow multiple /dts-v1/ tags
      d71d25d76012 Use xasprintf() in srcpos
      9dc404958e9c util: Add xasprintf portable asprintf variant
      beef80b8b55f Correct a missing space in a fdt_header cast
      68d43cec1253 Correct line lengths in libfdt.h
      b0dbceafd49a Correct space-after-tab in libfdt.h
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  25. 22 Jul, 2016 1 commit
  26. 29 Mar, 2016 1 commit
    • Rob Herring's avatar
      scripts/dtc: Update to upstream version 53bf130b1cdd · b9937347
      Rob Herring authored
      Sync to upstream dtc commit 53bf130b1cdd ("libfdt: simplify
      fdt_node_check_compatible()"). This adds the following commits from
      53bf130 libfdt: simplify fdt_node_check_compatible()
      c9d9121 Warn on node name unit-address presence/absence mismatch
      2e53f9d Catch unsigned 32bit overflow when parsing flattened device tree offsets
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  27. 12 Feb, 2016 2 commits
    • Rob Herring's avatar
      scripts/dtc: Update to upstream commit b06e55c88b9b · 91feabc2
      Rob Herring authored
      Sync to upstream dtc commit b06e55c88b9b ("Prevent crash on modulo by
      zero"). This adds the following commits from upstream:
      b06e55c Prevent crash on modulo by zero
      b433450 Fix some bugs in processing of line directives
      d728ad5 Fix crash on nul character in string escape sequence
      1ab2205 Gracefully handle bad octal literals
      1937095 Prevent crash on division by zero
      d0b3ab0 libfdt: Fix undefined behaviour in fdt_offset_ptr()
      d4c7c25 libfdt: check for potential overrun in _fdt_splice()
      f58799b libfdt: Add some missing symbols to version.lds
      af9f26d Remove duplicated -Werror in dtc Makefile
      604e61e fdt: Add functions to retrieve strings
      8702bd1 fdt: Add a function to get the index of a string
      2218387 fdt: Add a function to count strings
      554fde2 libfdt: fix comment block of fdt_get_property_namelen()
      e5e6df7 fdtdump: Fix bug printing bytestrings with negative values
      067829e Remove redundant fdtdump test code
      897a429 Move fdt_path_offset alias tests to right tests section
      2d1417c Add simple .travis.yml
      f6dbc6c guess output file format
      5e78dff guess input file format based on file content or file name
      8b927bf tests: convert `echo -n` to `printf`
      64c46b0 Fix crash with poorly defined #size-cells
      Cc: Grant Likely <grant.likely@linaro.org>
      Tested-by: default avatarFrank Rowand <frank.rowand@sonymobile.com>
      Reviewed-by: default avatarFrank Rowand <frank.rowand@sonymobile.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
    • Frank Rowand's avatar
      scripts/dtc: dtx_diff - add info to error message · 60c7f4cb
      Frank Rowand authored
      If kernel config options are not properly set, "make scripts" will not
      compile dtc.  Update the unable to find dtc error message to check
      the kernel config and give better advice on how to create dtc.
      Reword another error message to increase clarity.
      Signed-off-by: default avatarFrank Rowand <frank.rowand@sonymobile.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  28. 25 Jan, 2016 1 commit
  29. 29 Apr, 2015 2 commits
  30. 09 Jun, 2014 1 commit
  31. 21 Jan, 2014 3 commits
    • Grant Likely's avatar
      scripts/dtc: Add a script to update to mainline dtc source · c8a3e6a8
      Grant Likely authored
      A very simple script that automates pulling in a newer version of DTC.
      Not particularly robust, but a whole lot better than doing it by hand
      every time.
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
    • Grant Likely's avatar
      scripts/dtc: Update to upstream version v1.4.0 · 73ab39b1
      Grant Likely authored
      Update to the latest version of dtc with the following notable
      enhancements and bug fixes:
      * fdtput: expand fdt if value does not fit
      * dtc/fdt{get, put}/convert-dtsv0-lexer: convert to new usage helpers
      * libfdt: Add fdt_next_subnode() to permit easy subnode iteration
      * utilfdt_read: pass back up the length of data read
      * util_version: new helper for displaying version info
      * die: constify format string arg
      * utilfdt_read_err: use xmalloc funcs
      * Export fdt_stringlist_contains()
      * dtc: Drop the '-S is deprecated' warning
      * dtc/libfdt: sparse fixes
      * dtc/libfdt: introduce fdt types for annotation by endian checkers
      * Fix util_is_printable_string
      * dtc: srcpos_verror() should print to stderr
      * libfdt: Added missing functions to shared library
      Shipped bison/flex generated files were built on an Ubuntu 13.10 system.
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
    • Grant Likely's avatar
      scripts/dtc: Update shipped files to build with bison 2.7.12 · a878b910
      Grant Likely authored
      Preparation patch before updating to upstream dtc version 1.4.0. This
      change only contains the changes caused by a new version of bison
      on the shipped files. There are no functional changes.
      The shipped files were build on an Ubuntu 13.10 system
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>