]> Git Repo - linux.git/commitdiff
Merge tag 'devicetree-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <[email protected]>
Wed, 28 Apr 2021 22:50:24 +0000 (15:50 -0700)
committerLinus Torvalds <[email protected]>
Wed, 28 Apr 2021 22:50:24 +0000 (15:50 -0700)
Pull devicetree updates from Rob Herring:

 - Refactor powerpc and arm64 kexec DT handling to common code. This
   enables IMA on arm64.

 - Add kbuild support for applying DT overlays at build time. The first
   user are the DT unittests.

 - Fix kerneldoc formatting and W=1 warnings in drivers/of/

 - Fix handling 64-bit flag on PCI resources

 - Bump dtschema version required to v2021.2.1

 - Enable undocumented compatible checks for dtbs_check. This allows
   tracking of missing binding schemas.

 - DT docs improvements. Regroup the DT docs and add the example schema
   and DT kernel ABI docs to the doc build.

 - Convert Broadcom Bluetooth and video-mux bindings to schema

 - Add QCom sm8250 Venus video codec binding schema

 - Add vendor prefixes for AESOP, YIC System Co., Ltd, and Siliconfile
   Technologies Inc.

 - Cleanup of DT schema type references on common properties and
   standard unit properties

* tag 'devicetree-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (64 commits)
  powerpc: If kexec_build_elf_info() fails return immediately from elf64_load()
  powerpc: Free fdt on error in elf64_load()
  of: overlay: Fix kerneldoc warning in of_overlay_remove()
  of: linux/of.h: fix kernel-doc warnings
  of/pci: Add IORESOURCE_MEM_64 to resource flags for 64-bit memory addresses
  dt-bindings: bcm4329-fmac: add optional brcm,ccode-map
  docs: dt: update writing-schema.rst references
  dt-bindings: media: venus: Add sm8250 dt schema
  of: base: Fix spelling issue with function param 'prop'
  docs: dt: Add DT API documentation
  of: Add missing 'Return' section in kerneldoc comments
  of: Fix kerneldoc output formatting
  docs: dt: Group DT docs into relevant sub-sections
  docs: dt: Make 'Devicetree' wording more consistent
  docs: dt: writing-schema: Include the example schema in the doc build
  docs: dt: writing-schema: Remove spurious indentation
  dt-bindings: Fix reference in submitting-patches.rst to the DT ABI doc
  dt-bindings: ddr: Add optional manufacturer and revision ID to LPDDR3
  dt-bindings: media: video-interfaces: Drop the example
  devicetree: bindings: clock: Minor typo fix in the file armada3700-tbg-clock.txt
  ...

16 files changed:
1  2 
Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml
Documentation/devicetree/bindings/arm/cpus.yaml
Documentation/devicetree/bindings/phy/ti,phy-j721e-wiz.yaml
Documentation/devicetree/bindings/serial/serial.yaml
Documentation/devicetree/bindings/submitting-patches.rst
Documentation/devicetree/bindings/trivial-devices.yaml
Documentation/devicetree/bindings/vendor-prefixes.yaml
arch/arm64/Kconfig
arch/x86/kernel/crash.c
arch/x86/kernel/machine_kexec_64.c
drivers/of/address.c
drivers/of/fdt.c
drivers/of/overlay.c
drivers/of/property.c
scripts/Makefile.lib
scripts/checkpatch.pl

index e3664eab0f6a9b87a7729175f38ce04a55eae876,c6144c8421fa5dbb14d343da541fdb3191c45860..b369b374fc4a547737a190fbda3327ada8959423
@@@ -26,10 -26,7 +26,7 @@@ properties
        - const: simple-mfd
  
    mboxes:
-     $ref: '/schemas/types.yaml#/definitions/phandle'
-     description: |
-       Phandle to the firmware device's Mailbox.
-       (See: ../mailbox/mailbox.txt for more information)
+     maxItems: 1
  
    clocks:
      type: object
        - compatible
        - "#reset-cells"
  
 +  pwm:
 +    type: object
 +
 +    properties:
 +      compatible:
 +        const: raspberrypi,firmware-poe-pwm
 +
 +      "#pwm-cells":
 +        # See pwm.yaml in this directory for a description of the cells format.
 +        const: 2
 +
 +    required:
 +      - compatible
 +      - "#pwm-cells"
 +
      additionalProperties: false
  
  required:
@@@ -102,10 -84,5 +99,10 @@@ examples
              compatible = "raspberrypi,firmware-reset";
              #reset-cells = <1>;
          };
 +
 +        pwm: pwm {
 +            compatible = "raspberrypi,firmware-poe-pwm";
 +            #pwm-cells = <2>;
 +        };
      };
  ...
index c299423dc7cb9f9e78f699a84cc92eac67b07e79,6be4a8852ee53860d506caf29a7639b00c40a82e..f3c7249c73d659f9206f3ab3c5d565173249777a
@@@ -85,8 -85,6 +85,8 @@@ properties
  
    compatible:
      enum:
 +      - apple,icestorm
 +      - apple,firestorm
        - arm,arm710t
        - arm,arm720t
        - arm,arm740t
        where voltage is in V, frequency is in MHz.
  
    power-domains:
-     $ref: '/schemas/types.yaml#/definitions/phandle-array'
      description:
        List of phandles and PM domain specifiers, as defined by bindings of the
        PM domain provider (see also ../power_domain.txt).
  
    power-domain-names:
-     $ref: '/schemas/types.yaml#/definitions/string-array'
      description:
        A list of power domain name strings sorted in the same order as the
        power-domains property.
index 57e1d013a5028badeaf05f5ed88c68d946c9e73c,d0040255c591b1b2a4b51bc14bf544681ec01b80..5272b6f284ba24ce52db947db9e8c495161c4e83
@@@ -15,7 -15,6 +15,7 @@@ properties
      enum:
        - ti,j721e-wiz-16g
        - ti,j721e-wiz-10g
 +      - ti,am64-wiz-10g
  
    power-domains:
      maxItems: 1
@@@ -43,9 -42,6 +43,9 @@@
    "#reset-cells":
      const: 1
  
 +  "#clock-cells":
 +    const: 1
 +
    ranges: true
  
    assigned-clocks:
@@@ -222,7 -218,7 +222,7 @@@ examples
             };
  
             serdes@5000000 {
-                   compatible = "cdns,ti,sierra-phy-t0";
+                   compatible = "ti,sierra-phy-t0";
                    reg-names = "serdes";
                    reg = <0x5000000 0x10000>;
                    #address-cells = <1>;
index f368d58e808608baa8a572b806480a29ec6aeff9,eea3004058161ddd72d2110aeb6a3686a4f8ba91..2fdf4ed198da78145864b832f67a794a343df549
@@@ -75,16 -75,6 +75,16 @@@ properties
      type: boolean
      description: CTS and RTS pins are swapped.
  
 +  rx-threshold:
 +    $ref: /schemas/types.yaml#/definitions/uint32
 +    description:
 +      RX FIFO threshold configuration (in bytes).
 +
 +  tx-threshold:
 +    $ref: /schemas/types.yaml#/definitions/uint32
 +    description:
 +      TX FIFO threshold configuration (in bytes).
 +
  if:
    required:
      - uart-has-rtscts
@@@ -144,7 -134,7 +144,7 @@@ examples
              interrupts = <1>;
  
              bluetooth {
-                     compatible = "brcm,bcm43341-bt";
+                     compatible = "brcm,bcm4330-bt";
                      interrupt-parent = <&gpio>;
                      interrupts = <10>;
              };
index 1d11c25249ff546513864f32bb2dfef769923b96,a36c142249cc283b7ae7d557956cf4d17ee806c5..104fa8fb2c177eb02834dbc218c05e0dbe1aa61e
@@@ -1,7 -1,7 +1,7 @@@
  .. SPDX-License-Identifier: GPL-2.0
  
  ==========================================
- Submitting devicetree (DT) binding patches
+ Submitting Devicetree (DT) binding patches
  ==========================================
  
  I. For patch submitters
@@@ -25,7 -25,7 +25,7 @@@
  
         make dt_binding_check
  
-      See Documentation/devicetree/writing-schema.rst for more details about
+      See Documentation/devicetree/bindings/writing-schema.rst for more details about
       schema and tools setup.
  
    3) DT binding files should be dual licensed. The preferred license tag is
@@@ -75,8 -75,8 +75,8 @@@ II. For kernel maintainer
       binding, and it hasn't received an Acked-by from the devicetree
       maintainers after a few weeks, go ahead and take it.
  
 -     Subsystem bindings (anything affecting more than a single device)
 -     then getting a devicetree maintainer to review it is required.
 +     For subsystem bindings (anything affecting more than a single device),
 +     getting a devicetree maintainer to review it is required.
  
    3) For a series going though multiple trees, the binding patch should be
       kept with the driver using the binding.
