summaryrefslogtreecommitdiffstats
path: root/drivers/serial
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* dm: core: Update lists_bind_fdt() to use ofnodeSimon Glass2017-06-011-1/+2
| | | | | | | Adjust this function to use an ofnode instead of an offset, so it can be used with livetree. This involves updating all callers. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Replace of_offset with accessor (part 2)Simon Glass2017-06-011-1/+1
| | | | | | | | | At present devices use a simple integer offset to record the device tree node associated with the device. In preparation for supporting a live device tree, which uses a node pointer instead, refactor existing code to access this field through an inline function. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Fix up inclusion of common.hSimon Glass2017-06-011-0/+1
| | | | | | | | | | | | | | It is good practice to include common.h as the first header. This ensures that required features like the DECLARE_GLOBAL_DATA_PTR macro, configuration options and common types are available. Fix up some files which currently don't do this. This is necessary because driver model will soon start using global data and configuration in the dm/read.h header file, included via dm.h. The gd->fdt_blob value will be used to access the device tree and CONFIG options will be used to determine whether to support inline functions in the header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Rename dev_addr..() functionsSimon Glass2017-06-0120-20/+20
| | | | | | | | | | | | | | | | | | | These support the flat device tree. We want to use the dev_read_..() prefix for functions that support both flat tree and live tree. So rename the existing functions to avoid confusion. In the end we will have: 1. dev_read_addr...() - works on devices, supports flat/live tree 2. devfdt_get_addr...() - current functions, flat tree only 3. of_get_address() etc. - new functions, live tree only All drivers will be written to use 1. That function will in turn call either 2 or 3 depending on whether the flat or live tree is in use. Note this involves changing some dead code - the imx_lpi2c.c file. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Use dm.h header when driver mode is usedSimon Glass2017-06-012-2/+2
| | | | | | | | This header includes things that are needed to make driver build. Adjust existing users to include that always, even if other dm/ includes are present Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: serial: bcm6345: fix baud rate clock calculationÁlvaro Fernández Rojas2017-05-311-4/+4
| | | | | | | It's currently bugged and doesn't work for even cases. Right shift bits instead of dividing and fix even cases. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* dm: serial: bcm6345: fix uart stop bitsÁlvaro Fernández Rojas2017-05-311-0/+2
| | | | | | | I missed this when I added support for BMIPS UART driver and it's needed to achieve a real 115200 8N1 setup. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* serial: sh: Add r8a7796 supportHiroyuki Yokoyama2017-05-221-1/+2
| | | | | | Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com> Cc: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* serial: serial-uclass: Use force parameter in stdio_deregister_dev()Stefan Roese2017-05-171-1/+1
| | | | | | | | | | | | | On my x86 platform I've noticed, that calling dm_uninit() or the new function dm_remove_devices_flags() does not remove the desired device at all. Debugging showed, that the serial uclass returns -EPERM in serial_pre_remove(). This patch sets the force parameter when calling stdio_deregister_dev() resulting in a removal of the device. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* TI: Drop 'CONFIG_OMAP'Tom Rini2017-05-151-7/+3
| | | | | | | | | In the two cases in the code where we use CONFIG_OMAP as a useful test currently we can make use of CONFIG_ARCH_OMAP2PLUS instead. With that changed we can drop all defines of CONFIG_OMAP. While in here, CONFIG_OMAP3430 is only defined and then never used, so drop. Signed-off-by: Tom Rini <trini@konsulko.com>
* serial: omap: Support debug UARTLokesh Vutla2017-05-112-11/+43
| | | | | | | | | | | Add debug UART functions to permit omap specific ns16550 to provide an early debug UART. This is mostly in common with DEBUG_UART_NS16550 except for Mode definition register which is required for selecting UART mode(16x auto-baud or 13x mode). Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* serial: add serial driver for BCM6345Álvaro Fernández Rojas2017-05-103-0/+315
| | | | | | | It is based on linux/drivers/tty/serial/bcm63xx_uart.c Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: atmel_usart: Add clk supportWenyou Yang2017-05-091-3/+49
| | | | | | | | | Add the clock support. Note that the clock handling of the DBGU peripheral is different from the USART. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: atmel_usart: Fix early debug not work in SPLWenyou Yang2017-05-091-5/+31
| | | | | | | | | Add the uart init function to be used on both probe and the early debug uart init. For the latter, the input clock should be from CONFIG_DEBUG_UART_CLOCK. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Merge git://git.denx.de/u-boot-sunxiTom Rini2017-04-251-0/+11
|\
| * sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8IIcenowy Zheng2017-04-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only A23/A33 in SUN8I want a default value of CONS_INDEX of 5, for other chips the default value is 1 like other Allwinner SoCs. Fix this default value. The original wrong value has lead to wrong console on H3 Orange Pi boards. Fixes: 7095f8641863 ("sunxi: Convert CONS_INDEX to Kconfig") Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
| * sunxi: Convert CONS_INDEX to KconfigMylène Josserand2017-04-201-0/+11
| | | | | | | | | | | | | | | | | | | | | | Convert the CONS_INDEX configuration to Kconfig. Update sunxi's defconfigs to remove SYS_EXTRA_OPTIONS variable not needed anymore. Default value is 1 except for sun5i (equals 2) and sun8i (equals 5). Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> [Maxime: Added a depends on ARCH_SUNXI to avoid build breakages] Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
* | usbtty: avoid potential NULL pointer dereferencexypron.glpk@gmx.de2017-04-181-6/+7
|/ | | | | | | | | If current_urb is NULL it should not be dereferenced. The problem was indicated by cppcheck. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
* Merge git://git.denx.de/u-boot-dmTom Rini2017-04-131-5/+8
|\ | | | | | | | | Here with some DM changes as well as the long-standing AT91 DM/DT conversion patches which I have picked up via dm.
| * serial: ns16550: Link in the DM driver when when using platdataAlexandru Gagniuc2017-04-131-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | Do not condition the compilation of the U_BOOT_DRIVER by !OF_PLATDATA. This is inconsistent with the majority of other drivers. This also blocks OF_PLATDATA boards with an 16550-compatible serial from using serial in SPL. Signed-off-by: Alexandru Gagniuc <alex.g@adaptrum.com> Reviewed-by: Simon Glass <sjg@chromium.org> Added tweak for rock to avoid a TPL build failure: Signed-off-by: Simon Glass <sjg@chromium.org>
* | Fix a bug with PL010s running at 19200 baudAlyssa Rosenzweig2017-04-131-1/+1
|/ | | | | | | I don't have the hardware test this, but it is almost certainly a typo in the code dating back to at least 2004. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
* serial: Add serial driver for Intel MIDAndy Shevchenko2017-04-103-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | Add a specific serial driver for Intel MID platforms. It has special fractional divider which can be programmed via UART_PS, UART_MUL, and UART_DIV registers. The UART clock is calculated as UART clock = XTAL * UART_MUL / UART_DIV The baudrate is calculated as baud rate = UART clock / UART_PS / DLAB Initialize fractional divider correctly for Intel Edison platform. For backward compatibility we have to set initial DLAB value to 16 and speed to 115200 baud, where initial frequency is 29491200Hz, and XTAL frequency is 38.4MHz. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
* dm: serial: Allow driver-model serial to be disabled for TPLSimon Glass2017-04-052-1/+21
| | | | | | | | Add separate enable/disable controls for driver-model serial. While this is generally enabled in SPL it may not be in TPL, since serial output can be obtained with the debug UART with minimal code size. Signed-off-by: Simon Glass <sjg@chromium.org>
* Blackfin: RemoveTom Rini2017-04-052-412/+0
| | | | | | | | | | | | | | | | | | | The architecture is currently unmaintained, remove. Cc: Benjamin Matthews <mben12@gmail.com> Cc: Chong Huang <chuang@ucrobotics.com> Cc: Dimitar Penev <dpn@switchfin.org> Cc: Haitao Zhang <hzhang@ucrobotics.com> Cc: I-SYST Micromodule <support@i-syst.com> Cc: M.Hasewinkel (MHA) <info@ssv-embedded.de> Cc: Marek Vasut <marex@denx.de> Cc: Martin Strubel <strubel@section5.ch> Cc: Peter Meerwald <devel@bct-electronic.com> Cc: Sonic Zhang <sonic.adi@gmail.com> Cc: Valentin Yakovenkov <yakovenkov@niistt.ru> Cc: Wojtek Skulski <info@skutek.com> Cc: Wojtek Skulski <skulski@pas.rochester.edu> Signed-off-by: Tom Rini <trini@konsulko.com>
* Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini2017-03-192-112/+225
|\ | | | | | | | | | | | | | | | | | | | | Signed-off-by: Tom Rini <trini@konsulko.com> Conflicts: configs/bk4r1_defconfig configs/colibri_vf_defconfig configs/pcm052_defconfig include/configs/colibri_vf.h include/configs/pcm052.h
| * dm: imx: serial: add i.MX6UL supportSébastien Szymanski2017-03-191-0/+1
| | | | | | | | Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
| * serial: lpuart: add i.MX7ULP supportPeng Fan2017-03-171-9/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add i.MX7ULP support. The buadrate calculation on i.MX7ULP is different,so add a new setbrg function for i.MX7ULP. Add a enum lpuart_devtype for runtime check for different platforms. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Cc: York Sun <york.sun@nxp.com> Cc: Shaohui Xie <Shaohui.Xie@nxp.com> Cc: Alison Wang <b18965@freescale.com>
| * serial: lpuart: restructure lpuart driverPeng Fan2017-03-171-125/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop CONFIG_LPUART_32B_REG. Move the register structure to a common file include/fsl_lpuart.h Define lpuart_serial_platdata structure which includes the reg base and flags. For 32Bit register access, use lpuart_read32/lpuart_write32 which handles big/little endian. For 8Bit register access, still use the orignal code. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by : Stefano Babic <sbabic@denx.de> Cc: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Cc: York Sun <york.sun@nxp.com> Cc: Shaohui Xie <Shaohui.Xie@nxp.com> Cc: Alison Wang <b18965@freescale.com>
* | Kconfig: Migrate CONFIG_BAUDRATEPhilipp Tomsich2017-03-191-0/+9
| | | | | | | | | | | | | | | | Move this in to Kconfig with a default of 115200. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> [trini: Run moveconfig.py, reword commit slightly] Signed-off-by: Tom Rini <trini@konsulko.com>
* | Merge git://git.denx.de/u-boot-rockchipTom Rini2017-03-171-1/+18
|\ \ | | | | | | | | | | | | | | | This includes support for rk3188 from Heiko Stübner and and rk3328 from Kever Yang. Also included is SPL support for rk3399 and a fix for rk3288 to get it booting again (spl_early_init()).
| * | rockchip: serial: Adapt rockchip of-platdata driver for rk3188Heiko Stübner2017-03-161-1/+18
| |/ | | | | | | | | | | | | | | | | Add necessary structs to have the driver also work for the serial on the rk3188. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Kever Yang <kever.yang@rock-chips.com>
* | stm32f7: serial: use clock driver to enable clockVikas Manocha2017-03-171-0/+18
| | | | | | | | | | Signed-off-by: Vikas Manocha <vikas.manocha@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>