- 07 Feb, 2016 40 commits
-
-
Soren Brinkmann authored
Shutting down the UART port can happen while console operations are in progress. Holding the port lock serializes these operations and avoids the UART HW to be disabled in the middle of console prints. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Soren Brinkmann authored
The RX path in the interrupt handler released a lock unnecessarily. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Soren Brinkmann authored
The startup function is supposed to initialize the UART for receiving. Hence, don't enable the TX part. Also, protect HW accesses with the port lock. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Soren Brinkmann authored
When shutting down the UART, clear the interrupt status register. Bits in the ISR are cleared by writing them as '1'. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Soren Brinkmann authored
Restarting the transmitter even if the circ buffer is empty may be necessary to push out remaining data when the port is restarted after being stopped. Cc: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Soren Brinkmann authored
Instead of disabling the IRQ, use the spin lock to serialize accesses to the HW. This protects the driver from interference of non-IRQ callbacks with each other and makes the driver more consistent in its serialization method. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Soren Brinkmann authored
Non-functional, formatting changes to ease reading the code. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Yoshinori Sato authored
"earlyprintk" is architecture specific option. General "earlycon" option support is much better. Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> [uli: preserve other SCSCR bits when asserting RE and TE] Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com> [geert: rewording, #ifdef rework] Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jan Beulich authored
Considering that pci_pericom_setup(()'s only difference to pci_default_setup() is the setting of the uartclk field, and taking into account that this field already gets taken care of by having the base_baud field filled in the pci_boards[] entries, there's no need for both the function and the quirks table entry. Signed-off-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Geliang Tang authored
Use to_pci_dev() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Arnd Bergmann authored
The pl011 driver has gone back and forth on the definition of the ZTE specific variation of the hardware definitions, but the current state is that the vendor definition is left in place yet unused: drivers/tty/serial/amba-pl011.c:190:27: warning: 'vendor_zte' defined but not used [-Wunused-variable] I don't know what the plan forward is to get this code to work, but the current behavior is a bit annoying as we get a warning whenever we build this driver. This patch does not help us to make it work, but at least shuts up the warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 7ec75871 ("tty: amba-pl011: add support for ZTE UART (EXPERIMENTAL)") Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Timur Tabi authored
Busy loops that poll on a register should call cpu_relax(). On some architectures, it can lower CPU power consumption or yield to a hyperthreaded twin processor. It also serves as a compiler barrier, so it can replace barrier() calls. Signed-off-by: Timur Tabi <timur@codeaurora.org> Reviewed-by: Dave Martin <Dave.Martin@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Wills Wang authored
In datasheet, Modem Status Register MSR[4-7] reflect the modem pins CTS/DSR/RI/CD signal state. Signed-off-by: Wills Wang <wills.wang@live.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jaeden Amero authored
In all functions other than atmel_serial_probe_fifos, atmel_serial_probe, and atmel_console_init, the name "port" is used to refer to an instance of struct uart_port. In many of these functions, "atmel_port" is used to refer to an instance of struct atmel_uart_port. We make the use of the name "port" consistent by making atmel_serial_probe_fifos, atmel_serial_probe, and atmel_console_init use "atmel_port" to refer to an instance of struct atmel_uart_port instead of the previous name of "port". Signed-off-by: Jaeden Amero <jaeden.amero@ni.com> Signed-off-by: Kyle Roeschley <kyle.roeschley@ni.com> Acked-by: Karthik Manamcheri <karthik.manamcheri@ni.com> [nicolas.ferre@atmel.com: fix typo in variable, adapt to newer kernel] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Ferre authored
Starting with sama5d2, the new UART revision has an hardware timer. So, add it to the IP detection code and set the "has_hw_timer" property for it. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Reported-by: David Mosberger <davidm@egauge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Ferre authored
No functional change is associated with this patch. A driver property depends on the Atmel serial IP revision. This property is the way the rx timeout is handled: by an hardware or software timer. So, change this property name and setup code so that it's easier to understand and more future proof as the distinction of USART vs. UART is blurrier on newer SoCs. Variable names and debug comments are also adapted to make this code more obvious. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Sebastian Frias authored
Some UART HW has a single register combining UART_DLL/UART_DLM (this was probably forgotten in the change that introduced the callbacks, commit b32b19b8) Fixes: b32b19b8 ("[SERIAL] 8250: set divisor register correctly ...") Signed-off-by: Sebastian Frias <sf84@laposte.net> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Frederik Völkel authored
It's old, messy and mostly unmaintained. Remove it as suggested by Peter Hurley and Alan. Signed-off-by: Frederik Völkel <frederik.voelkel@fau.de> Signed-off-by: Lukas Braun <lukas.braun@fau.de> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Aya Mahfouz authored
Constifies psc_ops structures in tty's serial port driver since they are not modified after their initialization. Detected and found using Coccinelle. Suggested-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Noam Camus authored
Direct call to readl()/writel() is checked against iotype and in case of UPIO_MEM32BE we use ioread32be()/iowrite32be() instead of them. Signed-off-by: Noam Camus <noamc@ezchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Noam Camus authored
Add support for UPIO_MEM32BE in addition to UPIO_MEM32. For big endian we use 2 new accessors similar to little endian, called dw8250_serial_out32be() and dw8250_serial_in32be(). Signed-off-by: Noam Camus <noamc@ezchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Noam Camus authored
With the help of Heikki we take common code that makes sure LCR write wasn't ignored and put it in new function called dw8250_check_lcr(). This function serves 3 serial_out routines: dw8250_serial_out(), dw8250_serial_out32(), and dw8250_serial_outq(). This patch only brings better code reuse. Signed-off-by: Noam Camus <noamc@ezchip.com> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Matwey V. Kornilov authored
Use software emulated RS485 direction control to provide RS485 API existed in omap_serial driver. Note that 8250_omap issues interrupt on shift register empty which is single prerequesite for using software emulated RS485. Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Matwey V. Kornilov authored
Implementation of software emulation of RS485 direction handling is based on omap_serial driver. Before and after transmission RTS is set to the appropriate value. Note that before calling serial8250_em485_init() the caller has to ensure that UART will interrupt when shift register empty. Otherwise, emultaion cannot be used. Both serial8250_em485_init() and serial8250_em485_destroy() are idempotent functions. Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Matwey V. Kornilov authored
Software RS485 emultaion is to be added in the following commit. serial8250_start_tx() will need to refer serial8250_stop_rx(). Move serial8250_stop_rx() in front of serial8250_start_tx() in order to avoid function forward declaration. Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
struct uart_sio_port has a lots of unused members. Some of them are set to some constant but never read. Remove all those. This includes removal of uart_ops->pm handler as we never handle pm (pm was never set). Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
DEBUG_AUTOCONF is unused. Switch DEBUG_INTR to pr_debug. This is only enabled with DEBUG or dynamic debug when explicitly asked for. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
The only variables in old_serial_port are port and irq. So make old_serial_port contain only those two and move the initialization of the rest to the place where old_serial_port is actually read. Also get rid of SERIAL_PORT_DFNS. It is ugly and having the initializer where it belongs makes more sense. Finally, use already defined UART_NR in the loop. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
The only needed information from the header is struct old_serial_port. Move it to m32r_sio.c, make it const and anonymous. And kill the rest from the header as it is dead stuff. Given m32r_sio_suspend_port and m32r_sio_resume_port are local to m32r_sio.c and unused, kill them from .c too. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
This is a remnant from the dark age. Nobody uses the macro now, so remove. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Chris Zankel <chris@zankel.net> Cc: Max Filippov <jcmvbkbc@gmail.com> Cc: <linux-xtensa@linux-xtensa.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
Since check_name and check_resources return only 0/1, switch them to bool/true/false. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
Make modem_names and base static const. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
c_iflag and c_cflag are set, but unused. Remove. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
There is a chain of up to 4 nested ifs in init and remove functions. Instead, make the code linear and use goto's to handle failures. Remove unneeded cast from mpsc_release_port by referencing pi->port directly. And finally, use dev_dbg instead of pr_debug given we have dev->dev node. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
When mpsc_routing_base, sdma_intr_base, mpsc_base, sdma_base, and brg_base are mapped, they are never unmapped. The condition in the free paths is always 'if (!XXX_base) { unmap }'. Fix it by inverting the condition. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Hurley authored
Add DT earlycon for 8250_omap driver. This boot console is included for kernels built with CONFIG_SERIAL_EARLYCON=y, CONFIG_OF=y, CONFIG_SERIAL_8250_OMAP=y, and CONFIG_OF_EARLY_FLATTREE=y. This boot console is enabled with the command line option "earlycon" (without "=<name>...") when the DT 'stdout-path' property matches a compatible uart. For example, / { chosen { stdout-path = "serial0:115200"; }; .... aliases { serial0 = &uart0; }; .... ocp : ocp { uart0 : serial@44e09000 { compatible = "ti,omap3-uart"; } }; }; Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Hurley authored
Earlycon may fail to initialize for a variety of reasons, most of which log the default early param message. If the stdout-path node is not found, log the path which was not found (and suppress the default early param message). Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Hurley authored
earlycon initializes struct uart_port::regshift to the correct value for UPIO_MEM32 already. Use the port field rather than hard-coded value. This enables broader support for various i/o access methods in 8250 earlycon (eg., omap8250 earlycon). Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Hurley authored
Output the earlycon "driver" from the just-parsed console 'name' and 'index' fields. NB: ->mapbase is a resource_size_t so use %pa format specifier Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Hurley authored
Refactor the command line earlycon banner into earlycon_init() so both earlycon startup methods output an info banner. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-