History log of /u-boot/drivers/serial/Kconfig
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 6b163a63 14-Apr-2024 Robert Marko <robert.marko@sartura.hr>

serial: allow selecting MSM debug UART with ARCH_IPQ40XX

Currently, DEBUG_UART_MSM depends on ARCH_SNAPDRAGON only, but IPQ40XX
devices also use the same UART HW so they can also use the debug UART.

So, allow selecting DEBUG_UART_MSM when using ARCH_IPQ40XX as well.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>

# 20a0ce57 11-Mar-2024 Tom Rini <trini@konsulko.com>

Merge tag 'v2024.04-rc4' into next

Prepare v2024.04-rc4


# f9aabd45 27-Feb-2024 Marek Vasut <marek.vasut+renesas@mailbox.org>

ARM: renesas: Rename ARCH_RMOBILE to ARCH_RENESAS

Rename ARCH_RMOBILE to ARCH_RENESAS because all the chips are made
by Renesas, while only a subset of them is from the R-Mobile
line.

Use the following command to perform the rename:

"
$ git grep -l 'ARCH_RMOBILE' | xargs -I {} sed -i 's@ARCH_RMOBILE@ARCH_RENESAS@g' {}
"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>

# 90023bdf 26-Feb-2024 Caleb Connolly <caleb.connolly@linaro.org>

serial: msm: add debug UART

Introduce support for early debugging. This relies on the previous stage
bootloader to initialise the UART clocks, when running with U-Boot as
the primary bootloader this feature doesn't work. It will require a way
to configure the clocks before the driver model is available.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>

# 836b7f44 13-Nov-2023 Caleb Connolly <caleb.connolly@linaro.org>

serial: msm-geni: don't rely on parent misc device

commit 1b15483deb3f ("misc: add Qualcomm GENI SE QUP device driver")
introduced support for platform-specific oversampling values, necessary
to configure the UART clocks on all platforms at runtime. However it
relies in probing a parent device. Despite the DM_FLAG_PRE_RELOC flag,
this is not done consistently during boot.

Instead, take another approach by relying on ofnode_ helpers to read the
serial engine base address and do the read directly. This fixes early
UART on boards with a non-default oversampling rate.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>

# bd9ff681 21-Sep-2023 Algapally Santosh Sagar <santoshsagar.algapally@amd.com>

serial: zynqmp: Fetch baudrate from dtb and update

The baudrate configured in .config is taken by default by serial. If
change of baudrate is required then the .config needs to changed and
u-boot recompilation is required or the u-boot environment needs to be
updated.

