1. 29 Jun, 2017 10 commits
    • Dong Aisheng's avatar
      tty: serial: lpuart: add imx7ulp support · 24b1e5f0
      Dong Aisheng authored
      The lpuart of imx7ulp is basically the same as ls1021a. It's also
      32 bit width register, but unlike ls1021a, it's little endian.
      Besides that, imx7ulp lpuart has a minor different register layout
      from ls1021a that it has four extra registers (verid, param, global,
      pincfg) located at the beginning of register map, which are currently
      not used by the driver and less to be used later.
      
      To ease the register difference handling, we add a reg_off member
      in lpuart_soc_data structure to represent if the normal
      lpuart32_{read|write} requires plus a offset to hide the issue.
      
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Stefan Agner <stefan@agner.ch>
      Cc: Mingkai Hu <Mingkai.Hu@nxp.com>
      Cc: Yangbo Lu <yangbo.lu@nxp.com>
      Cc: Fugang Duan <fugang.duan@nxp.com>
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      24b1e5f0
    • Dong Aisheng's avatar
      dt-bindings: serial: fsl-lpuart: add i.MX7ULP support · f2422fe4
      Dong Aisheng authored
      The lpuart of imx7ulp is basically the same as ls1021a. It's also
      32 bit width register, but unlike ls1021a, it's little endian.
      Besides that, imx7ulp lpuart has a minor different register layout
      from ls1021a.
      
      Cc: devicetree@vger.kernel.org
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Stefan Agner <stefan@agner.ch>
      Cc: Mingkai Hu <Mingkai.Hu@nxp.com>
      Cc: Yangbo Lu <yangbo.lu@nxp.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Acked-by: default avatarFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f2422fe4
    • Dong Aisheng's avatar
      tty: serial: lpuart: add little endian 32 bit register support · f98e1fcd
      Dong Aisheng authored
      Use standard port->iotype to distinguish endian difference. Note as we
      read/write register by checking iotype dynamically, we need to initialize
      the iotype correctly for earlycon as well to avoid a break.
      
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Slaby <jslaby@suse.com> (supporter:TTY LAYER)
      Cc: Stefan Agner <stefan@agner.ch>
      Cc: Mingkai Hu <Mingkai.Hu@nxp.com>
      Cc: Yangbo Lu <yangbo.lu@nxp.com>
      Cc: Fugang Duan <fugang.duan@nxp.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      
      ChangeLog:
      v3->v4:
       * Removed unneeded semicolon catched by 0day Robot.
      v2->v3:
       * Instead of using global var, use standard port->iotype to distinguish
         endian difference.
      v1->v2:
       * No changes
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f98e1fcd
    • Dong Aisheng's avatar
      tty: serial: lpuart: refactor lpuart32_{read|write} prototype · a0204f25
      Dong Aisheng authored
      Due to the original lpuart32_read/write takes no port specific
      information arguments, it's hard to distinguish port difference
      within the API. Although it works before, but not suitable anymore
      when adding more new chips support.
      
      So let's convert it to accept a new struct uart_port argument
      to make it be able to retrieve more port specific information.
      This is a preparation for the later adding new chips support
      more easily. No functions changes.
      
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Stefan Agner <stefan@agner.ch>
      Cc: Mingkai Hu <Mingkai.Hu@nxp.com>
      Cc: Yangbo Lu <yangbo.lu@nxp.com>
      Cc: Fugang Duan <fugang.duan@nxp.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a0204f25
    • Dong Aisheng's avatar
      tty: serial: lpuart: introduce lpuart_soc_data to represent SoC property · 0d6fce90
      Dong Aisheng authored
      This is used to dynamically check the SoC specific lpuart properies.
      Currently only the iotype is added, it functions the same as before.
      With this, new chips with different iotype will be more easily added.
      
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Stefan Agner <stefan@agner.ch>
      Cc: Mingkai Hu <Mingkai.Hu@nxp.com>
      Cc: Yangbo Lu <yangbo.lu@nxp.com>
      Cc: Fugang Duan <fugang.duan@nxp.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0d6fce90
    • Nandor Han's avatar
      serial: imx-serial - move DMA buffer configuration to DT · a3015aff
      Nandor Han authored
      The size of the DMA buffer can affect the delta time between data being
      produced and data being consumed. Basically the DMA system will move
      data to tty buffer when a) DMA buffer is full b) serial line is idle.
      The situation is visible when producer generates data continuously and
      there is no possibility for idle line. At this point the DMA buffer is
      directly affecting the delta time.
      
      The patch will add the possibility to configure the DMA buffers in DT,
      which case by case can be configured separately for every driver
      instance. The DT configuration is optional and in case missing the
      driver will use the 4096 buffer with 4 periods (as before), therefore no
      clients are impacted by this change.
      Signed-off-by: default avatarNandor Han <nandor.han@ge.com>
      Signed-off-by: default avatarRomain Perier <romain.perier@collabora.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a3015aff
    • Nandor Han's avatar
      serial: imx: Enable RTSD only when needed · 6376cd39
      Nandor Han authored
      Currently, this IRQ is always enabled. Some devices might mux these pins
      to other I/Os, like I2C. This could lead to spurious interrupts.
      
      This commit makes this IRQ optional, by using the field have_rtscts.
      Signed-off-by: default avatarNandor Han <nandor.han@ge.com>
      Signed-off-by: default avatarRomain Perier <romain.perier@collabora.com>
      Reviewed-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6376cd39
    • Fabio Estevam's avatar
      serial: imx: Remove unused members from imx_port struct · 5ac88295
      Fabio Estevam authored
      IRDA support is gone since commit afe9cbb1 ("serial: imx: drop
      support for IRDA"), so remove the remaining irda members from
      imx_port structure.
      
      While at it, also remove 'trcv_delay' which is also unused.
      Signed-off-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5ac88295
    • Vignesh R's avatar
      serial: 8250: 8250_omap: Fix race b/w dma completion and RX timeout · a1bfb6eb
      Vignesh R authored
      DMA RX completion handler for UART is called from a tasklet and hence
      may be delayed depending on the system load. In meanwhile, there may be
      RX timeout interrupt which can get serviced first before DMA RX
      completion handler is executed for the completed transfer.
      omap_8250_rx_dma_flush() which is called on RX timeout interrupt makes
      sure that the DMA RX buffer is pushed and then the FIFO is drained and
      also queues a new DMA request. But, when DMA RX completion handler
      executes, it will erroneously flush the currently queued DMA transfer
      which sometimes results in data corruption and double queueing of DMA RX
      requests.
      
      Fix this by checking whether RX completion is for the currently queued
      transfer or not. And also hold port lock when in DMA completion to avoid
      race wrt RX timeout handler preempting it.
      Signed-off-by: default avatarVignesh R <vigneshr@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a1bfb6eb
    • Phil Elwell's avatar
      serial: 8250: Fix THRE flag usage for CAP_MINI · cfde770d
      Phil Elwell authored
      The BCM2835 MINI UART has non-standard THRE semantics. Conventionally
      the bit means that the FIFO is empty (although there may still be a
      byte in the transmit register), but on 2835 it indicates that the FIFO
      is not full. This causes interrupts after every byte is transmitted,
      with the FIFO providing some interrupt latency tolerance.
      
      A consequence of this difference is that the usual strategy of writing
      multiple bytes into the TX FIFO after checking THRE once is unsafe.
      In the worst case of 7 bytes in the FIFO, writing 8 bytes loses all
      but the first since by then the FIFO is full.
      
      There is an HFIFO ("Hidden FIFO") capability that causes the transmit
      loop to terminate when both THRE and TEMT are set, i.e. when the TX
      block is completely idle. This is unnecessarily cautious, potentially
      causing gaps in transmission.
      
      Add a new conditional to the transmit loop, predicated on CAP_MINI,
      that exits when THRE is no longer set (the FIFO is full). This allows
      the FIFO to fill quickly but subsequent writes are paced by the
      transmission rate.
      Signed-off-by: default avatarPhil Elwell <phil@raspberrypi.org>
      Acked-by: default avatarEric Anholt <eric@anholt.net>
      Acked-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cfde770d
  2. 20 Jun, 2017 7 commits
  3. 14 Jun, 2017 2 commits
  4. 13 Jun, 2017 9 commits
  5. 09 Jun, 2017 11 commits
  6. 05 Jun, 2017 1 commit