@@@ -84,7 -84,7 +84,7 @@@
  III. Notes
  ==========
  
-   0) Please see ...bindings/ABI.txt for details regarding devicetree ABI.
+   0) Please see :doc:`ABI` for details regarding devicetree ABI.
  
    1) This document is intended as a general familiarization with the process as
       decided at the 2013 Kernel Summit.  When in doubt, the current word of the
index 08e417e2236cf98259a84dd9610ec49e80c8a756,c751326a593d9a0d260cb12a59fe221a3a7421bb..8341e9d23c1e6de52eb646c11712a191a67e8aa9
@@@ -23,6 -23,9 +23,9 @@@ properties
      maxItems: 1
    interrupts:
      maxItems: 1
+   spi-max-frequency: true
    compatible:
      items:
        - enum:
@@@ -50,8 -53,6 +53,8 @@@
            - atmel,atsha204a
              # i2c h/w elliptic curve crypto module
            - atmel,atecc508a
 +            # BPA-RS600: Power Supply
 +          - blutek,bpa-rs600
              # Bosch Sensortec pressure, temperature, humididty and VOC sensor
            - bosch,bme680
              # CM32181: Ambient Light Sensor
            - mps,mp2975
              # G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface
            - gmt,g751
 +            # Infineon IR36021 digital POL buck controller
 +          - infineon,ir36021
              # Infineon IR38064 Voltage Regulator
            - infineon,ir38064
              # Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
            - ti,tmp103
              # Digital Temperature Sensor
            - ti,tmp275
 +            # TI Dual channel DCAP+ multiphase controller TPS53676 with AVSBus
 +          - ti,tps53676
              # TI Dual channel DCAP+ multiphase controller TPS53679
            - ti,tps53679
              # TI Dual channel DCAP+ multiphase controller TPS53688
index c88b1cfb52cb62b8199ce3504cd41a729881aea6,ab3bb1020d8db4d2eb7139c49b564244c73a1158..b0b83635e0b5c108d53eb15bebfe98938f8b27a1
@@@ -57,6 -57,8 +57,8 @@@ patternProperties
      description: Advantech Corporation
    "^aeroflexgaisler,.*":
      description: Aeroflex Gaisler AB
+   "^aesop,.*":
+     description: AESOP Embedded Forum
    "^al,.*":
      description: Annapurna Labs
    "^alcatel,.*":
      description: Anvo-Systems Dresden GmbH
    "^apm,.*":
      description: Applied Micro Circuits Corporation (APM)
 +  "^apple,.*":
 +    description: Apple Inc.
    "^aptina,.*":
      description: Aptina Imaging
    "^arasan,.*":
      description: Beckhoff Automation GmbH & Co. KG
    "^bitmain,.*":
      description: Bitmain Technologies
 +  "^blutek,.*":
 +    description: BluTek Power
    "^boe,.*":
      description: BOE Technology Group Co., Ltd.
    "^bosch,.*":
      description: Liebherr-Werk Nenzing GmbH
    "^lxa,.*":
      description: Linux Automation GmbH
 +  "^m5stack,.*":
 +    description: M5Stack
    "^macnica,.*":
      description: Macnica Americas
    "^mantix,.*":
      description: Unisoc Communications, Inc.
    "^realtek,.*":
      description: Realtek Semiconductor Corp.
 +  "^remarkable,.*":
 +    description: reMarkable AS
    "^renesas,.*":
      description: Renesas Electronics Corporation
    "^rex,.*":
      description: Silergy Corp.
    "^silex-insight,.*":
      description: Silex Insight
+   "^siliconfile,.*":
+     description: Siliconfile Technologies lnc.
    "^siliconmitus,.*":
      description: Silicon Mitus, Inc.
 +  "^siemens,.*":
 +    description: Siemens AG
    "^simtek,.*":
      description: Cypress Semiconductor Corporation (Simtek Corporation)
    "^sinlinx,.*":
      description: Shenzhen Sunchip Technology Co., Ltd
    "^SUNW,.*":
      description: Sun Microsystems, Inc
 +  "^supermicro,.*":
 +    description: Super Micro Computer, Inc.
    "^silvaco,.*":
      description: Silvaco, Inc.
    "^swir,.*":
      description: Trusted Computing Group
    "^tcl,.*":
      description: Toby Churchill Ltd.
 +  "^tcs,.*":
 +    description: Shenzhen City Tang Cheng Technology Co., Ltd.
    "^tdo,.*":
      description: Shangai Top Display Optoelectronics Co., Ltd
    "^technexion,.*":
      description: Yamaha Corporation
    "^yes-optoelectronics,.*":
      description: Yes Optoelectronics Co.,Ltd.
+   "^yic,.*":
+     description: YIC System Co., Ltd.
    "^ylm,.*":
      description: Shenzhen Yangliming Electronic Technology Co., Ltd.
    "^yna,.*":
diff --combined arch/arm64/Kconfig
index ef5c7ffa7f557fd6d6f204694d320a5ae990b7b5,31bd885b79eb0e5ce6bfe9d56823e18c9371fd2c..2afc7152a1eabcad4a58933953d94d907cbd8adf
@@@ -75,7 -75,6 +75,7 @@@ config ARM6
        select ARCH_SUPPORTS_SHADOW_CALL_STACK if CC_HAVE_SHADOW_CALL_STACK
        select ARCH_SUPPORTS_LTO_CLANG if CPU_LITTLE_ENDIAN
        select ARCH_SUPPORTS_LTO_CLANG_THIN
 +      select ARCH_SUPPORTS_CFI_CLANG
        select ARCH_SUPPORTS_ATOMIC_RMW
        select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && (GCC_VERSION >= 50000 || CC_IS_CLANG)
        select ARCH_SUPPORTS_NUMA_BALANCING
        select GENERIC_CPU_AUTOPROBE
        select GENERIC_CPU_VULNERABILITIES
        select GENERIC_EARLY_IOREMAP
 +      select GENERIC_FIND_FIRST_BIT
        select GENERIC_IDLE_POLL_SETUP
        select GENERIC_IRQ_IPI
 -      select GENERIC_IRQ_MULTI_HANDLER
        select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
        select GENERIC_IRQ_SHOW_LEVEL
        select HAVE_ARCH_JUMP_LABEL
        select HAVE_ARCH_JUMP_LABEL_RELATIVE
        select HAVE_ARCH_KASAN if !(ARM64_16K_PAGES && ARM64_VA_BITS_48)
 +      select HAVE_ARCH_KASAN_VMALLOC if HAVE_ARCH_KASAN
        select HAVE_ARCH_KASAN_SW_TAGS if HAVE_ARCH_KASAN
        select HAVE_ARCH_KASAN_HW_TAGS if (HAVE_ARCH_KASAN && ARM64_MTE)
        select HAVE_ARCH_KFENCE
        select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
        select HAVE_ARCH_PFN_VALID
        select HAVE_ARCH_PREL32_RELOCATIONS
 +      select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
        select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_STACKLEAK
        select HAVE_ARCH_THREAD_STRUCT_WHITELIST
        select IOMMU_DMA if IOMMU_SUPPORT
        select IRQ_DOMAIN
        select IRQ_FORCED_THREADING
 +      select KASAN_VMALLOC if KASAN_GENERIC
        select MODULES_USE_ELF_RELA
        select NEED_DMA_MAP_STATE
        select NEED_SG_DMA_LENGTH
@@@ -814,16 -810,6 +814,16 @@@ config QCOM_FALKOR_ERRATUM_E104
  
          If unsure, say Y.
  
 +config NVIDIA_CARMEL_CNP_ERRATUM
 +      bool "NVIDIA Carmel CNP: CNP on Carmel semantically different than ARM cores"
 +      default y
 +      help
 +        If CNP is enabled on Carmel cores, non-sharable TLBIs on a core will not
 +        invalidate shared TLB entries installed by a different core, as it would
 +        on standard ARM cores.
 +
 +        If unsure, say Y.
 +
  config SOCIONEXT_SYNQUACER_PREITS
        bool "Socionext Synquacer: Workaround for GICv3 pre-ITS"
        default y
@@@ -1069,12 -1055,11 +1069,12 @@@ config HW_PERF_EVENT
  config SYS_SUPPORTS_HUGETLBFS
        def_bool y
  
 -config ARCH_WANT_HUGE_PMD_SHARE
 -
  config ARCH_HAS_CACHE_LINE_SIZE
        def_bool y
  
 +config ARCH_HAS_FILTER_PGPROT
 +      def_bool y
 +
  config ARCH_ENABLE_SPLIT_PMD_PTLOCK
        def_bool y if PGTABLE_LEVELS > 2
  
