1. 03 2月, 2015 3 次提交
  2. 10 1月, 2015 2 次提交
    • V
      tty: 8250: Add 64byte UART support for FSL platforms · fddceb8b
      Vijay Rai 提交于
      Some of FSL SoCs like T1040 has new version of UART controller which
      can support 64byte FiFo.
      To enable 64 byte support, following needs to be done:
      -FCR[EN64] needs to be programmed to 1 to enable it.
      -Also, when FCR[EN64]==1, RTL bits to be used as below
      to define various Receive Trigger Levels:
              -FCR[RTL] = 00  1 byte
              -FCR[RTL] = 01  16 bytes
              -FCR[RTL] = 10  32 bytes
              -FCR[RTL] = 11  56 bytes
      -tx_loadsz is set to 63-bytes instead of 64-bytes to implement
       workaround of errata A-008006 which states that tx_loadsz should
       be configured less than Maximum supported fifo bytes
      Signed-off-by: NVijay Rai <vijay.rai@freescale.com>
      Signed-off-by: NPriyanka Jain <Priyanka.Jain@freescale.com>
      Signed-off-by: NPoonam Aggrwal <poonam.aggrwal@freescale.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fddceb8b
    • P
      serial: omap_8250: Fix RTS handling · 4bf4ea9d
      Peter Hurley 提交于
      The OMAP3 UART ignores MCR[1] (ie., UART_MCR_RTS) when in autoRTS
      mode (UPF_HARD_FLOW + CRTSCTS). This makes it impossible for either
      the serial core or userspace to manually flow control the sender.
      
      Disable autoRTS mode when RTS is lowered and restore the previous
      mode when RTS is raised.
      
      Note that the OMAP3 UART provides no mechanism for switching from
      autoRTS mode without corrupting incoming data; to access the
      necessary register, the line control settings must be set to 8-e-2
      and thus any data received during that time will be interpreted with
      those settings. This corruption has been observed in practice.
      
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4bf4ea9d
  3. 26 11月, 2014 1 次提交
    • R
      serial: 8250: don't attempt a trylock if in sysrq · 6fad18fa
      Rabin Vincent 提交于
      Attempting to use SysRq via the 8250 serial port with spin lock
      debugging on on a uniprocessor system results in the following splat:
      
       SysRq :
       BUG: spinlock trylock failure on UP on CPU#0, swapper/0
        lock: serial8250_ports+0x0/0x8c0, .magic: dead4ead, .owner: swapper/0, .owner_cpu: 0
       CPU: 0 PID: 0 Comm: swapper Not tainted 3.18.0-rc4+ #37
       Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
        ffffffff8245ba00 ffffffff81628b28 ffffffff812c8d27 ffffffff81628b48
        ffffffff8106812e ffffffff8245ba00 ffffffff814e22ed ffffffff81628b68
        ffffffff810681a6 0000000000000000 0000000000000000 ffffffff81628b88
       Call Trace:
        <IRQ>  [<ffffffff812c8d27>] dump_stack+0x19/0x1b
        [<ffffffff8106812e>] spin_dump+0x7e/0xd0
        [<ffffffff810681a6>] spin_bug+0x26/0x30
        [<ffffffff8106843c>] do_raw_spin_trylock+0x4c/0x60
        [<ffffffff812cdb1d>] _raw_spin_trylock+0x1d/0x60
        [<ffffffff812336d8>] serial8250_console_write+0x68/0x190
        [<ffffffff811eb0b0>] ? sprintf+0x40/0x50
        [<ffffffff8106ab5e>] call_console_drivers.constprop.11+0x9e/0xf0
        [<ffffffff8106b276>] console_unlock+0x3e6/0x490
        [<ffffffff8106b595>] vprintk_emit+0x275/0x530
        [<ffffffff812c869a>] printk+0x4d/0x4f
        [<ffffffff8121e612>] __handle_sysrq+0x62/0x1b0
        [<ffffffff8121e5b5>] ? __handle_sysrq+0x5/0x1b0
        [<ffffffff8121ebc6>] handle_sysrq+0x26/0x30
        [<ffffffff81233157>] serial8250_rx_chars+0x1d7/0x250
        [<ffffffff812338bb>] serial8250_handle_irq+0x7b/0x90
        [<ffffffff812338f3>] serial8250_default_handle_irq+0x23/0x30
        [<ffffffff812318b3>] serial8250_interrupt+0x63/0xe0
        [<ffffffff8106d80e>] handle_irq_event_percpu+0x4e/0x200
        [<ffffffff8106da01>] handle_irq_event+0x41/0x70
        [<ffffffff810701ee>] ? handle_edge_irq+0x1e/0x110
        [<ffffffff8107026e>] handle_edge_irq+0x9e/0x110
        [<ffffffff810041c2>] handle_irq+0x22/0x40
        [<ffffffff812d096e>] do_IRQ+0x4e/0xf0
        [<ffffffff812cf4ed>] common_interrupt+0x6d/0x6d
        <EOI>  [<ffffffff8100acbf>] ? default_idle+0x1f/0xd0
        [<ffffffff8100acbd>] ? default_idle+0x1d/0xd0
        [<ffffffff8100b61f>] arch_cpu_idle+0xf/0x20
        [<ffffffff8105c1db>] cpu_startup_entry+0x25b/0x360
        [<ffffffff812c726e>] rest_init+0xbe/0xd0
        [<ffffffff816a4dcb>] start_kernel+0x339/0x346
        [<ffffffff816a4495>] x86_64_start_reservations+0x2a/0x2c
        [<ffffffff816a4589>] x86_64_start_kernel+0xf2/0xf6
       HELP : loglevel(0-9) reboot(b) crash(c) show-all-locks(d) te...
      
      Before ebade5e8 ("serial: 8250: Clean up the locking for -rt")
      this was handled by not even attempting to try the lock if port->sysrq,
      since it is known to be taken by the interrupt handler; see
      https://bugzilla.kernel.org/show_bug.cgi?id=6716#c1.  Restore that
      behavior.
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6fad18fa
  4. 07 11月, 2014 7 次提交
  5. 06 11月, 2014 6 次提交
  6. 20 10月, 2014 1 次提交
  7. 27 9月, 2014 5 次提交
  8. 10 9月, 2014 1 次提交
  9. 09 9月, 2014 5 次提交
  10. 27 8月, 2014 1 次提交
  11. 18 7月, 2014 2 次提交
    • Y
      serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers · aef9a7bd
      Yoshihiro YUNOMAE 提交于
      Add tunable RX interrupt trigger I/F of FIFO buffers.
      
      Serial devices are used as not only message communication devices but control
      or sending communication devices. For the latter uses, normally small data
      will be exchanged, so user applications want to receive data unit as soon as
      possible for real-time tendency. If we have a sensor which sends a 1 byte data
      each time and must control a device based on the sensor feedback, the RX
      interrupt should be triggered for each data.
      
      According to HW specification of serial UART devices, RX interrupt trigger
      can be changed, but the trigger is hard-coded. For example, RX interrupt trigger
      in 16550A can be set to 1, 4, 8, or 14 bytes for HW, but current driver sets
      the trigger to only 8bytes.
      
      This patch makes some devices change RX interrupt trigger from userland.
      
      <How to use>
      - Read current setting
       # cat /sys/class/tty/ttyS0/rx_trig_bytes
       8
      
      - Write user setting
       # echo 1 > /sys/class/tty/ttyS0/rx_trig_bytes
       # cat /sys/class/tty/ttyS0/rx_trig_bytes
       1
      
      <Support uart devices>
      - 16550A and Tegra (1, 4, 8, or 14 bytes)
      - 16650V2 (8, 16, 24, or 28 bytes)
      - 16654 (8, 16, 56, or 60 bytes)
      - 16750 (1, 16, 32, or 56 bytes)
      
      <Change log>
      Changes in V9:
       - Use attr_group instead of dev_spec_attr_group of uart_port structure
      
      Changes in V8:
       - Divide this patch from V7's patch based on Greg's comment
      
      Changes in V7:
       - Add Documentation
       - Change I/F name from rx_int_trig to rx_trig_bytes because the name
         rx_int_trig is hard to understand how users specify the value
      
      Changes in V6:
       - Move FCR_RX_TRIG_* definition in 8250.h to include/uapi/linux/serial_reg.h,
         rename those to UART_FCR_R_TRIG_*, and use UART_FCR_TRIGGER_MASK to
         UART_FCR_R_TRIG_BITS()
       - Change following function names:
          convert_fcr2val() => fcr_get_rxtrig_bytes()
          convert_val2rxtrig() => bytes_to_fcr_rxtrig()
       - Fix typo in serial8250_do_set_termios()
       - Delete the verbose error message pr_info() in bytes_to_fcr_rxtrig()
       - Rename *rx_int_trig/rx_trig* to *rxtrig* for several functions or variables
         (but UI remains rx_int_trig)
       - Change the meaningless variable name 'val' to 'bytes' following functions:
          fcr_get_rxtrig_bytes(), bytes_to_fcr_rxtrig(), do_set_rxtrig(),
          do_serial8250_set_rxtrig(), and serial8250_set_attr_rxtrig()
       - Use up->fcr in order to get rxtrig_bytes instead of rx_trig_raw in
         fcr_get_rxtrig_bytes()
       - Use conf_type->rxtrig_bytes[0] instead of switch statement for support check
         in register_dev_spec_attr_grp()
       - Delete the checking whether a user changed FCR or not when minimum buffer
         is needed in serial8250_do_set_termios()
      
      Changes in V5.1:
       - Fix FCR_RX_TRIG_MAX_STATE definition
      
      Changes in V5:
       - Support Tegra, 16650V2, 16654, and 16750
       - Store default FCR value to up->fcr when the port is first created
       - Add rx_trig_byte[] in uart_config[] for each device and use rx_trig_byte[]
         in convert_fcr2val() and convert_val2rxtrig()
      
      Changes in V4:
       - Introduce fifo_bug flag in uart_8250_port structure
         This is enabled only when parity is enabled and UART_BUG_PARITY is enabled
         for up->bugs. If this flag is enabled, user cannot set RX trigger.
       - Return -EOPNOTSUPP when it does not support device at convert_fcr2val() and
         at convert_val2rxtrig()
       - Set the nearest lower RX trigger when users input a meaningless value at
         convert_val2rxtrig()
       - Check whether p->fcr is existing at serial8250_clear_and_reinit_fifos()
       - Set fcr = up->fcr in the begging of serial8250_do_set_termios()
      
      Changes in V3:
       - Change I/F from ioctl(2) to sysfs(rx_int_trig)
      
      Changed in V2:
       - Use _IOW for TIOCSFIFORTRIG definition
       - Pass the interrupt trigger value itself
      Signed-off-by: NYoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aef9a7bd
    • A
      serial: 8250: introduce up_to_u8250p() helper · b1261c86
      Andy Shevchenko 提交于
      It helps to cast struct uart_port to struct uart_8250_port at runtime.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b1261c86
  12. 20 6月, 2014 1 次提交
    • P
      serial: Fix IGNBRK handling · ef8b9ddc
      Peter Hurley 提交于
      If IGNBRK is set without either BRKINT or PARMRK set, some uart
      drivers send a 0x00 byte for BREAK without the TTYBREAK flag to the
      line discipline, when it should send either nothing or the TTYBREAK flag
      set. This happens because the read_status_mask masks out the BI
      condition, which uart_insert_char() then interprets as a normal 0x00 byte.
      
      SUS v3 is clear regarding the meaning of IGNBRK; Section 11.2.2, General
      Terminal Interface - Input Modes, states:
        "If IGNBRK is set, a break condition detected on input shall be ignored;
         that is, not put on the input queue and therefore not read by any
         process."
      
      Fix read_status_mask to include the BI bit if IGNBRK is set; the
      lsr status retains the BI bit if a BREAK is recv'd, which is
      subsequently ignored in uart_insert_char() when masked with the
      ignore_status_mask.
      
      Affected drivers:
      8250 - all
      serial_txx9
      mfd
      amba-pl010
      amba-pl011
      atmel_serial
      bfin_uart
      dz
      ip22zilog
      max310x
      mxs-auart
      netx-serial
      pnx8xxx_uart
      pxa
      sb1250-duart
      sccnxp
      serial_ks8695
      sirfsoc_uart
      st-asc
      vr41xx_siu
      zs
      sunzilog
      fsl_lpuart
      sunsab
      ucc_uart
      bcm63xx_uart
      sunsu
      efm32-uart
      pmac_zilog
      mpsc
      msm_serial
      m32r_sio
      
      Unaffected drivers:
      omap-serial
      rp2
      sa1100
      imx
      icom
      
      Annotated for fixes:
      altera_uart
      mcf
      
      Drivers without break detection:
      21285
      xilinx-uartps
      altera_jtaguart
      apbuart
      arc-uart
      clps711x
      max3100
      uartlite
      msm_serial_hs
      nwpserial
      lantiq
      vt8500_serial
      
      Unknown:
      samsung
      mpc52xx_uart
      bfin_sport_uart
      cpm_uart/core
      
      Fixes: Bugzilla #71651, '8250_core.c incorrectly handles IGNBRK flag'
      Reported-by: NIvan <athlon_@mail.ru>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ef8b9ddc
  13. 29 5月, 2014 1 次提交
    • M
      serial: uart: add hw flow control support configuration · 06aa82e4
      Murali Karicheri 提交于
      8250 uart driver currently supports only software assisted hw flow
      control. The software assisted hw flow control maintains a hw_stopped
      flag in the tty structure to stop and start transmission and use modem
      status interrupt for the event to drive the handshake signals. This is
      not needed if hw has flow control capabilities. This patch adds a
      DT attribute for enabling hw flow control for a uart port. Also skip
      stop and start if this flag is present in flag field of the port
      structure.
      Signed-off-by: NMurali Karicheri <m-karicheri2@ti.com>
      CC: Rob Herring <robh+dt@kernel.org>
      CC: Pawel Moll <pawel.moll@arm.com>
      CC: Mark Rutland <mark.rutland@arm.com>
      CC: Ian Campbell <ijc+devicetree@hellion.org.uk>
      CC: Kumar Gala <galak@codeaurora.org>
      CC: Randy Dunlap <rdunlap@infradead.org>
      CC: Jiri Slaby <jslaby@suse.cz>
      CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      06aa82e4
  14. 04 5月, 2014 1 次提交
  15. 25 4月, 2014 2 次提交
  16. 18 4月, 2014 1 次提交