Merge tag 'devicetree-for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 22 Feb 2021 18:05:12 +0000 (10:05 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 22 Feb 2021 18:05:12 +0000 (10:05 -0800)
Pull devicetree updates from Rob Herring:

 - Sync dtc to upstream version v1.6.0-51-g183df9e9c2b9 and build host
   fdtoverlay

 - Add kbuild support to build DT overlays (%.dtbo)

 - Drop NULLifying match table in of_match_device().

   In preparation for this, there are several driver cleanups to use
   (of_)?device_get_match_data().

 - Drop pointless wrappers from DT struct device API

 - Convert USB binding schemas to use graph schema and remove old plain
   text graph binding doc

 - Convert spi-nor and v3d GPU bindings to DT schema

 - Tree wide schema fixes for if/then schemas, array size constraints,
   and undocumented compatible strings in examples

 - Handle 'no-map' correctly for already reserved memblock regions

* tag 'devicetree-for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (35 commits)
  driver core: platform: Drop of_device_node_put() wrapper
  of: Remove of_dev_{get,put}()
  dt-bindings: usb: Change descibe to describe in usbmisc-imx.txt
  dt-bindings: can: rcar_canfd: Group tuples in pin control properties
  dt-bindings: power: renesas,apmu: Group tuples in cpus properties
  dt-bindings: mtd: spi-nor: Convert to DT schema format
  dt-bindings: Use portable sort for version cmp
  dt-bindings: ethernet-controller: fix fixed-link specification
  dt-bindings: irqchip: Add node name to PRUSS INTC
  dt-bindings: interconnect: Fix the expected number of cells
  dt-bindings: Fix errors in 'if' schemas
  dt-bindings: iommu: renesas,ipmmu-vmsa: Make 'power-domains' conditionally required
  dt-bindings: Fix undocumented compatible strings in examples
  kbuild: Add support to build overlays (%.dtbo)
  scripts: dtc: Remove the unused fdtdump.c file
  scripts: dtc: Build fdtoverlay tool
  scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9
  scripts: dtc: Fetch fdtoverlay.c from external DTC project
  dt-bindings: thermal: sun8i: Fix misplaced schema keyword in compatible strings
  dt-bindings: iio: dac: Fix AD5686 references
  ...

22 files changed:
1  2 
Documentation/devicetree/bindings/connector/usb-connector.yaml
Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml
Documentation/devicetree/bindings/display/panel/mantix,mlaf057we51-x.yaml
Documentation/devicetree/bindings/gpio/gpio-pca95xx.yaml
Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml
Documentation/devicetree/bindings/media/i2c/imx219.yaml
Documentation/devicetree/bindings/mmc/mmc-controller.yaml
Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml
Documentation/devicetree/bindings/net/ethernet-controller.yaml
Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml
Documentation/devicetree/bindings/net/ti,k3-am654-cpts.yaml
Documentation/devicetree/bindings/serial/renesas,hscif.yaml
Documentation/devicetree/bindings/sram/sram.yaml
Documentation/devicetree/bindings/usb/generic-ehci.yaml
Documentation/devicetree/bindings/usb/generic-ohci.yaml
Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml
Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml
Makefile
drivers/base/platform.c
drivers/media/platform/renesas-ceu.c
drivers/of/device.c
drivers/tty/serial/stm32-usart.c

@@@ -72,7 -66,8 +72,8 @@@ properties
    dma-coherent: true
  
    clocks:
 -    description: CPSW2G NUSS functional clock
+     maxItems: 1
 +    description: CPSWxG NUSS functional clock
  
    clock-names:
      items:
@@@ -11,18 -11,12 +11,18 @@@ maintainers
  
  properties:
    compatible:
 -    items:
 +    oneOf:
        - const: ti,j721e-usb
 +      - const: ti,am64-usb
 +      - items:
 +          - const: ti,j721e-usb
 +          - const: ti,am64-usb
  
    reg:
-     description: module registers
+     maxItems: 1
  
 +  ranges: true
 +
    power-domains:
      description:
        PM domain provider node and an args specifier containing
