summaryrefslogtreecommitdiffstats
path: root/drivers/serial
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' of git://git.denx.de/u-boot-shTom Rini2014-11-171-1/+1
|\
| * sh: move CONFIG_{SH2, SH2A, SH3, SH4} to KconfigMasahiro Yamada2014-11-131-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-121-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-052-0/+40
|\
| * dm: sunxi: Add support for serial using driver modelSimon Glass2014-11-052-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-041-4/+6
|\ \ | |/ |/|
| * serial: sh: r8a7794: Add support external clockNobuhiro Iwamatsu2014-11-041-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-041-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-041-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-291-3/+3
| | | | | | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* | serial: UniPhier: add .pending handlerMasahiro Yamada2014-10-291-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-2612-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-231-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-231-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-231-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-231-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-231-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-231-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-231-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-232-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-232-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-232-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-231-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-232-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-231-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-231-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-231-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-231-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-231-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-252-6/+6
|/ | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* dm: serial: Support driver model in pl01x driverSimon Glass2014-10-221-0/+73
| | | | | | | | Add driver model support in this driver, using platform data provided by the board. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@wwwdotorg.org>
* dm: serial: Tidy up the pl01x driverSimon Glass2014-10-223-140/+165
| | | | | | | | | | | | | | | | | | | Adjust the driver so that leaf functions take a pointer to the serial port register base. Put all the global configuration in the init function, and use the same settings from then on. This makes it much easier to move to driver model without duplicating the code, since with driver model we use platform data rather than global settings. The driver is compiled with either the CONFIG_PL010_SERIAL or CONFIG_PL011_SERIAL option and this determines the uart type. With driver model this needs to come in from platform data, so create a new CONFIG_PL01X_SERIAL config which brings in the driver, and adjust the driver to support both peripheral variants. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@wwwdotorg.org>
* dm: imx: serial: Support driver model in the MXC serial driverSimon Glass2014-10-221-25/+145
| | | | | | | Add driver model support with this driver. Boards which use this driver should define platform data in their board files. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: serial: Put common code into separate functionsSimon Glass2014-10-221-15/+17
| | | | | | | Avoid duplicating the code which deals with getc() and putc(). It is fairly simple, but may expand later. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: exynos: Move serial to driver modelSimon Glass2014-10-221-183/+72
| | | | | | | Change the Exynos serial driver to work with driver model and switch over all relevant boards to use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* serial-uclass: Fix compilation errorHans de Goede2014-10-101-1/+1
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2014-10-073-0/+207
|\
| * serial: add UniPhier serial driverMasahiro Yamada2014-10-053-0/+207
| | | | | | | | | | | | The driver for on-chip UART used on Panasonic UniPhier platform. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* | stdio: Add force parameter to stdio_deregisterHans de Goede2014-10-061-1/+1
|/ | | | | | | In some cases we really want to move forward with a deregister, add a force parameter to allow this, and replace the dev with a nulldev in this case. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* cosmetic: replace MIN, MAX with min, maxMasahiro Yamada2014-09-241-2/+2
| | | | | | | The macro MIN, MAX is defined as the aliase of min, max, respectively. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* kconfig: add blank Kconfig filesMasahiro Yamada2014-09-241-0/+0
| | | | | | | | This would be useful to start moving various config options. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* dm: serial: Don't require device tree to configure a consoleSimon Glass2014-09-231-1/+2
| | | | | | Allow serial_find_console_or_panic() to work without a device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2014-09-171-6/+13
|\
| * arm: vf610: lpuart: disable FIFO on initializatonStefan Agner2014-09-091-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | UART does not use the UART FIFO, but we should also not rely that the UART FIFO is diabled by default. For instance, when loading U-Boot using the boot ROMs serial downloader protocol over UART, FIFO is enabled at U-Boot start time. This patch disables the RX and TX FIFO, sets back their thresholds and flushes them. Signed-off-by: Stefan Agner <stefan@agner.ch>
| * arm: vf610: lpuart: fix status register handlingStefan Agner2014-09-091-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The status register 1 (S1) is not writeable, hence we should not write it. In order to clear the RDRF flag we only need to read the data register. Also, when stressing U-Boot a lot with serial input, an overflow can occur which asserts the S1_OR flag (while not asserting the S1_RDRF flag). To clear this flag we again just need to read the data register, hence add this flag to the abort conditions for the while loop. Insert a compiler barrier to make sure reading the data register gets executed after reading the status register. Signed-off-by: Stefan Agner <stefan@agner.ch>
* | dm: tegra: Enable driver model for serialSimon Glass2014-09-102-0/+39
| | | | | | | | | | | | | | | | | | Use driver model for serial ports. Since Tegra now uses driver model for serial, adjust the definition of V_NS16550_CLK so that it is clear that this is only used for SPL. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: serial: Add driver model support for ns16550Simon Glass2014-09-102-3/+155
| | | | | | | | | | | | | | | | | | | | Add driver model support so that ns16550 can support operation both with and without driver model. The driver needs a clock frequency so cannot stand alone unfortunately. The clock frequency must be provided by a separate driver. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: serial: Collect common baud rate code in ns16550Simon Glass2014-09-101-20/+13
| | | | | | | | | | | | | | The same sequence is used in several places, so move it into a function. Note that UART_LCR_BKSE is an alias for UART_LCR_DLAB. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: serial: Move baud rate calculation to ns16550.cSimon Glass2014-09-102-11/+21
| | | | | | | | | | | | | | Move the function that calculates the baud rate divisor into ns16550.c so it can be used by that file. Signed-off-by: Simon Glass <sjg@chromium.org>
* | sandbox: serial: Support a coloured consoleSimon Glass2014-09-101-0/+83
| | | | | | | | | | | | | | | | | | | | The current sandbox serial driver is a pretty trivial example and does not have the featues that might be needed for other board serial drivers. To help provide a better example, add a text colour property to the device tree for sandbox. This uses platform data, a device tree node, driver private data and a remove() method. Signed-off-by: Simon Glass <sjg@chromium.org>
OpenPOWER on IntegriCloud