To avoid this, support is added to fetch the baudrate directly from the
device tree file and update.
The serial, prints the log with the configured baudrate in the dtb.
The commit c4df0f6f315c ("arm: mvebu: Espressobin: Set default value for
$fdtfile env variable") is taken as reference for changing the default
environment variable.

The default environment stores the default baudrate value, When default
baudrate and dtb baudrate are not same glitches are seen on the serial.
So, the environment also needs to be updated with the dtb baudrate to
avoid the glitches on the serial.

Also add test to cover this new function.

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20230921112043.3144726-3-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>

# 8819892b 21-Sep-2023 Algapally Santosh Sagar <santoshsagar.algapally@amd.com>

configs: Add support in Kconfig and convert for armada boards

Move the DEFAULT_ENV_IS_RW to Kconfig for easier configuration.
Hence, add the CONFIG_DEFAULT_ENV_IS_RW config to the defconfig files
to allow enabling them for armada boards.

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20230921112043.3144726-2-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>

# 77b9b187 26-Sep-2023 Simon Glass <sjg@chromium.org>

serial: Drop mention of SPL/TPL_SYS_MALLOC_F

These symbols do not (yet) exist, so drop the usage of them in the
serial Kconfig file. It has no effect.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 82e26e0d 26-Sep-2023 Simon Glass <sjg@chromium.org>

spl: Use CONFIG_SPL... instead of CONFIG_..._SPL_...

We like to put the SPL first so it is clear that it relates to SPL. Rename
various malloc-related options which have crept in, to stick to this
convention.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com>

# ac897385 02-Oct-2023 Tom Rini <trini@konsulko.com>

Merge branch 'next'

Signed-off-by: Tom Rini <trini@konsulko.com>


# b1350636 19-Sep-2023 Simon Glass <sjg@chromium.org>

x86: coreboot: Look for DBG2 UART in SPL too

If coreboot does not set up sysinfo for the UART, SPL currently hangs.
Use the DBG2 technique there as well. This allows coreboot64 to boot from
coreboot even if the console info is missing from sysinfo

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# dfe08374 04-Sep-2023 Heinrich Schuchardt <xypron.glpk@gmx.de>

risc-v: implement DBCN based debug console

Use the DBCN SBI extension to implement a debug console.
Make it the default for S-mode RISC-V.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>

# a077ac13 02-Aug-2023 Tom Rini <trini@konsulko.com>

Kconfigs: Correct default of "0" on hex type entries

It is not a parse error to have a default value of "0" for a "hex" type
entry, instead of "0x0". However, "0" and "0x0" are not treated the
same even by the tools themselves. Correct this by changing the default
value from "0" to "0x0" for all hex type questions that had the
incorrect default. Fix one instance (in two configs) of a default of "0"
being used on a hex question to be "0x0". Remove the cases where a
defconfig had set a value of "0x0" to be used as the default had been
"0".

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ff476897 06-May-2023 Marek Vasut <marex@denx.de>

serial: mxs: Add MXS AUART driver

Add trivial driver for the MXS AUART IP. This is the other UART IP
present in i.MX23 and i.MX28, used to drive the non-DUART ports.

Signed-off-by: Marek Vasut <marex@denx.de>

# b29dbf98 04-May-2023 Simon Glass <sjg@chromium.org>

x86: Allow locating the UART from ACPI tables

When coreboot does not pass a UART in its sysinfo struct, there is no
easy way to find it out.

Since coreboot does not actually init the serial device when serial is
disabled, it is not possible to make it add this information to the
sysinfo table.

Add a way to obtain this information from the DBG2 ACPI table, which is
normally set up by coreboot.

For now this only supports a memory-mapped 16550-style UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 10ea2a7a 21-Apr-2023 Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

serial: msm-geni: correct oversampling value based on QUP hardware revision

Starting from QUP v2.5 the value of oversampling is changed from 32
to 16, keeping the old value on newer platforms results on wrong set
UART IP clock divider, thus the asked baudrate does not correspond to
the actually set with all the consequencies for a user.

The change links the driver to a new Qualcomm GENI SE QUP driver
to get its hardware version and update the oversampling value.

Deliberately the code under CONFIG_DEBUG_UART_MSM_GENI is not touched,
since a wanted baudrate can be controlled by setting a modified
CONFIG_DEBUG_UART_CLOCK build time variable.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

# 836d1bff 28-Feb-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

serial: sh: Add DEBUG_UART support

Add support for debug output very early during boot using the DEBUG_UART
mechanism. This uses a static fixed UART port configuration selected via
Kconfig options and dedicated print functions from debug_uart.h. This is
useful e.g. when debugging problems so early during boot, that not even
the DM is initialized at that point, and thus DM_SERIAL is not available
either.

This functionality is disabled by default. To activate it, define the
following Kconfig options and select SCIF type using CFG_SCI/CFG_SCIF_A/
CFG_HSCIF/<nothing for regular SCIF>:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_SCIF=y
CONFIG_DEBUG_UART_BASE=0xe6540000
CONFIG_DEBUG_UART_CLOCK=24000000

The later two options define the SCIF physical base address and SCIF
input clock in Hz. Optionally, to validate DEBUG_UART works, enable
the following as well to get early serial output message by default:

CONFIG_DEBUG_UART_ANNOUNCE=y

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

# 5745de2c 17-Dec-2022 Stefan Bosch <stefan_b@posteo.net>

arm: s5p4418: dm_serial: switch to DM_SERIAL

Switch the S5P4418-SOC and therefore the s5p4418_nanopi2 board to
DM_SERIAL.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>

# 91092132 16-Nov-2022 Tom Rini <trini@konsulko.com>

global: Move remaining CONFIG_SYS_NS16550_* to CFG_SYS_NS16550_*

The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_NS16550
namespace do not easily transition to Kconfig. In many cases they likely
should come from the device tree instead. Move these out of CONFIG
namespace and in to CFG namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9591b635 04-Dec-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_NS16550_MEM32 et al to Kconfig

This converts the following to Kconfig:
CONFIG_SPL_NS16550_MIN_FUNCTIONS
CONFIG_SYS_NS16550_MEM32
CONFIG_SYS_NS16550_PORT_MAPPED
CONFIG_SYS_NS16550_REG_SIZE
CONFIG_SYS_NS16550_SERIAL

To do this we also introduce CONFIG_SPL_SYS_NS16550_SERIAL so that
platforms can enable the legacy driver here for SPL.

Signed-off-by: Tom Rini <trini@konsulko.com>

# a457ebd7 25-Jun-2022 Tom Rini <trini@konsulko.com>

arm: Remove PXA architecture support

With the last platform for this architecture removed, remove the rest of
the architecture support as well.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ad55d99e 06-Jun-2022 Michal Simek <michal.simek@amd.com>

serial: Setup serial base and freq for zynq/zynqmp

Setup default values for debug console, base address and frequency.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ce93efd3ed67aa6390810ce0b79e0d00e7c36b4b.1652871485.git.michal.simek@amd.com

# 74950512 08-May-2022 Samuel Holland <samuel@sholland.org>

serial: Remove obsolete CONS_INDEX_n Kconfig options

These were only ever implied by sunxi platforms, and that usage has
been removed. Current practice is to specify CONFIG_CONS_INDEX in each
board's defconfig.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

# 958789f0 16-May-2022 This contributor prefers not to receive mails <noreply@example.com>

serial: Add new config option TPL_DEBUG_UART_BASE

TPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for TPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>

# 9f971ff7 06-May-2022 This contributor prefers not to receive mails <noreply@example.com>

serial: Add new config option SPL_DEBUG_UART_BASE

SPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for SPL.

In some cases base address of UART is different in SPL and proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# 6f6a0b74 18-Apr-2022 Jim Liu <jim.t90615@gmail.com>

serial: npcm: Add support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx uart driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Signed-off-by: Stanley Chu <yschu@nuvoton.com>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <kabel@kernel.org>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <akashi.tkhro@gmail.com>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <masahiroy@kernel.org>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <masahiroy@kernel.org>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <masahiroy@kernel.org>

kconfig: add blank Kconfig files

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>

# 20a0ce57 11-Mar-2024 Tom Rini <trini@konsulko.com>

Merge tag 'v2024.04-rc4' into next

Prepare v2024.04-rc4


# f9aabd45 27-Feb-2024 Marek Vasut <marek.vasut+renesas@mailbox.org>

ARM: renesas: Rename ARCH_RMOBILE to ARCH_RENESAS

Rename ARCH_RMOBILE to ARCH_RENESAS because all the chips are made
by Renesas, while only a subset of them is from the R-Mobile
line.

Use the following command to perform the rename:

"
$ git grep -l 'ARCH_RMOBILE' | xargs -I {} sed -i 's@ARCH_RMOBILE@ARCH_RENESAS@g' {}
"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>

# 90023bdf 26-Feb-2024 Caleb Connolly <caleb.connolly@linaro.org>

serial: msm: add debug UART

Introduce support for early debugging. This relies on the previous stage
bootloader to initialise the UART clocks, when running with U-Boot as
the primary bootloader this feature doesn't work. It will require a way
to configure the clocks before the driver model is available.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>

# 836b7f44 13-Nov-2023 Caleb Connolly <caleb.connolly@linaro.org>

serial: msm-geni: don't rely on parent misc device

commit 1b15483deb3f ("misc: add Qualcomm GENI SE QUP device driver")
introduced support for platform-specific oversampling values, necessary
to configure the UART clocks on all platforms at runtime. However it
relies in probing a parent device. Despite the DM_FLAG_PRE_RELOC flag,
this is not done consistently during boot.

Instead, take another approach by relying on ofnode_ helpers to read the
serial engine base address and do the read directly. This fixes early
UART on boards with a non-default oversampling rate.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>

# bd9ff681 21-Sep-2023 Algapally Santosh Sagar <santoshsagar.algapally@amd.com>

serial: zynqmp: Fetch baudrate from dtb and update

The baudrate configured in .config is taken by default by serial. If
change of baudrate is required then the .config needs to changed and
u-boot recompilation is required or the u-boot environment needs to be
updated.

To avoid this, support is added to fetch the baudrate directly from the
device tree file and update.
The serial, prints the log with the configured baudrate in the dtb.
The commit c4df0f6f315c ("arm: mvebu: Espressobin: Set default value for
$fdtfile env variable") is taken as reference for changing the default
environment variable.

The default environment stores the default baudrate value, When default
baudrate and dtb baudrate are not same glitches are seen on the serial.
So, the environment also needs to be updated with the dtb baudrate to
avoid the glitches on the serial.

Also add test to cover this new function.

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20230921112043.3144726-3-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>

# 8819892b 21-Sep-2023 Algapally Santosh Sagar <santoshsagar.algapally@amd.com>

configs: Add support in Kconfig and convert for armada boards

Move the DEFAULT_ENV_IS_RW to Kconfig for easier configuration.
Hence, add the CONFIG_DEFAULT_ENV_IS_RW config to the defconfig files
to allow enabling them for armada boards.

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20230921112043.3144726-2-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>

# 77b9b187 26-Sep-2023 Simon Glass <sjg@chromium.org>

serial: Drop mention of SPL/TPL_SYS_MALLOC_F

These symbols do not (yet) exist, so drop the usage of them in the
serial Kconfig file. It has no effect.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 82e26e0d 26-Sep-2023 Simon Glass <sjg@chromium.org>

spl: Use CONFIG_SPL... instead of CONFIG_..._SPL_...

We like to put the SPL first so it is clear that it relates to SPL. Rename
various malloc-related options which have crept in, to stick to this
convention.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com>

# ac897385 02-Oct-2023 Tom Rini <trini@konsulko.com>

Merge branch 'next'

Signed-off-by: Tom Rini <trini@konsulko.com>


# b1350636 19-Sep-2023 Simon Glass <sjg@chromium.org>

x86: coreboot: Look for DBG2 UART in SPL too

If coreboot does not set up sysinfo for the UART, SPL currently hangs.
Use the DBG2 technique there as well. This allows coreboot64 to boot from
coreboot even if the console info is missing from sysinfo

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# dfe08374 04-Sep-2023 Heinrich Schuchardt <xypron.glpk@gmx.de>

risc-v: implement DBCN based debug console

Use the DBCN SBI extension to implement a debug console.
Make it the default for S-mode RISC-V.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>

# a077ac13 02-Aug-2023 Tom Rini <trini@konsulko.com>

Kconfigs: Correct default of "0" on hex type entries

It is not a parse error to have a default value of "0" for a "hex" type
entry, instead of "0x0". However, "0" and "0x0" are not treated the
same even by the tools themselves. Correct this by changing the default
value from "0" to "0x0" for all hex type questions that had the
incorrect default. Fix one instance (in two configs) of a default of "0"
being used on a hex question to be "0x0". Remove the cases where a
defconfig had set a value of "0x0" to be used as the default had been
"0".

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ff476897 06-May-2023 Marek Vasut <marex@denx.de>

serial: mxs: Add MXS AUART driver

Add trivial driver for the MXS AUART IP. This is the other UART IP
present in i.MX23 and i.MX28, used to drive the non-DUART ports.

Signed-off-by: Marek Vasut <marex@denx.de>

# b29dbf98 04-May-2023 Simon Glass <sjg@chromium.org>

x86: Allow locating the UART from ACPI tables

When coreboot does not pass a UART in its sysinfo struct, there is no
easy way to find it out.

Since coreboot does not actually init the serial device when serial is
disabled, it is not possible to make it add this information to the
sysinfo table.

Add a way to obtain this information from the DBG2 ACPI table, which is
normally set up by coreboot.

For now this only supports a memory-mapped 16550-style UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 10ea2a7a 21-Apr-2023 Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

serial: msm-geni: correct oversampling value based on QUP hardware revision

Starting from QUP v2.5 the value of oversampling is changed from 32
to 16, keeping the old value on newer platforms results on wrong set
UART IP clock divider, thus the asked baudrate does not correspond to
the actually set with all the consequencies for a user.

The change links the driver to a new Qualcomm GENI SE QUP driver
to get its hardware version and update the oversampling value.

Deliberately the code under CONFIG_DEBUG_UART_MSM_GENI is not touched,
since a wanted baudrate can be controlled by setting a modified
CONFIG_DEBUG_UART_CLOCK build time variable.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

# 836d1bff 28-Feb-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

serial: sh: Add DEBUG_UART support

Add support for debug output very early during boot using the DEBUG_UART
mechanism. This uses a static fixed UART port configuration selected via
Kconfig options and dedicated print functions from debug_uart.h. This is
useful e.g. when debugging problems so early during boot, that not even
the DM is initialized at that point, and thus DM_SERIAL is not available
either.

This functionality is disabled by default. To activate it, define the
following Kconfig options and select SCIF type using CFG_SCI/CFG_SCIF_A/
CFG_HSCIF/<nothing for regular SCIF>:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_SCIF=y
CONFIG_DEBUG_UART_BASE=0xe6540000
CONFIG_DEBUG_UART_CLOCK=24000000

The later two options define the SCIF physical base address and SCIF
input clock in Hz. Optionally, to validate DEBUG_UART works, enable
the following as well to get early serial output message by default:

CONFIG_DEBUG_UART_ANNOUNCE=y

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

# 5745de2c 17-Dec-2022 Stefan Bosch <stefan_b@posteo.net>

arm: s5p4418: dm_serial: switch to DM_SERIAL

Switch the S5P4418-SOC and therefore the s5p4418_nanopi2 board to
DM_SERIAL.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>

# 91092132 16-Nov-2022 Tom Rini <trini@konsulko.com>

global: Move remaining CONFIG_SYS_NS16550_* to CFG_SYS_NS16550_*

The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_NS16550
namespace do not easily transition to Kconfig. In many cases they likely
should come from the device tree instead. Move these out of CONFIG
namespace and in to CFG namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9591b635 04-Dec-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_NS16550_MEM32 et al to Kconfig

This converts the following to Kconfig:
CONFIG_SPL_NS16550_MIN_FUNCTIONS
CONFIG_SYS_NS16550_MEM32
CONFIG_SYS_NS16550_PORT_MAPPED
CONFIG_SYS_NS16550_REG_SIZE
CONFIG_SYS_NS16550_SERIAL

To do this we also introduce CONFIG_SPL_SYS_NS16550_SERIAL so that
platforms can enable the legacy driver here for SPL.

Signed-off-by: Tom Rini <trini@konsulko.com>

# a457ebd7 25-Jun-2022 Tom Rini <trini@konsulko.com>

arm: Remove PXA architecture support

With the last platform for this architecture removed, remove the rest of
the architecture support as well.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ad55d99e 06-Jun-2022 Michal Simek <michal.simek@amd.com>

serial: Setup serial base and freq for zynq/zynqmp

Setup default values for debug console, base address and frequency.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ce93efd3ed67aa6390810ce0b79e0d00e7c36b4b.1652871485.git.michal.simek@amd.com

# 74950512 08-May-2022 Samuel Holland <samuel@sholland.org>

serial: Remove obsolete CONS_INDEX_n Kconfig options

These were only ever implied by sunxi platforms, and that usage has
been removed. Current practice is to specify CONFIG_CONS_INDEX in each
board's defconfig.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

# 958789f0 16-May-2022 This contributor prefers not to receive mails <noreply@example.com>

serial: Add new config option TPL_DEBUG_UART_BASE

TPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for TPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>

# 9f971ff7 06-May-2022 This contributor prefers not to receive mails <noreply@example.com>

serial: Add new config option SPL_DEBUG_UART_BASE

SPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for SPL.

In some cases base address of UART is different in SPL and proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# 6f6a0b74 18-Apr-2022 Jim Liu <jim.t90615@gmail.com>

serial: npcm: Add support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx uart driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Signed-off-by: Stanley Chu <yschu@nuvoton.com>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <kabel@kernel.org>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <masahiroy@kernel.org>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <masahiroy@kernel.org>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <masahiroy@kernel.org>

kconfig: add blank Kconfig files

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>

# f9aabd45 27-Feb-2024 Marek Vasut <marek.vasut+renesas@mailbox.org>

ARM: renesas: Rename ARCH_RMOBILE to ARCH_RENESAS

Rename ARCH_RMOBILE to ARCH_RENESAS because all the chips are made
by Renesas, while only a subset of them is from the R-Mobile
line.

Use the following command to perform the rename:

"
$ git grep -l 'ARCH_RMOBILE' | xargs -I {} sed -i 's@ARCH_RMOBILE@ARCH_RENESAS@g' {}
"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>

# 836b7f44 13-Nov-2023 Caleb Connolly <caleb.connolly@linaro.org>

serial: msm-geni: don't rely on parent misc device

commit 1b15483deb3f ("misc: add Qualcomm GENI SE QUP device driver")
introduced support for platform-specific oversampling values, necessary
to configure the UART clocks on all platforms at runtime. However it
relies in probing a parent device. Despite the DM_FLAG_PRE_RELOC flag,
this is not done consistently during boot.

Instead, take another approach by relying on ofnode_ helpers to read the
serial engine base address and do the read directly. This fixes early
UART on boards with a non-default oversampling rate.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>

# bd9ff681 21-Sep-2023 Algapally Santosh Sagar <santoshsagar.algapally@amd.com>

serial: zynqmp: Fetch baudrate from dtb and update

The baudrate configured in .config is taken by default by serial. If
change of baudrate is required then the .config needs to changed and
u-boot recompilation is required or the u-boot environment needs to be
updated.

To avoid this, support is added to fetch the baudrate directly from the
device tree file and update.
The serial, prints the log with the configured baudrate in the dtb.
The commit c4df0f6f315c ("arm: mvebu: Espressobin: Set default value for
$fdtfile env variable") is taken as reference for changing the default
environment variable.

The default environment stores the default baudrate value, When default
baudrate and dtb baudrate are not same glitches are seen on the serial.
So, the environment also needs to be updated with the dtb baudrate to
avoid the glitches on the serial.

Also add test to cover this new function.

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20230921112043.3144726-3-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>

# 8819892b 21-Sep-2023 Algapally Santosh Sagar <santoshsagar.algapally@amd.com>

configs: Add support in Kconfig and convert for armada boards

Move the DEFAULT_ENV_IS_RW to Kconfig for easier configuration.
Hence, add the CONFIG_DEFAULT_ENV_IS_RW config to the defconfig files
to allow enabling them for armada boards.

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20230921112043.3144726-2-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>

# 77b9b187 26-Sep-2023 Simon Glass <sjg@chromium.org>

serial: Drop mention of SPL/TPL_SYS_MALLOC_F

These symbols do not (yet) exist, so drop the usage of them in the
serial Kconfig file. It has no effect.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 82e26e0d 26-Sep-2023 Simon Glass <sjg@chromium.org>

spl: Use CONFIG_SPL... instead of CONFIG_..._SPL_...

We like to put the SPL first so it is clear that it relates to SPL. Rename
various malloc-related options which have crept in, to stick to this
convention.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com>

# ac897385 02-Oct-2023 Tom Rini <trini@konsulko.com>

Merge branch 'next'

Signed-off-by: Tom Rini <trini@konsulko.com>


# b1350636 19-Sep-2023 Simon Glass <sjg@chromium.org>

x86: coreboot: Look for DBG2 UART in SPL too

If coreboot does not set up sysinfo for the UART, SPL currently hangs.
Use the DBG2 technique there as well. This allows coreboot64 to boot from
coreboot even if the console info is missing from sysinfo

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# dfe08374 04-Sep-2023 Heinrich Schuchardt <xypron.glpk@gmx.de>

risc-v: implement DBCN based debug console

Use the DBCN SBI extension to implement a debug console.
Make it the default for S-mode RISC-V.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>

# a077ac13 02-Aug-2023 Tom Rini <trini@konsulko.com>

Kconfigs: Correct default of "0" on hex type entries

It is not a parse error to have a default value of "0" for a "hex" type
entry, instead of "0x0". However, "0" and "0x0" are not treated the
same even by the tools themselves. Correct this by changing the default
value from "0" to "0x0" for all hex type questions that had the
incorrect default. Fix one instance (in two configs) of a default of "0"
being used on a hex question to be "0x0". Remove the cases where a
defconfig had set a value of "0x0" to be used as the default had been
"0".

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ff476897 06-May-2023 Marek Vasut <marex@denx.de>

serial: mxs: Add MXS AUART driver

Add trivial driver for the MXS AUART IP. This is the other UART IP
present in i.MX23 and i.MX28, used to drive the non-DUART ports.

Signed-off-by: Marek Vasut <marex@denx.de>

# b29dbf98 04-May-2023 Simon Glass <sjg@chromium.org>

x86: Allow locating the UART from ACPI tables

When coreboot does not pass a UART in its sysinfo struct, there is no
easy way to find it out.

Since coreboot does not actually init the serial device when serial is
disabled, it is not possible to make it add this information to the
sysinfo table.

Add a way to obtain this information from the DBG2 ACPI table, which is
normally set up by coreboot.

For now this only supports a memory-mapped 16550-style UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 10ea2a7a 21-Apr-2023 Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

serial: msm-geni: correct oversampling value based on QUP hardware revision

Starting from QUP v2.5 the value of oversampling is changed from 32
to 16, keeping the old value on newer platforms results on wrong set
UART IP clock divider, thus the asked baudrate does not correspond to
the actually set with all the consequencies for a user.

The change links the driver to a new Qualcomm GENI SE QUP driver
to get its hardware version and update the oversampling value.

Deliberately the code under CONFIG_DEBUG_UART_MSM_GENI is not touched,
since a wanted baudrate can be controlled by setting a modified
CONFIG_DEBUG_UART_CLOCK build time variable.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

# 836d1bff 28-Feb-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

serial: sh: Add DEBUG_UART support

Add support for debug output very early during boot using the DEBUG_UART
mechanism. This uses a static fixed UART port configuration selected via
Kconfig options and dedicated print functions from debug_uart.h. This is
useful e.g. when debugging problems so early during boot, that not even
the DM is initialized at that point, and thus DM_SERIAL is not available
either.

This functionality is disabled by default. To activate it, define the
following Kconfig options and select SCIF type using CFG_SCI/CFG_SCIF_A/
CFG_HSCIF/<nothing for regular SCIF>:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_SCIF=y
CONFIG_DEBUG_UART_BASE=0xe6540000
CONFIG_DEBUG_UART_CLOCK=24000000

The later two options define the SCIF physical base address and SCIF
input clock in Hz. Optionally, to validate DEBUG_UART works, enable
the following as well to get early serial output message by default:

CONFIG_DEBUG_UART_ANNOUNCE=y

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

# 5745de2c 17-Dec-2022 Stefan Bosch <stefan_b@posteo.net>

arm: s5p4418: dm_serial: switch to DM_SERIAL

Switch the S5P4418-SOC and therefore the s5p4418_nanopi2 board to
DM_SERIAL.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>

# 91092132 16-Nov-2022 Tom Rini <trini@konsulko.com>

global: Move remaining CONFIG_SYS_NS16550_* to CFG_SYS_NS16550_*

The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_NS16550
namespace do not easily transition to Kconfig. In many cases they likely
should come from the device tree instead. Move these out of CONFIG
namespace and in to CFG namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9591b635 04-Dec-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_NS16550_MEM32 et al to Kconfig

This converts the following to Kconfig:
CONFIG_SPL_NS16550_MIN_FUNCTIONS
CONFIG_SYS_NS16550_MEM32
CONFIG_SYS_NS16550_PORT_MAPPED
CONFIG_SYS_NS16550_REG_SIZE
CONFIG_SYS_NS16550_SERIAL

To do this we also introduce CONFIG_SPL_SYS_NS16550_SERIAL so that
platforms can enable the legacy driver here for SPL.

Signed-off-by: Tom Rini <trini@konsulko.com>

# a457ebd7 25-Jun-2022 Tom Rini <trini@konsulko.com>

arm: Remove PXA architecture support

With the last platform for this architecture removed, remove the rest of
the architecture support as well.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ad55d99e 06-Jun-2022 Michal Simek <michal.simek@amd.com>

serial: Setup serial base and freq for zynq/zynqmp

Setup default values for debug console, base address and frequency.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ce93efd3ed67aa6390810ce0b79e0d00e7c36b4b.1652871485.git.michal.simek@amd.com

# 74950512 08-May-2022 Samuel Holland <samuel@sholland.org>

serial: Remove obsolete CONS_INDEX_n Kconfig options

These were only ever implied by sunxi platforms, and that usage has
been removed. Current practice is to specify CONFIG_CONS_INDEX in each
board's defconfig.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

# 958789f0 16-May-2022 This contributor prefers not to receive mails <noreply@example.com>

serial: Add new config option TPL_DEBUG_UART_BASE

TPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for TPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>

# 9f971ff7 06-May-2022 This contributor prefers not to receive mails <noreply@example.com>

serial: Add new config option SPL_DEBUG_UART_BASE

SPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for SPL.

In some cases base address of UART is different in SPL and proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# 6f6a0b74 18-Apr-2022 Jim Liu <jim.t90615@gmail.com>

serial: npcm: Add support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx uart driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Signed-off-by: Stanley Chu <yschu@nuvoton.com>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <kabel@kernel.org>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <masahiroy@kernel.org>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <masahiroy@kernel.org>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <masahiroy@kernel.org>

kconfig: add blank Kconfig files

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>

# 836b7f44 13-Nov-2023 Caleb Connolly <caleb.connolly@linaro.org>

serial: msm-geni: don't rely on parent misc device

commit 1b15483deb3f ("misc: add Qualcomm GENI SE QUP device driver")
introduced support for platform-specific oversampling values, necessary
to configure the UART clocks on all platforms at runtime. However it
relies in probing a parent device. Despite the DM_FLAG_PRE_RELOC flag,
this is not done consistently during boot.

Instead, take another approach by relying on ofnode_ helpers to read the
serial engine base address and do the read directly. This fixes early
UART on boards with a non-default oversampling rate.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>

# bd9ff681 21-Sep-2023 Algapally Santosh Sagar <santoshsagar.algapally@amd.com>

serial: zynqmp: Fetch baudrate from dtb and update

The baudrate configured in .config is taken by default by serial. If
change of baudrate is required then the .config needs to changed and
u-boot recompilation is required or the u-boot environment needs to be
updated.

To avoid this, support is added to fetch the baudrate directly from the
device tree file and update.
The serial, prints the log with the configured baudrate in the dtb.
The commit c4df0f6f315c ("arm: mvebu: Espressobin: Set default value for
$fdtfile env variable") is taken as reference for changing the default
environment variable.

The default environment stores the default baudrate value, When default
baudrate and dtb baudrate are not same glitches are seen on the serial.
So, the environment also needs to be updated with the dtb baudrate to
avoid the glitches on the serial.

Also add test to cover this new function.

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20230921112043.3144726-3-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>

# 8819892b 21-Sep-2023 Algapally Santosh Sagar <santoshsagar.algapally@amd.com>

configs: Add support in Kconfig and convert for armada boards

Move the DEFAULT_ENV_IS_RW to Kconfig for easier configuration.
Hence, add the CONFIG_DEFAULT_ENV_IS_RW config to the defconfig files
to allow enabling them for armada boards.

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20230921112043.3144726-2-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>

# 77b9b187 26-Sep-2023 Simon Glass <sjg@chromium.org>

serial: Drop mention of SPL/TPL_SYS_MALLOC_F

These symbols do not (yet) exist, so drop the usage of them in the
serial Kconfig file. It has no effect.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 82e26e0d 26-Sep-2023 Simon Glass <sjg@chromium.org>

spl: Use CONFIG_SPL... instead of CONFIG_..._SPL_...

We like to put the SPL first so it is clear that it relates to SPL. Rename
various malloc-related options which have crept in, to stick to this
convention.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com>

# ac897385 02-Oct-2023 Tom Rini <trini@konsulko.com>

Merge branch 'next'

Signed-off-by: Tom Rini <trini@konsulko.com>


# b1350636 19-Sep-2023 Simon Glass <sjg@chromium.org>

x86: coreboot: Look for DBG2 UART in SPL too

If coreboot does not set up sysinfo for the UART, SPL currently hangs.
Use the DBG2 technique there as well. This allows coreboot64 to boot from
coreboot even if the console info is missing from sysinfo

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# dfe08374 04-Sep-2023 Heinrich Schuchardt <xypron.glpk@gmx.de>

risc-v: implement DBCN based debug console

Use the DBCN SBI extension to implement a debug console.
Make it the default for S-mode RISC-V.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>

# a077ac13 02-Aug-2023 Tom Rini <trini@konsulko.com>

Kconfigs: Correct default of "0" on hex type entries

It is not a parse error to have a default value of "0" for a "hex" type
entry, instead of "0x0". However, "0" and "0x0" are not treated the
same even by the tools themselves. Correct this by changing the default
value from "0" to "0x0" for all hex type questions that had the
incorrect default. Fix one instance (in two configs) of a default of "0"
being used on a hex question to be "0x0". Remove the cases where a
defconfig had set a value of "0x0" to be used as the default had been
"0".

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ff476897 06-May-2023 Marek Vasut <marex@denx.de>

serial: mxs: Add MXS AUART driver

Add trivial driver for the MXS AUART IP. This is the other UART IP
present in i.MX23 and i.MX28, used to drive the non-DUART ports.

Signed-off-by: Marek Vasut <marex@denx.de>

# b29dbf98 04-May-2023 Simon Glass <sjg@chromium.org>

x86: Allow locating the UART from ACPI tables

When coreboot does not pass a UART in its sysinfo struct, there is no
easy way to find it out.

Since coreboot does not actually init the serial device when serial is
disabled, it is not possible to make it add this information to the
sysinfo table.

Add a way to obtain this information from the DBG2 ACPI table, which is
normally set up by coreboot.

For now this only supports a memory-mapped 16550-style UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 10ea2a7a 21-Apr-2023 Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

serial: msm-geni: correct oversampling value based on QUP hardware revision

Starting from QUP v2.5 the value of oversampling is changed from 32
to 16, keeping the old value on newer platforms results on wrong set
UART IP clock divider, thus the asked baudrate does not correspond to
the actually set with all the consequencies for a user.

The change links the driver to a new Qualcomm GENI SE QUP driver
to get its hardware version and update the oversampling value.

Deliberately the code under CONFIG_DEBUG_UART_MSM_GENI is not touched,
since a wanted baudrate can be controlled by setting a modified
CONFIG_DEBUG_UART_CLOCK build time variable.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

# 836d1bff 28-Feb-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

serial: sh: Add DEBUG_UART support

Add support for debug output very early during boot using the DEBUG_UART
mechanism. This uses a static fixed UART port configuration selected via
Kconfig options and dedicated print functions from debug_uart.h. This is
useful e.g. when debugging problems so early during boot, that not even
the DM is initialized at that point, and thus DM_SERIAL is not available
either.

This functionality is disabled by default. To activate it, define the
following Kconfig options and select SCIF type using CFG_SCI/CFG_SCIF_A/
CFG_HSCIF/<nothing for regular SCIF>:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_SCIF=y
CONFIG_DEBUG_UART_BASE=0xe6540000
CONFIG_DEBUG_UART_CLOCK=24000000

The later two options define the SCIF physical base address and SCIF
input clock in Hz. Optionally, to validate DEBUG_UART works, enable
the following as well to get early serial output message by default:

CONFIG_DEBUG_UART_ANNOUNCE=y

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

# 5745de2c 17-Dec-2022 Stefan Bosch <stefan_b@posteo.net>

arm: s5p4418: dm_serial: switch to DM_SERIAL

Switch the S5P4418-SOC and therefore the s5p4418_nanopi2 board to
DM_SERIAL.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>

# 91092132 16-Nov-2022 Tom Rini <trini@konsulko.com>

global: Move remaining CONFIG_SYS_NS16550_* to CFG_SYS_NS16550_*

The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_NS16550
namespace do not easily transition to Kconfig. In many cases they likely
should come from the device tree instead. Move these out of CONFIG
namespace and in to CFG namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9591b635 04-Dec-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_NS16550_MEM32 et al to Kconfig

This converts the following to Kconfig:
CONFIG_SPL_NS16550_MIN_FUNCTIONS
CONFIG_SYS_NS16550_MEM32
CONFIG_SYS_NS16550_PORT_MAPPED
CONFIG_SYS_NS16550_REG_SIZE
CONFIG_SYS_NS16550_SERIAL

To do this we also introduce CONFIG_SPL_SYS_NS16550_SERIAL so that
platforms can enable the legacy driver here for SPL.

Signed-off-by: Tom Rini <trini@konsulko.com>

# a457ebd7 25-Jun-2022 Tom Rini <trini@konsulko.com>

arm: Remove PXA architecture support

With the last platform for this architecture removed, remove the rest of
the architecture support as well.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ad55d99e 06-Jun-2022 Michal Simek <michal.simek@amd.com>

serial: Setup serial base and freq for zynq/zynqmp

Setup default values for debug console, base address and frequency.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ce93efd3ed67aa6390810ce0b79e0d00e7c36b4b.1652871485.git.michal.simek@amd.com

# 74950512 08-May-2022 Samuel Holland <samuel@sholland.org>

serial: Remove obsolete CONS_INDEX_n Kconfig options

These were only ever implied by sunxi platforms, and that usage has
been removed. Current practice is to specify CONFIG_CONS_INDEX in each
board's defconfig.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

# 958789f0 16-May-2022 This contributor prefers not to receive mails <noreply@example.com>

serial: Add new config option TPL_DEBUG_UART_BASE

TPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for TPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>

# 9f971ff7 06-May-2022 This contributor prefers not to receive mails <noreply@example.com>

serial: Add new config option SPL_DEBUG_UART_BASE

SPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for SPL.

In some cases base address of UART is different in SPL and proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# 6f6a0b74 18-Apr-2022 Jim Liu <jim.t90615@gmail.com>

serial: npcm: Add support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx uart driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Signed-off-by: Stanley Chu <yschu@nuvoton.com>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <kabel@kernel.org>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <masahiroy@kernel.org>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <masahiroy@kernel.org>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <masahiroy@kernel.org>

kconfig: add blank Kconfig files

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>

# bd9ff681 21-Sep-2023 Algapally Santosh Sagar <santoshsagar.algapally@amd.com>

serial: zynqmp: Fetch baudrate from dtb and update

The baudrate configured in .config is taken by default by serial. If
change of baudrate is required then the .config needs to changed and
u-boot recompilation is required or the u-boot environment needs to be
updated.

To avoid this, support is added to fetch the baudrate directly from the
device tree file and update.
The serial, prints the log with the configured baudrate in the dtb.
The commit c4df0f6f315c ("arm: mvebu: Espressobin: Set default value for
$fdtfile env variable") is taken as reference for changing the default
environment variable.

The default environment stores the default baudrate value, When default
baudrate and dtb baudrate are not same glitches are seen on the serial.
So, the environment also needs to be updated with the dtb baudrate to
avoid the glitches on the serial.

Also add test to cover this new function.

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20230921112043.3144726-3-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>

# 8819892b 21-Sep-2023 Algapally Santosh Sagar <santoshsagar.algapally@amd.com>

configs: Add support in Kconfig and convert for armada boards

Move the DEFAULT_ENV_IS_RW to Kconfig for easier configuration.
Hence, add the CONFIG_DEFAULT_ENV_IS_RW config to the defconfig files
to allow enabling them for armada boards.

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20230921112043.3144726-2-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>

# 77b9b187 26-Sep-2023 Simon Glass <sjg@chromium.org>

serial: Drop mention of SPL/TPL_SYS_MALLOC_F

These symbols do not (yet) exist, so drop the usage of them in the
serial Kconfig file. It has no effect.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 82e26e0d 26-Sep-2023 Simon Glass <sjg@chromium.org>

spl: Use CONFIG_SPL... instead of CONFIG_..._SPL_...

We like to put the SPL first so it is clear that it relates to SPL. Rename
various malloc-related options which have crept in, to stick to this
convention.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com>

# ac897385 02-Oct-2023 Tom Rini <trini@konsulko.com>

Merge branch 'next'

Signed-off-by: Tom Rini <trini@konsulko.com>


# b1350636 19-Sep-2023 Simon Glass <sjg@chromium.org>

x86: coreboot: Look for DBG2 UART in SPL too

If coreboot does not set up sysinfo for the UART, SPL currently hangs.
Use the DBG2 technique there as well. This allows coreboot64 to boot from
coreboot even if the console info is missing from sysinfo

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# dfe08374 04-Sep-2023 Heinrich Schuchardt <xypron.glpk@gmx.de>

risc-v: implement DBCN based debug console

Use the DBCN SBI extension to implement a debug console.
Make it the default for S-mode RISC-V.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>

# a077ac13 02-Aug-2023 Tom Rini <trini@konsulko.com>

Kconfigs: Correct default of "0" on hex type entries

It is not a parse error to have a default value of "0" for a "hex" type
entry, instead of "0x0". However, "0" and "0x0" are not treated the
same even by the tools themselves. Correct this by changing the default
value from "0" to "0x0" for all hex type questions that had the
incorrect default. Fix one instance (in two configs) of a default of "0"
being used on a hex question to be "0x0". Remove the cases where a
defconfig had set a value of "0x0" to be used as the default had been
"0".

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ff476897 06-May-2023 Marek Vasut <marex@denx.de>

serial: mxs: Add MXS AUART driver

Add trivial driver for the MXS AUART IP. This is the other UART IP
present in i.MX23 and i.MX28, used to drive the non-DUART ports.

Signed-off-by: Marek Vasut <marex@denx.de>

# b29dbf98 04-May-2023 Simon Glass <sjg@chromium.org>

x86: Allow locating the UART from ACPI tables

When coreboot does not pass a UART in its sysinfo struct, there is no
easy way to find it out.

Since coreboot does not actually init the serial device when serial is
disabled, it is not possible to make it add this information to the
sysinfo table.

Add a way to obtain this information from the DBG2 ACPI table, which is
normally set up by coreboot.

For now this only supports a memory-mapped 16550-style UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 10ea2a7a 21-Apr-2023 Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

serial: msm-geni: correct oversampling value based on QUP hardware revision

Starting from QUP v2.5 the value of oversampling is changed from 32
to 16, keeping the old value on newer platforms results on wrong set
UART IP clock divider, thus the asked baudrate does not correspond to
the actually set with all the consequencies for a user.

The change links the driver to a new Qualcomm GENI SE QUP driver
to get its hardware version and update the oversampling value.

Deliberately the code under CONFIG_DEBUG_UART_MSM_GENI is not touched,
since a wanted baudrate can be controlled by setting a modified
CONFIG_DEBUG_UART_CLOCK build time variable.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

# 836d1bff 28-Feb-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

serial: sh: Add DEBUG_UART support

Add support for debug output very early during boot using the DEBUG_UART
mechanism. This uses a static fixed UART port configuration selected via
Kconfig options and dedicated print functions from debug_uart.h. This is
useful e.g. when debugging problems so early during boot, that not even
the DM is initialized at that point, and thus DM_SERIAL is not available
either.

This functionality is disabled by default. To activate it, define the
following Kconfig options and select SCIF type using CFG_SCI/CFG_SCIF_A/
CFG_HSCIF/<nothing for regular SCIF>:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_SCIF=y
CONFIG_DEBUG_UART_BASE=0xe6540000
CONFIG_DEBUG_UART_CLOCK=24000000

The later two options define the SCIF physical base address and SCIF
input clock in Hz. Optionally, to validate DEBUG_UART works, enable
the following as well to get early serial output message by default:

CONFIG_DEBUG_UART_ANNOUNCE=y

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

# 5745de2c 17-Dec-2022 Stefan Bosch <stefan_b@posteo.net>

arm: s5p4418: dm_serial: switch to DM_SERIAL

Switch the S5P4418-SOC and therefore the s5p4418_nanopi2 board to
DM_SERIAL.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>

# 91092132 16-Nov-2022 Tom Rini <trini@konsulko.com>

global: Move remaining CONFIG_SYS_NS16550_* to CFG_SYS_NS16550_*

The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_NS16550
namespace do not easily transition to Kconfig. In many cases they likely
should come from the device tree instead. Move these out of CONFIG
namespace and in to CFG namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9591b635 04-Dec-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_NS16550_MEM32 et al to Kconfig

This converts the following to Kconfig:
CONFIG_SPL_NS16550_MIN_FUNCTIONS
CONFIG_SYS_NS16550_MEM32
CONFIG_SYS_NS16550_PORT_MAPPED
CONFIG_SYS_NS16550_REG_SIZE
CONFIG_SYS_NS16550_SERIAL

To do this we also introduce CONFIG_SPL_SYS_NS16550_SERIAL so that
platforms can enable the legacy driver here for SPL.

Signed-off-by: Tom Rini <trini@konsulko.com>

# a457ebd7 25-Jun-2022 Tom Rini <trini@konsulko.com>

arm: Remove PXA architecture support

With the last platform for this architecture removed, remove the rest of
the architecture support as well.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ad55d99e 06-Jun-2022 Michal Simek <michal.simek@amd.com>

serial: Setup serial base and freq for zynq/zynqmp

Setup default values for debug console, base address and frequency.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ce93efd3ed67aa6390810ce0b79e0d00e7c36b4b.1652871485.git.michal.simek@amd.com

# 74950512 08-May-2022 Samuel Holland <samuel@sholland.org>

serial: Remove obsolete CONS_INDEX_n Kconfig options

These were only ever implied by sunxi platforms, and that usage has
been removed. Current practice is to specify CONFIG_CONS_INDEX in each
board's defconfig.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

# 958789f0 16-May-2022 This contributor prefers not to receive mails <noreply@example.com>

serial: Add new config option TPL_DEBUG_UART_BASE

TPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for TPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>

# 9f971ff7 06-May-2022 This contributor prefers not to receive mails <noreply@example.com>

serial: Add new config option SPL_DEBUG_UART_BASE

SPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for SPL.

In some cases base address of UART is different in SPL and proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# 6f6a0b74 18-Apr-2022 Jim Liu <jim.t90615@gmail.com>

serial: npcm: Add support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx uart driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Signed-off-by: Stanley Chu <yschu@nuvoton.com>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <kabel@kernel.org>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <masahiroy@kernel.org>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <masahiroy@kernel.org>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <masahiroy@kernel.org>

kconfig: add blank Kconfig files

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>

# 77b9b187 26-Sep-2023 Simon Glass <sjg@chromium.org>

serial: Drop mention of SPL/TPL_SYS_MALLOC_F

These symbols do not (yet) exist, so drop the usage of them in the
serial Kconfig file. It has no effect.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 82e26e0d 26-Sep-2023 Simon Glass <sjg@chromium.org>

spl: Use CONFIG_SPL... instead of CONFIG_..._SPL_...

We like to put the SPL first so it is clear that it relates to SPL. Rename
various malloc-related options which have crept in, to stick to this
convention.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com>

# ac897385 02-Oct-2023 Tom Rini <trini@konsulko.com>

Merge branch 'next'

Signed-off-by: Tom Rini <trini@konsulko.com>


# b1350636 19-Sep-2023 Simon Glass <sjg@chromium.org>

x86: coreboot: Look for DBG2 UART in SPL too

If coreboot does not set up sysinfo for the UART, SPL currently hangs.
Use the DBG2 technique there as well. This allows coreboot64 to boot from
coreboot even if the console info is missing from sysinfo

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# dfe08374 04-Sep-2023 Heinrich Schuchardt <xypron.glpk@gmx.de>

risc-v: implement DBCN based debug console

Use the DBCN SBI extension to implement a debug console.
Make it the default for S-mode RISC-V.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>

# a077ac13 02-Aug-2023 Tom Rini <trini@konsulko.com>

Kconfigs: Correct default of "0" on hex type entries

It is not a parse error to have a default value of "0" for a "hex" type
entry, instead of "0x0". However, "0" and "0x0" are not treated the
same even by the tools themselves. Correct this by changing the default
value from "0" to "0x0" for all hex type questions that had the
incorrect default. Fix one instance (in two configs) of a default of "0"
being used on a hex question to be "0x0". Remove the cases where a
defconfig had set a value of "0x0" to be used as the default had been
"0".

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ff476897 06-May-2023 Marek Vasut <marex@denx.de>

serial: mxs: Add MXS AUART driver

Add trivial driver for the MXS AUART IP. This is the other UART IP
present in i.MX23 and i.MX28, used to drive the non-DUART ports.

Signed-off-by: Marek Vasut <marex@denx.de>

# b29dbf98 04-May-2023 Simon Glass <sjg@chromium.org>

x86: Allow locating the UART from ACPI tables

When coreboot does not pass a UART in its sysinfo struct, there is no
easy way to find it out.

Since coreboot does not actually init the serial device when serial is
disabled, it is not possible to make it add this information to the
sysinfo table.

Add a way to obtain this information from the DBG2 ACPI table, which is
normally set up by coreboot.

For now this only supports a memory-mapped 16550-style UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 10ea2a7a 21-Apr-2023 Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

serial: msm-geni: correct oversampling value based on QUP hardware revision

Starting from QUP v2.5 the value of oversampling is changed from 32
to 16, keeping the old value on newer platforms results on wrong set
UART IP clock divider, thus the asked baudrate does not correspond to
the actually set with all the consequencies for a user.

The change links the driver to a new Qualcomm GENI SE QUP driver
to get its hardware version and update the oversampling value.

Deliberately the code under CONFIG_DEBUG_UART_MSM_GENI is not touched,
since a wanted baudrate can be controlled by setting a modified
CONFIG_DEBUG_UART_CLOCK build time variable.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

# 836d1bff 28-Feb-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

serial: sh: Add DEBUG_UART support

Add support for debug output very early during boot using the DEBUG_UART
mechanism. This uses a static fixed UART port configuration selected via
Kconfig options and dedicated print functions from debug_uart.h. This is
useful e.g. when debugging problems so early during boot, that not even
the DM is initialized at that point, and thus DM_SERIAL is not available
either.

This functionality is disabled by default. To activate it, define the
following Kconfig options and select SCIF type using CFG_SCI/CFG_SCIF_A/
CFG_HSCIF/<nothing for regular SCIF>:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_SCIF=y
CONFIG_DEBUG_UART_BASE=0xe6540000
CONFIG_DEBUG_UART_CLOCK=24000000

The later two options define the SCIF physical base address and SCIF
input clock in Hz. Optionally, to validate DEBUG_UART works, enable
the following as well to get early serial output message by default:

CONFIG_DEBUG_UART_ANNOUNCE=y

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

# 5745de2c 17-Dec-2022 Stefan Bosch <stefan_b@posteo.net>

arm: s5p4418: dm_serial: switch to DM_SERIAL

Switch the S5P4418-SOC and therefore the s5p4418_nanopi2 board to
DM_SERIAL.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>

# 91092132 16-Nov-2022 Tom Rini <trini@konsulko.com>

global: Move remaining CONFIG_SYS_NS16550_* to CFG_SYS_NS16550_*

The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_NS16550
namespace do not easily transition to Kconfig. In many cases they likely
should come from the device tree instead. Move these out of CONFIG
namespace and in to CFG namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9591b635 04-Dec-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_NS16550_MEM32 et al to Kconfig

This converts the following to Kconfig:
CONFIG_SPL_NS16550_MIN_FUNCTIONS
CONFIG_SYS_NS16550_MEM32
CONFIG_SYS_NS16550_PORT_MAPPED
CONFIG_SYS_NS16550_REG_SIZE
CONFIG_SYS_NS16550_SERIAL

To do this we also introduce CONFIG_SPL_SYS_NS16550_SERIAL so that
platforms can enable the legacy driver here for SPL.

Signed-off-by: Tom Rini <trini@konsulko.com>

# a457ebd7 25-Jun-2022 Tom Rini <trini@konsulko.com>

arm: Remove PXA architecture support

With the last platform for this architecture removed, remove the rest of
the architecture support as well.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ad55d99e 06-Jun-2022 Michal Simek <michal.simek@amd.com>

serial: Setup serial base and freq for zynq/zynqmp

Setup default values for debug console, base address and frequency.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ce93efd3ed67aa6390810ce0b79e0d00e7c36b4b.1652871485.git.michal.simek@amd.com

# 74950512 08-May-2022 Samuel Holland <samuel@sholland.org>

serial: Remove obsolete CONS_INDEX_n Kconfig options

These were only ever implied by sunxi platforms, and that usage has
been removed. Current practice is to specify CONFIG_CONS_INDEX in each
board's defconfig.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

# 958789f0 16-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option TPL_DEBUG_UART_BASE

TPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for TPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>

# 9f971ff7 06-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option SPL_DEBUG_UART_BASE

SPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for SPL.

In some cases base address of UART is different in SPL and proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# 6f6a0b74 18-Apr-2022 Jim Liu <jim.t90615@gmail.com>

serial: npcm: Add support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx uart driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Signed-off-by: Stanley Chu <yschu@nuvoton.com>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <kabel@kernel.org>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <masahiroy@kernel.org>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <masahiroy@kernel.org>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <masahiroy@kernel.org>

kconfig: add blank Kconfig files

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>

# ac897385 02-Oct-2023 Tom Rini <trini@konsulko.com>

Merge branch 'next'

Signed-off-by: Tom Rini <trini@konsulko.com>


# b1350636 19-Sep-2023 Simon Glass <sjg@chromium.org>

x86: coreboot: Look for DBG2 UART in SPL too

If coreboot does not set up sysinfo for the UART, SPL currently hangs.
Use the DBG2 technique there as well. This allows coreboot64 to boot from
coreboot even if the console info is missing from sysinfo

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# dfe08374 04-Sep-2023 Heinrich Schuchardt <xypron.glpk@gmx.de>

risc-v: implement DBCN based debug console

Use the DBCN SBI extension to implement a debug console.
Make it the default for S-mode RISC-V.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>

# a077ac13 02-Aug-2023 Tom Rini <trini@konsulko.com>

Kconfigs: Correct default of "0" on hex type entries

It is not a parse error to have a default value of "0" for a "hex" type
entry, instead of "0x0". However, "0" and "0x0" are not treated the
same even by the tools themselves. Correct this by changing the default
value from "0" to "0x0" for all hex type questions that had the
incorrect default. Fix one instance (in two configs) of a default of "0"
being used on a hex question to be "0x0". Remove the cases where a
defconfig had set a value of "0x0" to be used as the default had been
"0".

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ff476897 06-May-2023 Marek Vasut <marex@denx.de>

serial: mxs: Add MXS AUART driver

Add trivial driver for the MXS AUART IP. This is the other UART IP
present in i.MX23 and i.MX28, used to drive the non-DUART ports.

Signed-off-by: Marek Vasut <marex@denx.de>

# b29dbf98 04-May-2023 Simon Glass <sjg@chromium.org>

x86: Allow locating the UART from ACPI tables

When coreboot does not pass a UART in its sysinfo struct, there is no
easy way to find it out.

Since coreboot does not actually init the serial device when serial is
disabled, it is not possible to make it add this information to the
sysinfo table.

Add a way to obtain this information from the DBG2 ACPI table, which is
normally set up by coreboot.

For now this only supports a memory-mapped 16550-style UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 10ea2a7a 21-Apr-2023 Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

serial: msm-geni: correct oversampling value based on QUP hardware revision

Starting from QUP v2.5 the value of oversampling is changed from 32
to 16, keeping the old value on newer platforms results on wrong set
UART IP clock divider, thus the asked baudrate does not correspond to
the actually set with all the consequencies for a user.

The change links the driver to a new Qualcomm GENI SE QUP driver
to get its hardware version and update the oversampling value.

Deliberately the code under CONFIG_DEBUG_UART_MSM_GENI is not touched,
since a wanted baudrate can be controlled by setting a modified
CONFIG_DEBUG_UART_CLOCK build time variable.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

# 836d1bff 28-Feb-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

serial: sh: Add DEBUG_UART support

Add support for debug output very early during boot using the DEBUG_UART
mechanism. This uses a static fixed UART port configuration selected via
Kconfig options and dedicated print functions from debug_uart.h. This is
useful e.g. when debugging problems so early during boot, that not even
the DM is initialized at that point, and thus DM_SERIAL is not available
either.

This functionality is disabled by default. To activate it, define the
following Kconfig options and select SCIF type using CFG_SCI/CFG_SCIF_A/
CFG_HSCIF/<nothing for regular SCIF>:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_SCIF=y
CONFIG_DEBUG_UART_BASE=0xe6540000
CONFIG_DEBUG_UART_CLOCK=24000000

The later two options define the SCIF physical base address and SCIF
input clock in Hz. Optionally, to validate DEBUG_UART works, enable
the following as well to get early serial output message by default:

CONFIG_DEBUG_UART_ANNOUNCE=y

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

# 5745de2c 17-Dec-2022 Stefan Bosch <stefan_b@posteo.net>

arm: s5p4418: dm_serial: switch to DM_SERIAL

Switch the S5P4418-SOC and therefore the s5p4418_nanopi2 board to
DM_SERIAL.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>

# 91092132 16-Nov-2022 Tom Rini <trini@konsulko.com>

global: Move remaining CONFIG_SYS_NS16550_* to CFG_SYS_NS16550_*

The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_NS16550
namespace do not easily transition to Kconfig. In many cases they likely
should come from the device tree instead. Move these out of CONFIG
namespace and in to CFG namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9591b635 04-Dec-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_NS16550_MEM32 et al to Kconfig

This converts the following to Kconfig:
CONFIG_SPL_NS16550_MIN_FUNCTIONS
CONFIG_SYS_NS16550_MEM32
CONFIG_SYS_NS16550_PORT_MAPPED
CONFIG_SYS_NS16550_REG_SIZE
CONFIG_SYS_NS16550_SERIAL

To do this we also introduce CONFIG_SPL_SYS_NS16550_SERIAL so that
platforms can enable the legacy driver here for SPL.

Signed-off-by: Tom Rini <trini@konsulko.com>

# a457ebd7 25-Jun-2022 Tom Rini <trini@konsulko.com>

arm: Remove PXA architecture support

With the last platform for this architecture removed, remove the rest of
the architecture support as well.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ad55d99e 06-Jun-2022 Michal Simek <michal.simek@amd.com>

serial: Setup serial base and freq for zynq/zynqmp

Setup default values for debug console, base address and frequency.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ce93efd3ed67aa6390810ce0b79e0d00e7c36b4b.1652871485.git.michal.simek@amd.com

# 74950512 08-May-2022 Samuel Holland <samuel@sholland.org>

serial: Remove obsolete CONS_INDEX_n Kconfig options

These were only ever implied by sunxi platforms, and that usage has
been removed. Current practice is to specify CONFIG_CONS_INDEX in each
board's defconfig.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

# 958789f0 16-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option TPL_DEBUG_UART_BASE

TPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for TPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>

# 9f971ff7 06-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option SPL_DEBUG_UART_BASE

SPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for SPL.

In some cases base address of UART is different in SPL and proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# 6f6a0b74 18-Apr-2022 Jim Liu <jim.t90615@gmail.com>

serial: npcm: Add support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx uart driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Signed-off-by: Stanley Chu <yschu@nuvoton.com>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <kabel@kernel.org>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <masahiroy@kernel.org>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <masahiroy@kernel.org>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <masahiroy@kernel.org>

kconfig: add blank Kconfig files

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>

# dfe08374 04-Sep-2023 Heinrich Schuchardt <xypron.glpk@gmx.de>

risc-v: implement DBCN based debug console

Use the DBCN SBI extension to implement a debug console.
Make it the default for S-mode RISC-V.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>

# ff476897 06-May-2023 Marek Vasut <marex@denx.de>

serial: mxs: Add MXS AUART driver

Add trivial driver for the MXS AUART IP. This is the other UART IP
present in i.MX23 and i.MX28, used to drive the non-DUART ports.

Signed-off-by: Marek Vasut <marex@denx.de>

# b29dbf98 04-May-2023 Simon Glass <sjg@chromium.org>

x86: Allow locating the UART from ACPI tables

When coreboot does not pass a UART in its sysinfo struct, there is no
easy way to find it out.

Since coreboot does not actually init the serial device when serial is
disabled, it is not possible to make it add this information to the
sysinfo table.

Add a way to obtain this information from the DBG2 ACPI table, which is
normally set up by coreboot.

For now this only supports a memory-mapped 16550-style UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 10ea2a7a 21-Apr-2023 Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

serial: msm-geni: correct oversampling value based on QUP hardware revision

Starting from QUP v2.5 the value of oversampling is changed from 32
to 16, keeping the old value on newer platforms results on wrong set
UART IP clock divider, thus the asked baudrate does not correspond to
the actually set with all the consequencies for a user.

The change links the driver to a new Qualcomm GENI SE QUP driver
to get its hardware version and update the oversampling value.

Deliberately the code under CONFIG_DEBUG_UART_MSM_GENI is not touched,
since a wanted baudrate can be controlled by setting a modified
CONFIG_DEBUG_UART_CLOCK build time variable.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

# 836d1bff 28-Feb-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

serial: sh: Add DEBUG_UART support

Add support for debug output very early during boot using the DEBUG_UART
mechanism. This uses a static fixed UART port configuration selected via
Kconfig options and dedicated print functions from debug_uart.h. This is
useful e.g. when debugging problems so early during boot, that not even
the DM is initialized at that point, and thus DM_SERIAL is not available
either.

This functionality is disabled by default. To activate it, define the
following Kconfig options and select SCIF type using CFG_SCI/CFG_SCIF_A/
CFG_HSCIF/<nothing for regular SCIF>:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_SCIF=y
CONFIG_DEBUG_UART_BASE=0xe6540000
CONFIG_DEBUG_UART_CLOCK=24000000

The later two options define the SCIF physical base address and SCIF
input clock in Hz. Optionally, to validate DEBUG_UART works, enable
the following as well to get early serial output message by default:

CONFIG_DEBUG_UART_ANNOUNCE=y

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

# 5745de2c 17-Dec-2022 Stefan Bosch <stefan_b@posteo.net>

arm: s5p4418: dm_serial: switch to DM_SERIAL

Switch the S5P4418-SOC and therefore the s5p4418_nanopi2 board to
DM_SERIAL.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>

# 91092132 16-Nov-2022 Tom Rini <trini@konsulko.com>

global: Move remaining CONFIG_SYS_NS16550_* to CFG_SYS_NS16550_*

The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_NS16550
namespace do not easily transition to Kconfig. In many cases they likely
should come from the device tree instead. Move these out of CONFIG
namespace and in to CFG namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9591b635 04-Dec-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_NS16550_MEM32 et al to Kconfig

This converts the following to Kconfig:
CONFIG_SPL_NS16550_MIN_FUNCTIONS
CONFIG_SYS_NS16550_MEM32
CONFIG_SYS_NS16550_PORT_MAPPED
CONFIG_SYS_NS16550_REG_SIZE
CONFIG_SYS_NS16550_SERIAL

To do this we also introduce CONFIG_SPL_SYS_NS16550_SERIAL so that
platforms can enable the legacy driver here for SPL.

Signed-off-by: Tom Rini <trini@konsulko.com>

# a457ebd7 25-Jun-2022 Tom Rini <trini@konsulko.com>

arm: Remove PXA architecture support

With the last platform for this architecture removed, remove the rest of
the architecture support as well.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ad55d99e 06-Jun-2022 Michal Simek <michal.simek@amd.com>

serial: Setup serial base and freq for zynq/zynqmp

Setup default values for debug console, base address and frequency.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ce93efd3ed67aa6390810ce0b79e0d00e7c36b4b.1652871485.git.michal.simek@amd.com

# 74950512 08-May-2022 Samuel Holland <samuel@sholland.org>

serial: Remove obsolete CONS_INDEX_n Kconfig options

These were only ever implied by sunxi platforms, and that usage has
been removed. Current practice is to specify CONFIG_CONS_INDEX in each
board's defconfig.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

# 958789f0 16-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option TPL_DEBUG_UART_BASE

TPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for TPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>

# 9f971ff7 06-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option SPL_DEBUG_UART_BASE

SPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for SPL.

In some cases base address of UART is different in SPL and proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# 6f6a0b74 18-Apr-2022 Jim Liu <jim.t90615@gmail.com>

serial: npcm: Add support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx uart driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Signed-off-by: Stanley Chu <yschu@nuvoton.com>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <kabel@kernel.org>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <masahiroy@kernel.org>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <masahiroy@kernel.org>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <masahiroy@kernel.org>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <masahiroy@kernel.org>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <masahiroy@kernel.org>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <masahiroy@kernel.org>

kconfig: add blank Kconfig files

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>

# ff476897 06-May-2023 Marek Vasut <marex@denx.de>

serial: mxs: Add MXS AUART driver

Add trivial driver for the MXS AUART IP. This is the other UART IP
present in i.MX23 and i.MX28, used to drive the non-DUART ports.

Signed-off-by: Marek Vasut <marex@denx.de>

# b29dbf98 04-May-2023 Simon Glass <sjg@chromium.org>

x86: Allow locating the UART from ACPI tables

When coreboot does not pass a UART in its sysinfo struct, there is no
easy way to find it out.

Since coreboot does not actually init the serial device when serial is
disabled, it is not possible to make it add this information to the
sysinfo table.

Add a way to obtain this information from the DBG2 ACPI table, which is
normally set up by coreboot.

For now this only supports a memory-mapped 16550-style UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 10ea2a7a 21-Apr-2023 Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

serial: msm-geni: correct oversampling value based on QUP hardware revision

Starting from QUP v2.5 the value of oversampling is changed from 32
to 16, keeping the old value on newer platforms results on wrong set
UART IP clock divider, thus the asked baudrate does not correspond to
the actually set with all the consequencies for a user.

The change links the driver to a new Qualcomm GENI SE QUP driver
to get its hardware version and update the oversampling value.

Deliberately the code under CONFIG_DEBUG_UART_MSM_GENI is not touched,
since a wanted baudrate can be controlled by setting a modified
CONFIG_DEBUG_UART_CLOCK build time variable.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

# 836d1bff 28-Feb-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

serial: sh: Add DEBUG_UART support

Add support for debug output very early during boot using the DEBUG_UART
mechanism. This uses a static fixed UART port configuration selected via
Kconfig options and dedicated print functions from debug_uart.h. This is
useful e.g. when debugging problems so early during boot, that not even
the DM is initialized at that point, and thus DM_SERIAL is not available
either.

This functionality is disabled by default. To activate it, define the
following Kconfig options and select SCIF type using CFG_SCI/CFG_SCIF_A/
CFG_HSCIF/<nothing for regular SCIF>:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_SCIF=y
CONFIG_DEBUG_UART_BASE=0xe6540000
CONFIG_DEBUG_UART_CLOCK=24000000

The later two options define the SCIF physical base address and SCIF
input clock in Hz. Optionally, to validate DEBUG_UART works, enable
the following as well to get early serial output message by default:

CONFIG_DEBUG_UART_ANNOUNCE=y

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

# 5745de2c 17-Dec-2022 Stefan Bosch <stefan_b@posteo.net>

arm: s5p4418: dm_serial: switch to DM_SERIAL

Switch the S5P4418-SOC and therefore the s5p4418_nanopi2 board to
DM_SERIAL.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>

# 91092132 16-Nov-2022 Tom Rini <trini@konsulko.com>

global: Move remaining CONFIG_SYS_NS16550_* to CFG_SYS_NS16550_*

The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_NS16550
namespace do not easily transition to Kconfig. In many cases they likely
should come from the device tree instead. Move these out of CONFIG
namespace and in to CFG namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9591b635 04-Dec-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_NS16550_MEM32 et al to Kconfig

This converts the following to Kconfig:
CONFIG_SPL_NS16550_MIN_FUNCTIONS
CONFIG_SYS_NS16550_MEM32
CONFIG_SYS_NS16550_PORT_MAPPED
CONFIG_SYS_NS16550_REG_SIZE
CONFIG_SYS_NS16550_SERIAL

To do this we also introduce CONFIG_SPL_SYS_NS16550_SERIAL so that
platforms can enable the legacy driver here for SPL.

Signed-off-by: Tom Rini <trini@konsulko.com>

# a457ebd7 25-Jun-2022 Tom Rini <trini@konsulko.com>

arm: Remove PXA architecture support

With the last platform for this architecture removed, remove the rest of
the architecture support as well.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ad55d99e 06-Jun-2022 Michal Simek <michal.simek@amd.com>

serial: Setup serial base and freq for zynq/zynqmp

Setup default values for debug console, base address and frequency.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ce93efd3ed67aa6390810ce0b79e0d00e7c36b4b.1652871485.git.michal.simek@amd.com

# 74950512 08-May-2022 Samuel Holland <samuel@sholland.org>

serial: Remove obsolete CONS_INDEX_n Kconfig options

These were only ever implied by sunxi platforms, and that usage has
been removed. Current practice is to specify CONFIG_CONS_INDEX in each
board's defconfig.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

# 958789f0 16-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option TPL_DEBUG_UART_BASE

TPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for TPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>

# 9f971ff7 06-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option SPL_DEBUG_UART_BASE

SPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for SPL.

In some cases base address of UART is different in SPL and proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# 6f6a0b74 18-Apr-2022 Jim Liu <jim.t90615@gmail.com>

serial: npcm: Add support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx uart driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Signed-off-by: Stanley Chu <yschu@nuvoton.com>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <kabel@kernel.org>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

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>

# 836d1bff 28-Feb-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

serial: sh: Add DEBUG_UART support

Add support for debug output very early during boot using the DEBUG_UART
mechanism. This uses a static fixed UART port configuration selected via
Kconfig options and dedicated print functions from debug_uart.h. This is
useful e.g. when debugging problems so early during boot, that not even
the DM is initialized at that point, and thus DM_SERIAL is not available
either.

This functionality is disabled by default. To activate it, define the
following Kconfig options and select SCIF type using CFG_SCI/CFG_SCIF_A/
CFG_HSCIF/<nothing for regular SCIF>:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_SCIF=y
CONFIG_DEBUG_UART_BASE=0xe6540000
CONFIG_DEBUG_UART_CLOCK=24000000

The later two options define the SCIF physical base address and SCIF
input clock in Hz. Optionally, to validate DEBUG_UART works, enable
the following as well to get early serial output message by default:

CONFIG_DEBUG_UART_ANNOUNCE=y

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

# 5745de2c 17-Dec-2022 Stefan Bosch <stefan_b@posteo.net>

arm: s5p4418: dm_serial: switch to DM_SERIAL

Switch the S5P4418-SOC and therefore the s5p4418_nanopi2 board to
DM_SERIAL.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>

# 91092132 16-Nov-2022 Tom Rini <trini@konsulko.com>

global: Move remaining CONFIG_SYS_NS16550_* to CFG_SYS_NS16550_*

The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_NS16550
namespace do not easily transition to Kconfig. In many cases they likely
should come from the device tree instead. Move these out of CONFIG
namespace and in to CFG namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9591b635 04-Dec-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_NS16550_MEM32 et al to Kconfig

This converts the following to Kconfig:
CONFIG_SPL_NS16550_MIN_FUNCTIONS
CONFIG_SYS_NS16550_MEM32
CONFIG_SYS_NS16550_PORT_MAPPED
CONFIG_SYS_NS16550_REG_SIZE
CONFIG_SYS_NS16550_SERIAL

To do this we also introduce CONFIG_SPL_SYS_NS16550_SERIAL so that
platforms can enable the legacy driver here for SPL.

Signed-off-by: Tom Rini <trini@konsulko.com>

# a457ebd7 25-Jun-2022 Tom Rini <trini@konsulko.com>

arm: Remove PXA architecture support

With the last platform for this architecture removed, remove the rest of
the architecture support as well.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ad55d99e 06-Jun-2022 Michal Simek <michal.simek@amd.com>

serial: Setup serial base and freq for zynq/zynqmp

Setup default values for debug console, base address and frequency.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ce93efd3ed67aa6390810ce0b79e0d00e7c36b4b.1652871485.git.michal.simek@amd.com

# 74950512 08-May-2022 Samuel Holland <samuel@sholland.org>

serial: Remove obsolete CONS_INDEX_n Kconfig options

These were only ever implied by sunxi platforms, and that usage has
been removed. Current practice is to specify CONFIG_CONS_INDEX in each
board's defconfig.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

# 958789f0 16-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option TPL_DEBUG_UART_BASE

TPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for TPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>

# 9f971ff7 06-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option SPL_DEBUG_UART_BASE

SPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for SPL.

In some cases base address of UART is different in SPL and proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# 6f6a0b74 18-Apr-2022 Jim Liu <jim.t90615@gmail.com>

serial: npcm: Add support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx uart driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Signed-off-by: Stanley Chu <yschu@nuvoton.com>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <kabel@kernel.org>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

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>

# 5745de2c 17-Dec-2022 Stefan Bosch <stefan_b@posteo.net>

arm: s5p4418: dm_serial: switch to DM_SERIAL

Switch the S5P4418-SOC and therefore the s5p4418_nanopi2 board to
DM_SERIAL.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>

# 91092132 16-Nov-2022 Tom Rini <trini@konsulko.com>

global: Move remaining CONFIG_SYS_NS16550_* to CFG_SYS_NS16550_*

The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_NS16550
namespace do not easily transition to Kconfig. In many cases they likely
should come from the device tree instead. Move these out of CONFIG
namespace and in to CFG namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9591b635 04-Dec-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_NS16550_MEM32 et al to Kconfig

This converts the following to Kconfig:
CONFIG_SPL_NS16550_MIN_FUNCTIONS
CONFIG_SYS_NS16550_MEM32
CONFIG_SYS_NS16550_PORT_MAPPED
CONFIG_SYS_NS16550_REG_SIZE
CONFIG_SYS_NS16550_SERIAL

To do this we also introduce CONFIG_SPL_SYS_NS16550_SERIAL so that
platforms can enable the legacy driver here for SPL.

Signed-off-by: Tom Rini <trini@konsulko.com>

# a457ebd7 25-Jun-2022 Tom Rini <trini@konsulko.com>

arm: Remove PXA architecture support

With the last platform for this architecture removed, remove the rest of
the architecture support as well.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ad55d99e 06-Jun-2022 Michal Simek <michal.simek@amd.com>

serial: Setup serial base and freq for zynq/zynqmp

Setup default values for debug console, base address and frequency.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ce93efd3ed67aa6390810ce0b79e0d00e7c36b4b.1652871485.git.michal.simek@amd.com

# 74950512 08-May-2022 Samuel Holland <samuel@sholland.org>

serial: Remove obsolete CONS_INDEX_n Kconfig options

These were only ever implied by sunxi platforms, and that usage has
been removed. Current practice is to specify CONFIG_CONS_INDEX in each
board's defconfig.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

# 958789f0 16-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option TPL_DEBUG_UART_BASE

TPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for TPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>

# 9f971ff7 06-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option SPL_DEBUG_UART_BASE

SPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for SPL.

In some cases base address of UART is different in SPL and proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# 6f6a0b74 18-Apr-2022 Jim Liu <jim.t90615@gmail.com>

serial: npcm: Add support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx uart driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Signed-off-by: Stanley Chu <yschu@nuvoton.com>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <kabel@kernel.org>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

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>

# a457ebd7 25-Jun-2022 Tom Rini <trini@konsulko.com>

arm: Remove PXA architecture support

With the last platform for this architecture removed, remove the rest of
the architecture support as well.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ad55d99e 06-Jun-2022 Michal Simek <michal.simek@amd.com>

serial: Setup serial base and freq for zynq/zynqmp

Setup default values for debug console, base address and frequency.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ce93efd3ed67aa6390810ce0b79e0d00e7c36b4b.1652871485.git.michal.simek@amd.com

# 74950512 08-May-2022 Samuel Holland <samuel@sholland.org>

serial: Remove obsolete CONS_INDEX_n Kconfig options

These were only ever implied by sunxi platforms, and that usage has
been removed. Current practice is to specify CONFIG_CONS_INDEX in each
board's defconfig.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

# 958789f0 16-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option TPL_DEBUG_UART_BASE

TPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for TPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>

# 9f971ff7 06-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option SPL_DEBUG_UART_BASE

SPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for SPL.

In some cases base address of UART is different in SPL and proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# 6f6a0b74 18-Apr-2022 Jim Liu <jim.t90615@gmail.com>

serial: npcm: Add support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx uart driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Signed-off-by: Stanley Chu <yschu@nuvoton.com>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <marek.behun@nic.cz>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

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>

# 74950512 08-May-2022 Samuel Holland <samuel@sholland.org>

serial: Remove obsolete CONS_INDEX_n Kconfig options

These were only ever implied by sunxi platforms, and that usage has
been removed. Current practice is to specify CONFIG_CONS_INDEX in each
board's defconfig.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

# 958789f0 16-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option TPL_DEBUG_UART_BASE

TPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for TPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>

# 9f971ff7 06-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option SPL_DEBUG_UART_BASE

SPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for SPL.

In some cases base address of UART is different in SPL and proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# 6f6a0b74 18-Apr-2022 Jim Liu <jim.t90615@gmail.com>

serial: npcm: Add support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx uart driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Signed-off-by: Stanley Chu <yschu@nuvoton.com>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <marek.behun@nic.cz>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

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>

# 958789f0 16-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option TPL_DEBUG_UART_BASE

TPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for TPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>

# 9f971ff7 06-May-2022 Pali Rohár <pali@kernel.org>

serial: Add new config option SPL_DEBUG_UART_BASE

SPL_DEBUG_UART_BASE is same as DEBUG_UART_BASE, but applies only for SPL.

In some cases base address of UART is different in SPL and proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# 6f6a0b74 18-Apr-2022 Jim Liu <jim.t90615@gmail.com>

serial: npcm: Add support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx uart driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Signed-off-by: Stanley Chu <yschu@nuvoton.com>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <marek.behun@nic.cz>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

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>

# 6f6a0b74 18-Apr-2022 Jim Liu <jim.t90615@gmail.com>

serial: npcm: Add support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx uart driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Signed-off-by: Stanley Chu <yschu@nuvoton.com>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <marek.behun@nic.cz>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

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>

# 747093dd 30-Apr-2022 Simon Glass <sjg@chromium.org>

vpl: Add Kconfig options for VPL

Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <marek.behun@nic.cz>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@amd.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@amd.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@amd.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@amd.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@amd.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@amd.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@amd.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@amd.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

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>

# 9ee6c076 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 6dcaf2d2 09-Apr-2022 Johan Jonker <jbx6244@gmail.com>

rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@xilinx.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <marek.behun@nic.cz>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@xilinx.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

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>

# 34855b39 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>

# efa51f2b 04-Apr-2022 Sean Anderson <sean.anderson@seco.com>

serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@xilinx.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <marek.behun@nic.cz>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@xilinx.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

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>

# 5d14c336 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>

# f9f3209a 30-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_SCIF0
CONFIG_CONS_SCIF1
CONFIG_CONS_SCIF2
CONFIG_CONS_SCIF4
CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@xilinx.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <marek.behun@nic.cz>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@xilinx.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

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>

# 7a763471 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: dm: Add support for puts

Some serial drivers can be vastly more efficient when printing multiple
characters at once. Non-DM serial has had a puts option for these sorts
of drivers; implement it for DM serial as well.

Because we have to add carriage returns, we can't just pass the whole
string directly to the serial driver. Instead, we print up to the
newline, then print a carriage return, and then continue on. This is
less efficient, but it is better than printing each character
individually. It also avoids having to allocate memory just to add a few
characters.

Drivers may perform short writes (such as filling a FIFO) and return the
number of characters written in len. We loop over them in the same way
that _serial_putc loops over putc.

This results in around sizeof(void *) growth for all boards with
DM_SERIAL. The full implementation takes around 140 bytes.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 74d11d37 22-Mar-2022 Sean Anderson <sean.anderson@seco.com>

serial: Add semihosting driver

This adds a serial driver which uses semihosting calls to read and write
to the host's console. For convenience, if CONFIG_DM_SERIAL is enabled,
we will instantiate a serial driver. This allows users to enable this
driver (which has no physical device) without modifying their device
trees or board files. We also implement a non-DM driver for SPL, or for
much faster output in U-Boot proper.

There are three ways to print to the console:

Method Baud
================== =====
smh_putc in a loop 170
smh_puts 1600
smh_write with :tt 20000
================== =====

These speeds were measured using a 175 character message with a J-Link
adapter. For reference, U-Boot typically prints around 2700 characters
during boot on this board. There are two major factors affecting the
speed of these functions. First, each breakpoint incurs a delay. Second,
each debugger memory transaction incurs a delay. smh_putc has a
breakpoint and memory transaction for every character. smh_puts has one
breakpoint, but still has to use a transaction for every character. This
is because we don't know the length up front, so OpenOCD has to check if
each character is nul. smh_write has only one breakpoint and one memory
transfer.

DM serial drivers can only implement a putc interface, so we are stuck
with the slowest API. Non-DM drivers can implement puts, which is vastly
more efficient. When the driver starts up, we try to open :tt. Since
this is an extension, this may fail. If it does, we fall back to
smh_puts. We don't check :semihosting-features, since there are
nonconforming implementations (OpenOCD) which don't implement it (but
*do* implement :tt).

Some semihosting implementations (QEMU) don't handle READC properly. To
work around this, we try to use open/read (much like for stdin) if
possible.

There is no non-blocking I/O available, so we don't implement pending.
This will cause __serial_tstc to always return true. If
CONFIG_SERIAL_RX_BUFFER is enabled, _serial_tstc will try and read
characters forever. To avoid this, we depend on this config being
disabled.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# db48e525 23-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_LPUART et al to Kconfig

This converts the following to Kconfig:
CONFIG_LPUART
CONFIG_LPUART_32B_REG

And note that CONFIG_LPUART_32B_REG is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@xilinx.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <marek.behun@nic.cz>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@xilinx.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marex@denx.de>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

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>

# d6ba787e 26-Jan-2022 Anup Patel <apatel@ventanamicro.com>

serial: Add RISC-V HTIF console driver

Quite a few RISC-V emulators and ISS (including Spike) have host
transfer interface (HTIF) based console. This patch adds HTIF
based console driver for RISC-V platforms which depends totally
on DT node for HTIF register base address.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@xilinx.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <marek.behun@nic.cz>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@xilinx.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 324df15a 17-Oct-2021 Dzmitry Sankouski <dsankouski@gmail.com>

serial: qcom: add support for GENI serial driver

Generic Interface (GENI) Serial Engine (SE) based uart
can be found on newer qualcomm SOCs, starting from SDM845.
Tested on Samsung SM-G9600(starqltechn)
by chain-loading u-boot with stock bootloader.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Tom Rini <trini@konsulko.com>

# d520e1fb 23-Oct-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Add Apple M1 support

Apple M1 SoCs include an S5L UART which is a variant of the S5P
UART. Add support for this variant and enable it by default
on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@xilinx.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <marek.behun@nic.cz>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@xilinx.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 41f7be73 12-Sep-2021 Samuel Holland <samuel@sholland.org>

serial: Add a debug console using the RISC-V SBI interface

The RISC-V SBI interface v0.1 provides a function for printing a
character to the console. Even though SBI v0.1 functions are deprecated,
the SBI console is quite useful for early debugging, because it works
without any dcache, memory, or MMIO access in S mode.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 8ba59608 09-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove zmx25 board and ARCH_MX25

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.

Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 14b38cb0 14-Sep-2021 Tom Rini <trini@konsulko.com>

arm: Remove flea3 board

This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 52510486 08-Aug-2021 Simon Glass <sjg@chromium.org>

serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@xilinx.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 4a8ad584 09-Jul-2021 Marek Behún <marek.behun@nic.cz>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@xilinx.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 4a8ad584 09-Jul-2021 Marek Behún <marek.behun@nic.cz>

arm: mvebu: armada-3720: remove unused config option

The config option CONFIG_DEBUG_UART_CLOCK is not used by Armada 3720's
serial driver (it wasn't even before the recent update of that driver).

Even if it was used, the value was incorrect (the frequency of the clock
is 25 MHz, not 25.8048 MHz).

Remove it from config files and set the default value to 0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@xilinx.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# bc08dc56 22-May-2021 Tom Rini <trini@konsulko.com>

arm: Remove edb9315a board

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM. Remove it.

This is also the last PL010_SERIAL using board, so remove those
references.

Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@xilinx.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 5e9d2833 24-Jun-2021 Michal Simek <michal.simek@xilinx.com>

serial: Add additional depencies for PL010 and PL011 drivers

Both of these drivers are implemented with and without DM that's why more
symbols should be handled.
The most problematic one is enabling DEBUG_UART_PL011 based on
PL01X_SERIAL(DM based) because debug console has type selection based on
it.
enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
TYPE_PL011 : TYPE_PL010;

Without it pl01x_generic_setbrg() is configuring different registers.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# f1054661 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_bootcmd.c: Add PCI remote console support

This patch adds the PCI bootcmd feature for MIPS Octeon, which will be
used by the upcoming Octeon III NIC23 board support. It enables the use
of the "oct-remote-load" and "oct-remote-bootcmd" on host PC's to
communicate with the PCIe target and load images into the onboard
memory and issue commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4dead10d 07-Apr-2021 Stefan Roese <sr@denx.de>

serial: serial_octeon_pcie_console.c: Add PCI remote console support

This patch adds the PCI remote console feature for MIPS Octeon, which
will be used by the upcoming Octeon III NIC23 board support. It enables
the use of the "oct-remote-console" tool on host PC's to communicate
with the PCIe target.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 4652bef1 20-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove apf27 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 0d9ff95c 12-Feb-2021 Mark Kettenis <kettenis@openbsd.org>

serial: s5p: Allow independent selection

Currently support for the Samsung serial port driver is part
of CONFIG_S5P which controls selection of several drivers for
the S5P family. Give it its own config option such that we
can use it on other SoCs as well.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# a1361f45 09-Feb-2021 Tom Rini <trini@konsulko.com>

arm: Remove mx35pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline of
v2019.04, which is almost two years ago. In addition there are other DM
migrations it is also missing. Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 2161f1fc 12-Nov-2020 Weijie Gao <weijie.gao@mediatek.com>

serial: add uart driver for MediaTek MT7620 SoC

This patch adds uart support for MediaTek MT7620 and earlier SoCs.

The UART used by MT7620 is incompatible with the ns16550a driver.
All registers of this UART have different addresses. A special 16-bit
register for Divisor Latch is used to set the baudrate instead of the
original two 8-bit registers (DLL and DLM).

The driver supports of-platdata which is useful for tiny SPL.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 67b2ed02 08-Dec-2020 Vabhav Sharma <vabhav.sharma@nxp.com>

drivers: serial: probe all uart devices

U-Boot DM model probe only single device at a time
which is enabled and configured using device tree
or platform data method.

PL011 UART IP is SBSA compliant and firmware does the
serial port set-up, initialization and let the kernel use
UART port for sending and receiving characters.

Normally software talk to one serial port time but some
LayerScape platform require all the UART devices enabled
in Linux for various use case.

Adding support to probe all enabled serial devices like SBSA
compliant PL011 UART ports probe and initialization by firmware.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@foss.st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@foss.st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@foss.st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 467591b8 23-Oct-2020 Tom Rini <trini@konsulko.com>

Revert "serial: serial_xen: add DEBUG_UART support"

This reverts commit 82e21b391bd315f6fe0e0b79326af8a141e9cca7.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 82e21b39 14-Oct-2020 AKASHI Takahiro <takahiro.akashi@linaro.org>

serial: serial_xen: add DEBUG_UART support

By using a hypervisor call, we can implement DEBUG_UART on xen.
This will allow us to see messages even earlier than serial_init().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

# 54fdef24 24-Aug-2020 Michal Simek <michal.simek@xilinx.com>

xilinx: kconfig: Change Kconfig dependencies for Xilinx drivers

Zynq/ZynqMP/Versal IPs should be possible to called also from Microblaze in
PL and vice versa. That's why change dependencies and do not limit enabling
just for some platforms.

This is follow up patch based on commit 664e16ce99a0 ("xilinx: kconfig:
Change Kconfig dependencies for Xilinx drivers").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 384d5cfe 05-Aug-2020 Peng Fan <peng.fan@nxp.com>

serial: serial_xen: Add Xen PV serial driver

Add support for Xen para-virtualized serial driver. This
driver fully supports serial console for the virtual machine.

Please note that as the driver is initialized late, so no banner
nor memory size is visible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 27b4a4ab 09-Jul-2020 Michal Simek <michal.simek@xilinx.com>

serial: Fix SIFIVE debug serial dependency

The commit 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for
debug consoles") has added incorrect dependency for SIFIVE debug uart which
should depend on SIFIVE driver instead of PL01x.

Fixes: 4cc24aeaf420 ("serial: Add missing Kconfig dependencies for debug consoles")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# e6676a34 09-Jun-2020 Tom Rini <trini@konsulko.com>

Convert CONFIG_MXC_UART to Kconfig

This converts the following to Kconfig:
CONFIG_MXC_UART

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Peng Fan <peng.fan@nxp.com>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 4cc24aea 27-May-2020 Michal Simek <michal.simek@xilinx.com>

serial: Add missing Kconfig dependencies for debug consoles

Debug console is the part of serial driver in the same file. It means to be
able to enable debug console you also need to enable driver itself.
That's why add all dependecies and list only debug consoles which are
enabled based on driver selection to avoid compilation error when user
asks for certain debug console but driver is not enable for it.

Error:
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `putc':
/home/monstr/data/disk/u-boot/common/console.c:513: undefined reference to `printch'
aarch64-linux-gnu-ld.bfd: common/built-in.o: in function `puts':
/home/monstr/data/disk/u-boot/common/console.c:563: undefined reference to `printch'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix ns16550 dependency, add ZYNQ_SERIAL, change S5P]
Signed-off-by: Tom Rini <trini@konsulko.com>

# c2a38411 02-Jun-2020 Tom Rini <trini@konsulko.com>

serial: Convert ARM_DCC to Kconfig

The symbol "CONFIG_ARM_DCC" is used to control building
drivers/serial/arm_dcc.c. Provide a simple Kconfig entry for this.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tom McLeod <tom.mcleod@opalkelly.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 0de653d8 30-Jan-2020 Jason Li <jason.li@cortina-access.com>

serial: serial_cortina: add UART DM driver for CAxxxx SoCs

Add serial UART driver support for all Cortina Access
CAxxxx family of SoCs.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Jason Li <jason.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 44482e8a 19-Dec-2019 Simon Glass <sjg@chromium.org>

x86: serial: Add a coreboot serial driver

Coreboot can provide information about the serial device in use on a
platform. Add a driver that uses this information to produce a working
UART.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 62cbde4c 19-Dec-2019 Simon Glass <sjg@chromium.org>

serial: ns16550: Support run-time configuration

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 327bb3bc 17-Dec-2019 Sean Anderson <seanga2@gmail.com>

Add dependencies for MALLOC_F and OF_LIBFDT

Some features implicitly depended on MALLOC_F and OF_LIBFDT and would
fail at link-time if these features were not enabled.

Signed-off-by: Sean Anderson <seanga2@gmail.com>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@csgraf.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@csgraf.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda <ricardo@ribalda.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 6920f00c 10-Nov-2019 Thomas Hebb <tommyhebb@gmail.com>

Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@suse.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@suse.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@suse.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@suse.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@suse.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@suse.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# 8c247bbe 07-Aug-2019 Peng Fan <peng.fan@nxp.com>

serial: Kconfig: make MXC_UART usable for MX7 and IMX8M

i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could
use MXC_UART kconfig.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@suse.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@suse.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@suse.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@suse.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@suse.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@suse.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# a074667d 24-Aug-2019 Adam Ford <aford173@gmail.com>

Kconfig: Varios: Fix more SPL, TPL dependencies

Several options are presenting themselves on a various boards
where the options are clearly not used. (ie, SPL/TPL options
when SPL or TPL are not defined)

This patch is not attempting to be a complete list of items, but
more like low hanging fruit. In some instances, I wasn't sure
of DM was required, so I simply made them SPL or TPL.

This patch attempts to reduce some of the menuconfig noise
by defining dependencies so they don't appear when not used.

Signed-off-by: Adam Ford <aford173@gmail.com>

# 461ea079 13-Mar-2019 Angelo Dureghello <angelo@sysam.it>

drivers: serial: mcfuart: add DT support

This patch adds devicetree support to the mcfuart.c driver
and removes non DM code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Angelo Dureghello <angelo@sysam.it>

# e567dfb2 03-Apr-2019 Stefan Roese <sr@denx.de>

serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>

# c4448bdc 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

serial: ns16550: fix debug uart putc called before init

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>

# 7828e3cf 09-Jan-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2842496 14-Dec-2018 Anup Patel <anup@brainfault.org>

drivers: serial: Add SiFive UART driver

This patch adds SiFive UART driver. The driver is 100% DM driver
and it determines input clock using clk framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# e9e8d80d 01-Dec-2018 Álvaro Fernández Rojas <noltari@gmail.com>

serial: bcm6858: remove driver and switch to bcm6345

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

# 849b1160 14-Nov-2018 Ryder Lee <ryder.lee@mediatek.com>

serial: MediaTek: add high-speed uart driver for MediaTek SoCs

Many SoCs from MediaTek have a high-speed uart. This UART is compatible
with the ns16550 in legacy mode. It has extra registers for high-speed
mode which can reach a maximum baudrate at 921600.

However this UART will no longer be compatible if it's in high-speed mode.
Some BootROM of MediaTek's SoCs will change the UART into high-speed mode
and the U-Boot must use this driver to initialize the UART.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>

# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>

# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>

# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>

# ae5326a6 29-Jan-2018 Alexander Graf <agraf@suse.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 6001985f 24-Jan-2018 Alexander Graf <agraf@suse.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

# fa487594 24-Jan-2018 Alexander Graf <agraf@suse.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>

# cf2c7784 24-Jan-2018 Alexander Graf <agraf@suse.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>

# d10fc50f 24-Jan-2018 Alexander Graf <agraf@suse.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>

# 884f9013 24-Jan-2018 Alexander Graf <agraf@suse.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>

# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>

# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>

# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>

# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>

# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>

# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>

# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>

# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>

# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>

# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>

# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>

# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>

# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>

# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 1df182dd 28-Oct-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-atmel


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>

# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>

# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>

# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 80cce262 26-Jan-2016 Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>

# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>

# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>

# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>

# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>

# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>

# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>

# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>

# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# c9feb427 03-Sep-2015 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-rockchip


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>

# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>

# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>

# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>

# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>

# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>

# f371f91b 11-Oct-2018 Philippe Reynes <philippe.reynes@softathome.com>

serial: bcm6858: add serial support

This driver add the support of serial on bcm6858.
It's based on serial for bcm6345.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>


# aa0ffe8e 01-Oct-2018 Simon Glass <sjg@chromium.org>

serial: Allow serial to be absent in TPL

At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().

Signed-off-by: Simon Glass <sjg@chromium.org>


# ee441764 01-Oct-2018 Simon Glass <sjg@chromium.org>

sandbox: Add a debug UART

Add support for the debug UART so that sandbox provides build testing for
this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 586bde93 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

arm: K3: Add initial support for TI's K3 generation of SoCs

Add support for Texas Instruments' K3 Generation Processor
families.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 5d754197 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Introduce DM specific omap serial

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>


# 6f9347f3 14-Jun-2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

serial: Add Actions Semi OWL UART support

This commit adds Actions Semi OWL family UART support. This driver
relies on baudrate configured by primary bootloaders.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 215c8bed 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

serial: stm32: Add debug uart support

Add support for early debug printf, before the availability of
driver model and device tree support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 54705016 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial/serial_arc: Implement debug serial

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>


# d7ac185f 21-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

serial: Convert ARC_SERIAL to Kconfig

One step closer to completely Kconfig-driven target configuration in
U-Boot :)

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>


# 1d6c54ec 12-Apr-2018 Michal Simek <michal.simek@xilinx.com>

arm: zynqmp: Add ZynqMP minimal R5 support

Xilinx ZynqMP also contains dual Cortex R5 which can run U-Boot.
This patch is adding minimal support to get U-Boot boot.
U-Boot on R5 runs out of DDR with default configuration that's why
DDR needs to be partitioned if there is something else running on arm64.
Console is done via Cadence uart driver and the first Cadence Triple
Timer Counter is used for time.

This configuration with uart1 was tested on zcu100-revC.

U-Boot 2018.05-rc2-00021-gd058a08d907d (Apr 18 2018 - 14:11:27 +0200)

Model: Xilinx ZynqMP R5
DRAM: 512 MiB
WARNING: Caches not enabled
MMC:
In: serial@ff010000
Out: serial@ff010000
Err: serial@ff010000
Net: Net Initialization Skipped
No ethernet found.
ZynqMP r5>

There are two ways how to run this on ZynqMP.
1. Run from ZynqMP arm64
tftpb 20000000 u-boot-r5.elf
setenv autostart no && bootelf -p 20000000
cpu 4 disable && cpu 4 release 10000000 lockstep
or
cpu 4 disable && cpu 4 release 10000000 split

2. Load via jtag when directly to R5

Signed-off-by: Michal Simek <michal.simek@xilinx.com>


# fac379e1 08-Apr-2018 Tuomas Tynkkynen <tuomas@tuxera.com>

serial: Migrate CONFIG_FSL_LINFLEXUART to Kconfig

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>


# ee1e600c 16-Mar-2018 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx

CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>


# 2514c2d0 12-Mar-2018 Patrick Delaunay <patrick.delaunay@st.com>

arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>


# 6f6b7cfa 06-Mar-2018 Tom Rini <trini@konsulko.com>

Convert all of CONFIG_CONS_INDEX to Kconfig

This converts the following to Kconfig:
CONFIG_CONS_INDEX

We have existing entries for this option in a number of places, with
different guards on them. They're also sometimes used for things not
directly inside of the serial driver. First, introduce a new symbol to
guard the use of CONFIG_CONS_INDEX, so that in the case where we don't
need this for the serial driver, but for some other use, we can still do
it. Next, consolidate all of these into the single entry in
drivers/serial/Kconfig. Finally, introduce CONS_INDEX_[023456] so that
we can imply a correct value here to make the defconfig side of this
smaller.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rework a lot of the logic here, such that I took authorship from
Adam, but kept his S-o-B line]
Signed-off-by: Tom Rini <trini@konsulko.com>


# ae5326a6 29-Jan-2018 Alexander Graf <agraf@suse.de>

serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6001985f 24-Jan-2018 Alexander Graf <agraf@suse.de>

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>


# fa487594 24-Jan-2018 Alexander Graf <agraf@suse.de>

bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>


# cf2c7784 24-Jan-2018 Alexander Graf <agraf@suse.de>

pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>


# d10fc50f 24-Jan-2018 Alexander Graf <agraf@suse.de>

pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>


# 884f9013 24-Jan-2018 Alexander Graf <agraf@suse.de>

pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>


# ae74de0d 12-Jan-2018 Patrice Chotard <patrice.chotard@st.com>

serial: stm32: Rename serial_stm32x7.c to serial_stm32.c

Now this driver is used across stm32f4, stm32f7 and stm32h7
SoCs family, give it a generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>


# 809704eb 06-Nov-2017 Michal Simek <michal.simek@xilinx.com>

arm: zynq: Move ZYNQ_SERIAL to Kconfig

Move cadence/zynq serial driver via Kconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 6c30f15b 27-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32F4 support

stm32f4 doesn't support FIFO and OVERRUN feature.
The enable bit is not at the same location in CR1
register than for STM32F7 and STM32H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>


# 776b2ddb 13-Sep-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: add STM32H7 support

STM32F7 and STM32H7 shares the same UART block, add
STM32H7 compatible string.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# cac73f20 24-Aug-2017 Keng Soon Cheah <keng.soon.cheah@ni.com>

serial: nulldev: Add nulldev serial driver

Some device the serial console's initialization cannot run early during
the boot process. Hence, nulldev serial device is helpful on that
situation.

For example, if the serial module was implemented in FPGA. Serial
initialization is prohibited to run until the FPGA was programmed.

This commit is to adding nulldev serial driver. This will allows the
default console to be specified as a nulldev.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>


# 3ca7a06a 16-Aug-2017 Stefan Roese <sr@denx.de>

serial: serial-uclass: Add generic serial RX buffer support

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 buffer support
for all DM based serial drivers. 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>
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>
Tested-by: Bin Meng <bmeng.cn@gmail.com>


# 7fded0ce 16-Aug-2017 Stefan Roese <sr@denx.de>

Revert "serial: ns16550: Add RX interrupt buffer support"

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>


# 03a38a39 21-Jul-2017 Marek Vasut <marek.vasut@gmail.com>

serial: sh: Convert to Kconfig

Convert the SH Serial to Kconfig using tools/moveconfig.py tool
and a bit of manual adjustment to cater for failed conversions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>


# 84e9dcc1 26-Jul-2017 Patrice Chotard <patrice.chotard@st.com>

serial: stm32x7: Convert CONFIG_STM32X7_SERIAL to Kconfig

Add CONFIG_STM32X7_SERIAL as a Kconfig option.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>


# 6822cf3e 14-Jul-2017 Stefan Roese <sr@denx.de>

serial: ns16550: Add RX interrupt buffer support

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>


# 61366b71 05-Jun-2017 Jagan Teki <jagan@amarulasolutions.com>

serial: mxc: Add debug uart support

Add support for the debug UART to assist with early debugging.
Enable it for i.CoreM6 as an example.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# dd7ff472 06-Jul-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc, 8xx: move Serial driver to drivers/serial/

At the same time, move to Kconfig

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>


# 0424990c 20-Jun-2017 Heiko Schocher <hs@denx.de>

serial, kconfig: fix menutext

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>


# a52cf086 22-Apr-2017 Lokesh Vutla <lokeshvutla@ti.com>

serial: omap: Support debug UART

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>


# 30581040 24-Apr-2017 Álvaro Fernández Rojas <noltari@gmail.com>

serial: add serial driver for BCM6345

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>


# e8f86a02 24-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

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>


# 7095f864 01-Apr-2017 Mylène Josserand <mylene.josserand@free-electrons.com>

sunxi: Convert CONS_INDEX to Kconfig

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>


# c5f8dd48 28-Feb-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

serial: Add serial driver for Intel MID

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>


# 891f7ae6 02-Apr-2017 Simon Glass <sjg@chromium.org>

dm: serial: Allow driver-model serial to be disabled for TPL

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>


# f40574e2 17-Mar-2017 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Kconfig: Migrate CONFIG_BAUDRATE

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>


# 214a17e6 21-Feb-2017 Patrice Chotard <patrice.chotard@st.com>

STiH410: Add STi serial driver

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP
is common across other STMicroelectronics SoCs

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 7f73ca48 13-Jan-2017 Tom Rini <trini@konsulko.com>

Kconfig: CONFIG_OF_PLATDATA doesn't really exist

There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>


# 98d62e61 04-Nov-2016 Patrick Bruenn <p.bruenn@beckhoff.com>

arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>


# d804a5e1 14-Nov-2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>

serial: pxa: use kconfig for serial configuration

Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>


# 998cf3c2 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: atmel_usart: Support enable an early debug UART

Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>


# 6ec739aa 16-Oct-2016 Wenyou Yang <wenyou.yang@atmel.com>

serial: Kconfig: Add ATMEL_USART option

Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>


# 8829e662 08-Oct-2016 Jagan Teki <jagan@amarulasolutions.com>

serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>


# 6985d496 17-May-2016 Stefan Roese <sr@denx.de>

serial: Add serial_mvebu_a3700 for Armada 3700 SoC

The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>


# 85dc2fe1 25-Aug-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: change UNIPHIER_SERIAL to default y option

This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 2fc24d53 04-Jul-2016 Simon Glass <sjg@chromium.org>

rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bfcef28a 08-May-2016 Beniamino Galvani <b.galvani@gmail.com>

arm: add initial support for Amlogic Meson and ODROID-C2

This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60b49761 16-Mar-2016 Wills Wang <wills.wang@live.com>

drivers: serial: add serial driver for ar933x SOC

This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 142a20c3 31-Mar-2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

serial: Add support for Qualcomm serial port

This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>


# d5cf3297 18-Mar-2016 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: uniphier: support Debug UART

For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it. Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 966bfa73 23-Feb-2016 Michal Simek <michal.simek@xilinx.com>

serial: dcc: Move driver to DM

Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
compatible = "arm,dcc";
u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
serial0 = &uart0;
serial1 = &uart1;
serial2 = &dcc;

Change stdout-path to point to dcc port.
stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 9e160ee8 28-Jan-2016 Paul Thacker <paul.thacker@microchip.com>

drivers: serial: add driver for Microchip PIC32 UART controller.

This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 80cce262 26-Jan-2016 Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>

ppc: xilinx-ppc4xx: Port to DM serial

xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>


# 54e24d33 08-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add uartlite to Kconfig

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>


# 4166ba3b 14-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Add support for debug console

Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>


# 5ed07cf5 13-Jan-2016 Bin Meng <bmeng.cn@gmail.com>

serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig

LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>


# 19de8150 14-Oct-2015 Sergey Temerkhanov <s.temerkhanov@gmail.com>

arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output

This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>


# 92c55b68 13-Dec-2015 Simon Glass <sjg@chromium.org>

dm: serial: Allow the UART driver to be dropped from the image

In very very space-constrained devices even the full UART driver is too
large. In this case the debug UART can still be used in some cases.

Add options to enable the UART driver in SPL and U-Boot proper. Enable both
options by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>


# 6bf87dac 01-Dec-2015 Michal Simek <michal.simek@xilinx.com>

serial: zynq: Fix incorrect reference to s5p driver

Remove this c&p error from s5p driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 9e39003e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: move CONFIG_SYS_NS16550 to Kconfig

Move CONFIG_SYS_NS16550 to Kconfig, and run moveconfig.py.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>


# 4fb60552 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: zap CONFIG_NS16550_SERIAL

Zap CONFIG_NS16550_SERIAL, as the unification of ns16550 drivers
is completed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>


# 98a51fc3 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_rockchip

Unify serial_rockchip, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Acked-by: Simon Glass <sjg@chromium.org>


# f27445cb 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_ppc

Unify serial_ppc, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add TODO comment]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 81cd63a9 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: unify serial_x86

Unify serial_x86, and use the generic binding.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>


# 8e62d32e 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

ns16550: add generic binding to unify the drivers

Add generic binding to unify ns16550 drivers. There are
several drivers using almost the same code, such as serial_dw,
serial_keystone, serial_omap, serial_ppc, serial_rockchip,
serial_tegra.c, and serial_x86. But each is platform specific.

The key difference between these drivers is the way to get
input clock frequency. With this unified approach, fixed clock
frequency should be extracted from "clock-frequency" property of
device tree blob. If this property is not available, the macro
CONFIG_SYS_NS16550_CLK will be used. It can be a constant or a
function to get clock, eg, get_serial_clock().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>


# b1e361b6 19-Nov-2015 Thomas Chou <thomas@wytron.com.tw>

debug_uart: restore ns16550 as default

Since commit 220e8021af96 ("nios2: convert altera_jtag_uart to
driver model"), the default debug uart was changed. Most people
use ns16550 UART, so restore it as default.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>


# e43ce3fc 28-Oct-2015 Francois Retief <fgretief@spaceteq.co.za>

sparc: leon3: Add debug_uart support to LEON3 serial driver.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>


# c54c0a4c 17-Oct-2015 Simon Glass <sjg@chromium.org>

arm: zynq: Support the debug UART

Add support for the debug UART to assist with early debugging. Enable it
for Zybo as an example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>


# da2f838d 21-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_uart to driver model

Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>


# 220e8021 22-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

nios2: convert altera_jtag_uart to driver model

Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>


# c7fefcb9 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Add an option to announce the debug UART

It is useful to see a message from the debug UART early during boot so that
you know things are working. Add an option to enable this. The message will
be displayed as soon as debug_uart_init() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# 0e977bc1 18-Oct-2015 Simon Glass <sjg@chromium.org>

debug_uart: Support board-specific UART initialisation

Some boards need to set things up before the debug UART can be used. On
these boards a call to debug_uart_init() is insufficient. When this option
is enabled, the function board_debug_uart_init() will be called when
debug_uart_init() is called. You can put any code here that is needed to
set up the UART ready for use, such as set pin multiplexing or enable
clocks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# d18f37c7 28-Sep-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>


# 765a1b1e 30-Aug-2015 Simon Glass <sjg@chromium.org>

rockchip: Add serial support

Add support for the Rockchip serial device using the ns16550 driver.
This uses driver model and device tree for both SPL and U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2ea65f3e 28-Aug-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

serial: drop redundant depends on

SANDBOX_SERIAL depends on SANDBOX, and SANDBOX selects DM.
So, "SANDBOX_SERIAL depends on DM" is redundant.

Likewise, UNIPHIER_SERIAL depends on ARCH_UNIPHIER, and
ARCH_UNIPHIER selects DM_SERIAL.
So, "UNIPHIER_SERIAL depends on DM_SERIAL" is redundant.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>


# 0b11dbf7 25-Jul-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

drivers: hierarchize drivers Kconfig menu

The menuconfig for drivers are getting more and more cluttered
and unreadable because too many entries are displayed in a single
flat menu. Use hierarchic menu for each category.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Update to apply again in a few places, drop USB hunk]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 8c458588 08-Aug-2015 Hans de Goede <hdegoede@redhat.com>

dm: serial: Add a REQUIRE_SERIAL_CONSOLE option for boards with no serial port

Currently the serial code assumes that there is always at least one serial
port (and panics / crashes due to null pointer dereferences when there is
none).

This makes it impossible to use u-boot on boards where there is no (debug)
serial port, because e.g. all uart pins are muxed to another function.

This commit adds a CONFIG_REQUIRE_SERIAL_CONSOLE Kconfig option, which
defaults to y (preserving existing behavior), which can be set to n on
such boards to make them work.

This commit only implements this for CONFIG_DM_SERIAL=y configs, as allowing
running without a serial port for CONFIG_DM_SERIAL=n configs is non trivial,
and is not necessary at this moment.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>


# bf6e7022 02-Jul-2015 Simon Glass <sjg@chromium.org>

exynos: Add debug UART support for Samsung S5P serial

Add a debug UART implementation for this serial driver. It does not set up
pinmux automatically - this must be done before calling debug_uart_init().

Signed-off-by: Simon Glass <sjg@chromium.org>


# 275854ba 04-Aug-2015 Simon Glass <sjg@chromium.org>

efi: Add a serial driver

Add a serial driver which makes use of EFI's console in/out service.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on Intel Crown Bay and QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>


# dcfe4a54 27-Jul-2015 Simon Glass <sjg@chromium.org>

x86: Move CONFIG_X86_SERIAL to Kconfig

Move this config option to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# af282245 06-Mar-2015 Simon Glass <sjg@chromium.org>

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b6ef3a3f 29-May-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: UniPhier: update the vendor name of UniPhier in Kconfig

The business for UniPhier Soc family has been transferred from
Panasonic Corporation to Socionext Inc.

Update the SoC select menu in Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# dd0b0122 27-Feb-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Add an option to specify the debug UART register shift

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>


# 21d00436 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: ns16550: Support debug UART

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>


# 2f964aa7 26-Jan-2015 Simon Glass <sjg@chromium.org>

serial: Support an early UART for debugging

This came up in a discussion on the mailing list here:

https://patchwork.ozlabs.org/patch/384613/

My concerns at the time were:
- it doesn't need to be written in assembler
- it doesn't need to be ARM-specific

This patch provides a possible alternative. It works by allowing any serial
driver to export one init function and provide a putc() function. These
can be used to output debug data before the real serial driver is available.

This implementation does not depend on driver model, and it is possible for
it to operate without a stack on some architectures (e.g. PowerPC, ARM). It
provides the same features as the ARM-specific debug.S but with more UART
and architecture support.

Signed-off-by: Simon Glass <sjg@chromium.org>


# f94a1bed 05-Feb-2015 Simon Glass <sjg@chromium.org>

dm: Expand and complete Kconfig in drivers/

Expand the help messages for each driver. Add missing Kconfig for I2C,
SPI flash and thermal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>


# ff247b7a 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

serial: uniphier: move CONFIG_UNIPHIER_SERIAL to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>


# da333ae7 23-Oct-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

dm: add entries to Kconfig

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>


# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

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>