@@@ -1113,6 -1098,7 +1113,7 @@@ config KEXE
  config KEXEC_FILE
        bool "kexec file based system call"
        select KEXEC_CORE
+       select HAVE_IMA_KEXEC if IMA
        help
          This is new version of kexec system call. This system call is
          file based and takes file descriptors as system call argument
@@@ -1172,8 -1158,8 +1173,8 @@@ config XE
  
  config FORCE_MAX_ZONEORDER
        int
 -      default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE)
 -      default "12" if (ARM64_16K_PAGES && TRANSPARENT_HUGEPAGE)
 +      default "14" if ARM64_64K_PAGES
 +      default "12" if ARM64_16K_PAGES
        default "11"
        help
          The kernel memory allocator divides physically contiguous memory
@@@ -1413,13 -1399,10 +1414,13 @@@ config ARM64_PA
  config AS_HAS_LDAPR
        def_bool $(as-instr,.arch_extension rcpc)
  
 +config AS_HAS_LSE_ATOMICS
 +      def_bool $(as-instr,.arch_extension lse)
 +
  config ARM64_LSE_ATOMICS
        bool
        default ARM64_USE_LSE_ATOMICS
 -      depends on $(as-instr,.arch_extension lse)
 +      depends on AS_HAS_LSE_ATOMICS
  
  config ARM64_USE_LSE_ATOMICS
        bool "Atomic instructions"
          built with binutils >= 2.25 in order for the new instructions
          to be used.
  
 -config ARM64_VHE
 -      bool "Enable support for Virtualization Host Extensions (VHE)"
 -      default y
 -      help
 -        Virtualization Host Extensions (VHE) allow the kernel to run
 -        directly at EL2 (instead of EL1) on processors that support
 -        it. This leads to better performance for KVM, as they reduce
 -        the cost of the world switch.
 -
 -        Selecting this option allows the VHE feature to be detected
 -        at runtime, and does not affect processors that do not
 -        implement this feature.
 -
  endmenu
  
  menu "ARMv8.2 architectural features"
@@@ -1663,7 -1659,6 +1664,7 @@@ config ARM64_MT
        default y
        depends on ARM64_AS_HAS_MTE && ARM64_TAGGED_ADDR_ABI
        depends on AS_HAS_ARMV8_5
 +      depends on AS_HAS_LSE_ATOMICS
        # Required for tag checking in the uaccess routines
        depends on ARM64_PAN
        select ARCH_USES_HIGH_VMA_FLAGS
  
  endmenu
  
 +menu "ARMv8.7 architectural features"
 +
 +config ARM64_EPAN
 +      bool "Enable support for Enhanced Privileged Access Never (EPAN)"
 +      default y
 +      depends on ARM64_PAN
 +      help
 +       Enhanced Privileged Access Never (EPAN) allows Privileged
 +       Access Never to be used with Execute-only mappings.
 +
 +       The feature is detected at runtime, and will remain disabled
 +       if the cpu does not implement the feature.
 +endmenu
 +
  config ARM64_SVE
        bool "ARM Scalable Vector Extension support"
        default y
 -      depends on !KVM || ARM64_VHE
        help
          The Scalable Vector Extension (SVE) is an extension to the AArch64
          execution state which complements and extends the SIMD functionality
          booting the kernel.  If unsure and you are not observing these
          symptoms, you should assume that it is safe to say Y.
  
 -        CPUs that support SVE are architecturally required to support the
 -        Virtualization Host Extensions (VHE), so the kernel makes no
 -        provision for supporting SVE alongside KVM without VHE enabled.
 -        Thus, you will need to enable CONFIG_ARM64_VHE if you want to support
 -        KVM in the same kernel image.
 -
  config ARM64_MODULE_PLTS
        bool "Use PLTs to allow module memory to spill over into vmalloc area"
        depends on MODULES
@@@ -1868,6 -1856,12 +1869,6 @@@ config CMDLINE_FROM_BOOTLOADE
          the boot loader doesn't provide any, the default kernel command
          string provided in CMDLINE will be used.
  
 -config CMDLINE_EXTEND
 -      bool "Extend bootloader kernel arguments"
 -      help
 -        The command-line arguments provided by the boot loader will be
 -        appended to the default kernel command string.
 -
  config CMDLINE_FORCE
        bool "Always use the default kernel command string"
        help
diff --combined arch/x86/kernel/crash.c
index b1deacbeb266934b76c7d46b556784d00ae8cb91,9d0722fb88424b9825b4877c4fd22ddd7304bd0c..54ce999ed321285ff9417d94e76adcd294bda017
@@@ -323,8 -323,8 +323,8 @@@ static int memmap_exclude_ranges(struc
        cmem->nr_ranges = 1;
  
        /* Exclude elf header region */
-       start = image->arch.elf_load_addr;
-       end = start + image->arch.elf_headers_sz - 1;
+       start = image->elf_load_addr;
+       end = start + image->elf_headers_sz - 1;
        return crash_exclude_mem_range(cmem, start, end);
  }
  
@@@ -337,7 -337,7 +337,7 @@@ int crash_setup_memmap_entries(struct k
        struct crash_memmap_data cmd;
        struct crash_mem *cmem;
  
 -      cmem = vzalloc(sizeof(struct crash_mem));
 +      cmem = vzalloc(struct_size(cmem, ranges, 1));
        if (!cmem)
                return -ENOMEM;
  
@@@ -407,20 -407,20 +407,20 @@@ int crash_load_segments(struct kimage *
        if (ret)
                return ret;
  
-       image->arch.elf_headers = kbuf.buffer;
-       image->arch.elf_headers_sz = kbuf.bufsz;
+       image->elf_headers = kbuf.buffer;
+       image->elf_headers_sz = kbuf.bufsz;
  
        kbuf.memsz = kbuf.bufsz;
        kbuf.buf_align = ELF_CORE_HEADER_ALIGN;
        kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
        ret = kexec_add_buffer(&kbuf);
        if (ret) {
-               vfree((void *)image->arch.elf_headers);
+               vfree((void *)image->elf_headers);
                return ret;
        }
-       image->arch.elf_load_addr = kbuf.mem;
+       image->elf_load_addr = kbuf.mem;
        pr_debug("Loaded ELF headers at 0x%lx bufsz=0x%lx memsz=0x%lx\n",
-                image->arch.elf_load_addr, kbuf.bufsz, kbuf.bufsz);
+                image->elf_load_addr, kbuf.bufsz, kbuf.bufsz);
  
        return ret;
  }
