1. 23 4月, 2018 8 次提交
    • J
      serial: Introduce UPSTAT_SYNC_FIFO for synchronised FIFOs · c5f78b1f
      Jeremy Kerr 提交于
      This change adds a flag to indicate that a UART is has an external means
      of synchronising its FIFO, without needing CTSRTS or XON/XOFF.
      
      This allows us to use the throttle/unthrottle callbacks, without having
      to claim other methods of flow control.
      Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
      Tested-by: NEddie James <eajames@linux.vnet.ibm.com>
      Tested-by: NJoel Stanley <joel@jms.id.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c5f78b1f
    • G
      serial: Remove depends on HAS_DMA in case of platform dependency · d6810a82
      Geert Uytterhoeven 提交于
      Remove dependencies on HAS_DMA where a Kconfig symbol depends on another
      symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST".
      In most cases this other symbol is an architecture or platform specific
      symbol, or PCI.
      
      Generic symbols and drivers without platform dependencies keep their
      dependencies on HAS_DMA, to prevent compiling subsystems or drivers that
      cannot work anyway.
      
      This simplifies the dependencies, and allows to improve compile-testing.
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Reviewed-by: NMark Brown <broonie@kernel.org>
      Acked-by: NRobin Murphy <robin.murphy@arm.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d6810a82
    • M
      earlycon: Initialize port->uartclk based on clock-frequency property · 814453ad
      Michal Simek 提交于
      On DT based platforms when current-speed property is present baudrate
      is setup. Also port->uartclk is initialized to bogus BASE_BAUD * 16
      value. Drivers like uartps/ns16550 contain logic when baudrate and
      uartclk is used for baudrate calculation.
      
      The patch is reading optional clock-frequency property to replace bogus
      BASE_BAUD * 16 calculation to have proper baudrate calculation.
      Signed-off-by: NMichal Simek <michal.simek@xilinx.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      814453ad
    • K
      tty: serial: 8250: pass IRQ shared flag to UART ports · 54e53b2e
      Kurt Kanzenbach 提交于
      On some systems IRQ lines between multiple UARTs might be shared. If so, the
      irqflags have to be configured accordingly. The reason is: The 8250 port startup
      code performs IRQ tests *before* the IRQ handler for that particular port is
      registered. This is performed in serial8250_do_startup(). This function checks
      whether IRQF_SHARED is configured and only then disables the IRQ line while
      testing.
      
      This test is performed upon each open() of the UART device. Imagine two UARTs
      share the same IRQ line: On is already opened and the IRQ is active. When the
      second UART is opened, the IRQ line has to be disabled while performing IRQ
      tests. Otherwise an IRQ might handler might be invoked, but the the IRQ itself
      cannot be handled, because the corresponding handler isn't registered,
      yet. That's because the 8250 code uses a chain-handler and invokes the
      corresponding port's IRQ handling rountines himself.
      
      Unfortunately this IRQF_SHARED flag isn't configured for UARTs probed via device
      tree even if the IRQs are shared. This way, the actual and shared IRQ line isn't
      disabled while performing tests and the kernel correctly detects a spurious
      IRQ. So, adding this flag to the DT probe solves the issue.
      
      Note: The UPF_SHARE_IRQ flag is configured unconditionally. Therefore, the
      IRQF_SHARED flag can be set unconditionally as well.
      
      Example stacktrace by performing echo 1 > /dev/ttyS2 on a non-patched system:
      
      |irq 85: nobody cared (try booting with the "irqpoll" option)
      | [...]
      |handlers:
      |[<ffff0000080fc628>] irq_default_primary_handler threaded [<ffff00000855fbb8>] serial8250_interrupt
      |Disabling IRQ #85
      Signed-off-by: NKurt Kanzenbach <kurt@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      54e53b2e
    • V
      serial: 8250: omap: Provide ability to enable/disable UART as wakeup source · 09d8b2bd
      Vignesh R 提交于
      Enable/Clear module level UART wakeup in UART_OMAP_WER register based on
      return value of device_may_wakeup() in .suspend(). This allows
      userspace to use sysfs to control the ability of UART to wakeup the
      system from deep sleep state. Register is restored back in .startup()
      call that happens as part of resume sequence.
      
      With this patch, userspace can control UART wakeup capability via sysfs:
      To enable wakeup capability:
      echo enabled >  /sys/class/tty/ttyXX/device/power/wakeup
      For disabling wakeup capability:
      echo disabled > /sys/class/tty/ttyXX/device/power/wakeup
      
      Note that the UART wakeup events configured in the 8250 hardware only
      work for idle modes that do not cut off power for the UART. For deeper
      idle states, dedicated padconf wakeirqs must be used. Or in some cases
      the UART RX pin can be remuxed to GPIO input if the GPIO block stays
      powered.
      Signed-off-by: NVignesh R <vigneshr@ti.com>
      Tested-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      09d8b2bd
    • J
      serial: 8250_dw: Limit dw8250_tx_wait_empty quirk to armada-38x devices · b7639b0b
      Joshua Scott 提交于
      The previous implementation has had a detrimental effect on devices using
      high bitrates (bluetooth), as the fifo being non-empty for a single check
      would result in a 10 µs delay.
      
      Limit the change to devices with the new "marvell,armada-38x-uart"
      compatible string. Also update the code to allow the first 1000 retries
      to not perform a delay.
      
      The maximum duration of retries has been increased to cover a worst-case
      seen on the Armada 385 SoC. "dmesg ; resize", will fill the buffer with
      text to output before doing a resize. At 9600 baud this took up to 13 ms
      to flush all characters and avoid some getting lost.
      Signed-off-by: NJoshua Scott <joshua.scott@alliedtelesis.co.nz>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b7639b0b
    • U
      serial: sh-sci: Support for HSCIF RX sampling point adjustment · 63ba1e00
      Ulrich Hecht 提交于
      HSCIF has facilities that allow moving the RX sampling point by between
      -8 and 7 sampling cycles (one sampling cycles equals 1/15 of a bit
      by default) to improve the error margin in case of slightly mismatched
      bit rates between sender and receiver.
      
      This patch tries to determine if shifting the sampling point can improve
      the error margin and will enable it if so.
      Signed-off-by: NUlrich Hecht <ulrich.hecht+renesas@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      63ba1e00
    • G
      serial: sh-sci: Add support for dynamic instances · 7678f4c2
      Geert Uytterhoeven 提交于
      On DT platforms, the sh-sci driver requires the presence of "serialN"
      aliases in DT, from which instance IDs are derived.  If a DT alias is
      missing, the drivers fails to probe the corresponding serial port.
      
      This becomes cumbersome when considering DT overlays, as currently
      there is no upstream support for dynamically updating the /aliases node
      in DT.  Furthermore, even in the presence of such support, hardcoded
      instance IDs in independent overlays are prone to conflicts.
      
      Hence add support for dynamic instance IDs, to be used in the absence of
      a DT alias.  This makes serial ports behave similar to I2C and SPI
      buses, which already support dynamic instances.
      
      Ports in use are tracked using a simple bitmask of type unsigned long,
      which is sufficient to handle all current hardware (max. 18 ports).
      The maximum number of serial ports is still fixed, and configurable
      through Kconfig.  Range validation is done through both Kconfig and a
      compile-time check.
      
      Due to the fixed maximum number of serial ports, dynamic and static
      instances share the same ID space.  Static instances added later are
      rejected when conflicting with dynamic instances registered earlier.
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7678f4c2
  2. 22 4月, 2018 3 次提交
  3. 13 4月, 2018 8 次提交
  4. 12 4月, 2018 21 次提交