summaryrefslogtreecommitdiff
path: root/drivers/serial
Commit message (Collapse)AuthorAgeFilesLines
* board: stm32f429-disco: switch to DM STM32 serial driverPatrice Chotard2018-01-101-117/+0
| | | | | | | | | | | Remove serial_stm32.c driver and uart init from board file, use available DM serial_stm32x7.c driver compatible for STM32F4/F7 and H7 SoCs. The serial_stm32x7.c driver will be renamed later with a more generic name as it's shared with all STM32 Socs. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* serial: sh: Unify R8A7795 and R8A7796 as Gen3Marek Vasut2017-11-301-2/+1
| | | | | | | | | Unify the CONFIG_R8A7795 and CONFIG_R8A7796 as CONFIG_RCAR_GEN3 so that every time we add a new SoC, we won't have to add more stuff to this list. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* arm: zynq: Move ZYNQ_SERIAL to KconfigMichal Simek2017-11-281-0/+7
| | | | | | | Move cadence/zynq serial driver via Kconfig Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: nulldev: Implement "pending" function to fix tstc return "true"Wilson Lee2017-11-171-0/+6
| | | | | | | | | | | | | | | | | | | | In U-boot, serial_tstc was use to determine is there have a character in serial console that pending for read. If there is no "pending" function implemented in serial driver, the serial-uclass will return "true(1)" to indicate there have a character pending to read. Thus, read a character from nulldev serial will result in continuous getting -EAGAIN return which might lead system to hang. This commit is to fix a bug in nulldev serial which implement "pending" function in nulldev serial to always indicate there is no character in console that pending for read. Signed-off-by: Wilson Lee <wilson.lee@ni.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Keng Soon Cheah <keng.soon.cheah@ni.com> Cc: Chen Yee Chew <chen.yee.chew@ni.com> Cc: Bin Meng <bmeng.cn@gmail.com>
* stm32: fix STMicroelectronics copyrightPatrice Chotard2017-11-062-4/+4
| | | | | | | Uniformize STMicroelectronics copyrights headers for STM32 related code. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* sti: fix STMicroelectronics copyrightPatrice Chotard2017-11-061-3/+3
| | | | | | | Uniformize all STMicroelectronics copyrights headers for STi related code. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* usbtty: fix typosHeinrich Schuchardt2017-10-161-1/+1
| | | | | | Fix typos in USB tty driver. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* Merge branch 'rmobile' of git://git.denx.de/u-boot-shTom Rini2017-10-101-3/+6
|\
| * serial: sh: Enable clock if availableMarek Vasut2017-09-241-3/+6
| | | | | | | | | | | | | | | | | | | | If the clock framework provides the driver with valid clock, enable them, otherwise the SCIF might not work if the clock are not enabled prior to the driver probe. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* | serial: stm32x7: remove useless CONFIG_CLK and OF_CONTROL flagPatrice Chotard2017-10-081-7/+2
| | | | | | | | | | | | | | | | This driver is currently used by STM32F7 and STM32H7 SoCs. As CONFIG_CLK and OF_CONTROL flags are set by default for these 2 SoCs, this flag becomes useless in this driver, so remove it. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* | serial: stm32x7: add STM32F4 supportPatrice Chotard2017-10-083-2/+10
| | | | | | | | | | | | | | | | stm32f4 doesn't support FIFO and OVERRUN feature. The enable bit is not at the same location in CR1 register than for STM32F7 and STM32H7. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* | serial: stm32x7: add fifo support for STM32H7Patrice Chotard2017-10-082-3/+15
| | | | | | | | | | | | | | | | Add fifo mode support for rx and tx. As only STM32H7 supports this feature, add has_fifo flag to uart configuration to use fifo only when possible. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* | serial: stm32x7: prepare the ground to STM32F4 supportPatrice Chotard2017-10-082-44/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | STM32F4 serial IP is similar to F7 and H7, but registers are not located at the same offset and some feature are only supported by F7 and H7 version. Registers offset must be added for each version and also some flags indicated the supported feature. Update registers name to match with datasheet (sr to isr, rx_dr to rdr and tx_dr to tdr) and remove unused regs (cr2, gtpr, rtor, and rqr). Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* | serial: stm32x7: remove stm32f7-usart and stm32h7-usart compatiblePatrice Chotard2017-10-081-2/+0
| | | | | | | | | | | | | | | | This patch remove the extra compatibility string "st,stm32h7-usart" and "st,stm32f7-usart" to avoid confusion, save some time & space. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Vikas Manocha <vikas.manocha@st.com>
* | serial: stm32x7: cleanup codePatrice Chotard2017-10-081-9/+9
|/ | | | | | | Use BIT() macro and GENMASK() macro Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Vikas Manocha <vikas.manocha@st.com>
* serial: stm32x7: add STM32H7 supportPatrice Chotard2017-09-222-3/+6
| | | | | | | | STM32F7 and STM32H7 shares the same UART block, add STM32H7 compatible string. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: nulldev: Add nulldev serial driverKeng Soon Cheah2017-09-133-0/+56
| | | | | | | | | | | | | | | | Some device the serial console's initialization cannot run early during the boot process. Hence, nulldev serial device is helpful on that situation. For example, if the serial module was implemented in FPGA. Serial initialization is prohibited to run until the FPGA was programmed. This commit is to adding nulldev serial driver. This will allows the default console to be specified as a nulldev. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com> Cc: Chen Yee Chew <chen.yee.chew@ni.com>
* serial: serial-uclass: Add generic serial RX buffer supportStefan Roese2017-08-242-2/+61
| | | | | | | | | | | | | | | | | | Pasting longer lines into the U-Boot console prompt sometimes leads to characters missing. One problem here is the small 16-byte FIFO of the legacy NS16550 UART, e.g. on x86 platforms. This patch now introduces a Kconfig option to enable RX buffer support for all DM based serial drivers. With this option enabled, I was able paste really long lines into the U-Boot console, without any characters missing. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
* Revert "serial: ns16550: Add RX interrupt buffer support"Stefan Roese2017-08-242-128/+5
| | | | | | | | | | | | | | | | | | | This reverts commit 6822cf3ec7c8768b8727573b8f4b2cb3d870b881. As Bin Meng has tested and pointed out, we don't need the RX interrupt for the RX buffer support at all. Just reading all available characters into a buffer is sufficient to solve the problem with the dropped characters upon long lines pasted into the U-Boot prompt. Since this RX buffer support can be implemented in a generic way, without any device specifica (e.g. for the ns16550), I'll post a new patch with a new serial RX buffer support for DM, which all DM based serial drivers can use. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* env: Rename getenv/_f() to env_get()Simon Glass2017-08-161-5/+4
| | | | | | | | | | | We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
* serial: sh: Use the clock framework to obtain clock configMarek Vasut2017-08-031-2/+11
| | | | | | | | | | | Since we now have clock driver on the RCar Gen3 , obtain the clock configuration using the clock framework functions. In case this fails, fall back to the original code for pulling the clock config directly out of OF. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* serial: sh: Convert to KconfigMarek Vasut2017-08-031-0/+8
| | | | | | | | | Convert the SH Serial to Kconfig using tools/moveconfig.py tool and a bit of manual adjustment to cater for failed conversions. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* dm: console: Check for serial devices properlySimon Glass2017-07-311-1/+1
| | | | | | | | | With driver model the serial device is often not called "serial". Mark driver-model stdio devices so that they can be detected and we can look up the uclass. This is a more reliable way of finding out whether the console is connected to a serial device or not. Signed-off-by: Simon Glass <sjg@chromium.org>
* serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to KconfigPatrice Chotard2017-07-311-0/+7
| | | | | | | Add CONFIG_STM32X7_SERIAL as a Kconfig option. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Vikas Manocha <vikas.manocha@st.com>
* spl: make SPL and normal u-boot stage use independent SYS_MALLOC_F_LENAndy Yan2017-07-271-2/+2
| | | | | | | | | | | | | | | | | Some platforms have very limited SRAM to run SPL code, so there may not be the same amount space for a malloc pool before relocation in the SPL stage as the normal U-Boot stage. Make SPL and (the full) U-Boot stage use independent SYS_MALLOC_F_LEN, so the size of pre-relocation malloc pool can be configured memory space independently. Signed-off-by: Andy Yan <andy.yan@rock-chips.com> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> [fixed up commit-message:] Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
* serial: stm32x7: add clk_get_rate() supportPatrice Chotard2017-07-262-10/+9
| | | | | | | | | Replace proprietary clock_get() by clk_get_rate() The stm32x7 serial driver is now "generic" and can be used by other STM32 SoCs. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Acked-by: Vikas MANOCHA <vikas.manocha@st.com>
* serial: stm32x7: migrate serial struct to driverPatrice Chotard2017-07-262-1/+5
| | | | | | | | | | | This allow to remove include/dm/platform_data/serial_stm32x7.h which was included in the past by stm32x7 driver and by stm32f746-disco.c board file. Since patch 42bf5e7c27 "serial: stm32f7: add device tree support" this file is no more needed in board file. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Acked-by: Vikas MANOCHA <vikas.manocha@st.com>
* serial: ns16550: Add RX interrupt buffer supportStefan Roese2017-07-232-5/+128
| | | | | | | | | | | | | | | | | | Pasting longer lines into the U-Boot console prompt sometimes leads to characters missing. One problem here is the small 16-byte FIFO of the legacy NS16550 UART, e.g. on x86 platforms. This patch now introduces a Kconfig option to enable RX interrupt buffer support for NS16550 style UARTs. With this option enabled, I was able paste really long lines into the U-Boot console, without any characters missing. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> [trini: Guard ns16550_serial_remove with CONFIG_IS_ENABLED(SERIAL_PRESENT) to match struct assignment] Signed-off-by: Tom Rini <trini@konsulko.com>
* powerpc: Remove 8260 remaindersChristophe Leroy2017-07-231-3/+0
| | | | | | | | | commit 2eb48ff7a210d ("powerpc, 8260: remove support for mpc8260") removed support for 8260 CPU. This patch remove some remainders. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
* serial: mxc: Add debug uart supportJagan Teki2017-07-122-0/+34
| | | | | | | | Add support for the debug UART to assist with early debugging. Enable it for i.CoreM6 as an example. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: mxc: Code cleanupJagan Teki2017-07-121-97/+94
| | | | | | | | - Remove space between #define to macro - Add tab between macro and value Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: mxc: Move common baud gen into _mxc_serial_setbrgJagan Teki2017-07-121-26/+24
| | | | | | | | Move the common baud generation code into _mxc_serial_setbrg so-that dm and non-dm can call this func. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: mxc: Move common init into _mxc_serial_initJagan Teki2017-07-121-20/+17
| | | | | | | | Move the common initialization code into _mxc_serial_init so-that dm and non-dm can call this func. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: mxc: Move cr1 and cr2 write to mxc_serial_setbrgJagan Teki2017-07-121-5/+3
| | | | | | | | | Control reg write should be part of setbrg for better buadrate generation, so move cr1 and cr2 write to mxc_serial_setbrg Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: mxc: Use RFDIV in dm-codeJagan Teki2017-07-121-3/+3
| | | | | | | | Use RFDIV in dm-code instead of numeric value, so-that it can be common for dm and non-dm. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: mxc: Add common mxc_uart reg spaceJagan Teki2017-07-121-66/+49
| | | | | | | | | | | | | This patch will add common reg space for non-dm and dm code and non-dm reg space can be accessed using mxc_base. This will - get rid of __REG volatile assignments - Make common reg_space by removing unneeded macros Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Merge git://git.denx.de/u-boot-dmTom Rini2017-07-112-40/+55
|\
| * dm: serial: Add livetree supportSimon Glass2017-07-111-3/+15
| | | | | | | | | | | | | | | | Add support for a live device tree to the core serial uclass. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * dm: serial: Separate out the core serial-device finding codeSimon Glass2017-07-111-40/+44
| | | | | | | | | | | | | | | | | | This function is quite long. Move the core code into a separate function in preparation for adding livetree support. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
| * dm: serial: ns16550: Convert to livetreeSimon Glass2017-07-111-10/+5
| | | | | | | | | | | | | | | | Update this driver to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
* | rockchip: ns16550: dm: convert fdt_get to dev_readPhilipp Tomsich2017-07-111-7/+4
|/ | | | | | | | | | | | With the new dev_read functions available, we can convert the rockchip architecture-specific drivers and common drivers used by these devices over to the dev_read family of calls. This covers the serial driver (ns16550 and compatible) used for the Rockchip devices. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* powerpc, 8xx: move Serial driver to drivers/serial/Christophe Leroy2017-07-083-0/+310
| | | | | | At the same time, move to Kconfig Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
* serial: make serial_stub_* to static functionsMasahiro Yamada2017-07-062-6/+9
| | | | | | | | | | Add missing static to serial_stub_puts(). Unexport serial_stub_{getc,tstc} because they are used locally. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial, kconfig: fix menutextHeiko Schocher2017-06-231-2/+2
| | | | | | | | | fix menutext for the options SPL_DM_SERIAL and TPL_DM_SERIAL. Both have the same text as DM_SERIAL, which is confusing. Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Stefan Roese <sr@denx.de>
* powerpc, 5xx: remove some "5xx" remainsHeiko Schocher2017-06-161-1/+0
| | | | | | we removed 5xx support. So delete some forgotten remains. Signed-off-by: Heiko Schocher <hs@denx.de>
* powerpc, 82xx: remove some missed mpc82xx remainsHeiko Schocher2017-06-161-2/+0
| | | | | | | we removed 82xx support. Missed some 82xx remains, remove them now. Signed-off-by: Heiko Schocher <hs@denx.de>
* powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512xHeiko Schocher2017-06-161-2/+0
| | | | | | | | | There was for long time no activity in the mpx5xxx area. We need to go further and convert to Kconfig, but it turned out, nobody is interested anymore in mpc5xxx, so remove it. Signed-off-by: Heiko Schocher <hs@denx.de>
* serial: stm32x7: simplify baud rate register calculationPatrice Chotard2017-06-122-7/+17
| | | | | | | | | | | | Simplify baud rate register formula and use the oversampling uart feature. This code is aligned with what is implemented in kernel driver drivers/tty/serial/stm32-usart.c since kernel v4.9. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Christophe KERELLO <christophe.kerello@st.com> Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com> Acked-by: Vikas MANOCHA <vikas.manocha@st.com>
* serial: stm32x7: align compatible with kernel onePatrice Chotard2017-06-121-2/+2
| | | | | | | | | | | | | | | stm32x7.c driver is dedicated for STM32F7. In kernel, "st,stm32-usart" and "st,stm32-uart" compatible strings are dedicated for STM32F4. To keep U-boot and kernel aligned, replace the serial compatible string from "st,stm32-usart", "st,stm32-uart" to "st,stm32f7-usart", "st,stm32f7-uart" specific for STM32F7. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Christophe KERELLO <christophe.kerello@st.com> Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com> Acked-by: Vikas MANOCHA <vikas.manocha@st.com>
* serial: stm32f7: disable overrunVikas Manocha2017-06-092-0/+5
| | | | | | | With overrun enabled, serial port console freezes & stops receiving data with overun error if we keep sending data. Signed-off-by: Vikas Manocha <vikas.manocha@st.com>