summaryrefslogtreecommitdiff
path: root/drivers/serial/ns16550.c
AgeCommit message (Collapse)Author
2020-04-04serial: ns16550: Fix ordering of getting base addressBin Meng
Currently the driver gets ns16550 base address in the driver probe() routine, which may potentially break any ns16550 wrapper driver that does additional initialization before calling ns16550_serial_probe(). Things are complicated that we need consider ns16550 devices on both simple-bus and PCI bus. To fix the issue we move the base address assignment for simple-bus ns16550 device back to the ofdata_to_platdata(), and assign base address for PCI ns16550 device in ns16550_serial_probe(). This is still not perfect. If any PCI bus based ns16550 wrapper driver tries to access plat->base before calling probe(), it is still subject to break. Fixes: 720f9e1fdb0c9 ("serial: ns16550: Move PCI access from ofdata_to_platdata() to probe()") Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Tested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
2020-03-05serial: ns16550: Move PCI access from ofdata_to_platdata() to probe()Wolfgang Wallner
Currently the ofdata_to_platdata() method calls dev_read_addr_pci(), which potentially accesses the parent PCI bus. If this happens before the parent PCI bus is probed the resulting address will be wrong. This behavior was triggered by commit 82de42fa1468 ("dm: core: Allocate parent data separate from probing parent"). According to a comment in drivers/pci/pci-uclass.c [1] accessing the PCI parent bus in ofdata_to_platdata() is not allowed, and the access should be moved to the probe() function. Move the call to dev_read_addr_pci() and the related handling of the 'addr' value from the ofdata_to_platdata() to its own function, which is then called from the probe() method. While moving the code, the comment /* try Processor Local Bus device first */ was dropped. It was initially added with commit 3db886a5bf38 ("serial: ns16550: Support ns16550 compatible pci uart devices") and later made obsolete with commit 33c215af4b9d ("dm: pci: Add a function to read a PCI BAR"). [1] Comment in drivers/pci/pci-uclass.c: "A common cause of this problem is that this function is called in the ofdata_to_platdata() method of @dev. Accessing the PCI bus in that method is not allowed, since it has not yet been probed. To fix this, move that access to the probe() method of @dev instead." Fixes: 82de42fa1468 ("dm: core: Allocate parent data separate from probing parent") Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> # Tested on Intel Galileo
2020-02-05dm: core: Require users of devres to include the headerSimon Glass
At present devres.h is included in all files that include dm.h but few make use of it. Also this pulls in linux/compat which adds several more headers. Drop the automatic inclusion and require files to include devres themselves. This provides a good indication of which files use devres. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2020-02-04serial: ns16550: Support run-time configurationSimon Glass
At present this driver uses an assortment of CONFIG options to control how it accesses the hardware. This is painful for platforms that are supposed to be controlled by a device tree or a previous-stage bootloader. Add a new CONFIG option to enable fully dynamic configuration. This controls register spacing, size, offset and endianness. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Aiden Park <aiden.park@intel.com> Tested-by: Aiden Park <aiden.park@intel.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: squashed in http://patchwork.ozlabs.org/patch/1232929/] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2020-01-24serial: ns16550: Use old baud rate divisor for flushing if not givenPatrik Dahlström
If baud_divisor is not set (i.e. == -1), we should use the baud divisor already in use for flushing the xmit register. If we don't flush the xmit register, then SPL will hang. Signed-off-by: Patrik Dahlström <risca@dalakolonin.se>
2020-01-17common: Move clock functions into a new fileSimon Glass
These three clock functions don't use driver model and should be migrated. In the meantime, create a new file to hold them. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-08dm: pci: Add a function to read a PCI BARSimon Glass
At present PCI address transaction is not supported so drivers must manually read the correct BAR after reading the device tree info. The ns16550 has a suitable implementation, so move this code into the core DM support. Note that there is no live-tree equivalent at present. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: correct the unclear comments in test.dts] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-10-08serial: ns16550: Allow serial to enabled/disabled in SPLSimon Glass
At present this driver uses the wrong condition for including the code and drivers in SPL/TPL. Update it so that the code is only included if DM_SERIAL is enabled for SPL/TPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-01-15serial: ns16550: fix debug uart putc called before initSimon Goldschmidt
If _debug_uart_putc() is called before _debug_uart_init(), the ns16550 debug uart driver hangs in a tight loop waiting for the tx FIFO to get empty. As this can happen via a printf sneaking in before the port calls debug_uart_init(), introduce a config option to ignore characters before the debug uart is initialized. This is done by reading the baudrate divisor and aborting if is zero. The Kconfig option is required as reading the baudrate divisor does not seem to work for all ns16500 compatibles (which is why the last attempt on this has been reverted in 1a67969a99). Tested on socfpga_cyclone5_socrates. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-12spl: fix build failure with !CONFIG_SPL_PCI_SUPPORTSekhar Nori
Building U-Boot with CONFIG_PCI and CONFIG_DM_PCI enabled, but CONFIG_SPL_PCI_SUPPORT disabled, results in following linker error: lib/built-in.o: In function `fdtdec_get_pci_bar32': lib/fdtdec.c:305: undefined reference to `dm_pci_read_bar32' fdtdec.c:305:(.text.fdtdec_get_pci_bar32+0x24): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `dm_pci_read_bar32' This is because reference to dm_pci_read_bar32() remains in lib/fdtdec.c while SPL build does not descend into drivers/pci directory in drivers/Makefile if CONFIG_SPL_PCI_SUPPORT is not enabled. Fix this by applying appropriate #define guards in lib/fdtdec.c. It looks like ns16550.c has the same problem, so fixed that too. To simplify this, CONFIG_SPL_PCI_SUPPORT is renamed to CONFIG_SPL_PCI (enables use of CONFIG_IS_ENABLED() macro). Suggested-by: Vignesh R <vigneshr@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-05serial: ns16550: Provide ->getinfo() implementationAndy Shevchenko
New callback will supply necessary information, for example, to ACPI SPCR table. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-05serial: ns16550: Read reg-io-width from device treeAndy Shevchenko
Cache the value of the reg-io-width property for the future use. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-03Revert "serial: ns16550: fix debug uart putc called before init"Simon Goldschmidt
This reverts commit 6f57c34473d37b8da5e6a3764d0d377d748aeef1 since it does not seem to work at least on rk3399. The Rockchip Technical Reference Manual (TRM) for the rk3399 says the baud rate prescaler register is readable only when USR[0] is zero. Since this bit is defined as "reserved" in the socfpga cylcone5 TRM, let's rather drop this than making the ns16550 debug uart more platform specific. Reported-by: Roosen Henri <Henri.Roosen@ginzinger.com> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com
2018-11-16serial: ns16550: add setconfig supportSimon Goldschmidt
Add possibility to update the serial parity used. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
2018-11-14serial: Remove DM_FLAG_PRE_RELOC flag in various driversBin Meng
When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared via U_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declared DM_FLAG_PRE_RELOC flag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage. To mitigate this potential impact, the following changes are implemented: - Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver only supports configuration from device tree (OF_CONTROL) - Keep DM_FLAG_PRE_RELOC flag in the driver only if the device is statically declared via U_BOOT_DEVICE() - Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-14serial: ns16550: fix debug uart putc called before initSimon Goldschmidt
If _debug_uart_putc() is called before _debug_uart_init(), the ns16550 debug uart driver hangs in a tight loop waiting for the tx FIFO to get empty. As this can happen via a printf sneaking in before the port calls debug_uart_init(), let's rather ignore characters before the debug uart is initialized. This is done by reading the baudrate divisor and aborting if is zero. Tested on socfpga_cyclone5_socrates. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
2018-09-10serial: omap: Introduce DM specific omap serialLokesh Vutla
Add driver model support for OMAP_SERIAL while reusing the functions in ns16550.c Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Tested-by: Derald D. Woods <woods.technical@gmail.com>
2018-07-09serial: ns16550: Add reset ctrl to driverLey Foon Tan
Add code to reset all reset signals as in serial DT node. A reset property is an optional feature, so do not fail if a reset property is not present. If a reset property is discovered, then use it to deassert, thus bringing the IP out of reset. Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-02-23ns16550: Fix mem mapped endian checkBernhard Messerklinger
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-01-28serial: ns16550: Fix style violationMario Six
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>
2017-08-24Revert "serial: ns16550: Add RX interrupt buffer support"Stefan Roese
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-07-23serial: ns16550: Add RX interrupt buffer supportStefan Roese
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 interrupt buffer support for NS16550 style UARTs. 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> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> [trini: Guard ns16550_serial_remove with CONFIG_IS_ENABLED(SERIAL_PRESENT) to match struct assignment] Signed-off-by: Tom Rini <trini@konsulko.com>
2017-07-11Merge git://git.denx.de/u-boot-dmTom Rini
2017-07-11dm: serial: ns16550: Convert to livetreeSimon Glass
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
2017-07-11rockchip: ns16550: dm: convert fdt_get to dev_readPhilipp Tomsich
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>
2017-06-01dm: Rename dev_addr..() functionsSimon Glass
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>
2017-05-15TI: Drop 'CONFIG_OMAP'Tom Rini
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>
2017-05-11serial: omap: Support debug UARTLokesh Vutla
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>
2017-04-13serial: ns16550: Link in the DM driver when when using platdataAlexandru Gagniuc
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>
2017-02-08dm: core: Replace of_offset with accessorSimon Glass
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>
2017-01-20serial, ns16550: bugfix: ns16550 fifo not enabledHeiko Schocher
commit: 65f83802b7a5b "serial: 16550: Add getfcr accessor" breaks u-boot commandline working with long commands sending to the board. Since the above patch, you have to setup the fcr register. For board/archs which enable OF_PLATDATA, the new field fcr in struct ns16550_platdata is not filled with a default value ... This leads in not setting up the uarts fifo, which ends in problems, when you send long commands to u-boots commandline. Detected this issue with automated tbot tests on am335x based shc board. The error does not popup, if you type commands. You need to copy&paste a long command to u-boots commandshell (or send a long command with tbot) Possible boards/plattforms with problems: ./arch/arm/cpu/arm926ejs/lpc32xx/devices.c ./arch/arm/mach-tegra/board.c ./board/overo/overo.c ./board/quipos/cairo/cairo.c ./board/logicpd/omap3som/omap3logic.c ./board/logicpd/zoom1/zoom1.c ./board/timll/devkit8000/devkit8000.c ./board/lg/sniper/sniper.c ./board/ti/beagle/beagle.c ./drivers/serial/serial_rockchip.c Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Tested-by: Adam Ford <aford173@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-12-19serial: 16550: Add Ingenic JZ4780 supportMarek Vasut
Add compatibility string for the Ingenic JZ4780 SoC, the necessary UART enable bit into FCR and register shift. Neither are encoded in the DTS coming from Linux, so we need to support it this way. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Paul Burton <paul.burton@imgtec.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-12-19serial: 16550: Add port type as driver dataMarek Vasut
Add driver data to each compatible string to identify the type of the port. Since all the ports in the driver are entirely compatible with 16550 for now, all are marked with PORT_NS16550. But, there are ports which have specific quirks, like the JZ4780 UART, which do not have any DT property to denote the quirks. Instead, Linux uses the compatible string to discern such ports and enable the necessary quirks. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org>
2016-12-19serial: 16550: Add getfcr accessorMarek Vasut
Add function which allows fetching the default FCR register setting from platform data for DM , while retaining old behavior for non-DM by returning UART_FCRVAL. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-10-08Revert "ns16650: Make sure we have CONFIG_CLK set before using infrastructure"Masahiro Yamada
This reverts commit 82f5279b0cd99a9163d34cfe926d0316d9dc0d37. The build failure of k2*evm boards was fixed in a different way by the previous commit. It is nasty to patch generic drivers around with #ifdef CONFIG_CLK just for the KeyStone's matter. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06serial: ns16550: Handle -ENOENT when requesting clockAlexandre Courbot
When calling clk_get_by_index(), fall back to the legacy method of getting the clock if -ENOENT is returned. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com> Acked-by: Thierry Reding <treding@nvidia.com>
2016-09-22ns16650: Make sure we have CONFIG_CLK set before using infrastructureTom Rini
We cannot call on the CONFIG_CLK based clk_get_rate function unless CONFIG_CLK is set. Signed-off-by: Tom Rini <trini@konsulko.com>
2016-09-21serial: ns16550: Support clocks via phandlePaul Burton
Previously ns16550 compatible UARTs probed via device tree have needed their device tree nodes to contain a clock-frequency property. An alternative to this commonly used with Linux is to reference a clock via a phandle. This patch allows U-Boot to support that, retrieving the clock frequency by probing the appropriate clock device. For example, a system might choose to provide the UART base clock as a reference to a clock common to multiple devices: sys_clk: clock { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <10000000>; }; uart0: uart@10000000 { compatible = "ns16550a"; reg = <0x10000000 0x1000>; clocks = <&sys_clk>; }; uart1: uart@10000000 { compatible = "ns16550a"; reg = <0x10001000 0x1000>; clocks = <&sys_clk>; }; This removes the need for the frequency information to be duplicated in multiple nodes and allows the device tree to be more descriptive of the system. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-07-14dm: serial: ns16550: Update to support of-platdataSimon Glass
With of-platdata this driver cannot know the format of the of-platdata struct, so we cannot use generic code for accessing the of-platdata. Each SoC that uses this driver will need to set up ns16550's platdata for it. So don't compile in the generic code. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-06-02serial: 16550: Drop OMAP1510 supportMarek Vasut
The CONFIG_OMAP1510 is no longer defined, so remove this dead code. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Nishanth Menon <nm@ti.com>
2016-06-02serial: 16550: Make serial_io/out_shift available to debug modeMarek Vasut
The ns16550 driver needs serial_in_shift() and serial_out_shift() when compiled in debug UART mode, so shift the DM_SERIAL check a little to make these functions available. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-26dm: ns16550: Don't map_physmem for I/O portsPaul Burton
If the UART is to be accessed using I/O port accessors (inb & outb) then using map_physmem doesn't make sense, since it operates in a different memory space. Remove the call to map_physmem when CONFIG_SYS_NS16550_PORT_MAPPED is defined, allowing I/O port addresses to not be mangled by the incorrect mapping. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2016-03-17dm: ns16550: Add support for reg-offset propertyMichal Simek
reg-offset is the part of standard 8250 binding in the kernel. It is shifting start of address space by reg-offset. On Xilinx platform this offset is typically 0x1000. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Moved the new field to the end of the struct to avoid problems: Signed-off-by: Simon Glass <sjg@chromium.org>
2016-02-29Revert "dm: ns16550: Add support for reg-offset property"Tom Rini
This reverts commit d9a3bec682f9756621615f4306718a356a3230e3. While this is a correct change to do long term it unfortunately breaks a number of platforms that are using pdata and not named struct members so they are getting all of their data after 'base' incorrect. Acked-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2016-02-22dm: ns16550: Add support for reg-offset propertyMichal Simek
reg-offset is the part of standard 8250 binding in the kernel. It is shifting start of address space by reg-offset. On Xilinx platform this offset is typically 0x1000. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-01-25ns16550: zap the rockchip serial compatible stringThomas Chou
Zap the rockchip serial compatible string, because rockchip serial has "snps,dw-apb-uart" compatible string in the dts. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Simon Glass <sjg@chromium.org>
2016-01-12dm: ns16550: Allow the driver to be omitted if requestedSimon Glass
Allow the ns16550 debug UART to be used without the full driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
2016-01-12dm: serial: Convert ns16550 driver to use driver model PCI APISimon Glass
Use the driver model version of the function to find the BAR. This updates the fdtdec function, of which ns16550 is the only user. The fdtdec_get_pci_bdf() function is dropped for several reasons: - with driver model we should use 'struct udevice *' rather than passing the device tree offset explicitly - there are no other users in the tree - the function parses for information which is already available in the PCI device structure (specifically struct pci_child_platdata which is available at dev_get_parent_platdata(dev) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2015-12-05dm: serial: ns16550: Add pre-reloc flag to the driverSimon Glass
For platforms that don't use device tree in SPL the only way to mark this driver as 'required by relocation' is with the DM_FLAG_PRE_RELOC flag. Add this to ensure that the driver is bound. Fixes: fde7e18938d8 ("dm: tegra: pci: Move CONFIG_PCI_TEGRA to Kconfig") Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Stephen Warren <swarren@nvidia.com> Acked-by: Thomas Chou <thomas@wytron.com.tw>
2015-12-05ns16550: change reg-shift property default to zeroThomas Chou
Change reg-shift property default to zero. When the integer property is missing, it should be taken as zero. This is consistent to Linux drivers/tty/serial/of_serial.c. The x86 and most powerpc use reg-shift of 0. Most others use reg-shift of 2. While reg-shift of 1 is rarely used. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com> Acked-by: Simon Glass <sjg@chromium.org>