diff --cc Makefile
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -96,12 -95,12 +96,12 @@@ static void stm32_usart_config_reg_rs48
        *cr1 |= rs485_deat_dedt;
  }
  
 -static int stm32_config_rs485(struct uart_port *port,
 -                            struct serial_rs485 *rs485conf)
 +static int stm32_usart_config_rs485(struct uart_port *port,
 +                                  struct serial_rs485 *rs485conf)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
-       struct stm32_usart_config *cfg = &stm32_port->info->cfg;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_config *cfg = &stm32_port->info->cfg;
        u32 usartdiv, baud, cr1, cr3;
        bool over8;
  
@@@ -165,11 -162,11 +165,11 @@@ static int stm32_usart_init_rs485(struc
        return uart_get_rs485_mode(port);
  }
  
 -static int stm32_pending_rx(struct uart_port *port, u32 *sr, int *last_res,
 -                          bool threaded)
 +static int stm32_usart_pending_rx(struct uart_port *port, u32 *sr,
 +                                int *last_res, bool threaded)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
        enum dma_status status;
        struct dma_tx_state state;
  
        return 0;
  }
  
 -static unsigned long stm32_get_char(struct uart_port *port, u32 *sr,
 -                                  int *last_res)
 +static unsigned long stm32_usart_get_char(struct uart_port *port, u32 *sr,
 +                                        int *last_res)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
        unsigned long c;
  
        if (stm32_port->rx_ch) {
@@@ -285,45 -282,45 +285,45 @@@ static void stm32_usart_tx_dma_complete
  {
        struct uart_port *port = arg;
        struct stm32_port *stm32port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32port->info->ofs;
  
 -      stm32_clr_bits(port, ofs->cr3, USART_CR3_DMAT);
 +      stm32_usart_clr_bits(port, ofs->cr3, USART_CR3_DMAT);
        stm32port->tx_dma_busy = false;
  
        /* Let's see if we have pending data to send */
 -      stm32_transmit_chars(port);
 +      stm32_usart_transmit_chars(port);
  }
  
 -static void stm32_tx_interrupt_enable(struct uart_port *port)
 +static void stm32_usart_tx_interrupt_enable(struct uart_port *port)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
  
        /*
         * Enables TX FIFO threashold irq when FIFO is enabled,
         * or TX empty irq when FIFO is disabled
         */
        if (stm32_port->fifoen)
 -              stm32_set_bits(port, ofs->cr3, USART_CR3_TXFTIE);
 +              stm32_usart_set_bits(port, ofs->cr3, USART_CR3_TXFTIE);
        else
 -              stm32_set_bits(port, ofs->cr1, USART_CR1_TXEIE);
 +              stm32_usart_set_bits(port, ofs->cr1, USART_CR1_TXEIE);
  }
  
 -static void stm32_tx_interrupt_disable(struct uart_port *port)
 +static void stm32_usart_tx_interrupt_disable(struct uart_port *port)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
  
        if (stm32_port->fifoen)
 -              stm32_clr_bits(port, ofs->cr3, USART_CR3_TXFTIE);
 +              stm32_usart_clr_bits(port, ofs->cr3, USART_CR3_TXFTIE);
        else
 -              stm32_clr_bits(port, ofs->cr1, USART_CR1_TXEIE);
 +              stm32_usart_clr_bits(port, ofs->cr1, USART_CR1_TXEIE);
  }
  
 -static void stm32_transmit_chars_pio(struct uart_port *port)
 +static void stm32_usart_transmit_chars_pio(struct uart_port *port)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
        struct circ_buf *xmit = &port->state->xmit;
  
        if (stm32_port->tx_dma_busy) {
  
        /* rely on TXE irq (mask or unmask) for sending remaining data */
        if (uart_circ_empty(xmit))
 -              stm32_tx_interrupt_disable(port);
 +              stm32_usart_tx_interrupt_disable(port);
        else
 -              stm32_tx_interrupt_enable(port);
 +              stm32_usart_tx_interrupt_enable(port);
  }
  
 -static void stm32_transmit_chars_dma(struct uart_port *port)
 +static void stm32_usart_transmit_chars_dma(struct uart_port *port)
  {
        struct stm32_port *stm32port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32port->info->ofs;
        struct circ_buf *xmit = &port->state->xmit;
        struct dma_async_tx_descriptor *desc = NULL;
        unsigned int count, i;
  
        xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1);
        port->icount.tx += count;
 +      return;
 +
 +fallback_err:
 +      for (i = count; i > 0; i--)
 +              stm32_usart_transmit_chars_pio(port);
  }
  
 -static void stm32_transmit_chars(struct uart_port *port)
 +static void stm32_usart_transmit_chars(struct uart_port *port)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
        struct circ_buf *xmit = &port->state->xmit;
  
        if (port->x_char) {
@@@ -500,23 -491,23 +500,23 @@@ static irqreturn_t stm32_usart_threaded
        return IRQ_HANDLED;
  }
  
 -static unsigned int stm32_tx_empty(struct uart_port *port)
 +static unsigned int stm32_usart_tx_empty(struct uart_port *port)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
  
        return readl_relaxed(port->membase + ofs->isr) & USART_SR_TXE;
  }
  
 -static void stm32_set_mctrl(struct uart_port *port, unsigned int mctrl)
 +static void stm32_usart_set_mctrl(struct uart_port *port, unsigned int mctrl)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
  
        if ((mctrl & TIOCM_RTS) && (port->status & UPSTAT_AUTORTS))
 -              stm32_set_bits(port, ofs->cr3, USART_CR3_RTSE);
 +              stm32_usart_set_bits(port, ofs->cr3, USART_CR3_RTSE);
        else
 -              stm32_clr_bits(port, ofs->cr3, USART_CR3_RTSE);
 +              stm32_usart_clr_bits(port, ofs->cr3, USART_CR3_RTSE);
  
        mctrl_gpio_set(stm32_port->gpios, mctrl);
  }
