summaryrefslogtreecommitdiff
path: root/drivers/serial
Commit message (Collapse)AuthorAgeLines
* dm: serial_pl01x: Add missing private data sizeSimon Glass2014-12-11-0/+1
| | | | | | | | | | | The private data size is missing from the driver, so we store it at 0, which causes problems when something overwrites memory at 0. Fix this. Change-Id: I6f551ee905b0064ae8343e41e46450c37c8c8c1a Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@wwwdotorg.org>
* Merge branch 'master' of git://git.denx.de/u-boot-tiTom Rini2014-12-08-4/+5
|\
| * ns16550.c: Fix for ns16550 driver hanging on OMAP4Gregoire Gentil2014-12-04-4/+5
| | | | | | | | | | | | | | | | The same problem that is seen on some OMAP3 is also seen on some OMAP4 so include them in the test in order to prevent some hangs during SPL. [trini: Re-word commit message, make apply cleanly] Signed-off-by: Tom Rini <trini@ti.com>
* | serial: pl01x: avoid pl01x type check two timesVikas Manocha2014-12-08-9/+6
| | | | | | | | | | Signed-off-by: Vikas Manocha <vikas.manocha@st.com> Acked-by: Simon Glass <sjg@chromium.org>
* | serial: pl01x: disable as per type of pl01xVikas Manocha2014-12-08-3/+4
| | | | | | | | | | | | | | | | pl010 & pl011 have different control register offsets, setting it as per the pl01x type. Signed-off-by: Vikas Manocha <vikas.manocha@st.com> Acked-by: Simon Glass <sjg@chromium.org>
* | serial: pl01x: move all line control at same placeVikas Manocha2014-12-08-23/+21
| | | | | | | | | | | | | | | | Receive line control uses same setting as transmit line control, also one lcrh write is effective for both baud rate & receive line control internal update. Signed-off-by: Vikas Manocha <vikas.manocha@st.com> Acked-by: Simon Glass <sjg@chromium.org>
* | serial: pl01x: fix pl011 baud rate configurationVikas Manocha2014-12-08-0/+8
| | | | | | | | | | | | | | | | | | | | UART_IBRD, UART_FBRD, and UART_LCR_H form a single 30-bit wide register which is updated on a single write strobe generated by a UART_LCR_H write. So, to internally update the content of UART_IBRD or UART_FBRD, a write to UART_LCR_H must always be performed at the end. Signed-off-by: Vikas Manocha <vikas.manocha@st.com> Acked-by: Simon Glass <sjg@chromium.org>
* | serial: pl01x: pass pl01x_type to set baudrateVikas Manocha2014-12-08-1/+1
|/ | | | | | | | Although we were checking the pl01x type, seems like PL010 type was being passed by mistake. Signed-off-by: Vikas Manocha <vikas.manocha@st.com> Acked-by: Simon Glass <sjg@chromium.org>
* Merge git://git.denx.de/u-boot-fdtTom Rini2014-12-01-1/+1
|\
| * fdt: remove fdtdec_get_alias_node() functionMasahiro Yamada2014-11-27-1/+1
| | | | | | | | | | | | | | | | | | | | The fdt_path_offset() checks an alias too. fdtdec_get_alias_node(blob, "foo") is equivalent to fdt_path_offset(blob, "foo"). Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* | serial: UniPhier: support OF configurationMasahiro Yamada2014-11-28-8/+11
|/ | | | | | | This commit implements the ofdata_to_platdata handler for the UniPhier serial driver and adds serial device nodes to the device tree sources. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* Merge git://git.denx.de/u-boot-dmTom Rini2014-11-24-12/+197
|\ | | | | | | | | | | | | Conflicts: drivers/serial/serial-uclass.c Signed-off-by: Tom Rini <trini@ti.com>
| * dm: tegra: Add platform data for the SPL uartSimon Glass2014-11-21-0/+16
| | | | | | | | | | | | | | Since we currently don't have device tree available in SPL, add platform data so the uart works. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: Allow stdio registration to be droppedSimon Glass2014-11-21-3/+7
| | | | | | | | | | | | | | | | | | Provide a CONFIG_DM_STDIO option to enable registering a serial device with the stdio library. This is seldom useful in SPL, so disable it by default when building for SPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
| * dm: serial: Support changing the baud rateSimon Glass2014-11-21-0/+67
| | | | | | | | | | | | | | Implement this feature in the uclass so that the baudrate can be changed with 'setenv baudrate <rate>'. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: at91: Add driver model support for the serial driverSimon Glass2014-11-21-0/+84
| | | | | | | | | | | | | | | | Add driver model support while retaining the existing legacy code. This allows the driver to support boards that have converted to driver model as well as those that have not. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: at91: Refactor serial driver slightly for driver modelSimon Glass2014-11-21-9/+23
| | | | | | | | | | | | | | | | Before adding driver model support, split out a few of the functions so that they can be used by the driver model code. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
* | Merge git://git.denx.de/u-boot-x86Tom Rini2014-11-24-16/+19
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: arch/x86/cpu/Makefile Signed-off-by: Tom Rini <trini@ti.com>
| * | dm: serial: Move current serial port pointer to global_dataSimon Glass2014-11-21-16/+19
| |/ | | | | | | | | | | | | | | | | | | | | In general we can't store things in the data section until we have inited SDRAM. Some platforms allow this (e.g. those with SPL) but some don't. Move the pointer to global_data so that it will work on all platforms. Without this fix the serial port will not work prior to relocation with driver model on some platforms. Signed-off-by: Simon Glass <sjg@chromium.org>
* | linux/kernel.h: sync min, max, min3, max3 macros with LinuxMasahiro Yamada2014-11-23-1/+1
|/ | | | | | | | | | | | | | | | | | | | U-Boot has never cared about the type when we get max/min of two values, but Linux Kernel does. This commit gets min, max, min3, max3 macros synced with the kernel introducing type checks. Many of references of those macros must be fixed to suppress warnings. We have two options: - Use min, max, min3, max3 only when the arguments have the same type (or add casts to the arguments) - Use min_t/max_t instead with the appropriate type for the first argument Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Pavel Machek <pavel@denx.de> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Lukasz Majewski <l.majewski@samsung.com> [trini: Fixup arch/blackfin/lib/string.c] Signed-off-by: Tom Rini <trini@ti.com>
* Merge branch 'master' of git://git.denx.de/u-boot-shTom Rini2014-11-17-1/+1
|\
| * sh: move CONFIG_{SH2, SH2A, SH3, SH4} to KconfigMasahiro Yamada2014-11-13-1/+1
| | | | | | | | | | | | | | | | | | | | | | This commit moves CONFIG_SH2, CONFIG_SH2A, CONFIG_SH3, CONFIG_SH4 to Kconfig renaming into CONFIG_CPU_SH2, CONFIG_CPU_SH2A, CONFIG_CPU_SH3, CONFIG_CPU_SH4, respectively because arch/sh/Kconfig of Linux uses CONFIG_CPU_SH* convention. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* | serial: UniPhier: borrow macros from linux/serial_reg.hMasahiro Yamada2014-11-12-13/+2
|/ | | | | | | | | The same bit-field macros are defined in include/linux/serial_reg.h so let's include it and delete duplicated defines. Also, remove unnecessary inclusion of <common.h>. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* Merge git://www.denx.de/git/u-boot-sunxiTom Rini2014-11-05-0/+40
|\
| * dm: sunxi: Add support for serial using driver modelSimon Glass2014-11-05-0/+40
| | | | | | | | | | | | | | | | | | | | Add a driver for the designware serial UART used on sunxi. This just redirects to the normal ns16550 driver. Add a stdout-path to the device tree so that the correct UART is chosen. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* | Merge git://git.denx.de/u-boot-shTom Rini2014-11-04-4/+6
|\ \ | |/ |/|
| * serial: sh: r8a7794: Add support external clockNobuhiro Iwamatsu2014-11-04-2/+2
| | | | | | | | | | | | | | | | The baud rate setting of external clock is enabled. Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * serial: sh: Add support R8A7793Nobuhiro Iwamatsu2014-11-04-4/+6
| | | | | | | | | | | | | | This adds the preset value to register for R8A7793. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* | serial: add prototypes for init functionsJeroen Hofstee2014-11-04-70/+70
| | | | | | | | | | | | | | | | While at it, sort them. Cc: Tom Rini <trini@ti.com> Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* | serial: UniPhier: add static to locally used functionsMasahiro Yamada2014-10-29-3/+3
| | | | | | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* | serial: UniPhier: add .pending handlerMasahiro Yamada2014-10-29-0/+11
|/ | | | | | Without .pending handler, tstc() function always returns 1. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* Merge git://git.denx.de/u-boot-dmTom Rini2014-10-26-200/+251
|\ | | | | | | | | | | | | | | | | Fix a trivial conflict over adding <dm.h> Conflicts: arch/arm/cpu/armv7/omap3/board.c Signed-off-by: Tom Rini <trini@ti.com>
| * serial: remove uniphier_serial_initialize() callMasahiro Yamada2014-10-23-2/+0
| | | | | | | | | | | | | | | | | | The UniPhier serial driver has been converted to driver model. Let's remove uniphier_serial_initialize() call from the old serial driver framework. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
| * serial: uniphier: move CONFIG_UNIPHIER_SERIAL to KconfigMasahiro Yamada2014-10-23-0/+6
| | | | | | | | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
| * dm: serial: use Driver Model for UniPhier serial driverMasahiro Yamada2014-10-23-126/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit converts UniPhier on-chip serial driver to driver model. Since UniPhier SoCs do not have Device Tree support, some board files should be added under arch/arm/cpu/armv7/uniphier/ph1-*/ directories. (Device Tree support for UniPhier platform is still under way.) Now the base address and master clock frequency are passed from platform data, so CONFIG_SYS_UNIPHIER_SERIAL_BASE* and CONFIG_SYS_UNIPHIER_UART_CLK should be removed. Tested on UniPhier PH1-LD4 ref board. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
| * dm: add entries to KconfigMasahiro Yamada2014-10-23-0/+6
| | | | | | | | | | | | | | | | Create entries of CONFIG_DM, CONFIG_DM_SERIAL, CONFIG_DM_GPIO and CONFIG_DM_SPI. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
| * dm: serial: consolidate common code moreMasahiro Yamada2014-10-23-38/+41
| | | | | | | | | | | | | | | | | | | | | | Commit b8893327e9d2 (dm: serial: Put common code into separate functions) consolidated getc() and putc(). This commit does more puts() and tsts(). Also rename locally used functions to _serial_*() for clarification because we have similar functions names here are there in this file. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
| * dm: serial: remove unnecessary castingMasahiro Yamada2014-10-23-6/+2
| | | | | | | | | | | | | | | | The type (void *) can be directly passed to a function that takes a specific pointer type. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
| * dm: serial: fix console putcMasahiro Yamada2014-10-23-3/+3
| | | | | | | | | | | | | | | | | | | | Commit b8893327e9d2 (dm: serial: Put common code into separate functions) consolidated getc() correctly, but introduced another bug to putc(); serial_stub_putc() passes sdev->priv to serial_putc_dev(), but serial_putc_dev() uses cur_dev instead of the given argument. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
| * serial: add static directive to local functionsMasahiro Yamada2014-10-23-19/+12
| | | | | | | | | | | | | | | | | | | | | | | | The functions _serial_putc, _serial_putc_raw, _serial_puts, _serial_getc, _serial_tstc, _serial_setbrg are defined and used locally in each of serial_ns16550.c and serial_s3c24x0.c. Add static directive to them and remove declarations from include/common.h. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
| * dm: move platform data headers to include/dm/platform_dataMasahiro Yamada2014-10-23-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The platform_data definitions are generally referenced from both drivers and board files. That is why header files defining platform_data sturectures are placed in "include" directory, but our top level "include" directory is already too cluttered. Let's collect platform_data definitions under the directory "include/dm/platform_data" like Linux gathers ones around under "include/linux/platform_data". This commit moves two header files: include/serial_mxc.h -> include/dm/platform_data/serial_mxc.h include/serial_pl01x.h -> include/dm/platform_data/serial_pl01x.h Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
| * dm: x86: Convert coreboot serial to use driver modelSimon Glass2014-10-23-0/+39
| | | | | | | | | | | | | | This makes use of the existing device tree node to use driver model for the serial console. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: serial: ns16550: Add a cast to the I/O operationsSimon Glass2014-10-23-2/+2
| | | | | | | | | | | | | | This generates a warning when driver model is enabled, so fix it by adding a cast. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: omap: serial: Add driver model supportSimon Glass2014-10-23-0/+48
| | | | | | | | | | | | | | | | | | Add driver model support to this driver, while retaining support for the legacy system. Driver model serial support is enabled with CONFIG_DM_SERIAL as usual. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
| * dm: serial: Support CONFIG_CONS_INDEX if availableSimon Glass2014-10-23-1/+10
| | | | | | | | | | | | | | | | Try to use this option to select the correct uart for the console. This mimics the behaviour of drivers/serial.c. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
| * dm: ns16550: Correct the probe logic for platform dataSimon Glass2014-10-23-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | The probe logic sets up the pointer to the platform data in the device tree decode method. It should be done in the probe() method, and anyway the device tree decode method can't be used when CONFIG_OF_CONTROL is not enabled. Fix these two problems. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
| * dm: ns16550: Use an address instead of a pointer for the uart baseSimon Glass2014-10-23-3/+3
| | | | | | | | | | | | | | | | | | | | | | It is inconvenient to have to use casts when specifying platform data. Also it is not strictly correct, since we should use map_sysmem() to convert an address to a pointer. Adjust the platform data to use an address. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
| * dm: serial: ns16550: Correct logic for checking for characterSimon Glass2014-10-23-1/+1
| | | | | | | | | | | | | | | | | | There is a bug in the logic which checks for an available character. This can cause invalid characters to be received - this was noticed on beaglebone. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
| * dm: serial: Reset the watchdog while waiting in getc()Simon Glass2014-10-23-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | We have moved the busy-wait loop out of drivers and into the uclass. This means that we must reset the watchdog when busy-waiting. Note: some drivers may still have a busy-wait even with driver model, as a transition mechanism. Driver model will tolerate this, and is can be cleaned up when all users of the driver use driver model. An example is ns16550. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* | serial: make local functions staticJeroen Hofstee2014-10-25-6/+6
|/ | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>