1. 02 9月, 2016 1 次提交
  2. 31 8月, 2016 2 次提交
  3. 27 6月, 2016 1 次提交
  4. 26 6月, 2016 4 次提交
  5. 29 4月, 2016 1 次提交
  6. 08 3月, 2016 2 次提交
  7. 07 2月, 2016 3 次提交
  8. 09 1月, 2016 1 次提交
  9. 14 12月, 2015 2 次提交
  10. 18 10月, 2015 2 次提交
  11. 05 10月, 2015 4 次提交
  12. 05 8月, 2015 1 次提交
  13. 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
  14. 25 5月, 2015 1 次提交
  15. 07 5月, 2015 1 次提交
  16. 28 4月, 2015 1 次提交
  17. 07 3月, 2015 6 次提交
  18. 06 3月, 2015 1 次提交
  19. 10 1月, 2015 3 次提交
    • C
    • C
      tty/serial: at91: fix RTS line management when hardware handshake is enabled · 1cf6e8fc
      Cyrille Pitchen 提交于
      This patch fixes many bugs in the code dealing with the hardware handshake.
      
      As an example, in atmel_set_termios(), we used to test whether the CRTSCTS
      c_cflag was set. If so, we selected the "Hardware Handshake" mode through the
      Mode Register. However, few lines below the mode was reset to "Normal" (0).
      So there was no way to select the "Hardware Handshake" mode. To fix this issue,
      we moved the CRTSCRTS c_cflag test AFTER the mode has been reset to "Normal".
      
      Also setting the RTSEN and RTSDIS bits in the Control Register has different
      results whether the USART is set in "Normal" or "Hardware Handshake" mode:
      
      1) "Normal" mode
      - the RTSEN bit forces the RTS line to low level, which tells the remote peer
        that we are ready to received new data.
      - the RTSDIS bit forces the RTS line to high level, which tells the remote peer
        to stop sending new data.
      
      2) "Hardware Handshake" mode
      - the RTSEN bit forces the RTS line to high level.
      - the RTSDIS bit lets the hardware control the RTS line.
      
      WARNING:
      when FIFOs are not available or not enabled, the RTS line is controlled by the
      PDC. This is why using the Hardware Handshake mode requires using the PDC
      channel for reception. However the Hardware Handshake mode DOES NOT work with
      DMA controller since it cannot control the RTS line.
      Future designs with FIFOs will introduce a new feature: the RTS line will be
      controlled by the RX FIFO using thresholds. This patch was tested with this new
      design.
      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>
      1cf6e8fc
    • C
      tty/serial: at91: fix error handling in atmel_serial_probe() · 6fbb9bdf
      Cyrille Pitchen 提交于
      -EDEFER error wasn't handle properly by atmel_serial_probe().
      As an example, when atmel_serial_probe() is called for the first time, we pass
      the test_and_set_bit() test to check whether the port has already been
      initalized. Then we call atmel_init_port(), which may return -EDEFER, possibly
      returned before by clk_get(). Consequently atmel_serial_probe() used to return
      this error code WITHOUT clearing the port bit in the "atmel_ports_in_use" mask.
      When atmel_serial_probe() was called for the second time, it used to fail on
      the test_and_set_bit() function then returning -EBUSY.
      
      When atmel_serial_probe() fails, this patch make it clear the port bit in the
      "atmel_ports_in_use" mask, if needed, before returning the error code.
      Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com>
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Cc: <stable@vger.kernel.org> # 3.12+
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6fbb9bdf