Merge tag 'devicetree-for-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 May 2017 02:33:07 +0000 (19:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 May 2017 02:33:07 +0000 (19:33 -0700)
Pull DeviceTree updates from Rob Herring:

 - fix sparse warnings in drivers/of/

 - add more overlay unittests

 - update dtc to v1.4.4-8-g756ffc4f52f6. This adds more checks on dts
   files such as unit-address formatting and stricter character sets for
   node and property names

 - add a common DT modalias function

 - move trivial-devices.txt up and out of i2c dir

 - ARM NVIC interrupt controller binding

 - vendor prefixes for Sensirion, Dioo, Nordic, ROHM

 - correct some binding file locations

* tag 'devicetree-for-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (24 commits)
  of: fix sparse warnings in fdt, irq, reserved mem, and resolver code
  of: fix sparse warning in of_pci_range_parser_one
  of: fix sparse warnings in of_find_next_cache_node
  of/unittest: Missing unlocks on error
  of: fix uninitialized variable warning for overlay test
  of: fix unittest build without CONFIG_OF_OVERLAY
  of: Add unit tests for applying overlays
  of: per-file dtc compiler flags
  fpga: region: add missing DT documentation for config complete timeout
  of: Add vendor prefix for ROHM Semiconductor
  of: fix "/cpus" reference leak in of_numa_parse_cpu_nodes()
  of: Add vendor prefix for Nordic Semiconductor
  dt-bindings: arm,nvic: Binding for ARM NVIC interrupt controller on Cortex-M
  dtc: update warning settings for new bus and node/property name checks
  scripts/dtc: Update to upstream version v1.4.4-8-g756ffc4f52f6
  scripts/dtc: automate getting dtc version and log in update script
  of: Add function for generating a DT modalias with a newline
  of: fix of_device_get_modalias returned length when truncating buffers
  Documentation: devicetree: move trivial-devices out of I2C realm
  dt-bindings: add vendor prefix for Dioo
  ..

1  2 
Documentation/devicetree/bindings/fpga/fpga-region.txt
Documentation/devicetree/bindings/vendor-prefixes.txt
drivers/of/base.c
drivers/tty/serdev/core.c
scripts/Makefile.lib

@@@ -186,13 -186,14 +186,15 @@@ Optional properties
        otherwise full reconfiguration is done.
  - external-fpga-config : boolean, set if the FPGA has already been configured
        prior to OS boot up.
 +- encrypted-fpga-config : boolean, set if the bitstream is encrypted
  - region-unfreeze-timeout-us : The maximum time in microseconds to wait for
        bridges to successfully become enabled after the region has been
        programmed.
  - region-freeze-timeout-us : The maximum time in microseconds to wait for
        bridges to successfully become disabled before the region has been
        programmed.
+ - config-complete-timeout-us : The maximum time in microseconds time for the
+       FPGA to go to operating mode after the region has been programmed.
  - child nodes : devices in the FPGA after programming.
  
  In the example below, when an overlay is applied targeting fpga-region0,
@@@ -51,7 -51,6 +51,7 @@@ brcm  Broadcom Corporatio
  buffalo       Buffalo, Inc.
  calxeda       Calxeda
  capella       Capella Microsystems, Inc
 +cascoda       Cascoda, Ltd.
  cavium        Cavium, Inc.
  cdns  Cadence Design Systems Inc.
  ceva  Ceva, Inc.
@@@ -80,6 -79,7 +80,7 @@@ denx  Denx Software Engineerin
  devantech     Devantech, Ltd.
  digi  Digi International Inc.
  digilent      Diglent, Inc.
+ dioo  Dioo Microcircuit Co., Ltd
  dlg   Dialog Semiconductor
  dlink D-Link Corporation
  dmo   Data Modul AG