@@@ -585,10 -576,10 +585,10 @@@ static void stm32_usart_start_tx(struc
  }
  
  /* Throttle the remote when input buffer is about to overflow. */
 -static void stm32_throttle(struct uart_port *port)
 +static void stm32_usart_throttle(struct uart_port *port)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
        unsigned long flags;
  
        spin_lock_irqsave(&port->lock, flags);
  }
  
  /* Unthrottle the remote, the input buffer can now accept data. */
 -static void stm32_unthrottle(struct uart_port *port)
 +static void stm32_usart_unthrottle(struct uart_port *port)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
        unsigned long flags;
  
        spin_lock_irqsave(&port->lock, flags);
  }
  
  /* Receive stop */
 -static void stm32_stop_rx(struct uart_port *port)
 +static void stm32_usart_stop_rx(struct uart_port *port)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
  
 -      stm32_clr_bits(port, ofs->cr1, stm32_port->cr1_irq);
 +      stm32_usart_clr_bits(port, ofs->cr1, stm32_port->cr1_irq);
        if (stm32_port->cr3_irq)
 -              stm32_clr_bits(port, ofs->cr3, stm32_port->cr3_irq);
 -
 +              stm32_usart_clr_bits(port, ofs->cr3, stm32_port->cr3_irq);
  }
  
  /* Handle breaks - ignored by us */
@@@ -630,10 -622,10 +630,10 @@@ static void stm32_usart_break_ctl(struc
  {
  }
  
 -static int stm32_startup(struct uart_port *port)
 +static int stm32_usart_startup(struct uart_port *port)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
        const char *name = to_platform_device(port->dev)->name;
        u32 val;
        int ret;
        return 0;
  }
  
 -static void stm32_shutdown(struct uart_port *port)
 +static void stm32_usart_shutdown(struct uart_port *port)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
-       struct stm32_usart_config *cfg = &stm32_port->info->cfg;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_config *cfg = &stm32_port->info->cfg;
        u32 val, isr;
        int ret;
  