index f01cd9a08155795e62e0a550817ca6e9ca5c1fdf,055c18a6f7bfff4c1a6cd91655129bc76814ea8e..c078b0d3ab0ee698599704c1fd8ce56093a9e2f9
@@@ -260,7 -260,7 +260,7 @@@ static void set_idt(void *newidt, u16 l
  {
        struct desc_ptr curidt;
  
 -      /* x86-64 supports unaliged loads & stores */
 +      /* x86-64 supports unaligned loads & stores */
        curidt.size    = limit;
        curidt.address = (unsigned long)newidt;
  
@@@ -402,8 -402,8 +402,8 @@@ void machine_kexec(struct kimage *image
  #ifdef CONFIG_KEXEC_FILE
  void *arch_kexec_kernel_image_load(struct kimage *image)
  {
-       vfree(image->arch.elf_headers);
-       image->arch.elf_headers = NULL;
+       vfree(image->elf_headers);
+       image->elf_headers = NULL;
  
        if (!image->fops || !image->fops->load)
                return ERR_PTR(-ENOEXEC);
diff --combined drivers/of/address.c
index a2373fa4a5715b0da081dad7c6ec30b44117dc75,d3d10d45b9fa9e6e6d9e98c04921e5840e450b95..aca94c348bd4877ff4526b9711934ad91d6b9c5c
@@@ -26,7 -26,6 +26,7 @@@ static struct of_bus *of_match_bus(stru
  static int __of_address_to_resource(struct device_node *dev,
                const __be32 *addrp, u64 size, unsigned int flags,
                const char *name, struct resource *r);
 +static bool of_mmio_is_nonposted(struct device_node *np);
  
  /* Debug utility */
  #ifdef DEBUG
@@@ -117,9 -116,12 +117,12 @@@ static unsigned int of_bus_pci_get_flag
                flags |= IORESOURCE_IO;
                break;
        case 0x02: /* 32 bits */
-       case 0x03: /* 64 bits */
                flags |= IORESOURCE_MEM;
                break;
+       case 0x03: /* 64 bits */
+               flags |= IORESOURCE_MEM | IORESOURCE_MEM_64;
+               break;
        }
        if (w & 0x40000000)
                flags |= IORESOURCE_PREFETCH;
@@@ -848,9 -850,6 +851,9 @@@ static int __of_address_to_resource(str
                return -EINVAL;
        memset(r, 0, sizeof(struct resource));
  
 +      if (of_mmio_is_nonposted(dev))
 +              flags |= IORESOURCE_MEM_NONPOSTED;
 +
        r->start = taddr;
        r->end = taddr + size - 1;
        r->flags = flags;
  
  /**
   * of_address_to_resource - Translate device tree address and return as resource
+  * @dev:      Caller's Device Node
+  * @index:    Index into the array
+  * @r:                Pointer to resource array
   *
   * Note that if your address is a PIO address, the conversion will fail if
   * the physical address can't be internally converted to an IO token with
@@@ -900,10 -902,7 +906,10 @@@ void __iomem *of_iomap(struct device_no
        if (of_address_to_resource(np, index, &res))
                return NULL;
  
 -      return ioremap(res.start, resource_size(&res));
 +      if (res.flags & IORESOURCE_MEM_NONPOSTED)
 +              return ioremap_np(res.start, resource_size(&res));
 +      else
 +              return ioremap(res.start, resource_size(&res));
  }
  EXPORT_SYMBOL(of_iomap);
  
@@@ -935,11 -934,7 +941,11 @@@ void __iomem *of_io_request_and_map(str
        if (!request_mem_region(res.start, resource_size(&res), name))
                return IOMEM_ERR_PTR(-EBUSY);
  
 -      mem = ioremap(res.start, resource_size(&res));
 +      if (res.flags & IORESOURCE_MEM_NONPOSTED)
 +              mem = ioremap_np(res.start, resource_size(&res));
 +      else
 +              mem = ioremap(res.start, resource_size(&res));
 +
        if (!mem) {
                release_mem_region(res.start, resource_size(&res));
                return IOMEM_ERR_PTR(-ENOMEM);
@@@ -1105,31 -1100,3 +1111,31 @@@ bool of_dma_is_coherent(struct device_n
        return false;
  }
  EXPORT_SYMBOL_GPL(of_dma_is_coherent);
 +
 +/**
 + * of_mmio_is_nonposted - Check if device uses non-posted MMIO
 + * @np:       device node
 + *
 + * Returns true if the "nonposted-mmio" property was found for
 + * the device's bus.
 + *
 + * This is currently only enabled on builds that support Apple ARM devices, as
 + * an optimization.
 + */
 +static bool of_mmio_is_nonposted(struct device_node *np)
 +{
 +      struct device_node *parent;
 +      bool nonposted;
 +
 +      if (!IS_ENABLED(CONFIG_ARCH_APPLE))
 +              return false;
 +
 +      parent = of_get_parent(np);
 +      if (!parent)
 +              return false;
 +
 +      nonposted = of_property_read_bool(parent, "nonposted-mmio");
 +
 +      of_node_put(parent);
 +      return nonposted;
 +}
diff --combined drivers/of/fdt.c
index adb26aff481d5584c55db4621e915d678b44cdd6,134c7fb43a145da88d854e5d8069bedb262e7207..ba17a80b8c79cc219568ce0a045c8c636b653ee7
@@@ -205,7 -205,7 +205,7 @@@ static void populate_properties(const v
                *pprev = NULL;
  }
  
 -static bool populate_node(const void *blob,
 +static int populate_node(const void *blob,
                          int offset,
                          void **mem,
                          struct device_node *dad,
  {
        struct device_node *np;
        const char *pathp;
 -      unsigned int l, allocl;
 +      int len;
  
 -      pathp = fdt_get_name(blob, offset, &l);
 +      pathp = fdt_get_name(blob, offset, &len);
        if (!pathp) {
                *pnp = NULL;
 -              return false;
 +              return len;
        }
  
 -      allocl = ++l;
 +      len++;
  
 -      np = unflatten_dt_alloc(mem, sizeof(struct device_node) + allocl,
 +      np = unflatten_dt_alloc(mem, sizeof(struct device_node) + len,
                                __alignof__(struct device_node));
        if (!dryrun) {
                char *fn;
                of_node_init(np);
                np->full_name = fn = ((char *)np) + sizeof(*np);
  
 -              memcpy(fn, pathp, l);
 +              memcpy(fn, pathp, len);
  
                if (dad != NULL) {
                        np->parent = dad;
@@@ -282,7 -282,7 +282,7 @@@ static void reverse_nodes(struct device
   * @dad: Parent struct device_node
   * @nodepp: The device_node tree created by the call
   *
-  * It returns the size of unflattened device tree or error code
+  * Return: The size of unflattened device tree or error code
   */
  static int unflatten_dt_nodes(const void *blob,
                              void *mem,
        struct device_node *nps[FDT_MAX_DEPTH];
        void *base = mem;
        bool dryrun = !base;
 +      int ret;
  
        if (nodepp)
                *nodepp = NULL;
                    !of_fdt_device_is_available(blob, offset))
                        continue;
  
 -              if (!populate_node(blob, offset, &mem, nps[depth],
 -                                 &nps[depth+1], dryrun))
 -                      return mem - base;
 +              ret = populate_node(blob, offset, &mem, nps[depth],
 +                                 &nps[depth+1], dryrun);
 +              if (ret < 0)
 +                      return ret;
  
                if (!dryrun && nodepp && !*nodepp)
                        *nodepp = nps[depth+1];
  
  /**
   * __unflatten_device_tree - create tree of device_nodes from flat blob
-  *
-  * unflattens a device-tree, creating the
-  * tree of struct device_node. It also fills the "name" and "type"
-  * pointers of the nodes so the normal device-tree walking functions
-  * can be used.
   * @blob: The blob to expand
   * @dad: Parent device node
   * @mynodes: The device_node tree created by the call
   * for the resulting tree
   * @detached: if true set OF_DETACHED on @mynodes
   *
-  * Returns NULL on failure or the memory chunk containing the unflattened
+  * unflattens a device-tree, creating the tree of struct device_node. It also
+  * fills the "name" and "type" pointers of the nodes so the normal device-tree
+  * walking functions can be used.
+  *
+  * Return: NULL on failure or the memory chunk containing the unflattened
   * device tree on success.
   */
  void *__unflatten_device_tree(const void *blob,
  {
        int size;
        void *mem;
 +      int ret;
 +
 +      if (mynodes)
 +              *mynodes = NULL;
  
        pr_debug(" -> unflatten_device_tree()\n");
  
  
        /* First pass, scan for size */
        size = unflatten_dt_nodes(blob, NULL, dad, NULL);
 -      if (size < 0)
 +      if (size <= 0)
                return NULL;
  
        size = ALIGN(size, 4);
        pr_debug("  unflattening %p...\n", mem);
  
        /* Second pass, do actual unflattening */
 -      unflatten_dt_nodes(blob, mem, dad, mynodes);
 +      ret = unflatten_dt_nodes(blob, mem, dad, mynodes);
 +
        if (be32_to_cpup(mem + size) != 0xdeadbeef)
                pr_warn("End of tree marker overwritten: %08x\n",
                        be32_to_cpup(mem + size));
  
 -      if (detached && mynodes) {
 +      if (ret <= 0)
 +              return NULL;
 +
 +      if (detached && mynodes && *mynodes) {
                of_node_set_flag(*mynodes, OF_DETACHED);
                pr_debug("unflattened tree is detached\n");
        }
@@@ -452,7 -441,7 +451,7 @@@ static DEFINE_MUTEX(of_fdt_unflatten_mu
   * pointers of the nodes so the normal device-tree walking functions
   * can be used.
   *
-  * Returns NULL on failure or the memory chunk containing the unflattened
+  * Return: NULL on failure or the memory chunk containing the unflattened
   * device tree on success.
   */
  void *of_fdt_unflatten_tree(const unsigned long *blob,
@@@ -480,7 -469,7 +479,7 @@@ void *initial_boot_params __ro_after_in
  
  static u32 of_fdt_crc32;
  
- /**
+ /*
   * __reserved_mem_reserve_reg() - reserve all memory described in 'reg' property
   */
  static int __init __reserved_mem_reserve_reg(unsigned long node,
        return 0;
  }
  
- /**
+ /*
   * __reserved_mem_check_root() - check if #size-cells, #address-cells provided
   * in /reserved-memory matches the values supported by the current implementation,
   * also check if ranges property has been provided
@@@ -549,8 -538,8 +548,8 @@@ static int __init __reserved_mem_check_
        return 0;
  }
  
- /**
-  * fdt_scan_reserved_mem() - scan a single FDT node for reserved memory
+ /*
+  * __fdt_scan_reserved_mem() - scan a single FDT node for reserved memory
   */
  static int __init __fdt_scan_reserved_mem(unsigned long node, const char *uname,
                                          int depth, void *data)
@@@ -660,6 -649,7 +659,7 @@@ int __init of_scan_flat_dt(int (*it)(un
  
  /**
   * of_scan_flat_dt_subnodes - scan sub-nodes of a node call callback on each.
+  * @parent: parent node
   * @it: callback function
   * @data: context data pointer
   *
@@@ -699,7 -689,7 +699,7 @@@ int __init of_get_flat_dt_subnode_by_na
        return fdt_subnode_offset(initial_boot_params, node, uname);
  }
  
- /**
+ /*
   * of_get_flat_dt_root - find the root node in the flat blob
   */
  unsigned long __init of_get_flat_dt_root(void)
        return 0;
  }
  
- /**
+ /*
   * of_get_flat_dt_prop - Given a node in the flat blob, return the property ptr
   *
   * This function can be used within scan_flattened_dt callback to get
@@@ -726,7 -716,7 +726,7 @@@ const void *__init of_get_flat_dt_prop(
   * @node: node to test
   * @compat: compatible string to compare with compatible list.
   *
-  * On match, returns a non-zero value with smaller values returned for more
+  * Return: a non-zero value on match with smaller values returned for more
   * specific compatible values.
   */
  static int of_fdt_is_compatible(const void *blob,
@@@ -761,7 -751,7 +761,7 @@@ int __init of_flat_dt_is_compatible(uns
        return of_fdt_is_compatible(initial_boot_params, node, compat);
  }
  
- /**
+ /*
   * of_flat_dt_match - Return true if node matches a list of compatible values
   */
  static int __init of_flat_dt_match(unsigned long node, const char *const *compat)
        return score;
  }
  
- /**
-  * of_get_flat_dt_prop - Given a node in the flat blob, return the phandle
+ /*
+  * of_get_flat_dt_phandle - Given a node in the flat blob, return the phandle
   */
  uint32_t __init of_get_flat_dt_phandle(unsigned long node)
  {
@@@ -957,7 -947,7 +957,7 @@@ int __init early_init_dt_scan_chosen_st
  }
  #endif
  
- /**
+ /*
   * early_init_dt_scan_root - fetch the top level address and size cells
   */
  int __init early_init_dt_scan_root(unsigned long node, const char *uname,
@@@ -993,7 -983,7 +993,7 @@@ u64 __init dt_mem_next_cell(int s, cons
        return of_read_number(p, s);
  }
  
- /**
+ /*
   * early_init_dt_scan_memory - Look for and parse memory nodes
   */
  int __init early_init_dt_scan_memory(unsigned long node, const char *uname,
diff --combined drivers/of/overlay.c
index 23effe5e50ece15469f8ff6fe8d20f4820bf23d5,93af03c10e3b467b3728b5b50c51760b762ca427..180c6fb3ef36bb35e7c1d62a785083bc8a9eb05a
@@@ -57,7 -57,7 +57,7 @@@ struct fragment 
   * struct overlay_changeset
   * @id:                       changeset identifier
   * @ovcs_list:                list on which we are located
 - * @fdt:              FDT that was unflattened to create @overlay_tree
 + * @fdt:              base of memory allocated to hold aligned FDT that was unflattened to create @overlay_tree
   * @overlay_tree:     expanded device tree that contains the fragment nodes
   * @count:            count of fragment structures
   * @fragments:                fragment nodes in the overlay expanded device tree
@@@ -140,7 -140,7 +140,7 @@@ int of_overlay_notifier_register(struc
  EXPORT_SYMBOL_GPL(of_overlay_notifier_register);
  
  /**
-  * of_overlay_notifier_register() - Unregister notifier for overlay operations
+  * of_overlay_notifier_unregister() - Unregister notifier for overlay operations
   * @nb:               Notifier block to unregister
   */
  int of_overlay_notifier_unregister(struct notifier_block *nb)
@@@ -298,7 -298,7 +298,7 @@@ err_free_target_path
   *
   * Update of property in symbols node is not allowed.
   *
-  * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
+  * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
   * invalid @overlay.
   */
  static int add_changeset_property(struct overlay_changeset *ovcs,
   *
   * NOTE_2: Multiple mods of created nodes not supported.
   *
-  * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
+  * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
   * invalid @overlay.
   */
  static int add_changeset_node(struct overlay_changeset *ovcs,
   *
   * Do not allow symbols node to have any children.
   *
-  * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
+  * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
   * invalid @overlay_node.
   */
  static int build_changeset_next_level(struct overlay_changeset *ovcs,
@@@ -606,7 -606,7 +606,7 @@@ static int find_dup_cset_prop(struct ov
   * the same node or duplicate {add, delete, or update} properties entries
   * for the same property.
   *
-  * Returns 0 on success, or -EINVAL if duplicate changeset entry found.
+  * Return: 0 on success, or -EINVAL if duplicate changeset entry found.
   */
  static int changeset_dup_entry_check(struct overlay_changeset *ovcs)
  {
   * any portions of the changeset that were successfully created will remain
   * in @ovcs->cset.
   *
-  * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
+  * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
   * invalid overlay in @ovcs->fragments[].
   */
  static int build_changeset(struct overlay_changeset *ovcs)
@@@ -719,14 -719,14 +719,14 @@@ static struct device_node *find_target(
  /**
   * init_overlay_changeset() - initialize overlay changeset from overlay tree
   * @ovcs:     Overlay changeset to build
 - * @fdt:      the FDT that was unflattened to create @tree
 - * @tree:     Contains all the overlay fragments and overlay fixup nodes
 + * @fdt:      base of memory allocated to hold aligned FDT that was unflattened to create @tree
 + * @tree:     Contains the overlay fragments and overlay fixup nodes
   *
   * Initialize @ovcs.  Populate @ovcs->fragments with node information from
   * the top level of @tree.  The relevant top level nodes are the fragment
   * nodes and the __symbols__ node.  Any other top level node will be ignored.
   *
-  * Returns 0 on success, -ENOMEM if memory allocation failure, -EINVAL if error
+  * Return: 0 on success, -ENOMEM if memory allocation failure, -EINVAL if error
   * detected in @tree, or -ENOSPC if idr_alloc() error.
   */
  static int init_overlay_changeset(struct overlay_changeset *ovcs,
                if (!fragment->target) {
                        of_node_put(fragment->overlay);
                        ret = -EINVAL;
+                       of_node_put(node);
                        goto err_free_fragments;
                }
  
@@@ -873,7 -874,7 +874,7 @@@ static void free_overlay_changeset(stru
   * internal documentation
   *
   * of_overlay_apply() - Create and apply an overlay changeset
 - * @fdt:      the FDT that was unflattened to create @tree
 + * @fdt:      base of memory allocated to hold the aligned FDT
   * @tree:     Expanded overlay device tree
   * @ovcs_id:  Pointer to overlay changeset id
   *
@@@ -953,9 -954,7 +954,9 @@@ static int of_overlay_apply(const void 
        /*
         * after overlay_notify(), ovcs->overlay_tree related pointers may have
         * leaked to drivers, so can not kfree() tree, aka ovcs->overlay_tree;
 -       * and can not free fdt, aka ovcs->fdt
 +       * and can not free memory containing aligned fdt.  The aligned fdt
 +       * is contained within the memory at ovcs->fdt, possibly at an offset
 +       * from ovcs->fdt.
         */
        ret = overlay_notify(ovcs, OF_OVERLAY_PRE_APPLY);
        if (ret) {
  int of_overlay_fdt_apply(const void *overlay_fdt, u32 overlay_fdt_size,
                         int *ovcs_id)
  {
 -      const void *new_fdt;
 +      void *new_fdt;
 +      void *new_fdt_align;
        int ret;
        u32 size;
 -      struct device_node *overlay_root;
 +      struct device_node *overlay_root = NULL;
  
        *ovcs_id = 0;
        ret = 0;
         * Must create permanent copy of FDT because of_fdt_unflatten_tree()
         * will create pointers to the passed in FDT in the unflattened tree.
         */
 -      new_fdt = kmemdup(overlay_fdt, size, GFP_KERNEL);
 +      new_fdt = kmalloc(size + FDT_ALIGN_SIZE, GFP_KERNEL);
        if (!new_fdt)
                return -ENOMEM;
  
 -      of_fdt_unflatten_tree(new_fdt, NULL, &overlay_root);
 +      new_fdt_align = PTR_ALIGN(new_fdt, FDT_ALIGN_SIZE);
 +      memcpy(new_fdt_align, overlay_fdt, size);
 +
 +      of_fdt_unflatten_tree(new_fdt_align, NULL, &overlay_root);
        if (!overlay_root) {
                pr_err("unable to unflatten overlay_fdt\n");
                ret = -EINVAL;
@@@ -1186,7 -1181,7 +1187,7 @@@ static int overlay_removal_is_ok(struc
   * If an error is returned by an overlay changeset post-remove notifier
   * then no further overlay changeset post-remove notifier will be called.
   *
-  * Returns 0 on success, or a negative error number.  *ovcs_id is set to
+  * Return: 0 on success, or a negative error number.  *@ovcs_id is set to
   * zero after reverting the changeset, even if a subsequent error occurs.
   */
  int of_overlay_remove(int *ovcs_id)
@@@ -1264,7 -1259,7 +1265,7 @@@ EXPORT_SYMBOL_GPL(of_overlay_remove)
   *
   * Removes all overlays from the system in the correct order.
   *
-  * Returns 0 on success, or a negative error number
+  * Return: 0 on success, or a negative error number
   */
  int of_overlay_remove_all(void)
  {
diff --combined drivers/of/property.c
index aab6383f02198928f47319f9e70ef8b076dd2c00,2046ae311322f426f3ab34560f6509c07f0959aa..6c028632f425f42242c2697f630ce270b5112e35
@@@ -61,9 -61,11 +61,11 @@@ EXPORT_SYMBOL(of_graph_is_present)
   * @elem_size:        size of the individual element
   *
   * Search for a property in a device node and count the number of elements of
-  * size elem_size in it. Returns number of elements on sucess, -EINVAL if the
-  * property does not exist or its length does not match a multiple of elem_size
-  * and -ENODATA if the property does not have a value.
+  * size elem_size in it.
+  *
+  * Return: The number of elements on sucess, -EINVAL if the property does not
+  * exist or its length does not match a multiple of elem_size and -ENODATA if
+  * the property does not have a value.
   */
  int of_property_count_elems_of_size(const struct device_node *np,
                                const char *propname, int elem_size)
@@@ -95,8 -97,9 +97,9 @@@ EXPORT_SYMBOL_GPL(of_property_count_ele
   * @len:      if !=NULL, actual length is written to here
   *
   * Search for a property in a device node and valid the requested size.
-  * Returns the property value on success, -EINVAL if the property does not
-  *  exist, -ENODATA if property does not have a value, and -EOVERFLOW if the
+  *
+  * Return: The property value on success, -EINVAL if the property does not
+  * exist, -ENODATA if property does not have a value, and -EOVERFLOW if the
   * property data is too small or too large.
   *
   */
@@@ -129,7 -132,9 +132,9 @@@ static void *of_find_property_value_of_
   * @out_value:        pointer to return value, modified only if no error.
   *
   * Search for a property in a device node and read nth 32-bit value from
-  * it. Returns 0 on success, -EINVAL if the property does not exist,
+  * it.
+  *
+  * Return: 0 on success, -EINVAL if the property does not exist,
   * -ENODATA if property does not have a value, and -EOVERFLOW if the
   * property data isn't large enough.
   *
@@@ -161,7 -166,9 +166,9 @@@ EXPORT_SYMBOL_GPL(of_property_read_u32_
   * @out_value:        pointer to return value, modified only if no error.
   *
   * Search for a property in a device node and read nth 64-bit value from
-  * it. Returns 0 on success, -EINVAL if the property does not exist,
+  * it.
+  *
+  * Return: 0 on success, -EINVAL if the property does not exist,
   * -ENODATA if property does not have a value, and -EOVERFLOW if the
   * property data isn't large enough.
   *
@@@ -196,12 -203,14 +203,14 @@@ EXPORT_SYMBOL_GPL(of_property_read_u64_
   *            sz_min will be read.
   *
   * Search for a property in a device node and read 8-bit value(s) from
-  * it. Returns number of elements read on success, -EINVAL if the property
-  * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
-  * if the property data is smaller than sz_min or longer than sz_max.
+  * it.
   *
   * dts entry of array should be like:
-  *    property = /bits/ 8 <0x50 0x60 0x70>;
+  *  ``property = /bits/ 8 <0x50 0x60 0x70>;``
+  *
+  * Return: The number of elements read on success, -EINVAL if the property
+  * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
+  * if the property data is smaller than sz_min or longer than sz_max.
   *
   * The out_values is modified only if a valid u8 value can be decoded.
   */
@@@ -244,12 -253,14 +253,14 @@@ EXPORT_SYMBOL_GPL(of_property_read_vari
   *            sz_min will be read.
   *
   * Search for a property in a device node and read 16-bit value(s) from
-  * it. Returns number of elements read on success, -EINVAL if the property
-  * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
-  * if the property data is smaller than sz_min or longer than sz_max.
+  * it.
   *
   * dts entry of array should be like:
-  *    property = /bits/ 16 <0x5000 0x6000 0x7000>;
+  *  ``property = /bits/ 16 <0x5000 0x6000 0x7000>;``
+  *
+  * Return: The number of elements read on success, -EINVAL if the property
+  * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
+  * if the property data is smaller than sz_min or longer than sz_max.
   *
   * The out_values is modified only if a valid u16 value can be decoded.
   */
@@@ -292,7 -303,9 +303,9 @@@ EXPORT_SYMBOL_GPL(of_property_read_vari
   *            sz_min will be read.
   *
   * Search for a property in a device node and read 32-bit value(s) from
-  * it. Returns number of elements read on success, -EINVAL if the property
+  * it.
+  *
+  * Return: The number of elements read on success, -EINVAL if the property
   * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
   * if the property data is smaller than sz_min or longer than sz_max.
   *
@@@ -331,7 -344,9 +344,9 @@@ EXPORT_SYMBOL_GPL(of_property_read_vari
   * @out_value:        pointer to return value, modified only if return value is 0.
   *
   * Search for a property in a device node and read a 64-bit value from
-  * it. Returns 0 on success, -EINVAL if the property does not exist,
+  * it.
+  *
+  * Return: 0 on success, -EINVAL if the property does not exist,
   * -ENODATA if property does not have a value, and -EOVERFLOW if the
   * property data isn't large enough.
   *
@@@ -366,7 -381,9 +381,9 @@@ EXPORT_SYMBOL_GPL(of_property_read_u64)
   *            sz_min will be read.
   *
   * Search for a property in a device node and read 64-bit value(s) from
-  * it. Returns number of elements read on success, -EINVAL if the property
+  * it.
+  *
+  * Return: The number of elements read on success, -EINVAL if the property
   * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
   * if the property data is smaller than sz_min or longer than sz_max.
   *
@@@ -408,10 -425,11 +425,11 @@@ EXPORT_SYMBOL_GPL(of_property_read_vari
   *            return value is 0.
   *
   * Search for a property in a device tree node and retrieve a null
-  * terminated string value (pointer to data, not a copy). Returns 0 on
-  * success, -EINVAL if the property does not exist, -ENODATA if property
-  * does not have a value, and -EILSEQ if the string is not null-terminated
-  * within the length of the property data.
+  * terminated string value (pointer to data, not a copy).
+  *
+  * Return: 0 on success, -EINVAL if the property does not exist, -ENODATA if
+  * property does not have a value, and -EILSEQ if the string is not
+  * null-terminated within the length of the property data.
   *
   * The out_string pointer is modified only if a valid string can be decoded.
   */
@@@ -775,7 -793,7 +793,7 @@@ EXPORT_SYMBOL(of_graph_get_remote_port_
   * @node: pointer to a local endpoint device_node
   *
   * Return: Remote port node associated with remote endpoint node linked
-  *       to @node. Use of_node_put() on it when done.
+  * to @node. Use of_node_put() on it when done.
   */
  struct device_node *of_graph_get_remote_port(const struct device_node *node)
  {
@@@ -808,7 -826,7 +826,7 @@@ EXPORT_SYMBOL(of_graph_get_endpoint_cou
   * @endpoint: identifier (value of reg property) of the endpoint node
   *
   * Return: Remote device node associated with remote endpoint node linked
-  *       to @node. Use of_node_put() on it when done.
+  * to @node. Use of_node_put() on it when done.
   */
  struct device_node *of_graph_get_remote_node(const struct device_node *node,
                                             u32 port, u32 endpoint)
@@@ -1038,25 -1056,6 +1056,25 @@@ static bool of_is_ancestor_of(struct de
        return false;
  }
  
 +static struct device_node *of_get_compat_node(struct device_node *np)
 +{
 +      of_node_get(np);
 +
 +      while (np) {
 +              if (!of_device_is_available(np)) {
 +                      of_node_put(np);
 +                      np = NULL;
 +              }
 +
 +              if (of_find_property(np, "compatible", NULL))
 +                      break;
 +
 +              np = of_get_next_parent(np);
 +      }
 +
 +      return np;
 +}
 +
  /**
   * of_link_to_phandle - Add fwnode link to supplier from supplier phandle
   * @con_np: consumer device tree node
@@@ -1080,11 -1079,25 +1098,11 @@@ static int of_link_to_phandle(struct de
        struct device *sup_dev;
        struct device_node *tmp_np = sup_np;
  
 -      of_node_get(sup_np);
        /*
         * Find the device node that contains the supplier phandle.  It may be
         * @sup_np or it may be an ancestor of @sup_np.
         */
 -      while (sup_np) {
 -
 -              /* Don't allow linking to a disabled supplier */
 -              if (!of_device_is_available(sup_np)) {
 -                      of_node_put(sup_np);
 -                      sup_np = NULL;
 -              }
 -
 -              if (of_find_property(sup_np, "compatible", NULL))
 -                      break;
 -
 -              sup_np = of_get_next_parent(sup_np);
 -      }
 -
 +      sup_np = of_get_compat_node(sup_np);
        if (!sup_np) {
                pr_debug("Not linking %pOFP to %pOFP - No device\n",
                         con_np, tmp_np);
@@@ -1230,8 -1243,7 +1248,8 @@@ static struct device_node *parse_##fnam
   * @parse_prop.prop_name: Name of property holding a phandle value
   * @parse_prop.index: For properties holding a list of phandles, this is the
   *                  index into the list
-  * @optional: The property can be an optional dependency.
+  * @optional: Describes whether a supplier is mandatory or not
 + * @node_not_dev: The consumer node containing the property is never a device.
   *
   * Returns:
   * parse_prop() return values are
@@@ -1243,7 -1255,6 +1261,7 @@@ struct supplier_bindings 
        struct device_node *(*parse_prop)(struct device_node *np,
                                          const char *prop_name, int index);
        bool optional;
 +      bool node_not_dev;
  };
  
  DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells")
@@@ -1268,19 -1279,9 +1286,19 @@@ DEFINE_SIMPLE_PROP(pinctrl5, "pinctrl-5
  DEFINE_SIMPLE_PROP(pinctrl6, "pinctrl-6", NULL)
  DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
  DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
 +DEFINE_SIMPLE_PROP(remote_endpoint, "remote-endpoint", NULL)
  DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
  DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
 -DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells")
 +
 +static struct device_node *parse_gpios(struct device_node *np,
 +                                     const char *prop_name, int index)
 +{
 +      if (!strcmp_suffix(prop_name, ",nr-gpios"))
 +              return NULL;
 +
 +      return parse_suffix_prop_cells(np, prop_name, index, "-gpios",
 +                                     "#gpio-cells");
 +}
  
  static struct device_node *parse_iommu_maps(struct device_node *np,
                                            const char *prop_name, int index)
@@@ -1352,7 -1353,6 +1370,7 @@@ static const struct supplier_bindings o
        { .parse_prop = parse_pinctrl6, },
        { .parse_prop = parse_pinctrl7, },
        { .parse_prop = parse_pinctrl8, },
 +      { .parse_prop = parse_remote_endpoint, .node_not_dev = true, },
        { .parse_prop = parse_gpio_compat, },
        { .parse_prop = parse_interrupts, },
        { .parse_prop = parse_regulators, },
  
  /**
   * of_link_property - Create device links to suppliers listed in a property
-  * @dev: Consumer device
   * @con_np: The consumer device tree node which contains the property
   * @prop_name: Name of property to be parsed
   *
@@@ -1387,7 -1386,6 +1404,6 @@@ static int of_link_property(struct devi
        const struct supplier_bindings *s = of_supplier_bindings;
        unsigned int i = 0;
        bool matched = false;
-       int ret = 0;
  
        /* Do not stop at first failed link, link all available suppliers. */
        while (!matched && s->parse_prop) {
                }
  
                while ((phandle = s->parse_prop(con_np, prop_name, i))) {
 +                      struct device_node *con_dev_np;
 +
 +                      con_dev_np = s->node_not_dev
 +                                      ? of_get_compat_node(con_np)
 +                                      : of_node_get(con_np);
                        matched = true;
                        i++;
 -                      of_link_to_phandle(con_np, phandle);
 +                      of_link_to_phandle(con_dev_np, phandle);
                        of_node_put(phandle);
 +                      of_node_put(con_dev_np);
                }
                s++;
        }
-       return ret;
+       return 0;
  }
  
  static int of_fwnode_add_links(struct fwnode_handle *fwnode)
diff --combined scripts/Makefile.lib
index 8cd67b1b6d15ac4c6b397e004580b6f1ba97e11a,ad6938468c11dcde844cfa7d9055d00dc4f624c4..659bddbd55e26ac7919db13037fe8a8adc36db0a
@@@ -73,14 -73,26 +73,26 @@@ always-y += $(userprogs-always-y) $(use
  
  # DTB
  # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built
+ dtb-$(CONFIG_OF_ALL_DTBS)       += $(dtb-)
+ # List all dtbs to be generated by fdtoverlay
+ overlay-y := $(foreach m,$(dtb-y), $(if $(strip $($(m:.dtb=-dtbs))),$(m),))
+ # Generate symbols for the base files so overlays can be applied to them.
+ $(foreach m,$(overlay-y), $(eval DTC_FLAGS_$(basename $(firstword $($(m:.dtb=-dtbs)))) += -@))
+ # Add base dtb and overlay dtbo
+ dtb-y += $(foreach m,$(overlay-y), $($(m:.dtb=-dtbs)))
  always-y                      += $(dtb-y)
- always-$(CONFIG_OF_ALL_DTBS)  += $(dtb-)
  
  ifneq ($(CHECK_DTBS),)
- always-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y))
- always-y += $(patsubst %.dtbo,%.dt.yaml, $(dtb-y))
- always-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-))
- always-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtbo,%.dt.yaml, $(dtb-))
+ # Don't run schema checks for dtbs created by fdtoverlay as they don't
+ # have corresponding dts files.
+ dt-yaml-y := $(filter-out $(overlay-y),$(dtb-y))
+ always-y += $(patsubst %.dtb,%.dt.yaml, $(dt-yaml-y))
+ always-y += $(patsubst %.dtbo,%.dt.yaml, $(dt-yaml-y))
  endif
  
  # Add subdir path
@@@ -327,7 -339,7 +339,7 @@@ $(obj)/%.dtb.S: $(obj)/%.dtb FORC
  
  quiet_cmd_dtc = DTC     $@
  cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
 -      $(DTC) -O $(patsubst .%,%,$(suffix $@)) -o $@ -b 0 \
 +      $(DTC) -o $@ -b 0 \
                $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
                -d $(depfile).dtc.tmp $(dtc-tmp) ; \
        cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
@@@ -338,13 -350,23 +350,23 @@@ $(obj)/%.dtb: $(src)/%.dts $(DTC) FORC
  $(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE
        $(call if_changed_dep,dtc)
  
+ overlay-y := $(addprefix $(obj)/, $(overlay-y))
+ quiet_cmd_fdtoverlay = DTOVL   $@
+       cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $(real-prereqs)
+ $(overlay-y): FORCE
+       $(call if_changed,fdtoverlay)
+ $(call multi_depend, $(overlay-y), .dtb, -dtbs)
  DT_CHECKER ?= dt-validate
+ DT_CHECKER_FLAGS ?= $(if $(DT_SCHEMA_FILES),,-m)
  DT_BINDING_DIR := Documentation/devicetree/bindings
  # DT_TMP_SCHEMA may be overridden from Documentation/devicetree/bindings/Makefile
  DT_TMP_SCHEMA ?= $(objtree)/$(DT_BINDING_DIR)/processed-schema.json
  
  quiet_cmd_dtb_check = CHECK   $@
-       cmd_dtb_check = $(DT_CHECKER) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@
+       cmd_dtb_check = $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@
  
  define rule_dtc
        $(call cmd_and_fixdep,dtc)
  endef
  
  $(obj)/%.dt.yaml: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
 -      $(call if_changed_rule,dtc,yaml)
 +      $(call if_changed_rule,dtc)
  
  dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
  
diff --combined scripts/checkpatch.pl
index d67146d0b33c54772103a0d429addb6500d2e85d,3e8da40634b35dd52a74ac62a1398853186a50c2..ccb412a74725703f98d37b99b63523cdcbe011b2
@@@ -23,9 -23,6 +23,9 @@@ my $V = '0.32'
  use Getopt::Long qw(:config no_auto_abbrev);
  
  my $quiet = 0;
 +my $verbose = 0;
 +my %verbose_messages = ();
 +my %verbose_emitted = ();
  my $tree = 1;
  my $chk_signoff = 1;
  my $chk_patch = 1;
@@@ -64,7 -61,6 +64,7 @@@ my $spelling_file = "$D/spelling.txt"
  my $codespell = 0;
  my $codespellfile = "/usr/share/codespell/dictionary.txt";
  my $conststructsfile = "$D/const_structs.checkpatch";
 +my $docsfile = "$D/../Documentation/dev-tools/checkpatch.rst";
  my $typedefsfile;
  my $color = "auto";
  my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE
@@@ -82,7 -78,6 +82,7 @@@ Version: $
  
  Options:
    -q, --quiet                quiet
 +  -v, --verbose              verbose mode
    --no-tree                  run without a kernel tree
    --no-signoff               do not check for 'Signed-off-by' line
    --patch                    treat FILE as patchfile (default)
@@@ -163,51 -158,15 +163,51 @@@ sub list_types 
        my $text = <$script>;
        close($script);
  
 -      my @types = ();
 +      my %types = ();
        # Also catch when type or level is passed through a variable
 -      for ($text =~ /(?:(?:\bCHK|\bWARN|\bERROR|&\{\$msg_level})\s*\(|\$msg_type\s*=)\s*"([^"]+)"/g) {
 -              push (@types, $_);
 +      while ($text =~ /(?:(\bCHK|\bWARN|\bERROR|&\{\$msg_level})\s*\(|\$msg_type\s*=)\s*"([^"]+)"/g) {
 +              if (defined($1)) {
 +                      if (exists($types{$2})) {
 +                              $types{$2} .= ",$1" if ($types{$2} ne $1);
 +                      } else {
 +                              $types{$2} = $1;
 +                      }
 +              } else {
 +                      $types{$2} = "UNDETERMINED";
 +              }
        }
 -      @types = sort(uniq(@types));
 +
        print("#\tMessage type\n\n");
 -      foreach my $type (@types) {
 +      if ($color) {
 +              print(" ( Color coding: ");
 +              print(RED . "ERROR" . RESET);
 +              print(" | ");
 +              print(YELLOW . "WARNING" . RESET);
 +              print(" | ");
 +              print(GREEN . "CHECK" . RESET);
 +              print(" | ");
 +              print("Multiple levels / Undetermined");
 +              print(" )\n\n");
 +      }
 +
 +      foreach my $type (sort keys %types) {
 +              my $orig_type = $type;
 +              if ($color) {
 +                      my $level = $types{$type};
 +                      if ($level eq "ERROR") {
 +                              $type = RED . $type . RESET;
 +                      } elsif ($level eq "WARN") {
 +                              $type = YELLOW . $type . RESET;
 +                      } elsif ($level eq "CHK") {
 +                              $type = GREEN . $type . RESET;
 +                      }
 +              }
                print(++$count . "\t" . $type . "\n");
 +              if ($verbose && exists($verbose_messages{$orig_type})) {
 +                      my $message = $verbose_messages{$orig_type};
 +                      $message =~ s/\n/\n\t/g;
 +                      print("\t" . $message . "\n\n");
 +              }
        }
  
        exit($exitcode);
@@@ -239,46 -198,6 +239,46 @@@ if (-f $conf) 
        unshift(@ARGV, @conf_args) if @conf_args;
  }
  
 +sub load_docs {
 +      open(my $docs, '<', "$docsfile")
 +          or warn "$P: Can't read the documentation file $docsfile $!\n";
 +
 +      my $type = '';
 +      my $desc = '';
 +      my $in_desc = 0;
 +
 +      while (<$docs>) {
 +              chomp;
 +              my $line = $_;
 +              $line =~ s/\s+$//;
 +
 +              if ($line =~ /^\s*\*\*(.+)\*\*$/) {
 +                      if ($desc ne '') {
 +                              $verbose_messages{$type} = trim($desc);
 +                      }
 +                      $type = $1;
 +                      $desc = '';
 +                      $in_desc = 1;
 +              } elsif ($in_desc) {
 +                      if ($line =~ /^(?:\s{4,}|$)/) {
 +                              $line =~ s/^\s{4}//;
 +                              $desc .= $line;
 +                              $desc .= "\n";
 +                      } else {
 +                              $verbose_messages{$type} = trim($desc);
 +                              $type = '';
 +                              $desc = '';
 +                              $in_desc = 0;
 +                      }
 +              }
 +      }
 +
 +      if ($desc ne '') {
 +              $verbose_messages{$type} = trim($desc);
 +      }
 +      close($docs);
 +}
 +
  # Perl's Getopt::Long allows options to take optional arguments after a space.
  # Prevent --color by itself from consuming other arguments
  foreach (@ARGV) {
  
  GetOptions(
        'q|quiet+'      => \$quiet,
 +      'v|verbose!'    => \$verbose,
        'tree!'         => \$tree,
        'signoff!'      => \$chk_signoff,
        'patch!'        => \$chk_patch,
  
  help(0) if ($help);
  
 +die "$P: --git cannot be used with --file or --fix\n" if ($git && ($file || $fix));
 +die "$P: --verbose cannot be used with --terse\n" if ($verbose && $terse);
 +
 +if ($color =~ /^[01]$/) {
 +      $color = !$color;
 +} elsif ($color =~ /^always$/i) {
 +      $color = 1;
 +} elsif ($color =~ /^never$/i) {
 +      $color = 0;
 +} elsif ($color =~ /^auto$/i) {
 +      $color = (-t STDOUT);
 +} else {
 +      die "$P: Invalid color mode: $color\n";
 +}
 +
 +load_docs() if ($verbose);
  list_types(0) if ($list_types);
  
  $fix = 1 if ($fix_inplace);
  $check_orig = $check;
  
 -die "$P: --git cannot be used with --file or --fix\n" if ($git && ($file || $fix));
 -
  my $exit = 0;
  
  my $perl_version_ok = 1;
@@@ -364,6 -268,18 +364,6 @@@ if ($#ARGV < 0) 
        push(@ARGV, '-');
  }
  
 -if ($color =~ /^[01]$/) {
 -      $color = !$color;
 -} elsif ($color =~ /^always$/i) {
 -      $color = 1;
 -} elsif ($color =~ /^never$/i) {
 -      $color = 0;
 -} elsif ($color =~ /^auto$/i) {
 -      $color = (-t STDOUT);
 -} else {
 -      die "$P: Invalid color mode: $color\n";
 -}
 -
  # skip TAB size 1 to avoid additional checks on $tabsize - 1
  die "$P: Invalid TAB size: $tabsize\n" if ($tabsize < 2);
  
@@@ -2293,16 -2209,7 +2293,16 @@@ sub report 
                splice(@lines, 1, 1);
                $output = join("\n", @lines);
        }
 -      $output = (split('\n', $output))[0] . "\n" if ($terse);
 +
 +      if ($terse) {
 +              $output = (split('\n', $output))[0] . "\n";
 +      }
 +
 +      if ($verbose && exists($verbose_messages{$type}) &&
 +          !exists($verbose_emitted{$type})) {
 +              $output .= $verbose_messages{$type} . "\n\n";
 +              $verbose_emitted{$type} = 1;
 +      }
  
        push(our @report, $output);
  
@@@ -3245,7 -3152,7 +3245,7 @@@ sub process 
                    ($line =~ /^new file mode\s*\d+\s*$/) &&
                    ($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) {
                        WARN("DT_SCHEMA_BINDING_PATCH",
-                            "DT bindings should be in DT schema format. See: Documentation/devicetree/writing-schema.rst\n");
+                            "DT bindings should be in DT schema format. See: Documentation/devicetree/bindings/writing-schema.rst\n");
                }
  
  # Check for wrappage within a valid hunk of the file
                                        $specifier = $1;
                                        $extension = $2;
                                        $qualifier = $3;
 -                                      if ($extension !~ /[SsBKRraEehMmIiUDdgVCbGNOxtf]/ ||
 +                                      if ($extension !~ /[4SsBKRraEehMmIiUDdgVCbGNOxtf]/ ||
                                            ($extension eq "f" &&
 -                                           defined $qualifier && $qualifier !~ /^w/)) {
 +                                           defined $qualifier && $qualifier !~ /^w/) ||
 +                                          ($extension eq "4" &&
 +                                           defined $qualifier && $qualifier !~ /^cc/)) {
                                                $bad_specifier = $specifier;
                                                last;
                                        }
This page took 0.284153 seconds and 4 git commands to generate.