31 Mar, 2015

1 commit

  • Add TTY driver and consoles for the MIPS EJTAG Fast Debug Channel (FDC),
    which is found on the per-CPU MIPS Common Device Mapped Memory (CDMM)
    bus.

    The FDC is a per-CPU device which is used to communicate with an EJTAG
    probe. RX and TX FIFOs exist, containing 32-bits of data and 4-bit
    channel numbers. 16 general data streams are implemented on this for TTY
    and console use by encoding up to 4 bytes on each 32-bit FDC word.

    The TTY devices are named e.g. /dev/ttyFDC3c2 for channel 2 of the FDC
    attached to logical CPU 3.

    These can be used for getting the kernel log, a login prompt, or as a
    GDB remote transport, all over EJTAG and without needing a serial port.

    It can have an interrupt to notify of when incoming data is available in
    the RX FIFO or when the TX FIFO is no longer full. The detection of this
    interrupt occurs in architecture / platform code, but it may be shared
    with the timer and/or performance counter interrupt.

    Due to the per-CPU nature of the hardware, all outgoing TTY data is
    written out from a kthread which is pinned to the appropriate CPU.

    The console is not bound to a specific CPU, so output will appear on the
    chosen channel on whichever CPU the code is executing on. Enable with
    e.g. console=fdc1 in kernel arguments. /dev/console is bound to the same
    channel on the boot CPU's FDC if it exists.

    Signed-off-by: James Hogan
    Cc: Ralf Baechle
    Cc: Greg Kroah-Hartman
    Cc: Jiri Slaby
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/9146/
    Signed-off-by: Ralf Baechle

    James Hogan
     

21 May, 2013

1 commit

  • The semantics of a rw semaphore are almost ideally suited
    for tty line discipline lifetime management; multiple active
    threads obtain "references" (read locks) while performing i/o
    to prevent the loss or change of the current line discipline
    (write lock).

    Unfortunately, the existing rw_semaphore is ill-suited in other
    ways;
    1) TIOCSETD ioctl (change line discipline) expects to return an
    error if the line discipline cannot be exclusively locked within
    5 secs. Lock wait timeouts are not supported by rwsem.
    2) A tty hangup is expected to halt and scrap pending i/o, so
    exclusive locking must be prioritized.
    Writer priority is not supported by rwsem.

    Add ld_semaphore which implements these requirements in a
    semantically similar way to rw_semaphore.

    Writer priority is handled by separate wait lists for readers and
    writers. Pending write waits are priortized before existing read
    waits and prevent further read locks.

    Wait timeouts are trivially added, but obviously change the lock
    semantics as lock attempts can fail (but only due to timeout).

    This implementation incorporates the write-lock stealing work of
    Michel Lespinasse .

    Cc: Michel Lespinasse
    Signed-off-by: Peter Hurley
    Signed-off-by: Greg Kroah-Hartman

    Peter Hurley
     

07 Feb, 2013

1 commit


22 Jan, 2013

1 commit

  • This provides a console driver for the Goldfish virtual platform. The original
    is from Arve with changes from Jun Nakajima and Tom Keel. This has been then
    been ported to the current kernel and to the tty port mechanism by Alan Cox.
    In the process it gained proper POSIX semantics and vhangup works. The default
    name is not ttyS as this belongs to the 8250 driver. Instead ttyGFx is now used.

    In the normal usage case the first port serves as a kernel logging console and
    the second one carries various other data streams for the emulation.

    Signed-off-by: Arve Hjønnevåg
    [Cleaned up to handle x86]
    Signed-off-by: Sheng Yang
    Signed-off-by: Yunhong Jiang
    Signed-off-by: Xiaohui Xin
    Signed-off-by: Jun Nakajima
    Signed-off-by: Bruce Beare
    [Moved to 3.7 and chunks rewritten to use tty_port layer]
    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Arve Hjønnevåg
     

19 Jan, 2013

1 commit

  • The option allows you to remove TTY and compile without errors. This
    saves space on systems that won't support TTY interfaces anyway.
    bloat-o-meter output is below.

    The bulk of this patch consists of Kconfig changes adding "depends on
    TTY" to various serial devices and similar drivers that require the TTY
    layer. Ideally, these dependencies would occur on a common intermediate
    symbol such as SERIO, but most drivers "select SERIO" rather than
    "depends on SERIO", and "select" does not respect dependencies.

    bloat-o-meter output comparing our previous minimal to new minimal by
    removing TTY. The list is filtered to not show removed entries with awk
    '$3 != "-"' as the list was very long.

    add/remove: 0/226 grow/shrink: 2/14 up/down: 6/-35356 (-35350)
    function old new delta
    chr_dev_init 166 170 +4
    allow_signal 80 82 +2
    static.__warned 143 142 -1
    disallow_signal 63 62 -1
    __set_special_pids 95 94 -1
    unregister_console 126 121 -5
    start_kernel 546 541 -5
    register_console 593 588 -5
    copy_from_user 45 40 -5
    sys_setsid 128 120 -8
    sys_vhangup 32 19 -13
    do_exit 1543 1526 -17
    bitmap_zero 60 40 -20
    arch_local_irq_save 137 117 -20
    release_task 674 652 -22
    static.spin_unlock_irqrestore 308 260 -48

    Signed-off-by: Joe Millenbach
    Reviewed-by: Jamey Sharp
    Reviewed-by: Josh Triplett
    Signed-off-by: Greg Kroah-Hartman

    Joe Millenbach
     

24 Aug, 2011

1 commit

  • The ePAPR embedded hypervisor specification provides an API for "byte
    channels", which are serial-like virtual devices for sending and receiving
    streams of bytes. This driver provides Linux kernel support for byte
    channels via three distinct interfaces:

    1) An early-console (udbg) driver. This provides early console output
    through a byte channel. The byte channel handle must be specified in a
    Kconfig option.

    2) A normal console driver. Output is sent to the byte channel designated
    for stdout in the device tree. The console driver is for handling kernel
    printk calls.

    3) A tty driver, which is used to handle user-space input and output. The
    byte channel used for the console is designated as the default tty.

    Signed-off-by: Timur Tabi
    Signed-off-by: Greg Kroah-Hartman

    Timur Tabi
     

14 May, 2011

1 commit

  • The n_tracerouter and n_tracesink line discpline drivers use the
    Linux tty line discpline framework to route trace data coming
    from a tty port (say UART for example) to the trace sink line
    discipline driver and to another tty port(say USB). Those
    these two line discipline drivers can be used together,
    independently from pti.c, they are part of the original
    implementation solution of the MIPI P1149.7, compact JTAG, PTI
    solution for Intel mobile platforms starting with the
    Medfield platform.

    Signed-off-by: J Freyensee
    Signed-off-by: Greg Kroah-Hartman

    J Freyensee
     

23 Feb, 2011

2 commits


14 Jan, 2011

2 commits

  • The serial drivers are really just tty drivers, so move them to
    drivers/tty/ to make things a bit neater overall.

    This is part of the tty/serial driver movement proceedure as proposed by
    Arnd Bergmann and approved by everyone involved a number of months ago.

    Cc: Arnd Bergmann
    Cc: Alan Cox
    Cc: Geert Uytterhoeven
    Cc: Rogier Wolff
    Cc: Michael H. Warfield
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • As requested by Arnd Bergmann, the hvc drivers are now
    moved to the drivers/tty/hvc/ directory. The virtio_console.c driver
    was also moved, as it required the hvc_console.h file to be able to be
    built, and it really is a hvc driver.

    Cc: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

05 Nov, 2010

2 commits