@@@ -726,13 -717,12 +726,13 @@@ static unsigned int stm32_usart_get_dat
        return bits;
  }
  
 -static void stm32_set_termios(struct uart_port *port, struct ktermios *termios,
 -                          struct ktermios *old)
 +static void stm32_usart_set_termios(struct uart_port *port,
 +                                  struct ktermios *termios,
 +                                  struct ktermios *old)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
-       struct stm32_usart_config *cfg = &stm32_port->info->cfg;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_config *cfg = &stm32_port->info->cfg;
        struct serial_rs485 *rs485conf = &port->rs485;
        unsigned int baud, bits;
        u32 usartdiv, mantissa, fraction, oversampling;
@@@ -1096,10 -1078,10 +1096,10 @@@ static const struct of_device_id stm32_
  MODULE_DEVICE_TABLE(of, stm32_match);
  #endif
  
 -static int stm32_of_dma_rx_probe(struct stm32_port *stm32port,
 -                               struct platform_device *pdev)
 +static int stm32_usart_of_dma_rx_probe(struct stm32_port *stm32port,
 +                                     struct platform_device *pdev)
  {
-       struct stm32_usart_offsets *ofs = &stm32port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32port->info->ofs;
        struct uart_port *port = &stm32port->port;
        struct device *dev = &pdev->dev;
        struct dma_slave_config config;
@@@ -1171,10 -1149,10 +1171,10 @@@ alloc_err
        return ret;
  }
  
 -static int stm32_of_dma_tx_probe(struct stm32_port *stm32port,
 -                               struct platform_device *pdev)
 +static int stm32_usart_of_dma_tx_probe(struct stm32_port *stm32port,
 +                                     struct platform_device *pdev)
  {
-       struct stm32_usart_offsets *ofs = &stm32port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32port->info->ofs;
        struct uart_port *port = &stm32port->port;
        struct device *dev = &pdev->dev;
        struct dma_slave_config config;
@@@ -1222,9 -1200,8 +1222,8 @@@ alloc_err
        return ret;
  }
  
 -static int stm32_serial_probe(struct platform_device *pdev)
 +static int stm32_usart_serial_probe(struct platform_device *pdev)
  {
-       const struct of_device_id *match;
        struct stm32_port *stm32port;
        int ret;
  
        if (!stm32port)
                return -ENODEV;
  
-       match = of_match_device(stm32_match, &pdev->dev);
-       if (match && match->data)
-               stm32port->info = (struct stm32_usart_info *)match->data;
-       else
+       stm32port->info = of_device_get_match_data(&pdev->dev);
+       if (!stm32port->info)
                return -EINVAL;
  
 -      ret = stm32_init_port(stm32port, pdev);
 +      ret = stm32_usart_init_port(stm32port, pdev);
        if (ret)
                return ret;
  
@@@ -1334,11 -1309,12 +1331,11 @@@ static int stm32_usart_serial_remove(st
        return err;
  }
  
 -
  #ifdef CONFIG_SERIAL_STM32_CONSOLE
 -static void stm32_console_putchar(struct uart_port *port, int ch)
 +static void stm32_usart_console_putchar(struct uart_port *port, int ch)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
  
        while (!(readl_relaxed(port->membase + ofs->isr) & USART_SR_TXE))
                cpu_relax();
@@@ -1434,12 -1409,12 +1431,12 @@@ static struct uart_driver stm32_usart_d
        .cons           = STM32_SERIAL_CONSOLE,
  };
  
 -static void __maybe_unused stm32_serial_enable_wakeup(struct uart_port *port,
 -                                                    bool enable)
 +static void __maybe_unused stm32_usart_serial_en_wakeup(struct uart_port *port,
 +                                                      bool enable)
  {
        struct stm32_port *stm32_port = to_stm32_port(port);
-       struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
-       struct stm32_usart_config *cfg = &stm32_port->info->cfg;
+       const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+       const struct stm32_usart_config *cfg = &stm32_port->info->cfg;
        u32 val;
  
        if (stm32_port->wakeirq <= 0)