summaryrefslogtreecommitdiffstats
path: root/drivers/serial
Commit message (Collapse)AuthorAgeFilesLines
...
* serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIALStefan Roese2019-04-092-0/+21
| | | | | | | | | | | | | | | | | | | This patch adds an alterative SPL version of atmel_serial_enable_clk(). This enables the usage of this driver without full clock support (in drivers and DT nodes). This saves some space in the SPL image. Please note that this fixed clock support is only added to the SPL code in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL should not be affected. This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART input clock. It defaults to 132096000 for ARCH_AT91 but can be set to a different value if needed. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Heiko Schocher <hs@denx.de> Cc: Andreas Bießmann <andreas@biessmann.org> Cc: Eugen Hristev <eugen.hristev@microchip.com>
* imx: serial_mxc: use CONFIG_IS_ENABLED instead of ifdefAdam Ford2019-03-131-2/+2
| | | | | | | | | | Kconfig allows boards to configured with DM_SERIAL and still have SPL_DM_SERIAL disabled. This patch changes the ifdef's to CONFIG_IS_ENABLED to allow the modes to differ between SPL and U-Boot. Signed-off-by: Adam Ford <aford173@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* drivers: serial_sifive: Skip baudrate config if no input clockAtish Patra2019-02-271-16/+16
| | | | | | | | | | | | | It is possible that input clock is not available because clk device was not available and 'clock-frequency' DT property is also not available. In this case, instead of failing we should just skip baudrate config by returning zero. Signed-off-by: Atish Patra <atish.patra@wdc.com> Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alexander Graf <agraf@suse.de>
* drivers: serial_sifive: Fix baud rate calculationAtish Patra2019-02-271-2/+26
| | | | | | | | | Compute the baud rate multipler with more precision. Signed-off-by: Atish Patra <atish.patra@wdc.com> Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
* imx: serial_mxc: disable ri and dcd irq in dte modeMax Krummenacher2019-02-151-4/+9
| | | | | | | | | | | | If the UART is used in DTE mode the RI and DCD bits in UCR3 become irq enable bits. Both are set to enabled after reset and both likely are pending. Disable the bits to prevent an interrupt storm when Linux enables the UART interrupts. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
* drivers: serial: dm: Enable DM_FLAG_PRE_RELOC in SBSA pl011 uart driverVabhav Sharma2019-02-091-2/+0
| | | | | | | | | | | | | | | | | | | | | The DM_FLAG_PRE_RELOC shall be enabled in SBSA PL011 uart driver as this driver is used in NXP based SoCs It is necessary to have Serial console running before relocation The !CONFIG_IS_ENABLED(OF_CONTROL) [*] check is set as "workaround" for DM problem : 4687919684e This flag is set if board does not support device-tree and using platform data, In DM Model either of device tree or platform data can be used to fetch device configuration It is possible to use SBSA UART with CONFIG_DM_SERIAL but witout corresponding device tree description (OF_CONTROL) Other board/SoCs have this flag set unconditionally Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
* serial_arc: Allocate buffer for private dataAlexey Brodkin2019-01-251-0/+1
| | | | | | | | Apparently we never allocated buffer for arc_serial_platdata which for some reason never caused problems when executed in nSIM. But in Qemu this causes expected problems. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
* Merge tag 'dm-pull-15jan19' of git://git.denx.de/u-boot-dmTom Rini2019-01-151-18/+9
|\ | | | | | | | | | | | | | | Fix recent changes to serial API for driver model Buildman clang support and a few fixes Small fixes to 'dm tree' and regmap test Improve sandbox build compatibility A few other minor fixes
| * dm: serial: Adjust serial_getinfo() to use proper APISimon Glass2019-01-141-6/+3
| | | | | | | | | | | | | | | | All driver-model functions should have a device as the first parameter. Update this function accordingly. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
| * dm: serial: Adjust serial_setconfig() to use proper APISimon Glass2019-01-141-6/+3
| | | | | | | | | | | | | | | | All driver-model functions should have a device as the first parameter. Update this function accordingly. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
| * dm: serial: Adjust serial_getconfig() to use proper APISimon Glass2019-01-141-6/+3
| | | | | | | | | | | | | | | | All driver-model functions should have a device as the first parameter. Update this function accordingly. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
* | serial: ns16550: fix debug uart putc called before initSimon Goldschmidt2019-01-152-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If _debug_uart_putc() is called before _debug_uart_init(), the ns16550 debug uart driver hangs in a tight loop waiting for the tx FIFO to get empty. As this can happen via a printf sneaking in before the port calls debug_uart_init(), introduce a config option to ignore characters before the debug uart is initialized. This is done by reading the baudrate divisor and aborting if is zero. The Kconfig option is required as reading the baudrate divisor does not seem to work for all ns16500 compatibles (which is why the last attempt on this has been reverted in 1a67969a99). Tested on socfpga_cyclone5_socrates. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UARTSimon Goldschmidt2019-01-151-0/+1
|/ | | | | | | | DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend on DEBUG_UART. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* drivers: serial: Add SiFive UART driverAnup Patel2018-12-183-0/+229
| | | | | | | | | | This patch adds SiFive UART driver. The driver is 100% DM driver and it determines input clock using clk framework. Signed-off-by: Anup Patel <anup@brainfault.org> Reviewed-by: Palmer Dabbelt <palmer@sifive.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
* serial: serial_stm32: Add reset supportPatrice Chotard2018-12-151-0/+9
| | | | | | | | | | In some cases, UART is configured by early boot stage. To be sure of the initial state of UART and to avoid spurious chars on console, reset the serial block before configuring it. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* spl: fix build failure with !CONFIG_SPL_PCI_SUPPORTSekhar Nori2018-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Building U-Boot with CONFIG_PCI and CONFIG_DM_PCI enabled, but CONFIG_SPL_PCI_SUPPORT disabled, results in following linker error: lib/built-in.o: In function `fdtdec_get_pci_bar32': lib/fdtdec.c:305: undefined reference to `dm_pci_read_bar32' fdtdec.c:305:(.text.fdtdec_get_pci_bar32+0x24): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `dm_pci_read_bar32' This is because reference to dm_pci_read_bar32() remains in lib/fdtdec.c while SPL build does not descend into drivers/pci directory in drivers/Makefile if CONFIG_SPL_PCI_SUPPORT is not enabled. Fix this by applying appropriate #define guards in lib/fdtdec.c. It looks like ns16550.c has the same problem, so fixed that too. To simplify this, CONFIG_SPL_PCI_SUPPORT is renamed to CONFIG_SPL_PCI (enables use of CONFIG_IS_ENABLED() macro). Suggested-by: Vignesh R <vigneshr@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* serial: omap: Add code for early debuggingFelix Brack2018-12-071-1/+41
| | | | | | | | This patch adds code missing when CONFIG_DEBUG_UART_OMAP is enabled as early debugging UART. The code is basically copied from the ns16550 driver. Signed-off-by: Felix Brack <fb@ltec.ch>
* serial: bcm6858: remove driver and switch to bcm6345Álvaro Fernández Rojas2018-12-073-308/+1
| | | | Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* serial: bcm6345: switch to raw I/O functionsÁlvaro Fernández Rojas2018-12-071-50/+49
| | | | Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* serial: ns16550: Provide ->getinfo() implementationAndy Shevchenko2018-12-051-1/+21
| | | | | | | | New callback will supply necessary information, for example, to ACPI SPCR table. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: ns16550: Read reg-io-width from device treeAndy Shevchenko2018-12-051-0/+1
| | | | | | | Cache the value of the reg-io-width property for the future use. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: serial: Introduce ->getinfo() callbackAndy Shevchenko2018-12-052-0/+42
| | | | | | | | | | New callback will give a necessary information to fill up ACPI SPCR table, for example. Maybe used later for other purposes. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org> Change ADR_SPACE_SYSTEM_IO to SERIAL_ADDRESS_SPACE_IO to fix build error: Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: serial: Add ->getconfig() callbackAndy Shevchenko2018-12-052-0/+29
| | | | | | | | | In some cases it would be good to know the settings, such as parity, of current serial console. One example might be an ACPI SPCR table to generate using these parameters. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Revert "serial: ns16550: fix debug uart putc called before init"Simon Goldschmidt2018-12-031-16/+2
| | | | | | | | | | | | | | | This reverts commit 6f57c34473d37b8da5e6a3764d0d377d748aeef1 since it does not seem to work at least on rk3399. The Rockchip Technical Reference Manual (TRM) for the rk3399 says the baud rate prescaler register is readable only when USR[0] is zero. Since this bit is defined as "reserved" in the socfpga cylcone5 TRM, let's rather drop this than making the ns16550 debug uart more platform specific. Reported-by: Roosen Henri <Henri.Roosen@ginzinger.com> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com
* drivers: serial: get rid of non DM mpc8xx driverChristophe Leroy2018-12-032-85/+14
| | | | Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
* drivers: serial: migrate mpc8xx to DMChristophe Leroy2018-12-031-3/+74
| | | | Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
* serial: MediaTek: add high-speed uart driver for MediaTek SoCsRyder Lee2018-11-283-0/+289
| | | | | | | | | | | | | | Many SoCs from MediaTek have a high-speed uart. This UART is compatible with the ns16550 in legacy mode. It has extra registers for high-speed mode which can reach a maximum baudrate at 921600. However this UART will no longer be compatible if it's in high-speed mode. Some BootROM of MediaTek's SoCs will change the UART into high-speed mode and the U-Boot must use this driver to initialize the UART. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Tested-by: Ryder Lee <ryder.lee@mediatek.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: ns16550: add setconfig supportSimon Goldschmidt2018-11-161-2/+41
| | | | | | | | Add possibility to update the serial parity used. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
* serial: bcm6858: add serial supportPhilippe Reynes2018-11-163-0/+307
| | | | | | | This driver add the support of serial on bcm6858. It's based on serial for bcm6345. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
* serial: Remove DM_FLAG_PRE_RELOC flag in various driversBin Meng2018-11-1426-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared via U_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declared DM_FLAG_PRE_RELOC flag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage. To mitigate this potential impact, the following changes are implemented: - Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver only supports configuration from device tree (OF_CONTROL) - Keep DM_FLAG_PRE_RELOC flag in the driver only if the device is statically declared via U_BOOT_DEVICE() - Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: ns16550: fix debug uart putc called before initSimon Goldschmidt2018-11-141-2/+16
| | | | | | | | | | | | | | | | | If _debug_uart_putc() is called before _debug_uart_init(), the ns16550 debug uart driver hangs in a tight loop waiting for the tx FIFO to get empty. As this can happen via a printf sneaking in before the port calls debug_uart_init(), let's rather ignore characters before the debug uart is initialized. This is done by reading the baudrate divisor and aborting if is zero. Tested on socfpga_cyclone5_socrates. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()Bin Meng2018-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | Currently the comments of several APIs (eg: dm_init_and_scan()) say: @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC flag. If false bind all drivers. The 'Pre-Relocation Support' chapter in doc/driver-model/README.txt documents the same that both device tree properties and driver flag are supported. However the implementation only checks these special device tree properties without checking the driver flag at all. This updates lists_bind_fdt() to consider both scenarios. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Squashed in http://patchwork.ozlabs.org/patch/996473/ : Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Fix typo - missed semicolonAndy Shevchenko2018-11-091-1/+1
| | | | | | | | | | | | | The commit 484fdf5ba058 ("dm: Add support for all targets which requires MANUAL_RELOC") introduces subtle typo, i.e. missed semicolon. Fixes: 484fdf5ba058 ("dm: Add support for all targets which requires MANUAL_RELOC") Cc: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com>
* Merge tag 'u-boot-imx-20181025' of git://git.denx.de/u-boot-imxTom Rini2018-10-252-29/+115
|\ | | | | | | Merged imx8 architecture, fix build for imx8 + warnings
| * serial: mxc: Add match string for i.mx6 quad/dual lite serialBernhard Messerklinger2018-10-221-0/+1
| | | | | | | | | | | | Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com> Reviewed-by: Hannes Schmelzer <oe5hpm@oevsv.at> Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
| * serial: lpuart: support uclass clk apiPeng Fan2018-10-221-19/+76
| | | | | | | | | | | | | | | | | | | | Modify most APIs to use udevice as the first parameter, then it will be easy to get the clk reference by using udevice pointer. Use uclass api to get lpuart clk when CONFIG_CLK is enabled. Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Anatolij Gustschin <agust@denx.de> Cc: Stefano Babic <sbabic@denx.de>
| * serial: lpuart: Enable RX and TX FIFOYe Li2018-10-221-7/+26
| | | | | | | | | | | | | | | | | | | | Enable the RX and TX FIFO in LPUART driver to avoid the input lost during U-Boot boot up. Signed-off-by: Ye Li <ye.li@nxp.com> Acked-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Anatolij Gustschin <agust@denx.de> Cc: Stefano Babic <sbabic@denx.de>
| * serial_lpuart: Update lpuart driver to support i.MX8Peng Fan2018-10-221-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Add i.MX8 compatible string and cpu type support to lpuart driver, to use little endian 32 bits configurations. Also, according to RM, the Receive FIFO Enable (RXFE) field in LPUART FIFO register is bit 3, so this definition should change to 0x08 (not 0x40) for i.MX8, otherwise the Receive FIFO is not disabled. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Anatolij Gustschin <agust@denx.de> Cc: Stefano Babic <sbabic@denx.de>
* | serial: Allow serial to be absent in TPLSimon Glass2018-10-092-0/+14
| | | | | | | | | | | | | | | | At present this option applies to SPL, but it should be available in TPL also, and separately. Change to using CONFIG_IS_ENABLED(), add a new Kconfig option and fix up hang(). Signed-off-by: Simon Glass <sjg@chromium.org>
* | sandbox: Restore blocking I/O on exitSimon Glass2018-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | At present sandbox sets non-blocking I/O as soon as any input is read from the terminal. However it does not restore the previous state on exit. Fix this and drop the old os_read_no_block() function. This means that we always enable blocking I/O in sandbox (if input is a terminal) whereas previously it would only happen on the first call to tstc() or getc(). However, the difference is likely not important. Signed-off-by: Simon Glass <sjg@chromium.org>
* | serial: sandbox: Allow serial output without device treeSimon Glass2018-10-091-0/+5
| | | | | | | | | | | | | | At present sandbox assumes that device-tree control is active, but this may not be the case in SPL or TPL. Add some conditions to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
* | sandbox: Add a debug UARTSimon Glass2018-10-092-0/+28
|/ | | | | | | Add support for the debug UART so that sandbox provides build testing for this feature. Signed-off-by: Simon Glass <sjg@chromium.org>
* serial: serial_stm32: Enable uart FIFO for STM32F7xx SoCsPatrice Chotard2018-09-301-1/+1
| | | | | | | | | | | | Since commit 7b3b74d32127 ("serial: serial_stm32: Enable overrun") on STM32F7xx based boards, the first lines of serial output are missing during boot (we no more see the U-Boot release version, board model and DRAM size). By enabling the uart FIFO on STM32F7, the complete U-boot log can be sent correctly. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini2018-09-261-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch queue for efi - 2018-09-26 A lot of goodness in this release. We're *very* close to running the UEFI Shell and SCT natively. The only missing piece are HII protocols. - FAT write support (needed for SCT) - improved FAT directory support (needed for SCT) - RTC support with QEMU -M virt - Sandbox support (run UEFI binaries in Linux - yay) - Proper UTF-16 support - EFI_UNICODE_COLLATION_PROTOCOL support (for UEFI Shell) - EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL support (for UEFI Shell) - Fix window size determination - Fix Tegra by explicitly unmapping RAM - Clean up handle entanglement - Lots of generic code cleanup [trini: Fixup merge conflict in include/configs/qemu-arm.h] Signed-off-by: Tom Rini <trini@konsulko.com>
| * efi_loader: struct efi_simple_text_input_protocolHeinrich Schuchardt2018-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | %s/efi_simple_input_interface/efi_simple_text_input_protocol/ We should be consistent in the naming of the EFI protocol interface structures. The protocol is called EFI_SIMPLE_TEXT_INPUT_PROTOCOL. %s/ExtendedVerification/extended_verification/ Use consistent naming of function parameters. Do not use CamelCase. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* | serial: omap: Add support for AM654 uart controllerLokesh Vutla2018-09-251-0/+1
|/ | | | | | | | AM654 uses a UART controller that is compatible (partially) with existing OMAP UART, Introduce a compatible for adding support for this controller. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
* arm: K3: Add initial support for TI's K3 generation of SoCsLokesh Vutla2018-09-111-1/+1
| | | | | | | | Add support for Texas Instruments' K3 Generation Processor families. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* serial: omap: Introduce DM specific omap serialLokesh Vutla2018-09-104-44/+139
| | | | | | | | | Add driver model support for OMAP_SERIAL while reusing the functions in ns16550.c Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Tested-by: Derald D. Woods <woods.technical@gmail.com>
* serial: arm_dcc: Add DCC support for V7R based coresLokesh Vutla2018-09-101-1/+1
| | | | | | | DCC is supported on Cortex R series as well. Enable DCC support for V7R. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
* sandbox: Add serial testPatrice Chotard2018-09-101-0/+14
| | | | | Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>