summaryrefslogtreecommitdiff
path: root/drivers/serial
AgeCommit message (Collapse)AuthorFilesLines
2018-03-19arm: stm32: add new architecture for STM32MP familyPatrick Delaunay1-3/+3
- add new arch stm32mp for STM32 MPU/Soc based on Cortex A - support for stm32mp157 SOC - SPL is used as first boot stage loader - using driver model for all the drivers, even in SPL - all security feature are deactivated (ETZC and TZC) - reused STM32 MCU drivers when it is possible Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-16Convert all of CONFIG_CONS_INDEX to KconfigTom Rini1-8/+40
This converts the following to Kconfig: CONFIG_CONS_INDEX We have existing entries for this option in a number of places, with different guards on them. They're also sometimes used for things not directly inside of the serial driver. First, introduce a new symbol to guard the use of CONFIG_CONS_INDEX, so that in the case where we don't need this for the serial driver, but for some other use, we can still do it. Next, consolidate all of these into the single entry in drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that we can imply a correct value here to make the defconfig side of this smaller. Signed-off-by: Adam Ford <aford173@gmail.com> [trini: Rework a lot of the logic here, such that I took authorship from Adam, but kept his S-o-B line] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-03-09bcm283x_pl011: Flush RX queue after setting baud rateAlexander Graf3-7/+35
After the UART was initialized, we may still have bogus data in the RX queue if it was enabled with incorrect pin muxing before. So let's flush the RX queue whenever we initialize baud rates. This fixes a regression with the dynamic pinmuxing code when enable_uart=1 is not set in config.txt on Raspberry Pis that use pl011 for serial. Fixes: caf2233b28 ("bcm283x: Add pinctrl driver") Reported-by: Göran Lundberg <goran@lundberg.email> Reported-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de> Tested-by: Peter Robinson <pbrobinson@gmail.com> Tested-by: Tuomas Tynkkynen <tuomas@tuxera.com>
2018-03-09serial_bcm283x_mu: Flush RX queue after setting baud rateAlexander Graf1-1/+7
After the UART was initialized, we may still have bogus data in the RX queue if it was enabled with incorrect pin muxing before. So let's flush the RX queue whenever we initialize baud rates. This fixes a regression with the dynamic pinmuxing code when enable_uart=1 is not set in config.txt. Fixes: caf2233b28 ("bcm283x: Add pinctrl driver") Reported-by: Göran Lundberg <goran@lundberg.email> Reported-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de> Tested-by: Peter Robinson <pbrobinson@gmail.com> Tested-by: Tuomas Tynkkynen <tuomas@tuxera.com>
2018-02-23ns16550: Fix mem mapped endian checkBernhard Messerklinger1-2/+2
Do a explicit check for CONFIG_SYS_BIG_ENDIAN and CONFIG_SYS_LITTLE_ENDIAN to avoid errors on platforms where both are undefined (x86). Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com> Reviewed-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
2018-02-16serial: Replace CONFIG_ with CONFIG_IS_ENABLEDMarek Vasut1-2/+2
Cosmetic change, replace CONFIG_* with CONFIG_IS_ENABLED(*) . Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2018-01-29serial: Make full device search optionalAlexander Graf2-0/+25
Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails") added code to search for more serial devices if the default one was not probed correctly. Unfortunately, that breaks omap3_evm. So while investigating why that is the case, let's disable the full search for everyone but bcm283x where it is needed. Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails") Reported-by: Derald D. Woods <woods.technical@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-28bcm2835_pl011_serial: Add BCM2835 specific serial driverAlexander Graf5-9/+100
On bcm2835 we need to ensure we only access serial devices that are muxed to the serial output pins of the pin header. To achieve this for the pl011 device, add a bcm2835 specific pl011 wrapper device that does this check but otherwise behaves like a pl011 device. Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-28bcm2835_mu_serial: Convert to KconfigAlexander Graf1-0/+7
Setting config options using headers is deprecated. This patch converts the BCM2835 Mini-UART to Kconfig. Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-28pl01x: Convert CONFIG_PL01X_SERIAL to KconfigAlexander Graf1-0/+6
We want to use Kconfig logic to depend on whether pl01x devices are built in, so let's convert their inclusion selection to Kconfig. This round goes to pl01x. Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-28pl011: Convert CONFIG_PL011_SERIAL to KconfigAlexander Graf1-0/+6
We want to use Kconfig logic to depend on whether pl01x devices are built in, so let's convert their inclusion selection to Kconfig. This round goes to pl011. Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-28pl010: Convert CONFIG_PL010_SERIAL to KconfigAlexander Graf1-0/+6
We want to use Kconfig logic to depend on whether pl01x devices are built in, so let's convert their inclusion selection to Kconfig. This round goes to pl010. Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-28pl01x: Convert to dev_readAlexander Graf1-5/+3
The fdtdec API is deprecated, convert the pl010 and pl011 devices to use the dev_read API instead. Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-28serial_bcm283x_mu: Fail loading if not muxedAlexander Graf1-0/+28
The bcm283x mini-uart is only really usable as U-Boot serial output when it is muxed to the UART pins of the RPi pin header. So fail probing in case it is not muxed correctly, as in that case firmware did not initialize it properly either. Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-28serial_bcm283x_mu: Always skip initAlexander Graf1-1/+6
The serial initialization doesn't always quite work for me, so let's always skip it for now. We know that firmware on the RPi initializes us properly already. Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-28serial_bcm283x_mu: Convert to dev_readAlexander Graf1-7/+3
The fdtdec API got deprecated in favor of dev_read calls. Use those instead. Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-28serial: bcm283x_mu: Remove support for post-init disablingAlexander Graf1-17/+1
We are switching to a model where a serial device doesn't even get probed when it's not muxed properly, so we don't need device specific disabling functionality anymore. Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-28serial: Use next serial device if probing failsAlexander Graf1-6/+19
Currently our serial device search chokes on the fact that the serial probe function could fail. If it does, instead of searching for the next usable serial device, it just quits. This patch changes the fallback logic so that even when a serial device was not probed correctly, we just try the next ones until we find one that works. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-01-28serial: ns16550: Fix style violationMario Six1-2/+2
Clarify the computation precedence in two ternary operator constructions. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-01-28Merge branch 'rmobile-mx' of git://git.denx.de/u-boot-shTom Rini2-11/+7
2018-01-26Merge git://git.denx.de/u-boot-spiTom Rini1-2/+2
2018-01-25serial: sh: Add support for R7S72100 (RZ/A1)Chris Brandt1-1/+2
Add support for RZ/A1 series SoCs. Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
2018-01-25serial: sh: Unify CONFIG_R8A779[01234] as CONFIG_RCAR_GEN2Marek Vasut1-9/+4
Use the common RCAR_GEN2 config option instead of enumerating each SoC and having a lengthy ifdef clause. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2018-01-25serial: sh: Replace fdtdec_get_addr() with devfdt_get_addr()Marek Vasut1-2/+2
Replace fdtdec_get_addr() with devfdt_get_addr() as the later one is the current recommended practice. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2018-01-24wait_bit: use wait_for_bit_le32 and remove wait_for_bitÁlvaro Fernández Rojas1-2/+2
wait_for_bit callers use the 32 bit LE version Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
2018-01-19serial: stm32: Rename serial_stm32x7.c to serial_stm32.cPatrice Chotard4-6/+6
Now this driver is used across stm32f4, stm32f7 and stm32h7 SoCs family, give it a generic name. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Vikas Manocha <vikas.manocha@st.com>
2018-01-15serial: lpuart: Proper device identificationSriram Dash1-11/+7
Identify and distinguish between platform device type of MX7ULP and LS1021A. This is a fix to commit 7edf5c45("serial: lpuart: add i.MX7ULP support"). Signed-off-by: Sriram Dash <sriram.dash@nxp.com> Acked-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
2018-01-10board: stm32f429-disco: switch to DM STM32 serial driverPatrice Chotard1-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>
2017-11-30serial: sh: Unify R8A7795 and R8A7796 as Gen3Marek Vasut1-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>
2017-11-28arm: zynq: Move ZYNQ_SERIAL to KconfigMichal Simek1-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>
2017-11-17serial: nulldev: Implement "pending" function to fix tstc return "true"Wilson Lee1-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>
2017-11-06stm32: fix STMicroelectronics copyrightPatrice Chotard2-4/+4
Uniformize STMicroelectronics copyrights headers for STM32 related code. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2017-11-06sti: fix STMicroelectronics copyrightPatrice Chotard1-3/+3
Uniformize all STMicroelectronics copyrights headers for STi related code. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2017-10-16usbtty: fix typosHeinrich Schuchardt1-1/+1
Fix typos in USB tty driver. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2017-10-11Merge branch 'rmobile' of git://git.denx.de/u-boot-shTom Rini1-3/+6
2017-10-08serial: stm32x7: remove useless CONFIG_CLK and OF_CONTROL flagPatrice Chotard1-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>
2017-10-08serial: stm32x7: add STM32F4 supportPatrice Chotard3-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>
2017-10-08serial: stm32x7: add fifo support for STM32H7Patrice Chotard2-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>
2017-10-08serial: stm32x7: prepare the ground to STM32F4 supportPatrice Chotard2-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>
2017-10-08serial: stm32x7: remove stm32f7-usart and stm32h7-usart compatiblePatrice Chotard1-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>
2017-10-08serial: stm32x7: cleanup codePatrice Chotard1-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>
2017-09-24serial: sh: Enable clock if availableMarek Vasut1-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>
2017-09-22serial: stm32x7: add STM32H7 supportPatrice Chotard2-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>
2017-09-13serial: nulldev: Add nulldev serial driverKeng Soon Cheah3-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>
2017-08-24serial: serial-uclass: Add generic serial RX buffer supportStefan Roese2-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>
2017-08-24Revert "serial: ns16550: Add RX interrupt buffer support"Stefan Roese2-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>
2017-08-16env: Rename getenv/_f() to env_get()Simon Glass1-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>
2017-08-02serial: sh: Use the clock framework to obtain clock configMarek Vasut1-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>
2017-08-02serial: sh: Convert to KconfigMarek Vasut1-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>
2017-07-31dm: console: Check for serial devices properlySimon Glass1-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>