summaryrefslogtreecommitdiffstats
path: root/drivers/serial/ns16550.c
Commit message (Collapse)AuthorAgeFilesLines
* serial: ns16550: Remove hard-coded baud_divisor settingAxel Lin2015-04-281-1/+0
| | | | | | | | | This was accidentally added by commit dd0b0122bacc "serial: ns16550: Add an option to specify the debug UART register shift". Remove it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Simon Glass <sjg@chromium.org>
* serial: ns16550: Remove unnecessary init on UART setupSimon Glass2015-04-221-1/+0
| | | | | | | It is not necessary to write a zero baud rate to the device, and for some chips this will cause problems. Drop this code. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: ns16550: Support non-byte register spacing with driver modelSimon Glass2015-04-221-4/+6
| | | | | | | Allow this driver to support boards where the register shift is not 0. This fixes some compiler warnings which appear in that case. Signed-off-by: Simon Glass <sjg@chromium.org>
* serial: ns16550: Add an option to specify the debug UART register shiftSimon Glass2015-04-221-10/+15
| | | | | | | | This UART permits different register spacing. To support the debug UART on devices which have a spacing other than 1 byte, allow the shift value to be specified. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Make sure arch-specific map_sysmem() is definedJoe Hershberger2015-04-181-0/+1
| | | | | | | | | | | In the case where the arch defines a custom map_sysmem(), make sure that including just mapmem.h is sufficient to have these functions as they are when the arch does not override it. Also split the non-arch specific functions out of common.h Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: ns16550: Fix build error due to a typoAxel Lin2015-03-021-1/+1
| | | | | | | Fix trivial typo. Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Axel Lin <axel.lin@ingics.com>
* serial: ns16550: Support debug UARTSimon Glass2015-02-191-2/+48
| | | | | | | | Add debug UART functions to permit ns16550 to provide an early debug UART. Try to avoid using the stack so that this can be called from assembler before a stack is set up (at least on ARM and PowerPC). Signed-off-by: Simon Glass <sjg@chromium.org>
* serial: ns16550: Add access functions that don't need platdataSimon Glass2015-02-191-18/+30
| | | | | | | | For the debug UART we need to be able to provide any parameters before driver model is set up. Add parameters to the low-level access functions to make this possible. Signed-off-by: Simon Glass <sjg@chromium.org>
* serial: ns16550: Support ns16550 compatible pci uart devicesBin Meng2015-01-131-0/+31
| | | | | | | | | | | | | | There are many pci uart devices which are ns16550 compatible. We can describe them in the board dts file and use it as the U-Boot serial console as specified in the chosen node 'stdout-path' property. Those pci uart devices can have their register be memory-mapped, or i/o-mapped. The driver will try to use the memory-mapped register if the reg property in the node has an entry to describe the memory-mapped register, otherwise i/o-mapped register will be used. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
* ns16550.c: Fix for ns16550 driver hanging on OMAP4Gregoire Gentil2014-12-041-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>
* 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: 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: Add driver model support for ns16550Simon Glass2014-09-101-2/+154
| | | | | | | | | | 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-101-1/+17
| | | | | | | 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>
* omap: clean-up dead configsMasahiro Yamada2014-08-091-1/+1
| | | | | | | | | | | | | | The following configs are not defined at all. - CONFIG_OMAP1510 - CONFIG_OMAP_1510P1 - CONFIG_OMAP_SX1 - CONFIG_OMAP3_DMA - CONFIG_OMAP3_ZOOM2 - CONFIG_OMAP_INNOVATOR Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Tom Rini <trini@ti.com>
* keystone2: use CONFIG_SOC_KEYSTONE in common placesKhoronzhuk, Ivan2014-07-251-2/+2
| | | | | | | | Use CONFIG_SOC_KEYSTONE in common places instead of defining a lot of "if def .. || if def " for different Keystone2 SoC types. Acked-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
* serial: nsl16550: add hw flow control supportKaricheri, Muralidharan2014-05-121-0/+6
| | | | | | | | keystone serial hw support hw flow control. This patch enables hw flow control for keystone EVMs as an optional feature based on CONFIG_SERIAL_HW_FLOW_CONTROL. Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
* k2hk: add support for k2hk SOC and EVMVitaly Andrianov2014-04-171-0/+8
| | | | | | | | | | | | | | k2hk EVM is based on Texas Instruments Keystone2 Hawking/Kepler SoC. Keystone2 SoC has ARM v7 Cortex-A15 MPCore processor. Please refer the ti/k2hk_evm/README for details on the board, build and other information. This patch add support for keystone architecture and k2hk evm. Signed-off-by: Vitaly Andrianov <vitalya@ti.com> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: WingMan Kwok <w-kwok2@ti.com> Signed-off-by: Sandeep Nair <sandeep_n@ti.com>
* TI:omap3: Drop omap3_zoom2Tom Rini2014-01-071-3/+2
| | | | | | | The omap3_zoom2 board has not been updated for a correct CONFIG_SYS_HZ and Tom Rix's email has long been bouncing. Signed-off-by: Tom Rini <trini@ti.com>
* Prepare for TI816X : reuse existing code from TI814XTENART Antoine2013-08-151-2/+2
| | | | | | | | Rename some CONFIG_TI814X to a more generic CONFIG_TI81XX Signed-off-by: Antoine Tenart <atenart@adeneo-embedded.com> [trini: Adapt for CONFIG_OMAP_COMMON changes, AM43XX] Signed-off-by: Tom Rini <trini@ti.com>
* ARM: AM43xx: Add build supportLokesh Vutla2013-08-151-2/+3
| | | | | | Add AM43xx support in the required places Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
* arm: Remove OMAP2420H4 and all omap24xx supportTom Rini2013-06-101-5/+0
| | | | | | | | | The omap2420H4 was the only mainline omap24xx board. Prior to being fixed by Jon Hunter in time for v2013.04 it had been functionally broken for a very long time. Remove this board as there's not been interest in it in U-Boot for quite a long time. Signed-off-by: Tom Rini <trini@ti.com>
* omap3_beagle: Flush UART3 xmit on enable if TEMT is brokenManfred Huber2013-04-081-2/+16
| | | | | | | | | | | | Flush UART3 xmit on enable if TEMT is broken On some OMAP3 devices when UART3 is configured for boot mode before SPL starts only THRE bit is set. We have to empty the transmitter before initialization starts. This patch avoids the use of CONFIG_SYS_NS16550_BROKEN_TEMT. Signed-off-by: Manfred Huber <man.huber@arcor.de> Tested-by: Javier Martinez Canillas <javier@dowhile0.org> Tested-by: Andreas Bießmann <andreas.devel@googlemail.com>
* ns16550: enable quirks for ti814xMatt Porter2013-03-241-2/+3
| | | | | | | TI814X requires the same quirks as AM33XX to be enabled. Signed-off-by: Matt Porter <mporter@ti.com> Reviewed-by: Tom Rini <trini@ti.com>
* serial: ns16550: Remove unwanted castSimon Glass2013-03-151-1/+1
| | | | | | | | | | | This cast does not seem correct, since we should be writing to a pointer, not a ulong. This fixes the following warning on nds32: -ns16550.c:49: warning: passing argument 2 of 'writeb' makes pointer from integer without a cast Signed-off-by: Simon Glass <sjg@chromium.org>
* serial/ns16550: add an option to avoid hanging on broken platformsJavier Martinez Canillas2013-01-101-0/+2
| | | | | | | | | | | | | | | | | | Some platforms (e.g. IGEPv2 board) has a broken ns16550 UART that does not set the TEMT bit when the transmitter is empty in SPL. This makes U-Boot to hang while waiting for TEMT to be set. Add a new option to avoid this: CONFIG_SYS_NS16550_BROKEN_TEMT 16550 UART set the Transmitter Empty (TEMT) Bit when all output has finished and the transmitter is totally empty. U-Boot waits for this bit to be set to initialize the serial console. On some broken platforms this bit is not set in SPL making U-Boot to hang while waiting for TEMT. Define this option to avoid it. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
* serial/ns16550: wait for TEMT before initializingScott Wood2012-11-261-0/+3
| | | | | | | | | | | | | TEMT is set when the transmitter is totally empty and all output has finished. This prevents output problems (including a loss of synchronization observed on p2020 that persisted for quite a while) if SPL has output still on its way out. Signed-off-by: Scott Wood <scottwood@freescale.com> -- v2: fixed typo in subject, and explained what the bit does in the changelog
* serial: ns16550: Call usbtty_poll only in non-SPL buildMarek Vasut2012-10-151-1/+1
| | | | | | | | | | | Having both USBTTY and CONFIG_SERIAL_MULTI enabled in SPL, the usbtty.c file is protected in Makefile to not be compiled into the SPL. Yet, the ns16550 serial driver does not contain such protection. Add it to avoid missing symbol error. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Tom Rini <trini@ti.com>
* serial/ns16550: ns16550 has a different register layout on SOC_DA8XXMikhail Kshevetskiy2012-09-011-1/+1
| | | | | | | | | | also fix NS16550_init() as we need 16x divider Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@gmail.com> Acked-by: Christian Riesch <christian.riesch@omicron.at> Tested-by: Christian Riesch <christian.riesch@omicron.at> Acked-by: Sughosh Ganu <urwithsughosh@gmail.com> Tested-by: Sughosh Ganu <urwithsughosh@gmail.com>
* ARM:AM33XX: Add support for TI AM335X EVMChandan Nath2011-10-271-2/+5
| | | | | | | | | This patch adds basic support for booting the board. This patch adds support for the UART necessary to get to the u-boot prompt. Signed-off-by: Chandan Nath <chandan.nath@ti.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* NS16550: trivial code clean for checkpatchSimon Glass2011-10-231-17/+20
| | | | | | | This removes most checkpatch warnings from the ns16550 driver and its header. Signed-off-by: Simon Glass <sjg@chromium.org>
* ns16550: change to allow 32 bit access to registersDave Aldridge2011-10-011-0/+6
| | | | | | | | | | If CONFIG_SYS_NS16550_MEM32 is defined then 32 bit memory mapped access will be used to read/write the uart registers. This is especially useful for SoC devices that implement 16550 compatible uarts but that have peripheral access width constraints. Signed-off-by: Dave Aldridge <fovsoft@gmail.com>
* Serial: ns16550: Add support for CONFIG_SYS_NS16550_IER macroPrafulla Wadaskar2010-12-161-2/+6
| | | | | | | | | | On some processors this ier register configuration is different for ex. Marvell Armada100 This patch introduce CONFIG_SYS_NS16550_IER macro support to unconditionally initialize this register. Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
* ns16550: Add WATCHDOG_RESET to putc for short watchdog timeout boardsStefan Roese2010-10-131-0/+9
| | | | | | | | | | | | | | | | | | | | Call watchdog_reset() upon newline. This is done here in putc since the environment code uses a single puts() to print the complete envrironment upon "printenv". So we can't put this watchdog call in puts(). This is needed for boards with a very short watchdog timeout, like the lwmon5 with a 100ms timeout. Without this patch this board resets in the commands with long outputs, like "printenv" or "fdt print". Note that the image size is not increased with this patch when CONFIG_HW_WATCHDOG or CONFIG_WATCHDOG are not defined since the compiler optimizes this additional code away. Signed-off-by: Stefan Roese <sr@denx.de> Fix typo in comment. Signed-off-by: Wolfgang Denk <wd@denx.de>
* SERIAL: Enable port-mapped accessGraeme Russ2010-05-061-30/+39
| | | | | | | | | The x86 architecture exclusively uses Port-Mapped I/O (inb/outb) to access the 16550 UARTs. This patch mimics how Linux selects between Memory-Mapped and Port-Mapped I/O. This allows x86 boards to use CONFIG_SERIAL_MUTLI and drop the custom serial port driver Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* Move arch/ppc to arch/powerpcStefan Roese2010-04-211-1/+1
| | | | | | | | | | | | | | | | | As discussed on the list, move "arch/ppc" to "arch/powerpc" to better match the Linux directory structure. Please note that this patch also changes the "ppc" target in MAKEALL to "powerpc" to match this new infrastructure. But "ppc" is kept as an alias for now, to not break compatibility with scripts using this name. Signed-off-by: Stefan Roese <sr@denx.de> Acked-by: Wolfgang Denk <wd@denx.de> Acked-by: Detlev Zundel <dzu@denx.de> Acked-by: Kim Phillips <kim.phillips@freescale.com> Cc: Peter Tyser <ptyser@xes-inc.com> Cc: Anatolij Gustschin <agust@denx.de>
* ns16550: kick watchdog while waiting for a characterLadislav Michl2010-02-031-0/+2
| | | | | | | | ns16550 busyloops waiting for incoming byte causing watchdog to reboot while waiting for a key press. A call to WATCHDOG_RESET in NS16550_getc loop fixes it. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
* ZOOM2 Add serial support.Tom Rix2009-06-121-2/+2
| | | | | | | | | | | | | | | | | | Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board. The default serial is from the USB connector on left side of the debug board. The USB connector will produce 2 of the 4 UARTS. On your host pick the first enumeration. The details of the setting of the serial gpmc setup are not available. The values were provided by another party. The serial port set up is the same with Zoom1. Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow. The kernel bootargs are console=ttyS3,115200n8 Signed-off-by: Tom Rix <Tom.Rix@windriver.com>
* Rename common ns16550 constants with UART_ prefix to prevent conflictsDetlev Zundel2009-04-031-18/+21
| | | | | | | | | | | | Fix problems introduced in commit 7b5611cdd12ca0cc33f994f0d4a4454788fc3124 [inka4x0: Add hardware diagnosis functions for inka4x0] which redefined MSR_RI which is already used on PowerPC systems. Also eliminate redundant definitions in ps2mult.h. More cleanup will be needed for other redundant occurrences though. Signed-off-by: Detlev Zundel <dzu@denx.de>
* drivers/serial/ns16550: move ifdef into Makefile COBJS-$(...)Mike Frysinger2009-02-211-5/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Create configuration option for restricted ns16550 functionsRon Madrid2009-02-191-0/+4
| | | | | | | | | | | This patch will create a configuration option for a minimum configuration for the ns16550 serial driver at drivers/serial/ns16550.c and will apply this new configuration option to the SIMPC8313.h config file in order to fix the NAND bootstrap build error. This option will exclude all functions with exception of NS16550_putc and NS16550_init. This will be used primarily to save space and remove unused code from builds in which space is limited. Signed-off-by: Ron Madrid <ron_madrid@sbcglobal.net>
* rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD2008-10-181-2/+2
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* OMAP5912: fix FIFO handling in UART driverWolfgang Denk2008-02-051-4/+12
| | | | | | | | | | | | According to the OMAP5912 Serial Interfaces Reference Guide (see http://focus.ti.com/lit/ug/spru760c/spru760c.pdf, page 150), the FIFO_EN enable bit in the FIFO Control Register (FCR) can only be changed when the baud clock is not running, i. e. when both DLL and DLH are set to 0. Thus make sure that DLL and DLH are 0 when writing the FCR. Signed-off-by: Wolfgang Denk <wd@denx.de>
* drivers/serial : move serial drivers to drivers/serialJean-Christophe PLAGNIOL-VILLARD2007-11-251-0/+71
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
OpenPOWER on IntegriCloud