summaryrefslogtreecommitdiffstats
path: root/drivers/serial
Commit message (Collapse)AuthorAgeFilesLines
* sandbox: retire CONFIG_LINUX symbol in favor of CONFIG_SANDBOXAhmad Fatoum2020-11-271-1/+1
| | | | | | | | | | | | | 5211e428cbab ("image: Convert the IH_... values to enums") removed the IH_ARCH_LINUX enumeration value leading to breakage of sandbox configurations that enable bootm. Instead of reinstating IH_ARCH_LINUX, just use IH_ARCH_SANDBOX and remove mention of CONFIG_LINUX altogether, it's always true anyway when CONFIG_SANDBOX is true. Fixes: 5211e428cbab ("image: Convert the IH_... values to enums") Cc: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/driver-macro' into masterSascha Hauer2020-10-141-5/+1
|\
| * treewide: Use driver macroSascha Hauer2020-09-291-5/+1
| | | | | | | | | | | | | | We have several macros for a oneline driver registration. Add some missing and use them consistently where possible througout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | driver: migrate some from dev_get_drvdata to device_get_match_dataAhmad Fatoum2020-10-091-4/+2
| | | | | | | | | | | | | | | | The dev_get_drvdata instances here all store a valid pointer in the match data and can be readily converted. Do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | treewide: fix unterminated of_device_id[] reported by CoccinelleAhmad Fatoum2020-10-021-0/+1
|/ | | | | | | | driver_d::of_compatible outght to point at a NULL-terminated array. Fix instances where this is not the case. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: imx: set CTS if DT property "linux, rs485-enabled-at-boot-time" is ↵Oleksij Rempel2020-09-231-0/+8
| | | | | | | | | | | | | present If we have a "linux,rs485-enabled-at-boot-time" DT property, we should set CTS flag as soon as possible to the active state. This will set an RS485 transmitter to receive-enable mode. Otherwise the RS485 bus will be blocked for entire system boot time and other bus participants will not be able to communicate. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2020-07-272-39/+11
|\
| * treewide: Convert files covered by ARM copyright to SPDXUwe Kleine-König2020-07-142-39/+11
| | | | | | | | | | | | | | | | | | | | According to Marc Zyngier, former employee at ARM, the company owns the copyright for code created by its employees. Convert accordingly to SPDX with the usual rearrangements. Also dropped Marc's email address which doesn't work any more. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: i.MX: Add i.MX8MP compatibleSascha Hauer2020-07-141-0/+3
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: stm: set linux_console_nameMichael Grzeschik2020-06-031-0/+1
| | | | | | | | We set the linux_console_name so for this uart the linux.bootargs.console will be properly set. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: amba-pl011: set linux_console_nameMichael Grzeschik2020-06-031-0/+1
| | | | | | | | We set the linux_console_name so for this uart the linux.bootargs.console will be properly set. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: Add flush function to NS16550 driverDavid Dgien2020-06-031-0/+12
| | | | | | | | Add flush function to NS16550 to remove bad characters being printed during reset Signed-off-by: David Dgien <dgienda125@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mxs'Sascha Hauer2020-05-141-0/+1
|\
| * serial: mxs auart: Set Linux console nameSascha Hauer2020-05-071-0/+1
| | | | | | | | | | | | | | The MXS AUART is in the kernel known as "ttyAPP". Set the Linux console name to make automatic setting of the console= Kernel parameter work. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2020-05-1412-34/+0
|\ \
| * | treewide: remove references to CREDITSUwe Kleine-König2020-04-2712-34/+0
| |/ | | | | | | | | | | | | | | The CREDITS file was removed from barebox in 2015 by commit 6570288f2d97 ("Remove the CREDITS file"). Remove references to it from several files. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / drivers: explicitly select dependency STMP_DEVICE for i.MX23/28 driversAhmad Fatoum2020-05-081-0/+1
|/ | | | | | | | | | | | | Some of the i.MXs drivers can be build tested even if building for other platforms. Support adding a future COMPILE_TEST dependency to some of these drivers by explicitly having their Kconfig symbol select STMP_DEVICE if the driver calls stmp_reset_block. This has not been necessary for the normal build, because the ARCH symbols for the IMX23 and IMX28 already selected STMP_DEVICE. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: ns16550_pci: Use %pa to print resource_size_tSascha Hauer2020-04-011-4/+4
| | | | | | | The correct format specifier for printing a resource_size_t is %pa. Use it to avoid warninings. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: imx: Add imx8mm compatibleSascha Hauer2020-02-191-0/+3
| | | | | | Only add the compatible string to let the driver match. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: ns16550_pci: fix possible read of uninitialized variableAhmad Fatoum2020-02-141-6/+0
| | | | | | | | | When quirk->init is NULL, we evaluate an uninitialized rc. Is we have already checked for rc < 0 at the point of assignment, this if clause isn't needed. Remove it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: cadence: move register definitions into header fileLucas Stach2020-01-141-36/+5
| | | | | Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: add support for PCI NS16550 UARTsAhmad Fatoum2019-12-093-0/+5320
| | | | | | | | | | | | | | | | | | | | | | | This ports over the Linux v5.4 8250_pci driver. Unlike Linux, the barebox ns16550 implementation provides less hooks for covering all the quirky behavior of all the different 8250-"compatible" hardware blocks. The barebox driver matches against all serial port the Linux driver does, but for hardware with quirks that can't be expressed in the current barebox n16550 API, the probe fails with -ENOSYS and an appropriate message telling that the quirk handling is missing. This should make future extension of the driver straight-forward. Unlike the kernel variant of the driver, most ->exit quirk callbacks can be dropped in barebox as they often disable IRQs, which we do in the ->init anyway. This was tested with the EFI PCI driver on qemu with the options: -device pci-serial,chardev=cdev0 -chardev file,id=cdev0,path=COM Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>