@@@ -103,7 -103,6 +104,7 @@@ ettus      NI Ettus Researc
  eukrea  EukrĂ©a Electromatique
  everest       Everest Semiconductor Co. Ltd.
  everspin      Everspin Technologies, Inc.
 +exar  Exar Corporation
  excito        Excito
  ezchip        EZchip Semiconductor
  faraday       Faraday Technology Corporation
@@@ -180,7 -179,6 +181,7 @@@ maxim      Maxim Integrated Product
  mcube mCube
  meas  Measurement Specialties
  mediatek      MediaTek Inc.
 +megachips     MegaChips
  melexis       Melexis N.V.
  melfas        MELFAS Inc.
  memsic        MEMSIC Inc.
@@@ -215,6 -213,7 +216,7 @@@ newhaven   Newhaven Display Internationa
  ni    National Instruments
  nintendo      Nintendo
  nokia Nokia
+ nordic        Nordic Semiconductor
  nuvoton       Nuvoton Technology Corporation
  nvd   New Vision Display
  nvidia        NVIDIA
@@@ -261,6 -260,7 +263,7 @@@ richtek    Richtek Technology Corporatio
  ricoh Ricoh Co. Ltd.
  rikomagic     Rikomagic Tech Corp. Ltd
  rockchip      Fuzhou Rockchip Electronics Co., Ltd
+ rohm  ROHM Semiconductor Co., Ltd
  samsung       Samsung Semiconductor
  samtec        Samtec/Softing company
  sandisk       Sandisk Corporation
@@@ -339,7 -339,6 +342,7 @@@ wd Western Digital Corp
  wetek WeTek Electronics, limited.
  wexler        Wexler
  winbond Winbond Electronics corp.
 +winstar       Winstar Display Corp.
  wlf   Wolfson Microelectronics
  wm    Wondermedia Technologies, Inc.
  x-powers      X-Powers
