1. 08 3月, 2016 1 次提交
    • R
      tty/serial: at91: restore dynamic driver binding · f4a8ab04
      Romain Izard 提交于
      In commit c39dfebc, the modular support
      code for atmel_serial was removed, as the driver cannot be built as a
      module. Because no use case was proposed, the dynamic driver binding
      support was removed as well.
      
      The atmel_serial driver can manage up to 7 serial controllers, which are
      multiplexed with other functions. For example, in the Atmel SAMA5D2, the
      Flexcom controllers can work as USART, SPI or I2C controllers, and on
      all Atmel devices serial lines can be reconfigured as GPIOs.
      
      My use case uses GPIOs to transfer a firmware update using a custom
      protocol on the lines used as a serial port during the normal life of
      the device. If it is not possible to unbind the atmel_serial driver, the
      GPIO lines remain reserved and prevent this case from working.
      
      This patch reinstates the atmel_serial_remove function, and fixes it as
      it failed to clear the "clk" field on removal, triggering an oops when
      a device was bound again after being unbound.
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: NRomain Izard <romain.izard.pro@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f4a8ab04
  2. 07 2月, 2016 3 次提交
  3. 09 1月, 2016 1 次提交
  4. 14 12月, 2015 2 次提交
  5. 18 10月, 2015 2 次提交
  6. 05 10月, 2015 4 次提交
  7. 05 8月, 2015 1 次提交
  8. 24 7月, 2015 3 次提交
    • C
      tty/serial: at91: use 32bit writes into TX FIFO when DMA is enabled · 5f258b3e
      Cyrille Pitchen 提交于
      For now this improvement is only used with TX DMA transfers. The data
      width must be set properly when configuring the DMA controller. Also
      the FIFO configuration must be set to match the DMA transfer data
      width:
      TXRDYM (Transmitter Ready Mode) and RXRDYM (Receiver Ready Mode) must
      be set into the FIFO Mode Register. These values are used by the
      USART to trigger the DMA controller. In single data mode they are not
      used and should be reset to 0.
      So the TXRDYM bits are changed to FOUR_DATA; then USART triggers the
      DMA controller when at least 4 data can be written into the TX FIFO
      througth the THR. On the other hand the RXRDYM bits are left unchanged
      to ONE_DATA.
      
      Atmel eXtended DMA controller allows us to set a different data width
      for each part of a scatter-gather transfer. So when calling
      dmaengine_slave_config() to configure the TX path, we just need to set
      dst_addr_width to the maximum data width. Then DMA writes into THR are
      split into up to two parts. The first part carries the first data to
      be sent and has a length equal to the greatest multiple of 4 (bytes)
      lower than or equal to the total length of the TX DMA transfer. The
      second part carries the trailing data (up to 3 bytes). The first part
      is written by the DMA into THR using 32 bit accesses, whereas 8bit
      accesses are used for the second part.
      Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com>
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5f258b3e
    • C
      tty/serial: at91: add support to FIFOs · b5199d46
      Cyrille Pitchen 提交于
      Depending on the hardware, TX and RX FIFOs may be available. The RX
      FIFO can avoid receive overruns, especially when DMA transfers are
      not used to read data from the Receive Holding Register. For heavy
      system load, The CPU is likely not be able to fetch data fast enough
      from the RHR.
      
      In addition, the RX FIFO can supersede the DMA/PDC to control the RTS
      line when the Hardware Handshaking mode is enabled. Two thresholds
      are to be set for that purpose:
      - When the number of data in the RX FIFO crosses and becomes lower
        than or equal to the low threshold, the RTS line is set to low
        level: the remote peer is requested to send data.
      - When the number of data in the RX FIFO crosses and becomes greater
        than or equal to the high threshold, the RTS line is set to high
        level: the remote peer should stop sending new data.
      - low threshold <= high threshold
      Once these two thresholds are set properly, this new feature is
      enabled by setting the FIFO RTS Control bit of the FIFO Mode Register.
      
      FIFOs also introduce a new multiple data mode: the USART works either
      in multiple data mode or in single data (legacy) mode.
      
      If MODE9 bit is set into the Mode Register or if USMODE is set to
      either LIN_MASTER, LIN_SLAVE or LON_MODE, FIFOs operate in single
      data mode. Otherwise, they operate in multiple data mode.
      
      In this new multiple data mode, accesses to the Receive Holding
      Register or Transmit Holding Register slightly change.
      
      Since this driver implements neither the 9bit data feature (MODE9 bit
      set into the Mode Register) nor LIN modes, the USART works in
      multiple data mode whenever FIFOs are available and enabled. We also
      assume that data are 8bit wide.
      
      In single data mode, 32bit access CAN be used to read a single data
      from RHR or write a single data into THR.
      However in multiple data mode, a 32bit access to RHR now allows us to
      read four consecutive data from RX FIFO. Also a 32bit access to THR
      now allows to write four consecutive data into TX FIFO. So we MUST
      use 8bit access whenever only one data have to be read/written at a
      time.
      Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b5199d46
    • C
      tty/serial: at91: remove bunch of macros to access UART registers · 4e7decda
      Cyrille Pitchen 提交于
      This patch replaces the UART_PUT_*, resp. UART_GET_*, macros by
      atmel_uart_writel(), resp. atmel_uart_readl(), inline function calls.
      Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4e7decda
  9. 25 5月, 2015 1 次提交
  10. 07 5月, 2015 1 次提交
  11. 28 4月, 2015 1 次提交
  12. 07 3月, 2015 6 次提交
  13. 06 3月, 2015 1 次提交
  14. 10 1月, 2015 5 次提交
  15. 07 11月, 2014 7 次提交
  16. 06 11月, 2014 1 次提交
    • P
      serial: Refactor uart_flush_buffer() from uart_close() · 479e9b94
      Peter Hurley 提交于
      In the context of the final tty & port close, flushing the tx
      ring buffer after the hardware has already been shutdown and
      the ring buffer freed is neither required nor desirable.
      
      uart_flush_buffer() performs 3 operations:
      1. Resets tx ring buffer indices, but the tx ring buffer has
         already been freed and the indices are reset if the port is
         re-opened.
      2. Calls uart driver's flush_buffer() method
         5 in-tree uart drivers define flush_buffer() methods:
           amba-pl011, atmel-serial, imx, serial-tegra, timbuart
         These have been refactored into the shutdown() method, if
         required.
      3. Kicks the ldisc for more writing, but this is undesirable.
         The file handle is being released; any waiting writer will
         will be kicked out by tty_release() with a warning. Further,
         the N_TTY ldisc may generate SIGIO for a file handle which
         is no longer valid.
      
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Laxman Dewangan <ldewangan@nvidia.com>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      479e9b94