summaryrefslogtreecommitdiffstats
path: root/drivers/serial
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/efi'Sascha Hauer2019-11-072-11/+125
|\
| * serial: efi-stdio: Add simple_text_input_ex_protocol backendAhmad Fatoum2019-10-232-10/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EFI implementations differ in how simple_text_input_protocol treats ctrl+alpha combinations. OVMF (used with QEMU) returns a Unicode control character, the UEFI on the Dell Latitude 7490 on the other hand ignores the ctrl completely and returns just the letter rendering utilities like barebox edit unusable. To fix this, the simple_text_input_ex_protocol can be leveraged as it additionally provides the state of modifier keys. Extend efi-stdio to use it where possible. Cc: Michael Olbrich <mol@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * serial: efi-stdio: replace globals with handles in priv structAhmad Fatoum2019-10-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | Despite assigning efi_sys_table->{con_in,con_out} to priv->{in,out}, some functions still use the global efi_sys_table->{con_in,con_out}. Let's restrict globals access to the probe function and have the priv struct completely describe input and output used in the callbacks. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: cadence: fix serial_flushLucas Stach2019-11-041-1/+1
|/ | | | | | | | The TXEMPTY bit gets set as soon as the transmit FIFO gets empty, so flushing must wait until the bit is set instead of being unset. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/bfin'Sascha Hauer2019-10-173-138/+0
|\
| * serial: Remove blackfin driverSascha Hauer2019-09-123-138/+0
| | | | | | | | | | | | | | The blackfin architecture has been removed from barebox. Remove the serial driver as well. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: Remove NETX serial driverSascha Hauer2019-09-233-167/+0
|/ | | | | | | NETX support has been removed from barebox. Remove the serial driver as well. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2019-09-122-4/+6
|\
| * console: fix out-of-bounds read in dputc(/dev/*, ...)Ahmad Fatoum2019-09-022-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trying to output a single character via echo -a /dev/serial0-1 currently results in garbage output after the newline, because console.c's fops_write discards the buffer length and passes the buffer to (struct cdev)::puts which only handles NUL-terminated strings. Fix this by amending (struct cdev)::puts with a new nbytes parameter, which is correctly propagated. All this functions now return at most the nbytes parameter they were passed in. This fixes __console_puts, which used to count new lines twice in its return value. Fixes: b4f55fcf35 ("console: expose consoles in devfs") Cc: Bastian Krause <bst@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: atmel: set linux_console_nameOleksij Rempel2019-08-211-0/+1
| | | | | | | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: stm32: set linux_console_nameAhmad Fatoum2019-08-211-0/+1
|/ | | | | | | | Linux names these UARTs ttySTM. Tell barebox about this, so it can be used to correctly compose the console= kernel command line argument. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2019-07-121-0/+3
|\
| * serial: ns16550: support reg-offset device-tree propertyMarcin Niestroj2019-07-021-0/+3
| | | | | | | | | | | | | | | | Some SoC have serial registers with a fixed offset to the map base. Support them by respecting 'reg-offset' device-tree property. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: ar933x: set linux_console_nameAntony Pavlov2019-06-261-0/+1
|/ | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial_ns16550: readd support for mvebu armada 38xUwe Kleine-König2019-06-071-0/+3
| | | | | | | | | | | | | | The armada 38x device tree traditionally used "snps,dw-apb-uart" as compatible for the internal UARTs. This was changed in Linux by commit b7639b0b15dd ("serial: 8250_dw: Limit dw8250_tx_wait_empty quirk to armada-38x devices") which was imported into barebox in e4067b75fb6c ("dts: update to v4.18-rc1") to "marvell,armada-38x-uart". Teach the driver about the new compatible to make the console work again. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: stm32mp1: Add serial driverSascha Hauer2019-03-114-0/+299
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial_ns16550: add raspberry pi compatible and initRouven Czerwinski2019-02-051-0/+28
| | | | | | | | Add the compatible for the Raspberry Pi AUX UART and an init function which enables it via the aux register and configures the correct shift value. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial_ns16550: handle default reg-io-widthRouven Czerwinski2019-02-051-23/+23
| | | | | | | | | | According to the device tree bindings for 8250, width is an optional property. Default to 1 which is the same default value as used by the kernel. Before this change the driver would not work for device trees which do not include the optional binding. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/missing-prototypes'Sascha Hauer2019-01-151-1/+1
|\
| * serial: amba-pl011: fix "no previous prototype for 'pl011_init_port'" warningAntony Pavlov2019-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | The patch fixes the following compiler's warning: drivers/serial/amba-pl011.c:151:5: warning: no previous prototype for ‘pl011_init_port’ [-Wmissing-prototypes] int pl011_init_port (struct console_device *cdev) ^~~~~~~~~~~~~~~ Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2019-01-151-1/+1
|\ \
| * | serial: amba-pl011: Fix regulator_get() return checkAndrey Smirnov2018-12-171-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | NULL is used to designate a dummy regulator, so it it should be safe to use against regulator_enable(). Any value that would retrun true for IS_ERR(), OTOH, is not. Such value would also pass "if (r)" check without any problems. Fix the code to use !IS_ERR() instead. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: clps711x: Determine device name from device treeAlexander Shiyan2018-12-201-0/+9
| | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: clps711x: Use DIV_ROUND_CLOSEST() for baudrate calculationAlexander Shiyan2018-12-201-1/+1
| | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: clps711x: Switch to SPDX identifierAlexander Shiyan2018-12-201-10/+2
| | | | | | | | | | | | | | | | Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: clps711x: Change compatible stringAlexander Shiyan2018-12-201-1/+1
|/ | | | | | | | This patch changes compatible string for CLPS711X serial driver to "cirrus,ep7209-uart" for conform with linux kernel. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serdev: select POLLERLucas Stach2018-12-041-0/+1
| | | | | | | | A lot of the inner working of the serdev framework depend on the poller, so there is no point in allowing to build without poller support. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: lpuart: Avoid division by zero when requested baudrate isAndrey Smirnov2018-08-131-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | With serdev device support added there's now a corner case where: 1. There is a DT node for a serdev device on one of the UARTs 2. There is no driver that binds against serdev device's compatibility string with 1 and 2 being true it is possible to end up in a situation where a particualr UART has not been initalized to any baudrate when clock_notifier_call_chain() gets called. This effectively translates to set_baudrate(uart, 0); which for LPUART driver result in a division by zero. To avoid this problem, convert lpuart_serial_setbaudrate() to treat zero baudrate as a request to disable the UART. While we are at it add a BUG_ON() to lpuart_setbrg() to simplify finding any future bugs. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: i.MX: Add i.MX8 supportSascha Hauer2018-06-111-1/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/serdev'Sascha Hauer2018-05-099-82/+6
|\
| * serial: Drop .remove functions from all driversAndrey Smirnov2018-04-178-82/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Depending on specifics, some 'serdev' devices might need prevent parent console device from being removed and corresponding memory deallocated to properly function until the very end of Barebox's execution. An example of such a use-case would be a reset handler relying on a serdev device for transport. To avoid having to develop complicatione reference counting/ownership scheme drop all of the code that calls console_unregister() and frees the memory effectively making the problem above impossible to arise. All of the de-initialization that serial drivers were doing in their .remove functions was somewhat superflous anyway, so this change should be pretty harmless. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * console: Add simplified 'serdev' framework from Linux kernelAndrey Smirnov2018-04-171-0/+6
| | | | | | | | | | | | | | | | | | Port 'serdev' UART-slave deivce framework found in recent Linux kernels (post 4.13) in order to be able to port 'serdev' slave drivers from Linux. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial/lpuart: Do not enable UART FIFOAndrey Smirnov2018-04-161-3/+1
|/ | | | | | | | | | Using FIFO in LPUART results in subtle serial input draining issues which are quite difficult to reproduce and troubleshoot. Since the change offered only moderate performance gain revert the code to operate in no-FIFO mode to avoid FIFO-related problems alltogether. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: ns16550: provide big-endian supportOleksij Rempel2017-09-081-2/+17
| | | | | | | we need it at least for QCA AR9344 Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: ns16550: emit an error message if getting the clock failsUwe Kleine-König2017-06-191-0/+1
| | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: fix registering multiple consolesAleksander Morgado2017-06-011-0/+3
| | | | | | | | | | | | | | | | | | Consoles need to be registered with the "console" device name so that they are probed by the correct driver. The barebox_register_console() was already forcing this as it was overwriting the name that was being passed as argument, but it was failing to provide a unique id for each new console, so the underlying register_device() would just return an error when wanting to re-register a device with device name "console" and id 0. We remove the unused name parameter from barebox_register_console() as it is really nowhere used, and also specify DEVICE_ID_DYNAMIC as id, so that a new unique device id is given to each newly registered console device. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: atmel: Add DT compatibility tableAndrey Smirnov2017-03-301-0/+7
| | | | | | Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/efi'Sascha Hauer2017-03-134-2/+228
|\
| * efi: add serial driver supportJean-Christophe PLAGNIOL-VILLARD2017-03-093-0/+226
| | | | | | | | | | | | | | | | | | | | | | | | | | | | So now we can stop to use the efi-stdio as this driver print on the Framebuffer and the serial at the same time. This is specially usefull if we want to use the framebuffer via efi-gop for something else. Do not forget to disable the efi-stdio device before enabling the console otherwise you will get double printing. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * efi: move x86 efi boot support to x86 archJean-Christophe PLAGNIOL-VILLARD2017-02-271-1/+1
| | | | | | | | | | | | | | prepare to drop the efi arch as efi boot up is not arch sepecific Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * efi: move bus driver to driver/efiJean-Christophe PLAGNIOL-VILLARD2017-02-241-1/+1
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: atmel: Check result of clk_get()Andrey Smirnov2017-03-091-0/+5
|/ | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx'Sascha Hauer2017-02-131-0/+4
|\
| * serial: i.MX: add i.MX7 supportJuergen Borleis2017-01-191-0/+3
| | | | | | | | | | Signed-off-by Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * serial: i.MX: Enable clockSascha Hauer2017-01-191-0/+1
| | | | | | | | | | | | For architectures which do not enable all clocks during initialization. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/efi'Sascha Hauer2017-02-131-1/+2
|\ \
| * | serial: efi: improve input handlingMichael Olbrich2017-01-241-1/+2
| |/ | | | | | | | | | | | | | | | | 0x08 is the scan-code for 'backspace' not 'delete'. 0x17 indicates the start of an escape sequence, such as "[3~" for 'delete'. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: ns16550: Set read/write functions depending on reg-io-widthWadim Egorov2017-02-101-0/+19
|/ | | | | | | | Set proper register read/write functions depending on reg-io-width device tree property. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: Add 'lpuart' serial driverAndrey Smirnov2017-01-113-0/+223
| | | | | | | Add 'lpuart' serial driver, based on analogous driver from U-Boot Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: i.MX: Add i.MX6ul supportSascha Hauer2016-11-081-0/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>