diff --combined drivers/of/base.c
@@@ -1212,37 -1212,6 +1212,37 @@@ int of_property_read_u32_index(const st
  }
  EXPORT_SYMBOL_GPL(of_property_read_u32_index);
  
 +/**
 + * of_property_read_u64_index - Find and read a u64 from a multi-value property.
 + *
 + * @np:               device node from which the property value is to be read.
 + * @propname: name of the property to be searched.
 + * @index:    index of the u64 in the list of values
 + * @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,
 + * -ENODATA if property does not have a value, and -EOVERFLOW if the
 + * property data isn't large enough.
 + *
 + * The out_value is modified only if a valid u64 value can be decoded.
 + */
 +int of_property_read_u64_index(const struct device_node *np,
 +                                     const char *propname,
 +                                     u32 index, u64 *out_value)
 +{
 +      const u64 *val = of_find_property_value_of_size(np, propname,
 +                                      ((index + 1) * sizeof(*out_value)),
 +                                      0, NULL);
 +
 +      if (IS_ERR(val))
 +              return PTR_ERR(val);
 +
 +      *out_value = be64_to_cpup(((__be64 *)val) + index);
 +      return 0;
 +}
 +EXPORT_SYMBOL_GPL(of_property_read_u64_index);
 +
  /**
   * of_property_read_variable_u8_array - Find and read an array of u8 from a
   * property, with bounds on the minimum and maximum array size.
@@@ -2281,15 -2250,14 +2281,14 @@@ EXPORT_SYMBOL_GPL(of_console_check)
   */
  struct device_node *of_find_next_cache_node(const struct device_node *np)
  {
-       struct device_node *child;
-       const phandle *handle;
+       struct device_node *child, *cache_node;
  
-       handle = of_get_property(np, "l2-cache", NULL);
-       if (!handle)
-               handle = of_get_property(np, "next-level-cache", NULL);
+       cache_node = of_parse_phandle(np, "l2-cache", 0);
+       if (!cache_node)
+               cache_node = of_parse_phandle(np, "next-level-cache", 0);
  
-       if (handle)
-               return of_find_node_by_phandle(be32_to_cpup(handle));
+       if (cache_node)
+               return cache_node;
  
        /* OF on pmac has nodes instead of properties named "l2-cache"
         * beneath CPU nodes.
@@@ -173,39 -173,6 +173,39 @@@ void serdev_device_set_flow_control(str
  }
  EXPORT_SYMBOL_GPL(serdev_device_set_flow_control);
  
 +void serdev_device_wait_until_sent(struct serdev_device *serdev, long timeout)
 +{
 +      struct serdev_controller *ctrl = serdev->ctrl;
 +
 +      if (!ctrl || !ctrl->ops->wait_until_sent)
 +              return;
 +
 +      ctrl->ops->wait_until_sent(ctrl, timeout);
 +}
 +EXPORT_SYMBOL_GPL(serdev_device_wait_until_sent);
 +
 +int serdev_device_get_tiocm(struct serdev_device *serdev)
 +{
 +      struct serdev_controller *ctrl = serdev->ctrl;
 +
 +      if (!ctrl || !ctrl->ops->get_tiocm)
 +              return -ENOTSUPP;
 +
 +      return ctrl->ops->get_tiocm(ctrl);
 +}
 +EXPORT_SYMBOL_GPL(serdev_device_get_tiocm);
 +
 +int serdev_device_set_tiocm(struct serdev_device *serdev, int set, int clear)
 +{
 +      struct serdev_controller *ctrl = serdev->ctrl;
 +
 +      if (!ctrl || !ctrl->ops->set_tiocm)
 +              return -ENOTSUPP;
 +
 +      return ctrl->ops->set_tiocm(ctrl, set, clear);
 +}
 +EXPORT_SYMBOL_GPL(serdev_device_set_tiocm);
 +
  static int serdev_drv_probe(struct device *dev)
  {
        const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver);
@@@ -224,10 -191,7 +224,7 @@@ static int serdev_drv_remove(struct dev
  static ssize_t modalias_show(struct device *dev,
                             struct device_attribute *attr, char *buf)
  {
-       ssize_t len = of_device_get_modalias(dev, buf, PAGE_SIZE - 2);
-       buf[len] = '\n';
-       buf[len+1] = 0;
-       return len+1;
+       return of_device_modalias(dev, buf, PAGE_SIZE);
  }
  
  static struct device_attribute serdev_device_attrs[] = {
diff --combined scripts/Makefile.lib
@@@ -155,7 -155,7 +155,7 @@@ els
  # $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files
  #   and locates generated .h files
  # FIXME: Replace both with specific CFLAGS* statements in the makefiles
 -__c_flags     = $(if $(obj),-I$(srctree)/$(src) -I$(obj)) \
 +__c_flags     = $(if $(obj),$(call addtree,-I$(src)) -I$(obj)) \
                  $(call flags,_c_flags)
  __a_flags     = $(call flags,_a_flags)
  __cpp_flags     = $(call flags,_cpp_flags)
@@@ -280,9 -280,21 +280,21 @@@ DTC ?= $(objtree)/scripts/dtc/dt
  
  # Disable noisy checks by default
  ifeq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),)
- DTC_FLAGS += -Wno-unit_address_vs_reg
+ DTC_FLAGS += -Wno-unit_address_vs_reg \
+       -Wno-simple_bus_reg \
+       -Wno-unit_address_format \
+       -Wno-pci_bridge \
+       -Wno-pci_device_bus_num \
+       -Wno-pci_device_reg
  endif
  
+ ifeq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),2)
+ DTC_FLAGS += -Wnode_name_chars_strict \
+       -Wproperty_name_chars_strict
+ endif
+ DTC_FLAGS += $(DTC_FLAGS_$(basetarget))
  # Generate an assembly file to wrap the output of the device tree compiler
  quiet_cmd_dt_S_dtb= DTB     $@
  cmd_dt_S_dtb=                                         \