History log of /u-boot/include/serial.h
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 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>

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

pci: serial: Support reading PCI-register size with base

The PCI helpers read only the base address for a PCI region. In some cases
the size is needed as well, e.g. to pass along to a driver which needs to
know the size of its register area.

Update the functions to allow the size to be returned. For serial, record
the information and provided it with the serial_info() call.

A limitation still exists in that the size is not available when OF_LIVE
is enabled, so take account of that in the tests.

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

# 1e019503 04-Dec-2022 Tom Rini <trini@konsulko.com>

post: Move CONFIG_SYS_POST to CFG_SYS_POST

Migrate the rest of the CONFIG_SYS_POST macros over to CFG_SYS_POST
namespace.

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

# 9cebc4ad 19-Nov-2022 Tom Rini <trini@konsulko.com>

post: Migrate to Kconfig

We move the existing CONFIG_POST_* functionality over to CFG_POST and
then introduce CONFIG_POST to Kconfig.

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

# 78b52431 05-Sep-2022 This contributor prefers not to receive mails <noreply@example.com>

serial: Implement serial_flush() function for console flush() fallback

Like in all other console functions, implement also serial_flush() function
as a fallback int console flush() function.

Flush support is available only when config option CONSOLE_FLUSH_SUPPORT is
enabled. So when it is disabled then provides just empty static inline
function serial_flush().

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-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>

# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 39a19223 24-Jul-2020 Ovidiu Panait <ovidiu.panait@windriver.com>

drivers: serial: Make serial_initialize return int

serial_initialize is called only during the common init sequence, after
relocation (in common/board_r.c). Because it has a void return value, it
has to wrapped in initr_serial. In order to be able to get rid of this
indirection, make serial_initialize return int.

Remove extern from prototype in order to silence the following checkpatch
warning:
check: extern prototypes should be avoided in .h files

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>

# 18138ab2 06-May-2020 Trevor Woerner <twoerner@gmail.com>

rename symbol: CONFIG_TEGRA -> CONFIG_ARCH_TEGRA

Have this symbol follow the pattern of all other such symbols.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>

# bf4661bc 27-Feb-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add clock member to struct serial_device_info

Some callers of serial_getinfo() would like to know the UART base
clock speed in order to make decision what to pass to OS in some
cases. In particular, ACPI SPCR table expects only certain base
clock speed and thus we have to act accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# b03e0510 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial functions out of common.h

These functions belong in serial.h so move them over.

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

# f516fd99 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial_printf() to the serial header

Move this function header to serial.h since this function is clearly
related to serial. The function itself stays in console.c since we don't
have a single serial file. DM and non-DM each has a separate file so we
would have to either create a new common serial file, or repeat the
function in both serial.c and serial-uclass.c, neither of which seem
worthwhile.

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

# 2310c8ed 14-Nov-2019 Simon Glass <sjg@chromium.org>

serial: usb: Correct the usbtty_...() prototypes

The function declarations in serial.h are not in sync with what is
currently used in usbtty. Fix this by updating the header and including
it, to help catch future such problems.

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

# eab647d5 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Tidy up header file comments

The getconfig() comment is out of date. Fix this and add comments for
recently added functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# a61cbad7 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getinfo() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 3de04e77 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_setconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 67d1b051 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 0171f432 28-Dec-2018 Simon Glass <sjg@chromium.org>

serial: Move new functions to serial.h

We should not be adding new functions to common.h. Move these recently
added functions to serial.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# d5bb4f86 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Introduce ->getinfo() callback

New callback will give a necessary information to fill up ACPI SPCR table,
for example. Maybe used later for other purposes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change ADR_SPACE_SYSTEM_IO to SERIAL_ADDRESS_SPACE_IO to fix build error:
Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7f5db9 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add ->getconfig() callback

In some cases it would be good to know the settings, such as parity,
of current serial console. One example might be an ACPI SPCR table
to generate using these parameters.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 42b54013 21-Nov-2018 Christophe Leroy <christophe.leroy@c-s.fr>

drivers: serial: get rid of non DM mpc8xx driver

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

# 0a168687 02-Nov-2018 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

dm: serial: fix comment on dm_serial_ops setconfig

The comment on this function prototype describes nonexistent
parameters. It seems to be copied from 'setparity'.

Update it to match its the parameter list.

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

# d7c09684 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

sandbox: Add serial test

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

# ad060c05 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

dm: serial: Remove setparity ops

setparity users has been updated to use new setconfig ops,
so we can safely remove setparity ops

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

# cbf53883 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

dm: serial: Replace setparity by setconfig

Replace setparity by more generic setconfig ops
to allow uart parity, bits word length and stop bits
number change.

Adds SERIAL_GET_PARITY/BITS/STOP macros.

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>

# 481ea2e3 11-Jul-2018 Tom Rini <trini@konsulko.com>

mips: au1x00: Remove support for these SoCs

The only platform left for the AU1x00 SoCs was the pb1x00 platform, an
apparent clone of the dbau1x00 platform. As pb1x00 had no listed
maintainer I am assuming that it is also orphaned. Remove this platform
and then remove the unused SoC support.

Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

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

dm: serial: Add setparity

Implements serial setparity ops to allow uart parity change.
It allows to select ODD, EVEN or NONE parity.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

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

drivers: serial: remove nonexisting initialisation functions

This patch removes call of serial initialisation functions that
are not implemented anymore.

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

# 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>

# 98f705c9 27-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc: remove 4xx support

There was for long time no activity in the 4xx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in 4xx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# b9f7d881 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xx: remove some "5xx" remains

we removed 5xx support. So delete some forgotten remains.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 9057df88 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 82xx: remove some missed mpc82xx remains

we removed 82xx support. Missed some 82xx remains,
remove them now.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 064b55cf 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512x

There was for long time no activity in the mpx5xxx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in mpc5xxx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 3d16389c 16-May-2016 Lokesh Vutla <lokeshvutla@ti.com>

board: am335x: Allow to choose serial device dynamically

Different AM335x based platforms have different serial consoles. As serial
console is Kconfig option a separate defconfig has to be created for each
platform. So pass the serial device dynamically.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

# 2e2da4c6 08-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

serial: remove altera serial initializations

Both altera_jtag_serial_initialize() and
altera_serial_initialize() are no longer used after
they are converted to driver model.

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

# a2f39e83 23-Feb-2015 Masahiro Yamada <masahiroy@kernel.org>

ARM: remove cm4008 and cm41xx board support

These are still non-generic boards.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Greg Ungerer <greg.ungerer@opengear.com>
Acked-by: Marek Vasut <marex@denx.de>

# 41fbbbbc 23-Feb-2015 Masahiro Yamada <masahiroy@kernel.org>

ARM: remove jadecpu board support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Matthias Weisser <weisserm@arcor.de>
Acked-by: Marek Vasut <marex@denx.de>

# 94a255df 27-Oct-2014 Jeroen Hofstee <jeroen@myspectrum.nl>

serial: add prototypes for init functions

While at it, sort them.

Cc: Tom Rini <trini@ti.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

# 57d92753 04-Sep-2014 Simon Glass <sjg@chromium.org>

dm: Add a uclass for serial devices

Serial devices support simple byte input/output and a few operations to find
out whether data is available. Add a basic uclass for serial devices to be
used by drivers that are converted to driver model.

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

# 3fb85889 06-Aug-2013 Matthias Fuchs <matthias.fuchs@esd.eu>

ppc4xx: Remove support for PPC405CR CPUs

This patch removes support for the APM 405CR CPU.
This CPU is EOL and no board uses this chip.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>

# 6d6c0bae 11-Dec-2012 Tom Warren <twarren.nvidia@gmail.com>

Tegra30: Add generic Tegra30 build support

This patch adds basic Tegra30 (T30) build support - no specific
board is targeted.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>

# bfb7d7a3 06-Oct-2012 Marek Vasut <marex@denx.de>

serial: Implement default_serial_puts()

U-Boot contains a lot of duplicit implementations of serial_puts()
call which just pipes single characters into the port in loop. Implement
function that does this behavior into common code, so others can make
easy use of it.

This function is called default_serial_puts() and it's sole purpose
is to call putc() in loop on the whole string passed to it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 036036d7 14-Sep-2012 Marek Vasut <marex@denx.de>

serial: Remove CONFIG_SERIAL_MULTI from remaining sources

Remove the parts depending either on disabled CONFIG_SERIAL_MULTI
or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI
is now enabled by default.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 425101e1 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: zoom2: Remove zoom2 serial prototypes from serial.h

Remove the prototypes for zoom2_serial_deviceN from serial.h . This
can't be done right away, as they are referenced from the zoom2
config file. Therefore, adjust the code so the config file only
specifies number of the port. Then, replace the simple return in
default_serial_console() with a switch across possible values, which
returns the zoom2_serial_deviceN . With such adjustment in place,
the exported prototypes in serial.h can be safely removed.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 5ae1de0d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Adjust serial_register_bfin_uart()

Rename the serial_register_bfin_uart() to bfin_initialize_serial()
to be consistent with the rest of the naming. Next, remove it's
prototype from serial.h and properly insert it into serial.c as
the rest of the serial initialization functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# c513d7e5 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Remove the bfin_serialN_device exports from serial.h

Remove the exports from serial.h as they are only used in the blackfin
serial driver. Furthermore, they are only used for registration, which
is handled already inside that driver and default_serial_port() call,
which is also handled in that driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# abc0ed8d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: ns16550: Move serial registration from serial_initialize()

Move the registration of eserialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented ns16550_serial_initialize() function, which is
implemented inside of the ns16550 serial driver allows encapsulation
of eserialN_device within the ns16550 serial driver itself.

Also, remove the exports of eserialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the ns16550 serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Michal Simek <monstr@monstr.eu>

# 918327c8 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: mpc512x: Move serial registration from serial_initialize()

Move the registration of serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented mpc512x_serial_initialize() function, which is
implemented inside of the mpc512x serial driver allows encapsulation
of serialN_device within the mpc512x serial driver itself.

Also, remove the exports of serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the mpx512x serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 87d69229 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: microblaze: Move serial registration from serial_initialize()

Move the registration of xuartlite_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented xuartlite_serial_initialize() function, which is
implemented inside of the serial_xuartlite driver allows encapsulation
of xuartlite_serialN_device within the serial_xuartlite driver itself.

Also, remove the exports of xuartlite_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_xuartlite driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>

# 51d8102f 08-Oct-2012 Tom Rini <trini@konsulko.com>

serial: zynq: Move serial registration from serial_initialize()

Move the registration of zynq_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented zynq_serial_initialize() function, which is
implemented inside of the serial_zynq driver allows encapsulation
of zynq_serialN_device within the serial_zynq driver itself.

Also, remove the exports of zynq_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_zynq driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

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

# b4980515 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s5p: Move serial registration from serial_initialize()

Move the registration of s5p_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s5p_serial_initialize() function, which is
implemented inside of the serial_s5p driver allows encapsulation
of s5p_serialN_device within the serial_s5p driver itself.

Also, remove the exports of s5p_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s5p driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>

# 1fe5c110 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: pxa: Move serial registration from serial_initialize()

Move the registration of serial_XXuart ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented pxa_serial_initialize() function, which is
implemented inside of the serial_pxa driver allows encapsulation
of serial_XXuart within the serial_pxa driver itself.

Also, remove the exports of serial_XXuart from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_pxa driver and
the default console is picked by CONFIG_CONS_IDX macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 28af6385 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s3c24xx: Move serial registration from serial_initialize()

Move the registration of s3c24xx_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s3c24xx_serial_initialize() function, which is
implemented inside of the serial_s3c24xx driver allows encapsulation
of s3c24xx_serialN_device within the serial_s3c24xx driver itself.

Also, remove the exports of s3c24xx_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s3c24xx driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: C Nauman <cnauman@diagraph.com>

# 89143fb3 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Rename .init() and .uninit() in serial_device

Rename .init() to .start() and .uninit() to .stop() in struct
serial_device. This allows aligning struct serial_device with
closer to struct stdio_dev. The real goal here is to allow
these two structures to converge together and eventually make
one to be a superset of the other.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Tom Rini <trini@ti.com>

# 78322d63 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Coding style cleanup of struct serial_device

Do a simple cleanup of the struct serial_device and align it with
current coding style. Checkpatch now reports no errors.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 194846f3 13-Sep-2012 Michal Simek <michal.simek@amd.com>

serial: Add Zynq serial driver

The driver is used on Xilinx Zynq platform.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Joe Hershberger <joe.hershberger@gmail.com>
CC: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>

# 7636ebe1 01-Jul-2012 Michal Simek <michal.simek@amd.com>

serial: Support serial multi for Microblaze

enable serial multi for Microblaze.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephan Linz <linz@li-pro.net>

# 00a2749d 31-Aug-2012 Allen Martin <amartin@nvidia.com>

tegra20: rename tegra2 -> tegra20

This is make naming consistent with the kernel and devicetree and in
preparation of pulling out the common tegra20 code.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>

# f6add132 10-Nov-2011 Mike Frysinger <vapier@gentoo.org>

net/miiphy/serial: drop duplicate "NAMESIZE" define

A few subsystems are using the same define "NAMESIZE". This has been
working so far because they define it to the same number. However, I
want to change the size of eth_device's NAMESIZE, so rather than tweak
the define names, simply drop references to it. Almost no one does,
and the handful that do can easily be changed to a sizeof().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# ef5a5b00 29-Nov-2011 Gabe Black <gabeblack@chromium.org>

x86: Initial commit for running as a coreboot payload

Add a target for running u-boot as a coreboot payload in boards.cfg, a
board, CPU and a config. This is a skeleton implementation which always
reports the size of memory as 64 MB.

Signed-off-by: Gabe Black <gabeblack@chromium.org>

# 7813ca9b 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: constify serial_assign()

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# a6e6f7f4 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: cosmetic checkpatch compliance

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 49a23e4a 25-Sep-2011 Michal Simek <michal.simek@amd.com>

serial: uartlite: Support for SERIAL_MULTI

Add support for SERIAL MULTI for uartlite.

Signed-off-by: Michal Simek <monstr@monstr.eu>

# 1902692a 02-Aug-2011 Wolfgang Denk <wd@denx.de>

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

* 'master' of git://git.denx.de/u-boot-blackfin:
Blackfin: jtag-console: fix timer usage
Blackfin: switch to common display_options()
Blackfin: serial: move early debug strings into .rodata section
Blackfin: adi boards: also set stderr to nc with helper
Blackfin: update anomaly lists to latest public info
Blackfin: serial: convert to bfin_{read,write} helpers
Blackfin: split out async setup
Blackfin: adi boards: enable pretty flash progress output
Blackfin: drop unused dma.h header from start code
Blackfin: portmux: allow header to be included in assembly files
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: enable mmc_spi support
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings
Blackfin: sync MMR read/write helpers with Linux
Blackfin: gpio: optimize free path a little
Blackfin: post: setup default CONFIG_SYS_POST_WORD_ADDR
Blackfin: uart: fix printf warning
Blackfin: add init.elf helper code
Blackfin: dont reset SWRST on newer bf526 parts
Blackfin: adi boards: enable multi serial support by default
Blackfin: uart: add multiple serial support
Blackfin: uart: move debug buffers into local bss


# 7b826c2f 14-May-2011 Mike Frysinger <vapier@gentoo.org>

serial: implement common uart post test

The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data. If we ignore
the loop back part, the rest can be built upon the existing common serial
API. So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it. This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over. So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 1c9a5606 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

serial: drop useless ctlr field

The multi serial support has a "ctlr" field which almost no one uses,
but everyone is forced to set to useless strings. So punt it.

Funny enough, the only code that actually reads this field (the mpc8xx
driver) has a typo where it meant to look for the SCC driver. Fix it
while converting the check to use the name field.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Marek Vasut <marek.vasut@gmail.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>

# 635f330f 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

Blackfin: uart: add multiple serial support

This brings CONFIG_SERIAL_MULTI support to the Blackfin on-chip UARTs.
Ends up adding only ~512bytes per additional UART.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 2ee36781 27-Jan-2011 Tom Warren <twarren.nvidia@gmail.com>

serial: Add Tegra2 serial port support

Signed-off-by: Tom Warren <twarren@nvidia.com>

# 09b4a9cf 07-Sep-2010 Wolfgang Denk <wd@denx.de>

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


# 889a275d 23-Aug-2010 Minkyu Kang <mk7.kang@samsung.com>

ARMV7: S5P: rename from CONFIG_S5PC1XX to CONFIG_S5P

Use the same configuration around S5P SoCs.
(s5pc100, s5pc110, s5pc210 and so on)

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 6052ac83 09-Aug-2010 Matthias Weisser <weisserm@arcor.de>

ARM: Add support for MB86R0x SoCs

Signed-off-by: Matthias Weisser <weisserm@arcor.de>

# bf16500f 23-Apr-2010 Graeme Russ <graeme.russ@gmail.com>

x86: Use CONFIG_SERIAL_MULTI

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>

# 46a3b5c8 24-Mar-2010 Minkyu Kang <mk7.kang@samsung.com>

SAMSUNG: serial: modify name from s5pc1xx to s5p

Because of other s5p series SoC will use these serial functions,
modify function's name and structure's name.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 8e234e33 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc5121: add PSC serial communication routines

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# e3b28e67 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc512x: add multi serial PSC support

Extend mpc512x serial driver to support multiple PSC ports.

Subsequent patches for PDM360NG board support make use of this
functionality by defining CONFIG_SERIAL_MULTI in the board config
file. Additionally the used PSC devices are specified by defining
e.g. CONFIG_SYS_PSC1, CONFIG_SYS_PSC4 and CONFIG_SYS_PSC6.

Support for PSC devices other than 1, 3, 4 and 6 is not added
by this patch because these aren't used currently. In the future
it can be easily added using DECLARE_PSC_SERIAL_FUNCTIONS(N) and
INIT_PSC_SERIAL_STRUCTURE(N) macros in cpu/mpc512x/serial.c.
Additionally you have to add code for registering added
devices in serial_initialize() in common/serial.c.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# fbb0030e 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

serial: struct serial_device: add uninit() entry for drivers

Subsequent patch extends mpc512x serial driver to support
multiple PSC ports. The driver will provide an uninit()
function to stop the serial controller and to disable the
controller's clock. Adding uninit() entry to struct serial_device
allows disabling the serial controller after usage of
a stdio serial device.

This patch adds uninit() entry to the struct serial_device
and fixes initialization of this structure in the code
accordingly.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# 2ec1abea 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

OMAP3 zoom2 Use usbtty if the debug board is not connected.

The preferred serial output comes from the debug board.
When the debug board is disconnected, fall back on using
usbtty from the usb connector on the Zoom2 board.

This shows up as /dev/ttyACM0 in a linux host.

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6299487e 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

USBTTY make some function declarations easier to use.

Zoom2 needs to use these declarations and the include directory is a
better place from them than in the middle of the driver directory.
It did not make sense to create a new file for just a couple of
lines so they were appended to the serial.h

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# dd2c9e6a 01-Oct-2009 Minkyu Kang <mk7.kang@samsung.com>

s5pc1xx: support serial driver

This patch includes the serial driver for s5pc1xx.
s5pc1xx uart driver needs own register setting and clock configuration.
So, need to special driver.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 52cb4d4f 15-May-2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

stdio/device: rework function naming convention

So far the console API uses the following naming convention:

======Extract======
typedef struct device_t;

int device_register (device_t * dev);
int devices_init (void);
int device_deregister(char *devname);
struct list_head* device_get_list(void);
device_t* device_get_by_name(char* name);
device_t* device_clone(device_t *dev);
=======

which is too generic and confusing.

Instead of using device_XX and device_t we change this
into stdio_XX and stdio_dev

This will also allow to add later a generic device mechanism in order
to have support for multiple devices and driver instances.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Edited commit message.

Signed-off-by: Wolfgang Denk <wd@denx.de>

# 039594a4 02-Jul-2009 Poonam Aggrwal <poonam.aggrwal@freescale.com>

8xxx: Second UART port added for MPC85xx, MPC83xx, MPC86xx processors

Defining the next two configs allows to switch the serial port from the
console using the setenv stdin and stdout
1. #define CONFIG_SERIAL_MULTI 1 /* Enable both serial ports */
2. #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* determine from environment */

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

# 660888b7 30-May-2009 Tom Rix <Tom.Rix@windriver.com>

ZOOM2 Add serial support.

Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board.
The default serial is from the USB connector on left side of the debug board.
The USB connector will produce 2 of the 4 UARTS. On your host pick the first
enumeration.

The details of the setting of the serial gpmc setup are not available.
The values were provided by another party.

The serial port set up is the same with Zoom1.
Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow.

The kernel bootargs are
console=ttyS3,115200n8

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# a7c185ed 19-Dec-2007 Harald Welte <laforge@openmoko.org>

ARM: s3c24xx: Multiple serial port support

This patch adds support for CONFIG_SERIAL_MULTI on s3c24x0 CPU's

Signed-off-by: Harald Welte <laforge@openmoko.org>

# dbbd1257 05-Oct-2007 Stefan Roese <sr@denx.de>

ppc4xx: Add PPC405EX support

Signed-off-by: Stefan Roese <sr@denx.de>

# 80172c61 30-Aug-2007 Stefano Babic <sbabic@denx.de>

PXA270: Add support for multiple serial ports.

This patch adds support for multiple serial ports to the PXA target.
FFUART, BTUART and STUART are supported.

Signed-off-by: Stefano Babic <sbabic@denx.de>

# 3cb86f3e 24-Mar-2007 Stefan Roese <sr@denx.de>

[PATCH] Clean up 40EZ/Acadia support

This patch cleans up all the open issue of the preliminary
Acadia support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 0fd30252 30-Aug-2006 Wolfgang Denk <wd@denx.de>

Make the serial driver framework work with CONFIG_SERIAL_MULTI enabled

# c12cffc5 16-Jun-2006 Wolfgang Denk <wd@denx.de>

Add support for CONFIG_SERIAL_MULTI on MPC5xxx
Patch by Martin Krause, 8 Jun 2006

This patch supports two serial consoles on boards with
a MPC5xxx CPU. The console can be switched at runtime
by setting stdin, stdout and stderr to the desired serial
interface (serial0 or serial1). The PSCs to be used as
console port are definded by CONFIG_PSC_CONSOLE
and CONFIG_PSC_CONSOLE2.
See README.serial_multi for details.

# ff36fd85 09-Jan-2005 Wolfgang Denk <wd@denx.de>

* Patch by Leif Lindholm, 23 Sep 2004:
add support for the AMD db1550 board

* Patch by Travis Sawyer, 15 Sep 2004:
Add CONFIG_SERIAL_MULTI support for ppc4xx,
update README.serial_multi

# 281e00a3 01-Aug-2004 Wolfgang Denk <wd@denx.de>

* Code cleanup

* Patch by Sascha Hauer, 28 Jun:
- add generic support for Motorola i.MX architecture
- add support for mx1ads, mx1fs2 and scb9328 boards

* Patches by Marc Leeman, 23 Jul 2004:
- Add define for the PCI/Memory Buffer Configuration Register
- corrected comments in cpu/mpc824x/cpu_init.c

* Add support for multiple serial interfaces
(for example to allow modem dial-in / dial-out)

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

pci: serial: Support reading PCI-register size with base

The PCI helpers read only the base address for a PCI region. In some cases
the size is needed as well, e.g. to pass along to a driver which needs to
know the size of its register area.

Update the functions to allow the size to be returned. For serial, record
the information and provided it with the serial_info() call.

A limitation still exists in that the size is not available when OF_LIVE
is enabled, so take account of that in the tests.

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

# 1e019503 04-Dec-2022 Tom Rini <trini@konsulko.com>

post: Move CONFIG_SYS_POST to CFG_SYS_POST

Migrate the rest of the CONFIG_SYS_POST macros over to CFG_SYS_POST
namespace.

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

# 9cebc4ad 19-Nov-2022 Tom Rini <trini@konsulko.com>

post: Migrate to Kconfig

We move the existing CONFIG_POST_* functionality over to CFG_POST and
then introduce CONFIG_POST to Kconfig.

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

# 78b52431 05-Sep-2022 Pali Rohár <pali@kernel.org>

serial: Implement serial_flush() function for console flush() fallback

Like in all other console functions, implement also serial_flush() function
as a fallback int console flush() function.

Flush support is available only when config option CONSOLE_FLUSH_SUPPORT is
enabled. So when it is disabled then provides just empty static inline
function serial_flush().

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-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>

# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 39a19223 24-Jul-2020 Ovidiu Panait <ovidiu.panait@windriver.com>

drivers: serial: Make serial_initialize return int

serial_initialize is called only during the common init sequence, after
relocation (in common/board_r.c). Because it has a void return value, it
has to wrapped in initr_serial. In order to be able to get rid of this
indirection, make serial_initialize return int.

Remove extern from prototype in order to silence the following checkpatch
warning:
check: extern prototypes should be avoided in .h files

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>

# 18138ab2 06-May-2020 Trevor Woerner <twoerner@gmail.com>

rename symbol: CONFIG_TEGRA -> CONFIG_ARCH_TEGRA

Have this symbol follow the pattern of all other such symbols.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>

# bf4661bc 27-Feb-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add clock member to struct serial_device_info

Some callers of serial_getinfo() would like to know the UART base
clock speed in order to make decision what to pass to OS in some
cases. In particular, ACPI SPCR table expects only certain base
clock speed and thus we have to act accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# b03e0510 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial functions out of common.h

These functions belong in serial.h so move them over.

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

# f516fd99 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial_printf() to the serial header

Move this function header to serial.h since this function is clearly
related to serial. The function itself stays in console.c since we don't
have a single serial file. DM and non-DM each has a separate file so we
would have to either create a new common serial file, or repeat the
function in both serial.c and serial-uclass.c, neither of which seem
worthwhile.

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

# 2310c8ed 14-Nov-2019 Simon Glass <sjg@chromium.org>

serial: usb: Correct the usbtty_...() prototypes

The function declarations in serial.h are not in sync with what is
currently used in usbtty. Fix this by updating the header and including
it, to help catch future such problems.

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

# eab647d5 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Tidy up header file comments

The getconfig() comment is out of date. Fix this and add comments for
recently added functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# a61cbad7 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getinfo() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 3de04e77 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_setconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 67d1b051 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 0171f432 28-Dec-2018 Simon Glass <sjg@chromium.org>

serial: Move new functions to serial.h

We should not be adding new functions to common.h. Move these recently
added functions to serial.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# d5bb4f86 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Introduce ->getinfo() callback

New callback will give a necessary information to fill up ACPI SPCR table,
for example. Maybe used later for other purposes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change ADR_SPACE_SYSTEM_IO to SERIAL_ADDRESS_SPACE_IO to fix build error:
Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7f5db9 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add ->getconfig() callback

In some cases it would be good to know the settings, such as parity,
of current serial console. One example might be an ACPI SPCR table
to generate using these parameters.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 42b54013 21-Nov-2018 Christophe Leroy <christophe.leroy@c-s.fr>

drivers: serial: get rid of non DM mpc8xx driver

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

# 0a168687 02-Nov-2018 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

dm: serial: fix comment on dm_serial_ops setconfig

The comment on this function prototype describes nonexistent
parameters. It seems to be copied from 'setparity'.

Update it to match its the parameter list.

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

# d7c09684 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

sandbox: Add serial test

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

# ad060c05 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

dm: serial: Remove setparity ops

setparity users has been updated to use new setconfig ops,
so we can safely remove setparity ops

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

# cbf53883 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

dm: serial: Replace setparity by setconfig

Replace setparity by more generic setconfig ops
to allow uart parity, bits word length and stop bits
number change.

Adds SERIAL_GET_PARITY/BITS/STOP macros.

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>

# 481ea2e3 11-Jul-2018 Tom Rini <trini@konsulko.com>

mips: au1x00: Remove support for these SoCs

The only platform left for the AU1x00 SoCs was the pb1x00 platform, an
apparent clone of the dbau1x00 platform. As pb1x00 had no listed
maintainer I am assuming that it is also orphaned. Remove this platform
and then remove the unused SoC support.

Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

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

dm: serial: Add setparity

Implements serial setparity ops to allow uart parity change.
It allows to select ODD, EVEN or NONE parity.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

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

drivers: serial: remove nonexisting initialisation functions

This patch removes call of serial initialisation functions that
are not implemented anymore.

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

# 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>

# 98f705c9 27-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc: remove 4xx support

There was for long time no activity in the 4xx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in 4xx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# b9f7d881 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xx: remove some "5xx" remains

we removed 5xx support. So delete some forgotten remains.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 9057df88 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 82xx: remove some missed mpc82xx remains

we removed 82xx support. Missed some 82xx remains,
remove them now.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 064b55cf 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512x

There was for long time no activity in the mpx5xxx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in mpc5xxx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 3d16389c 16-May-2016 Lokesh Vutla <lokeshvutla@ti.com>

board: am335x: Allow to choose serial device dynamically

Different AM335x based platforms have different serial consoles. As serial
console is Kconfig option a separate defconfig has to be created for each
platform. So pass the serial device dynamically.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

# 2e2da4c6 08-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

serial: remove altera serial initializations

Both altera_jtag_serial_initialize() and
altera_serial_initialize() are no longer used after
they are converted to driver model.

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

# a2f39e83 23-Feb-2015 Masahiro Yamada <masahiroy@kernel.org>

ARM: remove cm4008 and cm41xx board support

These are still non-generic boards.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Greg Ungerer <greg.ungerer@opengear.com>
Acked-by: Marek Vasut <marex@denx.de>

# 41fbbbbc 23-Feb-2015 Masahiro Yamada <masahiroy@kernel.org>

ARM: remove jadecpu board support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Matthias Weisser <weisserm@arcor.de>
Acked-by: Marek Vasut <marex@denx.de>

# 94a255df 27-Oct-2014 Jeroen Hofstee <jeroen@myspectrum.nl>

serial: add prototypes for init functions

While at it, sort them.

Cc: Tom Rini <trini@ti.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

# 57d92753 04-Sep-2014 Simon Glass <sjg@chromium.org>

dm: Add a uclass for serial devices

Serial devices support simple byte input/output and a few operations to find
out whether data is available. Add a basic uclass for serial devices to be
used by drivers that are converted to driver model.

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

# 3fb85889 06-Aug-2013 Matthias Fuchs <matthias.fuchs@esd.eu>

ppc4xx: Remove support for PPC405CR CPUs

This patch removes support for the APM 405CR CPU.
This CPU is EOL and no board uses this chip.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>

# 6d6c0bae 11-Dec-2012 Tom Warren <twarren.nvidia@gmail.com>

Tegra30: Add generic Tegra30 build support

This patch adds basic Tegra30 (T30) build support - no specific
board is targeted.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>

# bfb7d7a3 06-Oct-2012 Marek Vasut <marex@denx.de>

serial: Implement default_serial_puts()

U-Boot contains a lot of duplicit implementations of serial_puts()
call which just pipes single characters into the port in loop. Implement
function that does this behavior into common code, so others can make
easy use of it.

This function is called default_serial_puts() and it's sole purpose
is to call putc() in loop on the whole string passed to it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 036036d7 14-Sep-2012 Marek Vasut <marex@denx.de>

serial: Remove CONFIG_SERIAL_MULTI from remaining sources

Remove the parts depending either on disabled CONFIG_SERIAL_MULTI
or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI
is now enabled by default.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 425101e1 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: zoom2: Remove zoom2 serial prototypes from serial.h

Remove the prototypes for zoom2_serial_deviceN from serial.h . This
can't be done right away, as they are referenced from the zoom2
config file. Therefore, adjust the code so the config file only
specifies number of the port. Then, replace the simple return in
default_serial_console() with a switch across possible values, which
returns the zoom2_serial_deviceN . With such adjustment in place,
the exported prototypes in serial.h can be safely removed.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 5ae1de0d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Adjust serial_register_bfin_uart()

Rename the serial_register_bfin_uart() to bfin_initialize_serial()
to be consistent with the rest of the naming. Next, remove it's
prototype from serial.h and properly insert it into serial.c as
the rest of the serial initialization functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# c513d7e5 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Remove the bfin_serialN_device exports from serial.h

Remove the exports from serial.h as they are only used in the blackfin
serial driver. Furthermore, they are only used for registration, which
is handled already inside that driver and default_serial_port() call,
which is also handled in that driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# abc0ed8d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: ns16550: Move serial registration from serial_initialize()

Move the registration of eserialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented ns16550_serial_initialize() function, which is
implemented inside of the ns16550 serial driver allows encapsulation
of eserialN_device within the ns16550 serial driver itself.

Also, remove the exports of eserialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the ns16550 serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Michal Simek <monstr@monstr.eu>

# 918327c8 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: mpc512x: Move serial registration from serial_initialize()

Move the registration of serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented mpc512x_serial_initialize() function, which is
implemented inside of the mpc512x serial driver allows encapsulation
of serialN_device within the mpc512x serial driver itself.

Also, remove the exports of serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the mpx512x serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 87d69229 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: microblaze: Move serial registration from serial_initialize()

Move the registration of xuartlite_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented xuartlite_serial_initialize() function, which is
implemented inside of the serial_xuartlite driver allows encapsulation
of xuartlite_serialN_device within the serial_xuartlite driver itself.

Also, remove the exports of xuartlite_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_xuartlite driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>

# 51d8102f 08-Oct-2012 Tom Rini <trini@konsulko.com>

serial: zynq: Move serial registration from serial_initialize()

Move the registration of zynq_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented zynq_serial_initialize() function, which is
implemented inside of the serial_zynq driver allows encapsulation
of zynq_serialN_device within the serial_zynq driver itself.

Also, remove the exports of zynq_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_zynq driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

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

# b4980515 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s5p: Move serial registration from serial_initialize()

Move the registration of s5p_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s5p_serial_initialize() function, which is
implemented inside of the serial_s5p driver allows encapsulation
of s5p_serialN_device within the serial_s5p driver itself.

Also, remove the exports of s5p_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s5p driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>

# 1fe5c110 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: pxa: Move serial registration from serial_initialize()

Move the registration of serial_XXuart ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented pxa_serial_initialize() function, which is
implemented inside of the serial_pxa driver allows encapsulation
of serial_XXuart within the serial_pxa driver itself.

Also, remove the exports of serial_XXuart from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_pxa driver and
the default console is picked by CONFIG_CONS_IDX macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 28af6385 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s3c24xx: Move serial registration from serial_initialize()

Move the registration of s3c24xx_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s3c24xx_serial_initialize() function, which is
implemented inside of the serial_s3c24xx driver allows encapsulation
of s3c24xx_serialN_device within the serial_s3c24xx driver itself.

Also, remove the exports of s3c24xx_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s3c24xx driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: C Nauman <cnauman@diagraph.com>

# 89143fb3 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Rename .init() and .uninit() in serial_device

Rename .init() to .start() and .uninit() to .stop() in struct
serial_device. This allows aligning struct serial_device with
closer to struct stdio_dev. The real goal here is to allow
these two structures to converge together and eventually make
one to be a superset of the other.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Tom Rini <trini@ti.com>

# 78322d63 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Coding style cleanup of struct serial_device

Do a simple cleanup of the struct serial_device and align it with
current coding style. Checkpatch now reports no errors.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 194846f3 13-Sep-2012 Michal Simek <michal.simek@amd.com>

serial: Add Zynq serial driver

The driver is used on Xilinx Zynq platform.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Joe Hershberger <joe.hershberger@gmail.com>
CC: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>

# 7636ebe1 01-Jul-2012 Michal Simek <michal.simek@amd.com>

serial: Support serial multi for Microblaze

enable serial multi for Microblaze.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephan Linz <linz@li-pro.net>

# 00a2749d 31-Aug-2012 Allen Martin <amartin@nvidia.com>

tegra20: rename tegra2 -> tegra20

This is make naming consistent with the kernel and devicetree and in
preparation of pulling out the common tegra20 code.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>

# f6add132 10-Nov-2011 Mike Frysinger <vapier@gentoo.org>

net/miiphy/serial: drop duplicate "NAMESIZE" define

A few subsystems are using the same define "NAMESIZE". This has been
working so far because they define it to the same number. However, I
want to change the size of eth_device's NAMESIZE, so rather than tweak
the define names, simply drop references to it. Almost no one does,
and the handful that do can easily be changed to a sizeof().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# ef5a5b00 29-Nov-2011 Gabe Black <gabeblack@chromium.org>

x86: Initial commit for running as a coreboot payload

Add a target for running u-boot as a coreboot payload in boards.cfg, a
board, CPU and a config. This is a skeleton implementation which always
reports the size of memory as 64 MB.

Signed-off-by: Gabe Black <gabeblack@chromium.org>

# 7813ca9b 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: constify serial_assign()

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# a6e6f7f4 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: cosmetic checkpatch compliance

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 49a23e4a 25-Sep-2011 Michal Simek <michal.simek@amd.com>

serial: uartlite: Support for SERIAL_MULTI

Add support for SERIAL MULTI for uartlite.

Signed-off-by: Michal Simek <monstr@monstr.eu>

# 1902692a 02-Aug-2011 Wolfgang Denk <wd@denx.de>

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

* 'master' of git://git.denx.de/u-boot-blackfin:
Blackfin: jtag-console: fix timer usage
Blackfin: switch to common display_options()
Blackfin: serial: move early debug strings into .rodata section
Blackfin: adi boards: also set stderr to nc with helper
Blackfin: update anomaly lists to latest public info
Blackfin: serial: convert to bfin_{read,write} helpers
Blackfin: split out async setup
Blackfin: adi boards: enable pretty flash progress output
Blackfin: drop unused dma.h header from start code
Blackfin: portmux: allow header to be included in assembly files
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: enable mmc_spi support
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings
Blackfin: sync MMR read/write helpers with Linux
Blackfin: gpio: optimize free path a little
Blackfin: post: setup default CONFIG_SYS_POST_WORD_ADDR
Blackfin: uart: fix printf warning
Blackfin: add init.elf helper code
Blackfin: dont reset SWRST on newer bf526 parts
Blackfin: adi boards: enable multi serial support by default
Blackfin: uart: add multiple serial support
Blackfin: uart: move debug buffers into local bss


# 7b826c2f 14-May-2011 Mike Frysinger <vapier@gentoo.org>

serial: implement common uart post test

The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data. If we ignore
the loop back part, the rest can be built upon the existing common serial
API. So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it. This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over. So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 1c9a5606 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

serial: drop useless ctlr field

The multi serial support has a "ctlr" field which almost no one uses,
but everyone is forced to set to useless strings. So punt it.

Funny enough, the only code that actually reads this field (the mpc8xx
driver) has a typo where it meant to look for the SCC driver. Fix it
while converting the check to use the name field.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Marek Vasut <marek.vasut@gmail.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>

# 635f330f 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

Blackfin: uart: add multiple serial support

This brings CONFIG_SERIAL_MULTI support to the Blackfin on-chip UARTs.
Ends up adding only ~512bytes per additional UART.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 2ee36781 27-Jan-2011 Tom Warren <twarren.nvidia@gmail.com>

serial: Add Tegra2 serial port support

Signed-off-by: Tom Warren <twarren@nvidia.com>

# 09b4a9cf 07-Sep-2010 Wolfgang Denk <wd@denx.de>

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


# 889a275d 23-Aug-2010 Minkyu Kang <mk7.kang@samsung.com>

ARMV7: S5P: rename from CONFIG_S5PC1XX to CONFIG_S5P

Use the same configuration around S5P SoCs.
(s5pc100, s5pc110, s5pc210 and so on)

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 6052ac83 09-Aug-2010 Matthias Weisser <weisserm@arcor.de>

ARM: Add support for MB86R0x SoCs

Signed-off-by: Matthias Weisser <weisserm@arcor.de>

# bf16500f 23-Apr-2010 Graeme Russ <graeme.russ@gmail.com>

x86: Use CONFIG_SERIAL_MULTI

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>

# 46a3b5c8 24-Mar-2010 Minkyu Kang <mk7.kang@samsung.com>

SAMSUNG: serial: modify name from s5pc1xx to s5p

Because of other s5p series SoC will use these serial functions,
modify function's name and structure's name.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 8e234e33 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc5121: add PSC serial communication routines

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# e3b28e67 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc512x: add multi serial PSC support

Extend mpc512x serial driver to support multiple PSC ports.

Subsequent patches for PDM360NG board support make use of this
functionality by defining CONFIG_SERIAL_MULTI in the board config
file. Additionally the used PSC devices are specified by defining
e.g. CONFIG_SYS_PSC1, CONFIG_SYS_PSC4 and CONFIG_SYS_PSC6.

Support for PSC devices other than 1, 3, 4 and 6 is not added
by this patch because these aren't used currently. In the future
it can be easily added using DECLARE_PSC_SERIAL_FUNCTIONS(N) and
INIT_PSC_SERIAL_STRUCTURE(N) macros in cpu/mpc512x/serial.c.
Additionally you have to add code for registering added
devices in serial_initialize() in common/serial.c.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# fbb0030e 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

serial: struct serial_device: add uninit() entry for drivers

Subsequent patch extends mpc512x serial driver to support
multiple PSC ports. The driver will provide an uninit()
function to stop the serial controller and to disable the
controller's clock. Adding uninit() entry to struct serial_device
allows disabling the serial controller after usage of
a stdio serial device.

This patch adds uninit() entry to the struct serial_device
and fixes initialization of this structure in the code
accordingly.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# 2ec1abea 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

OMAP3 zoom2 Use usbtty if the debug board is not connected.

The preferred serial output comes from the debug board.
When the debug board is disconnected, fall back on using
usbtty from the usb connector on the Zoom2 board.

This shows up as /dev/ttyACM0 in a linux host.

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6299487e 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

USBTTY make some function declarations easier to use.

Zoom2 needs to use these declarations and the include directory is a
better place from them than in the middle of the driver directory.
It did not make sense to create a new file for just a couple of
lines so they were appended to the serial.h

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# dd2c9e6a 01-Oct-2009 Minkyu Kang <mk7.kang@samsung.com>

s5pc1xx: support serial driver

This patch includes the serial driver for s5pc1xx.
s5pc1xx uart driver needs own register setting and clock configuration.
So, need to special driver.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 52cb4d4f 15-May-2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

stdio/device: rework function naming convention

So far the console API uses the following naming convention:

======Extract======
typedef struct device_t;

int device_register (device_t * dev);
int devices_init (void);
int device_deregister(char *devname);
struct list_head* device_get_list(void);
device_t* device_get_by_name(char* name);
device_t* device_clone(device_t *dev);
=======

which is too generic and confusing.

Instead of using device_XX and device_t we change this
into stdio_XX and stdio_dev

This will also allow to add later a generic device mechanism in order
to have support for multiple devices and driver instances.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Edited commit message.

Signed-off-by: Wolfgang Denk <wd@denx.de>

# 039594a4 02-Jul-2009 Poonam Aggrwal <poonam.aggrwal@freescale.com>

8xxx: Second UART port added for MPC85xx, MPC83xx, MPC86xx processors

Defining the next two configs allows to switch the serial port from the
console using the setenv stdin and stdout
1. #define CONFIG_SERIAL_MULTI 1 /* Enable both serial ports */
2. #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* determine from environment */

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

# 660888b7 30-May-2009 Tom Rix <Tom.Rix@windriver.com>

ZOOM2 Add serial support.

Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board.
The default serial is from the USB connector on left side of the debug board.
The USB connector will produce 2 of the 4 UARTS. On your host pick the first
enumeration.

The details of the setting of the serial gpmc setup are not available.
The values were provided by another party.

The serial port set up is the same with Zoom1.
Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow.

The kernel bootargs are
console=ttyS3,115200n8

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# a7c185ed 19-Dec-2007 Harald Welte <laforge@openmoko.org>

ARM: s3c24xx: Multiple serial port support

This patch adds support for CONFIG_SERIAL_MULTI on s3c24x0 CPU's

Signed-off-by: Harald Welte <laforge@openmoko.org>

# dbbd1257 05-Oct-2007 Stefan Roese <sr@denx.de>

ppc4xx: Add PPC405EX support

Signed-off-by: Stefan Roese <sr@denx.de>

# 80172c61 30-Aug-2007 Stefano Babic <sbabic@denx.de>

PXA270: Add support for multiple serial ports.

This patch adds support for multiple serial ports to the PXA target.
FFUART, BTUART and STUART are supported.

Signed-off-by: Stefano Babic <sbabic@denx.de>

# 3cb86f3e 24-Mar-2007 Stefan Roese <sr@denx.de>

[PATCH] Clean up 40EZ/Acadia support

This patch cleans up all the open issue of the preliminary
Acadia support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 0fd30252 30-Aug-2006 Wolfgang Denk <wd@denx.de>

Make the serial driver framework work with CONFIG_SERIAL_MULTI enabled

# c12cffc5 16-Jun-2006 Wolfgang Denk <wd@denx.de>

Add support for CONFIG_SERIAL_MULTI on MPC5xxx
Patch by Martin Krause, 8 Jun 2006

This patch supports two serial consoles on boards with
a MPC5xxx CPU. The console can be switched at runtime
by setting stdin, stdout and stderr to the desired serial
interface (serial0 or serial1). The PSCs to be used as
console port are definded by CONFIG_PSC_CONSOLE
and CONFIG_PSC_CONSOLE2.
See README.serial_multi for details.

# ff36fd85 09-Jan-2005 Wolfgang Denk <wd@denx.de>

* Patch by Leif Lindholm, 23 Sep 2004:
add support for the AMD db1550 board

* Patch by Travis Sawyer, 15 Sep 2004:
Add CONFIG_SERIAL_MULTI support for ppc4xx,
update README.serial_multi

# 281e00a3 01-Aug-2004 Wolfgang Denk <wd@denx.de>

* Code cleanup

* Patch by Sascha Hauer, 28 Jun:
- add generic support for Motorola i.MX architecture
- add support for mx1ads, mx1fs2 and scb9328 boards

* Patches by Marc Leeman, 23 Jul 2004:
- Add define for the PCI/Memory Buffer Configuration Register
- corrected comments in cpu/mpc824x/cpu_init.c

* Add support for multiple serial interfaces
(for example to allow modem dial-in / dial-out)

# 1e019503 04-Dec-2022 Tom Rini <trini@konsulko.com>

post: Move CONFIG_SYS_POST to CFG_SYS_POST

Migrate the rest of the CONFIG_SYS_POST macros over to CFG_SYS_POST
namespace.

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

# 9cebc4ad 19-Nov-2022 Tom Rini <trini@konsulko.com>

post: Migrate to Kconfig

We move the existing CONFIG_POST_* functionality over to CFG_POST and
then introduce CONFIG_POST to Kconfig.

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

# 78b52431 05-Sep-2022 Pali Rohár <pali@kernel.org>

serial: Implement serial_flush() function for console flush() fallback

Like in all other console functions, implement also serial_flush() function
as a fallback int console flush() function.

Flush support is available only when config option CONSOLE_FLUSH_SUPPORT is
enabled. So when it is disabled then provides just empty static inline
function serial_flush().

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-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>

# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 39a19223 24-Jul-2020 Ovidiu Panait <ovidiu.panait@windriver.com>

drivers: serial: Make serial_initialize return int

serial_initialize is called only during the common init sequence, after
relocation (in common/board_r.c). Because it has a void return value, it
has to wrapped in initr_serial. In order to be able to get rid of this
indirection, make serial_initialize return int.

Remove extern from prototype in order to silence the following checkpatch
warning:
check: extern prototypes should be avoided in .h files

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>

# 18138ab2 06-May-2020 Trevor Woerner <twoerner@gmail.com>

rename symbol: CONFIG_TEGRA -> CONFIG_ARCH_TEGRA

Have this symbol follow the pattern of all other such symbols.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>

# bf4661bc 27-Feb-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add clock member to struct serial_device_info

Some callers of serial_getinfo() would like to know the UART base
clock speed in order to make decision what to pass to OS in some
cases. In particular, ACPI SPCR table expects only certain base
clock speed and thus we have to act accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# b03e0510 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial functions out of common.h

These functions belong in serial.h so move them over.

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

# f516fd99 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial_printf() to the serial header

Move this function header to serial.h since this function is clearly
related to serial. The function itself stays in console.c since we don't
have a single serial file. DM and non-DM each has a separate file so we
would have to either create a new common serial file, or repeat the
function in both serial.c and serial-uclass.c, neither of which seem
worthwhile.

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

# 2310c8ed 14-Nov-2019 Simon Glass <sjg@chromium.org>

serial: usb: Correct the usbtty_...() prototypes

The function declarations in serial.h are not in sync with what is
currently used in usbtty. Fix this by updating the header and including
it, to help catch future such problems.

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

# eab647d5 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Tidy up header file comments

The getconfig() comment is out of date. Fix this and add comments for
recently added functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# a61cbad7 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getinfo() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 3de04e77 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_setconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 67d1b051 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 0171f432 28-Dec-2018 Simon Glass <sjg@chromium.org>

serial: Move new functions to serial.h

We should not be adding new functions to common.h. Move these recently
added functions to serial.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# d5bb4f86 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Introduce ->getinfo() callback

New callback will give a necessary information to fill up ACPI SPCR table,
for example. Maybe used later for other purposes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change ADR_SPACE_SYSTEM_IO to SERIAL_ADDRESS_SPACE_IO to fix build error:
Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7f5db9 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add ->getconfig() callback

In some cases it would be good to know the settings, such as parity,
of current serial console. One example might be an ACPI SPCR table
to generate using these parameters.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 42b54013 21-Nov-2018 Christophe Leroy <christophe.leroy@c-s.fr>

drivers: serial: get rid of non DM mpc8xx driver

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

# 0a168687 02-Nov-2018 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

dm: serial: fix comment on dm_serial_ops setconfig

The comment on this function prototype describes nonexistent
parameters. It seems to be copied from 'setparity'.

Update it to match its the parameter list.

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

# d7c09684 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

sandbox: Add serial test

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

# ad060c05 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

dm: serial: Remove setparity ops

setparity users has been updated to use new setconfig ops,
so we can safely remove setparity ops

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

# cbf53883 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

dm: serial: Replace setparity by setconfig

Replace setparity by more generic setconfig ops
to allow uart parity, bits word length and stop bits
number change.

Adds SERIAL_GET_PARITY/BITS/STOP macros.

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>

# 481ea2e3 11-Jul-2018 Tom Rini <trini@konsulko.com>

mips: au1x00: Remove support for these SoCs

The only platform left for the AU1x00 SoCs was the pb1x00 platform, an
apparent clone of the dbau1x00 platform. As pb1x00 had no listed
maintainer I am assuming that it is also orphaned. Remove this platform
and then remove the unused SoC support.

Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

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

dm: serial: Add setparity

Implements serial setparity ops to allow uart parity change.
It allows to select ODD, EVEN or NONE parity.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

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

drivers: serial: remove nonexisting initialisation functions

This patch removes call of serial initialisation functions that
are not implemented anymore.

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

# 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>

# 98f705c9 27-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc: remove 4xx support

There was for long time no activity in the 4xx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in 4xx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# b9f7d881 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xx: remove some "5xx" remains

we removed 5xx support. So delete some forgotten remains.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 9057df88 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 82xx: remove some missed mpc82xx remains

we removed 82xx support. Missed some 82xx remains,
remove them now.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 064b55cf 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512x

There was for long time no activity in the mpx5xxx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in mpc5xxx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 3d16389c 16-May-2016 Lokesh Vutla <lokeshvutla@ti.com>

board: am335x: Allow to choose serial device dynamically

Different AM335x based platforms have different serial consoles. As serial
console is Kconfig option a separate defconfig has to be created for each
platform. So pass the serial device dynamically.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

# 2e2da4c6 08-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

serial: remove altera serial initializations

Both altera_jtag_serial_initialize() and
altera_serial_initialize() are no longer used after
they are converted to driver model.

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

# a2f39e83 23-Feb-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: remove cm4008 and cm41xx board support

These are still non-generic boards.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Greg Ungerer <greg.ungerer@opengear.com>
Acked-by: Marek Vasut <marex@denx.de>

# 41fbbbbc 23-Feb-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: remove jadecpu board support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Matthias Weisser <weisserm@arcor.de>
Acked-by: Marek Vasut <marex@denx.de>

# 94a255df 27-Oct-2014 Jeroen Hofstee <jeroen@myspectrum.nl>

serial: add prototypes for init functions

While at it, sort them.

Cc: Tom Rini <trini@ti.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

# 57d92753 04-Sep-2014 Simon Glass <sjg@chromium.org>

dm: Add a uclass for serial devices

Serial devices support simple byte input/output and a few operations to find
out whether data is available. Add a basic uclass for serial devices to be
used by drivers that are converted to driver model.

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

# 3fb85889 06-Aug-2013 Matthias Fuchs <matthias.fuchs@esd.eu>

ppc4xx: Remove support for PPC405CR CPUs

This patch removes support for the APM 405CR CPU.
This CPU is EOL and no board uses this chip.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>

# 6d6c0bae 11-Dec-2012 Tom Warren <twarren.nvidia@gmail.com>

Tegra30: Add generic Tegra30 build support

This patch adds basic Tegra30 (T30) build support - no specific
board is targeted.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>

# bfb7d7a3 06-Oct-2012 Marek Vasut <marex@denx.de>

serial: Implement default_serial_puts()

U-Boot contains a lot of duplicit implementations of serial_puts()
call which just pipes single characters into the port in loop. Implement
function that does this behavior into common code, so others can make
easy use of it.

This function is called default_serial_puts() and it's sole purpose
is to call putc() in loop on the whole string passed to it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 036036d7 14-Sep-2012 Marek Vasut <marex@denx.de>

serial: Remove CONFIG_SERIAL_MULTI from remaining sources

Remove the parts depending either on disabled CONFIG_SERIAL_MULTI
or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI
is now enabled by default.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 425101e1 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: zoom2: Remove zoom2 serial prototypes from serial.h

Remove the prototypes for zoom2_serial_deviceN from serial.h . This
can't be done right away, as they are referenced from the zoom2
config file. Therefore, adjust the code so the config file only
specifies number of the port. Then, replace the simple return in
default_serial_console() with a switch across possible values, which
returns the zoom2_serial_deviceN . With such adjustment in place,
the exported prototypes in serial.h can be safely removed.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 5ae1de0d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Adjust serial_register_bfin_uart()

Rename the serial_register_bfin_uart() to bfin_initialize_serial()
to be consistent with the rest of the naming. Next, remove it's
prototype from serial.h and properly insert it into serial.c as
the rest of the serial initialization functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# c513d7e5 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Remove the bfin_serialN_device exports from serial.h

Remove the exports from serial.h as they are only used in the blackfin
serial driver. Furthermore, they are only used for registration, which
is handled already inside that driver and default_serial_port() call,
which is also handled in that driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# abc0ed8d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: ns16550: Move serial registration from serial_initialize()

Move the registration of eserialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented ns16550_serial_initialize() function, which is
implemented inside of the ns16550 serial driver allows encapsulation
of eserialN_device within the ns16550 serial driver itself.

Also, remove the exports of eserialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the ns16550 serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Michal Simek <monstr@monstr.eu>

# 918327c8 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: mpc512x: Move serial registration from serial_initialize()

Move the registration of serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented mpc512x_serial_initialize() function, which is
implemented inside of the mpc512x serial driver allows encapsulation
of serialN_device within the mpc512x serial driver itself.

Also, remove the exports of serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the mpx512x serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 87d69229 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: microblaze: Move serial registration from serial_initialize()

Move the registration of xuartlite_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented xuartlite_serial_initialize() function, which is
implemented inside of the serial_xuartlite driver allows encapsulation
of xuartlite_serialN_device within the serial_xuartlite driver itself.

Also, remove the exports of xuartlite_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_xuartlite driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>

# 51d8102f 08-Oct-2012 Tom Rini <trini@konsulko.com>

serial: zynq: Move serial registration from serial_initialize()

Move the registration of zynq_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented zynq_serial_initialize() function, which is
implemented inside of the serial_zynq driver allows encapsulation
of zynq_serialN_device within the serial_zynq driver itself.

Also, remove the exports of zynq_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_zynq driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

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

# b4980515 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s5p: Move serial registration from serial_initialize()

Move the registration of s5p_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s5p_serial_initialize() function, which is
implemented inside of the serial_s5p driver allows encapsulation
of s5p_serialN_device within the serial_s5p driver itself.

Also, remove the exports of s5p_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s5p driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>

# 1fe5c110 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: pxa: Move serial registration from serial_initialize()

Move the registration of serial_XXuart ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented pxa_serial_initialize() function, which is
implemented inside of the serial_pxa driver allows encapsulation
of serial_XXuart within the serial_pxa driver itself.

Also, remove the exports of serial_XXuart from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_pxa driver and
the default console is picked by CONFIG_CONS_IDX macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 28af6385 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s3c24xx: Move serial registration from serial_initialize()

Move the registration of s3c24xx_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s3c24xx_serial_initialize() function, which is
implemented inside of the serial_s3c24xx driver allows encapsulation
of s3c24xx_serialN_device within the serial_s3c24xx driver itself.

Also, remove the exports of s3c24xx_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s3c24xx driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: C Nauman <cnauman@diagraph.com>

# 89143fb3 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Rename .init() and .uninit() in serial_device

Rename .init() to .start() and .uninit() to .stop() in struct
serial_device. This allows aligning struct serial_device with
closer to struct stdio_dev. The real goal here is to allow
these two structures to converge together and eventually make
one to be a superset of the other.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Tom Rini <trini@ti.com>

# 78322d63 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Coding style cleanup of struct serial_device

Do a simple cleanup of the struct serial_device and align it with
current coding style. Checkpatch now reports no errors.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 194846f3 13-Sep-2012 Michal Simek <michal.simek@xilinx.com>

serial: Add Zynq serial driver

The driver is used on Xilinx Zynq platform.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Joe Hershberger <joe.hershberger@gmail.com>
CC: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>

# 7636ebe1 01-Jul-2012 Michal Simek <michal.simek@xilinx.com>

serial: Support serial multi for Microblaze

enable serial multi for Microblaze.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephan Linz <linz@li-pro.net>

# 00a2749d 31-Aug-2012 Allen Martin <amartin@nvidia.com>

tegra20: rename tegra2 -> tegra20

This is make naming consistent with the kernel and devicetree and in
preparation of pulling out the common tegra20 code.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>

# f6add132 10-Nov-2011 Mike Frysinger <vapier@gentoo.org>

net/miiphy/serial: drop duplicate "NAMESIZE" define

A few subsystems are using the same define "NAMESIZE". This has been
working so far because they define it to the same number. However, I
want to change the size of eth_device's NAMESIZE, so rather than tweak
the define names, simply drop references to it. Almost no one does,
and the handful that do can easily be changed to a sizeof().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# ef5a5b00 29-Nov-2011 Gabe Black <gabeblack@chromium.org>

x86: Initial commit for running as a coreboot payload

Add a target for running u-boot as a coreboot payload in boards.cfg, a
board, CPU and a config. This is a skeleton implementation which always
reports the size of memory as 64 MB.

Signed-off-by: Gabe Black <gabeblack@chromium.org>

# 7813ca9b 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: constify serial_assign()

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# a6e6f7f4 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: cosmetic checkpatch compliance

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 49a23e4a 25-Sep-2011 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Support for SERIAL_MULTI

Add support for SERIAL MULTI for uartlite.

Signed-off-by: Michal Simek <monstr@monstr.eu>

# 1902692a 02-Aug-2011 Wolfgang Denk <wd@denx.de>

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

* 'master' of git://git.denx.de/u-boot-blackfin:
Blackfin: jtag-console: fix timer usage
Blackfin: switch to common display_options()
Blackfin: serial: move early debug strings into .rodata section
Blackfin: adi boards: also set stderr to nc with helper
Blackfin: update anomaly lists to latest public info
Blackfin: serial: convert to bfin_{read,write} helpers
Blackfin: split out async setup
Blackfin: adi boards: enable pretty flash progress output
Blackfin: drop unused dma.h header from start code
Blackfin: portmux: allow header to be included in assembly files
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: enable mmc_spi support
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings
Blackfin: sync MMR read/write helpers with Linux
Blackfin: gpio: optimize free path a little
Blackfin: post: setup default CONFIG_SYS_POST_WORD_ADDR
Blackfin: uart: fix printf warning
Blackfin: add init.elf helper code
Blackfin: dont reset SWRST on newer bf526 parts
Blackfin: adi boards: enable multi serial support by default
Blackfin: uart: add multiple serial support
Blackfin: uart: move debug buffers into local bss


# 7b826c2f 14-May-2011 Mike Frysinger <vapier@gentoo.org>

serial: implement common uart post test

The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data. If we ignore
the loop back part, the rest can be built upon the existing common serial
API. So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it. This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over. So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 1c9a5606 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

serial: drop useless ctlr field

The multi serial support has a "ctlr" field which almost no one uses,
but everyone is forced to set to useless strings. So punt it.

Funny enough, the only code that actually reads this field (the mpc8xx
driver) has a typo where it meant to look for the SCC driver. Fix it
while converting the check to use the name field.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Marek Vasut <marek.vasut@gmail.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>

# 635f330f 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

Blackfin: uart: add multiple serial support

This brings CONFIG_SERIAL_MULTI support to the Blackfin on-chip UARTs.
Ends up adding only ~512bytes per additional UART.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 2ee36781 27-Jan-2011 Tom Warren <twarren.nvidia@gmail.com>

serial: Add Tegra2 serial port support

Signed-off-by: Tom Warren <twarren@nvidia.com>

# 09b4a9cf 07-Sep-2010 Wolfgang Denk <wd@denx.de>

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


# 889a275d 23-Aug-2010 Minkyu Kang <mk7.kang@samsung.com>

ARMV7: S5P: rename from CONFIG_S5PC1XX to CONFIG_S5P

Use the same configuration around S5P SoCs.
(s5pc100, s5pc110, s5pc210 and so on)

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 6052ac83 09-Aug-2010 Matthias Weisser <weisserm@arcor.de>

ARM: Add support for MB86R0x SoCs

Signed-off-by: Matthias Weisser <weisserm@arcor.de>

# bf16500f 23-Apr-2010 Graeme Russ <graeme.russ@gmail.com>

x86: Use CONFIG_SERIAL_MULTI

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>

# 46a3b5c8 24-Mar-2010 Minkyu Kang <mk7.kang@samsung.com>

SAMSUNG: serial: modify name from s5pc1xx to s5p

Because of other s5p series SoC will use these serial functions,
modify function's name and structure's name.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 8e234e33 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc5121: add PSC serial communication routines

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# e3b28e67 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc512x: add multi serial PSC support

Extend mpc512x serial driver to support multiple PSC ports.

Subsequent patches for PDM360NG board support make use of this
functionality by defining CONFIG_SERIAL_MULTI in the board config
file. Additionally the used PSC devices are specified by defining
e.g. CONFIG_SYS_PSC1, CONFIG_SYS_PSC4 and CONFIG_SYS_PSC6.

Support for PSC devices other than 1, 3, 4 and 6 is not added
by this patch because these aren't used currently. In the future
it can be easily added using DECLARE_PSC_SERIAL_FUNCTIONS(N) and
INIT_PSC_SERIAL_STRUCTURE(N) macros in cpu/mpc512x/serial.c.
Additionally you have to add code for registering added
devices in serial_initialize() in common/serial.c.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# fbb0030e 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

serial: struct serial_device: add uninit() entry for drivers

Subsequent patch extends mpc512x serial driver to support
multiple PSC ports. The driver will provide an uninit()
function to stop the serial controller and to disable the
controller's clock. Adding uninit() entry to struct serial_device
allows disabling the serial controller after usage of
a stdio serial device.

This patch adds uninit() entry to the struct serial_device
and fixes initialization of this structure in the code
accordingly.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# 2ec1abea 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

OMAP3 zoom2 Use usbtty if the debug board is not connected.

The preferred serial output comes from the debug board.
When the debug board is disconnected, fall back on using
usbtty from the usb connector on the Zoom2 board.

This shows up as /dev/ttyACM0 in a linux host.

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6299487e 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

USBTTY make some function declarations easier to use.

Zoom2 needs to use these declarations and the include directory is a
better place from them than in the middle of the driver directory.
It did not make sense to create a new file for just a couple of
lines so they were appended to the serial.h

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# dd2c9e6a 01-Oct-2009 Minkyu Kang <mk7.kang@samsung.com>

s5pc1xx: support serial driver

This patch includes the serial driver for s5pc1xx.
s5pc1xx uart driver needs own register setting and clock configuration.
So, need to special driver.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 52cb4d4f 15-May-2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

stdio/device: rework function naming convention

So far the console API uses the following naming convention:

======Extract======
typedef struct device_t;

int device_register (device_t * dev);
int devices_init (void);
int device_deregister(char *devname);
struct list_head* device_get_list(void);
device_t* device_get_by_name(char* name);
device_t* device_clone(device_t *dev);
=======

which is too generic and confusing.

Instead of using device_XX and device_t we change this
into stdio_XX and stdio_dev

This will also allow to add later a generic device mechanism in order
to have support for multiple devices and driver instances.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Edited commit message.

Signed-off-by: Wolfgang Denk <wd@denx.de>

# 039594a4 02-Jul-2009 Poonam Aggrwal <poonam.aggrwal@freescale.com>

8xxx: Second UART port added for MPC85xx, MPC83xx, MPC86xx processors

Defining the next two configs allows to switch the serial port from the
console using the setenv stdin and stdout
1. #define CONFIG_SERIAL_MULTI 1 /* Enable both serial ports */
2. #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* determine from environment */

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

# 660888b7 30-May-2009 Tom Rix <Tom.Rix@windriver.com>

ZOOM2 Add serial support.

Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board.
The default serial is from the USB connector on left side of the debug board.
The USB connector will produce 2 of the 4 UARTS. On your host pick the first
enumeration.

The details of the setting of the serial gpmc setup are not available.
The values were provided by another party.

The serial port set up is the same with Zoom1.
Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow.

The kernel bootargs are
console=ttyS3,115200n8

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# a7c185ed 19-Dec-2007 Harald Welte <laforge@openmoko.org>

ARM: s3c24xx: Multiple serial port support

This patch adds support for CONFIG_SERIAL_MULTI on s3c24x0 CPU's

Signed-off-by: Harald Welte <laforge@openmoko.org>

# dbbd1257 05-Oct-2007 Stefan Roese <sr@denx.de>

ppc4xx: Add PPC405EX support

Signed-off-by: Stefan Roese <sr@denx.de>

# 80172c61 30-Aug-2007 Stefano Babic <sbabic@denx.de>

PXA270: Add support for multiple serial ports.

This patch adds support for multiple serial ports to the PXA target.
FFUART, BTUART and STUART are supported.

Signed-off-by: Stefano Babic <sbabic@denx.de>

# 3cb86f3e 24-Mar-2007 Stefan Roese <sr@denx.de>

[PATCH] Clean up 40EZ/Acadia support

This patch cleans up all the open issue of the preliminary
Acadia support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 0fd30252 30-Aug-2006 Wolfgang Denk <wd@denx.de>

Make the serial driver framework work with CONFIG_SERIAL_MULTI enabled

# c12cffc5 16-Jun-2006 Wolfgang Denk <wd@denx.de>

Add support for CONFIG_SERIAL_MULTI on MPC5xxx
Patch by Martin Krause, 8 Jun 2006

This patch supports two serial consoles on boards with
a MPC5xxx CPU. The console can be switched at runtime
by setting stdin, stdout and stderr to the desired serial
interface (serial0 or serial1). The PSCs to be used as
console port are definded by CONFIG_PSC_CONSOLE
and CONFIG_PSC_CONSOLE2.
See README.serial_multi for details.

# ff36fd85 09-Jan-2005 Wolfgang Denk <wd@denx.de>

* Patch by Leif Lindholm, 23 Sep 2004:
add support for the AMD db1550 board

* Patch by Travis Sawyer, 15 Sep 2004:
Add CONFIG_SERIAL_MULTI support for ppc4xx,
update README.serial_multi

# 281e00a3 01-Aug-2004 Wolfgang Denk <wd@denx.de>

* Code cleanup

* Patch by Sascha Hauer, 28 Jun:
- add generic support for Motorola i.MX architecture
- add support for mx1ads, mx1fs2 and scb9328 boards

* Patches by Marc Leeman, 23 Jul 2004:
- Add define for the PCI/Memory Buffer Configuration Register
- corrected comments in cpu/mpc824x/cpu_init.c

* Add support for multiple serial interfaces
(for example to allow modem dial-in / dial-out)

# 78b52431 05-Sep-2022 Pali Rohár <pali@kernel.org>

serial: Implement serial_flush() function for console flush() fallback

Like in all other console functions, implement also serial_flush() function
as a fallback int console flush() function.

Flush support is available only when config option CONSOLE_FLUSH_SUPPORT is
enabled. So when it is disabled then provides just empty static inline
function serial_flush().

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-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>

# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 39a19223 24-Jul-2020 Ovidiu Panait <ovidiu.panait@windriver.com>

drivers: serial: Make serial_initialize return int

serial_initialize is called only during the common init sequence, after
relocation (in common/board_r.c). Because it has a void return value, it
has to wrapped in initr_serial. In order to be able to get rid of this
indirection, make serial_initialize return int.

Remove extern from prototype in order to silence the following checkpatch
warning:
check: extern prototypes should be avoided in .h files

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>

# 18138ab2 06-May-2020 Trevor Woerner <twoerner@gmail.com>

rename symbol: CONFIG_TEGRA -> CONFIG_ARCH_TEGRA

Have this symbol follow the pattern of all other such symbols.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>

# bf4661bc 27-Feb-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add clock member to struct serial_device_info

Some callers of serial_getinfo() would like to know the UART base
clock speed in order to make decision what to pass to OS in some
cases. In particular, ACPI SPCR table expects only certain base
clock speed and thus we have to act accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# b03e0510 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial functions out of common.h

These functions belong in serial.h so move them over.

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

# f516fd99 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial_printf() to the serial header

Move this function header to serial.h since this function is clearly
related to serial. The function itself stays in console.c since we don't
have a single serial file. DM and non-DM each has a separate file so we
would have to either create a new common serial file, or repeat the
function in both serial.c and serial-uclass.c, neither of which seem
worthwhile.

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

# 2310c8ed 14-Nov-2019 Simon Glass <sjg@chromium.org>

serial: usb: Correct the usbtty_...() prototypes

The function declarations in serial.h are not in sync with what is
currently used in usbtty. Fix this by updating the header and including
it, to help catch future such problems.

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

# eab647d5 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Tidy up header file comments

The getconfig() comment is out of date. Fix this and add comments for
recently added functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# a61cbad7 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getinfo() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 3de04e77 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_setconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 67d1b051 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 0171f432 28-Dec-2018 Simon Glass <sjg@chromium.org>

serial: Move new functions to serial.h

We should not be adding new functions to common.h. Move these recently
added functions to serial.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# d5bb4f86 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Introduce ->getinfo() callback

New callback will give a necessary information to fill up ACPI SPCR table,
for example. Maybe used later for other purposes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change ADR_SPACE_SYSTEM_IO to SERIAL_ADDRESS_SPACE_IO to fix build error:
Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7f5db9 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add ->getconfig() callback

In some cases it would be good to know the settings, such as parity,
of current serial console. One example might be an ACPI SPCR table
to generate using these parameters.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 42b54013 21-Nov-2018 Christophe Leroy <christophe.leroy@c-s.fr>

drivers: serial: get rid of non DM mpc8xx driver

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

# 0a168687 02-Nov-2018 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

dm: serial: fix comment on dm_serial_ops setconfig

The comment on this function prototype describes nonexistent
parameters. It seems to be copied from 'setparity'.

Update it to match its the parameter list.

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

# d7c09684 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

sandbox: Add serial test

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

# ad060c05 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

dm: serial: Remove setparity ops

setparity users has been updated to use new setconfig ops,
so we can safely remove setparity ops

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

# cbf53883 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

dm: serial: Replace setparity by setconfig

Replace setparity by more generic setconfig ops
to allow uart parity, bits word length and stop bits
number change.

Adds SERIAL_GET_PARITY/BITS/STOP macros.

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>

# 481ea2e3 11-Jul-2018 Tom Rini <trini@konsulko.com>

mips: au1x00: Remove support for these SoCs

The only platform left for the AU1x00 SoCs was the pb1x00 platform, an
apparent clone of the dbau1x00 platform. As pb1x00 had no listed
maintainer I am assuming that it is also orphaned. Remove this platform
and then remove the unused SoC support.

Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

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

dm: serial: Add setparity

Implements serial setparity ops to allow uart parity change.
It allows to select ODD, EVEN or NONE parity.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

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

drivers: serial: remove nonexisting initialisation functions

This patch removes call of serial initialisation functions that
are not implemented anymore.

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

# 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>

# 98f705c9 27-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc: remove 4xx support

There was for long time no activity in the 4xx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in 4xx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# b9f7d881 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xx: remove some "5xx" remains

we removed 5xx support. So delete some forgotten remains.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 9057df88 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 82xx: remove some missed mpc82xx remains

we removed 82xx support. Missed some 82xx remains,
remove them now.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 064b55cf 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512x

There was for long time no activity in the mpx5xxx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in mpc5xxx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 3d16389c 16-May-2016 Lokesh Vutla <lokeshvutla@ti.com>

board: am335x: Allow to choose serial device dynamically

Different AM335x based platforms have different serial consoles. As serial
console is Kconfig option a separate defconfig has to be created for each
platform. So pass the serial device dynamically.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

# 2e2da4c6 08-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

serial: remove altera serial initializations

Both altera_jtag_serial_initialize() and
altera_serial_initialize() are no longer used after
they are converted to driver model.

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

# a2f39e83 23-Feb-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: remove cm4008 and cm41xx board support

These are still non-generic boards.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Greg Ungerer <greg.ungerer@opengear.com>
Acked-by: Marek Vasut <marex@denx.de>

# 41fbbbbc 23-Feb-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: remove jadecpu board support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Matthias Weisser <weisserm@arcor.de>
Acked-by: Marek Vasut <marex@denx.de>

# 94a255df 27-Oct-2014 Jeroen Hofstee <jeroen@myspectrum.nl>

serial: add prototypes for init functions

While at it, sort them.

Cc: Tom Rini <trini@ti.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

# 57d92753 04-Sep-2014 Simon Glass <sjg@chromium.org>

dm: Add a uclass for serial devices

Serial devices support simple byte input/output and a few operations to find
out whether data is available. Add a basic uclass for serial devices to be
used by drivers that are converted to driver model.

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

# 3fb85889 06-Aug-2013 Matthias Fuchs <matthias.fuchs@esd.eu>

ppc4xx: Remove support for PPC405CR CPUs

This patch removes support for the APM 405CR CPU.
This CPU is EOL and no board uses this chip.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>

# 6d6c0bae 11-Dec-2012 Tom Warren <twarren.nvidia@gmail.com>

Tegra30: Add generic Tegra30 build support

This patch adds basic Tegra30 (T30) build support - no specific
board is targeted.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>

# bfb7d7a3 06-Oct-2012 Marek Vasut <marex@denx.de>

serial: Implement default_serial_puts()

U-Boot contains a lot of duplicit implementations of serial_puts()
call which just pipes single characters into the port in loop. Implement
function that does this behavior into common code, so others can make
easy use of it.

This function is called default_serial_puts() and it's sole purpose
is to call putc() in loop on the whole string passed to it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 036036d7 14-Sep-2012 Marek Vasut <marex@denx.de>

serial: Remove CONFIG_SERIAL_MULTI from remaining sources

Remove the parts depending either on disabled CONFIG_SERIAL_MULTI
or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI
is now enabled by default.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 425101e1 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: zoom2: Remove zoom2 serial prototypes from serial.h

Remove the prototypes for zoom2_serial_deviceN from serial.h . This
can't be done right away, as they are referenced from the zoom2
config file. Therefore, adjust the code so the config file only
specifies number of the port. Then, replace the simple return in
default_serial_console() with a switch across possible values, which
returns the zoom2_serial_deviceN . With such adjustment in place,
the exported prototypes in serial.h can be safely removed.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 5ae1de0d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Adjust serial_register_bfin_uart()

Rename the serial_register_bfin_uart() to bfin_initialize_serial()
to be consistent with the rest of the naming. Next, remove it's
prototype from serial.h and properly insert it into serial.c as
the rest of the serial initialization functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# c513d7e5 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Remove the bfin_serialN_device exports from serial.h

Remove the exports from serial.h as they are only used in the blackfin
serial driver. Furthermore, they are only used for registration, which
is handled already inside that driver and default_serial_port() call,
which is also handled in that driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# abc0ed8d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: ns16550: Move serial registration from serial_initialize()

Move the registration of eserialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented ns16550_serial_initialize() function, which is
implemented inside of the ns16550 serial driver allows encapsulation
of eserialN_device within the ns16550 serial driver itself.

Also, remove the exports of eserialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the ns16550 serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Michal Simek <monstr@monstr.eu>

# 918327c8 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: mpc512x: Move serial registration from serial_initialize()

Move the registration of serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented mpc512x_serial_initialize() function, which is
implemented inside of the mpc512x serial driver allows encapsulation
of serialN_device within the mpc512x serial driver itself.

Also, remove the exports of serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the mpx512x serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 87d69229 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: microblaze: Move serial registration from serial_initialize()

Move the registration of xuartlite_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented xuartlite_serial_initialize() function, which is
implemented inside of the serial_xuartlite driver allows encapsulation
of xuartlite_serialN_device within the serial_xuartlite driver itself.

Also, remove the exports of xuartlite_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_xuartlite driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>

# 51d8102f 08-Oct-2012 Tom Rini <trini@konsulko.com>

serial: zynq: Move serial registration from serial_initialize()

Move the registration of zynq_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented zynq_serial_initialize() function, which is
implemented inside of the serial_zynq driver allows encapsulation
of zynq_serialN_device within the serial_zynq driver itself.

Also, remove the exports of zynq_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_zynq driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

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

# b4980515 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s5p: Move serial registration from serial_initialize()

Move the registration of s5p_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s5p_serial_initialize() function, which is
implemented inside of the serial_s5p driver allows encapsulation
of s5p_serialN_device within the serial_s5p driver itself.

Also, remove the exports of s5p_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s5p driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>

# 1fe5c110 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: pxa: Move serial registration from serial_initialize()

Move the registration of serial_XXuart ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented pxa_serial_initialize() function, which is
implemented inside of the serial_pxa driver allows encapsulation
of serial_XXuart within the serial_pxa driver itself.

Also, remove the exports of serial_XXuart from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_pxa driver and
the default console is picked by CONFIG_CONS_IDX macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 28af6385 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s3c24xx: Move serial registration from serial_initialize()

Move the registration of s3c24xx_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s3c24xx_serial_initialize() function, which is
implemented inside of the serial_s3c24xx driver allows encapsulation
of s3c24xx_serialN_device within the serial_s3c24xx driver itself.

Also, remove the exports of s3c24xx_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s3c24xx driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: C Nauman <cnauman@diagraph.com>

# 89143fb3 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Rename .init() and .uninit() in serial_device

Rename .init() to .start() and .uninit() to .stop() in struct
serial_device. This allows aligning struct serial_device with
closer to struct stdio_dev. The real goal here is to allow
these two structures to converge together and eventually make
one to be a superset of the other.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Tom Rini <trini@ti.com>

# 78322d63 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Coding style cleanup of struct serial_device

Do a simple cleanup of the struct serial_device and align it with
current coding style. Checkpatch now reports no errors.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 194846f3 13-Sep-2012 Michal Simek <michal.simek@xilinx.com>

serial: Add Zynq serial driver

The driver is used on Xilinx Zynq platform.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Joe Hershberger <joe.hershberger@gmail.com>
CC: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>

# 7636ebe1 01-Jul-2012 Michal Simek <michal.simek@xilinx.com>

serial: Support serial multi for Microblaze

enable serial multi for Microblaze.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephan Linz <linz@li-pro.net>

# 00a2749d 31-Aug-2012 Allen Martin <amartin@nvidia.com>

tegra20: rename tegra2 -> tegra20

This is make naming consistent with the kernel and devicetree and in
preparation of pulling out the common tegra20 code.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>

# f6add132 10-Nov-2011 Mike Frysinger <vapier@gentoo.org>

net/miiphy/serial: drop duplicate "NAMESIZE" define

A few subsystems are using the same define "NAMESIZE". This has been
working so far because they define it to the same number. However, I
want to change the size of eth_device's NAMESIZE, so rather than tweak
the define names, simply drop references to it. Almost no one does,
and the handful that do can easily be changed to a sizeof().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# ef5a5b00 29-Nov-2011 Gabe Black <gabeblack@chromium.org>

x86: Initial commit for running as a coreboot payload

Add a target for running u-boot as a coreboot payload in boards.cfg, a
board, CPU and a config. This is a skeleton implementation which always
reports the size of memory as 64 MB.

Signed-off-by: Gabe Black <gabeblack@chromium.org>

# 7813ca9b 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: constify serial_assign()

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# a6e6f7f4 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: cosmetic checkpatch compliance

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 49a23e4a 25-Sep-2011 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Support for SERIAL_MULTI

Add support for SERIAL MULTI for uartlite.

Signed-off-by: Michal Simek <monstr@monstr.eu>

# 1902692a 02-Aug-2011 Wolfgang Denk <wd@denx.de>

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

* 'master' of git://git.denx.de/u-boot-blackfin:
Blackfin: jtag-console: fix timer usage
Blackfin: switch to common display_options()
Blackfin: serial: move early debug strings into .rodata section
Blackfin: adi boards: also set stderr to nc with helper
Blackfin: update anomaly lists to latest public info
Blackfin: serial: convert to bfin_{read,write} helpers
Blackfin: split out async setup
Blackfin: adi boards: enable pretty flash progress output
Blackfin: drop unused dma.h header from start code
Blackfin: portmux: allow header to be included in assembly files
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: enable mmc_spi support
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings
Blackfin: sync MMR read/write helpers with Linux
Blackfin: gpio: optimize free path a little
Blackfin: post: setup default CONFIG_SYS_POST_WORD_ADDR
Blackfin: uart: fix printf warning
Blackfin: add init.elf helper code
Blackfin: dont reset SWRST on newer bf526 parts
Blackfin: adi boards: enable multi serial support by default
Blackfin: uart: add multiple serial support
Blackfin: uart: move debug buffers into local bss


# 7b826c2f 14-May-2011 Mike Frysinger <vapier@gentoo.org>

serial: implement common uart post test

The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data. If we ignore
the loop back part, the rest can be built upon the existing common serial
API. So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it. This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over. So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 1c9a5606 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

serial: drop useless ctlr field

The multi serial support has a "ctlr" field which almost no one uses,
but everyone is forced to set to useless strings. So punt it.

Funny enough, the only code that actually reads this field (the mpc8xx
driver) has a typo where it meant to look for the SCC driver. Fix it
while converting the check to use the name field.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Marek Vasut <marek.vasut@gmail.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>

# 635f330f 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

Blackfin: uart: add multiple serial support

This brings CONFIG_SERIAL_MULTI support to the Blackfin on-chip UARTs.
Ends up adding only ~512bytes per additional UART.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 2ee36781 27-Jan-2011 Tom Warren <twarren.nvidia@gmail.com>

serial: Add Tegra2 serial port support

Signed-off-by: Tom Warren <twarren@nvidia.com>

# 09b4a9cf 07-Sep-2010 Wolfgang Denk <wd@denx.de>

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


# 889a275d 23-Aug-2010 Minkyu Kang <mk7.kang@samsung.com>

ARMV7: S5P: rename from CONFIG_S5PC1XX to CONFIG_S5P

Use the same configuration around S5P SoCs.
(s5pc100, s5pc110, s5pc210 and so on)

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 6052ac83 09-Aug-2010 Matthias Weisser <weisserm@arcor.de>

ARM: Add support for MB86R0x SoCs

Signed-off-by: Matthias Weisser <weisserm@arcor.de>

# bf16500f 23-Apr-2010 Graeme Russ <graeme.russ@gmail.com>

x86: Use CONFIG_SERIAL_MULTI

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>

# 46a3b5c8 24-Mar-2010 Minkyu Kang <mk7.kang@samsung.com>

SAMSUNG: serial: modify name from s5pc1xx to s5p

Because of other s5p series SoC will use these serial functions,
modify function's name and structure's name.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 8e234e33 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc5121: add PSC serial communication routines

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# e3b28e67 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc512x: add multi serial PSC support

Extend mpc512x serial driver to support multiple PSC ports.

Subsequent patches for PDM360NG board support make use of this
functionality by defining CONFIG_SERIAL_MULTI in the board config
file. Additionally the used PSC devices are specified by defining
e.g. CONFIG_SYS_PSC1, CONFIG_SYS_PSC4 and CONFIG_SYS_PSC6.

Support for PSC devices other than 1, 3, 4 and 6 is not added
by this patch because these aren't used currently. In the future
it can be easily added using DECLARE_PSC_SERIAL_FUNCTIONS(N) and
INIT_PSC_SERIAL_STRUCTURE(N) macros in cpu/mpc512x/serial.c.
Additionally you have to add code for registering added
devices in serial_initialize() in common/serial.c.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# fbb0030e 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

serial: struct serial_device: add uninit() entry for drivers

Subsequent patch extends mpc512x serial driver to support
multiple PSC ports. The driver will provide an uninit()
function to stop the serial controller and to disable the
controller's clock. Adding uninit() entry to struct serial_device
allows disabling the serial controller after usage of
a stdio serial device.

This patch adds uninit() entry to the struct serial_device
and fixes initialization of this structure in the code
accordingly.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# 2ec1abea 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

OMAP3 zoom2 Use usbtty if the debug board is not connected.

The preferred serial output comes from the debug board.
When the debug board is disconnected, fall back on using
usbtty from the usb connector on the Zoom2 board.

This shows up as /dev/ttyACM0 in a linux host.

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6299487e 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

USBTTY make some function declarations easier to use.

Zoom2 needs to use these declarations and the include directory is a
better place from them than in the middle of the driver directory.
It did not make sense to create a new file for just a couple of
lines so they were appended to the serial.h

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# dd2c9e6a 01-Oct-2009 Minkyu Kang <mk7.kang@samsung.com>

s5pc1xx: support serial driver

This patch includes the serial driver for s5pc1xx.
s5pc1xx uart driver needs own register setting and clock configuration.
So, need to special driver.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 52cb4d4f 15-May-2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

stdio/device: rework function naming convention

So far the console API uses the following naming convention:

======Extract======
typedef struct device_t;

int device_register (device_t * dev);
int devices_init (void);
int device_deregister(char *devname);
struct list_head* device_get_list(void);
device_t* device_get_by_name(char* name);
device_t* device_clone(device_t *dev);
=======

which is too generic and confusing.

Instead of using device_XX and device_t we change this
into stdio_XX and stdio_dev

This will also allow to add later a generic device mechanism in order
to have support for multiple devices and driver instances.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Edited commit message.

Signed-off-by: Wolfgang Denk <wd@denx.de>

# 039594a4 02-Jul-2009 Poonam Aggrwal <poonam.aggrwal@freescale.com>

8xxx: Second UART port added for MPC85xx, MPC83xx, MPC86xx processors

Defining the next two configs allows to switch the serial port from the
console using the setenv stdin and stdout
1. #define CONFIG_SERIAL_MULTI 1 /* Enable both serial ports */
2. #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* determine from environment */

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

# 660888b7 30-May-2009 Tom Rix <Tom.Rix@windriver.com>

ZOOM2 Add serial support.

Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board.
The default serial is from the USB connector on left side of the debug board.
The USB connector will produce 2 of the 4 UARTS. On your host pick the first
enumeration.

The details of the setting of the serial gpmc setup are not available.
The values were provided by another party.

The serial port set up is the same with Zoom1.
Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow.

The kernel bootargs are
console=ttyS3,115200n8

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# a7c185ed 19-Dec-2007 Harald Welte <laforge@openmoko.org>

ARM: s3c24xx: Multiple serial port support

This patch adds support for CONFIG_SERIAL_MULTI on s3c24x0 CPU's

Signed-off-by: Harald Welte <laforge@openmoko.org>

# dbbd1257 05-Oct-2007 Stefan Roese <sr@denx.de>

ppc4xx: Add PPC405EX support

Signed-off-by: Stefan Roese <sr@denx.de>

# 80172c61 30-Aug-2007 Stefano Babic <sbabic@denx.de>

PXA270: Add support for multiple serial ports.

This patch adds support for multiple serial ports to the PXA target.
FFUART, BTUART and STUART are supported.

Signed-off-by: Stefano Babic <sbabic@denx.de>

# 3cb86f3e 24-Mar-2007 Stefan Roese <sr@denx.de>

[PATCH] Clean up 40EZ/Acadia support

This patch cleans up all the open issue of the preliminary
Acadia support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 0fd30252 30-Aug-2006 Wolfgang Denk <wd@denx.de>

Make the serial driver framework work with CONFIG_SERIAL_MULTI enabled

# c12cffc5 16-Jun-2006 Wolfgang Denk <wd@denx.de>

Add support for CONFIG_SERIAL_MULTI on MPC5xxx
Patch by Martin Krause, 8 Jun 2006

This patch supports two serial consoles on boards with
a MPC5xxx CPU. The console can be switched at runtime
by setting stdin, stdout and stderr to the desired serial
interface (serial0 or serial1). The PSCs to be used as
console port are definded by CONFIG_PSC_CONSOLE
and CONFIG_PSC_CONSOLE2.
See README.serial_multi for details.

# ff36fd85 09-Jan-2005 Wolfgang Denk <wd@denx.de>

* Patch by Leif Lindholm, 23 Sep 2004:
add support for the AMD db1550 board

* Patch by Travis Sawyer, 15 Sep 2004:
Add CONFIG_SERIAL_MULTI support for ppc4xx,
update README.serial_multi

# 281e00a3 01-Aug-2004 Wolfgang Denk <wd@denx.de>

* Code cleanup

* Patch by Sascha Hauer, 28 Jun:
- add generic support for Motorola i.MX architecture
- add support for mx1ads, mx1fs2 and scb9328 boards

* Patches by Marc Leeman, 23 Jul 2004:
- Add define for the PCI/Memory Buffer Configuration Register
- corrected comments in cpu/mpc824x/cpu_init.c

* Add support for multiple serial interfaces
(for example to allow modem dial-in / dial-out)

# 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>

# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 39a19223 24-Jul-2020 Ovidiu Panait <ovidiu.panait@windriver.com>

drivers: serial: Make serial_initialize return int

serial_initialize is called only during the common init sequence, after
relocation (in common/board_r.c). Because it has a void return value, it
has to wrapped in initr_serial. In order to be able to get rid of this
indirection, make serial_initialize return int.

Remove extern from prototype in order to silence the following checkpatch
warning:
check: extern prototypes should be avoided in .h files

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>

# 18138ab2 06-May-2020 Trevor Woerner <twoerner@gmail.com>

rename symbol: CONFIG_TEGRA -> CONFIG_ARCH_TEGRA

Have this symbol follow the pattern of all other such symbols.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>

# bf4661bc 27-Feb-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add clock member to struct serial_device_info

Some callers of serial_getinfo() would like to know the UART base
clock speed in order to make decision what to pass to OS in some
cases. In particular, ACPI SPCR table expects only certain base
clock speed and thus we have to act accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# b03e0510 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial functions out of common.h

These functions belong in serial.h so move them over.

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

# f516fd99 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial_printf() to the serial header

Move this function header to serial.h since this function is clearly
related to serial. The function itself stays in console.c since we don't
have a single serial file. DM and non-DM each has a separate file so we
would have to either create a new common serial file, or repeat the
function in both serial.c and serial-uclass.c, neither of which seem
worthwhile.

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

# 2310c8ed 14-Nov-2019 Simon Glass <sjg@chromium.org>

serial: usb: Correct the usbtty_...() prototypes

The function declarations in serial.h are not in sync with what is
currently used in usbtty. Fix this by updating the header and including
it, to help catch future such problems.

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

# eab647d5 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Tidy up header file comments

The getconfig() comment is out of date. Fix this and add comments for
recently added functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# a61cbad7 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getinfo() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 3de04e77 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_setconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 67d1b051 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 0171f432 28-Dec-2018 Simon Glass <sjg@chromium.org>

serial: Move new functions to serial.h

We should not be adding new functions to common.h. Move these recently
added functions to serial.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# d5bb4f86 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Introduce ->getinfo() callback

New callback will give a necessary information to fill up ACPI SPCR table,
for example. Maybe used later for other purposes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change ADR_SPACE_SYSTEM_IO to SERIAL_ADDRESS_SPACE_IO to fix build error:
Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7f5db9 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add ->getconfig() callback

In some cases it would be good to know the settings, such as parity,
of current serial console. One example might be an ACPI SPCR table
to generate using these parameters.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 42b54013 21-Nov-2018 Christophe Leroy <christophe.leroy@c-s.fr>

drivers: serial: get rid of non DM mpc8xx driver

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

# 0a168687 02-Nov-2018 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

dm: serial: fix comment on dm_serial_ops setconfig

The comment on this function prototype describes nonexistent
parameters. It seems to be copied from 'setparity'.

Update it to match its the parameter list.

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

# d7c09684 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

sandbox: Add serial test

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

# ad060c05 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

dm: serial: Remove setparity ops

setparity users has been updated to use new setconfig ops,
so we can safely remove setparity ops

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

# cbf53883 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

dm: serial: Replace setparity by setconfig

Replace setparity by more generic setconfig ops
to allow uart parity, bits word length and stop bits
number change.

Adds SERIAL_GET_PARITY/BITS/STOP macros.

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>

# 481ea2e3 11-Jul-2018 Tom Rini <trini@konsulko.com>

mips: au1x00: Remove support for these SoCs

The only platform left for the AU1x00 SoCs was the pb1x00 platform, an
apparent clone of the dbau1x00 platform. As pb1x00 had no listed
maintainer I am assuming that it is also orphaned. Remove this platform
and then remove the unused SoC support.

Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

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

dm: serial: Add setparity

Implements serial setparity ops to allow uart parity change.
It allows to select ODD, EVEN or NONE parity.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

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

drivers: serial: remove nonexisting initialisation functions

This patch removes call of serial initialisation functions that
are not implemented anymore.

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

# 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>

# 98f705c9 27-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc: remove 4xx support

There was for long time no activity in the 4xx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in 4xx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# b9f7d881 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xx: remove some "5xx" remains

we removed 5xx support. So delete some forgotten remains.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 9057df88 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 82xx: remove some missed mpc82xx remains

we removed 82xx support. Missed some 82xx remains,
remove them now.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 064b55cf 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512x

There was for long time no activity in the mpx5xxx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in mpc5xxx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 3d16389c 16-May-2016 Lokesh Vutla <lokeshvutla@ti.com>

board: am335x: Allow to choose serial device dynamically

Different AM335x based platforms have different serial consoles. As serial
console is Kconfig option a separate defconfig has to be created for each
platform. So pass the serial device dynamically.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

# 2e2da4c6 08-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

serial: remove altera serial initializations

Both altera_jtag_serial_initialize() and
altera_serial_initialize() are no longer used after
they are converted to driver model.

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

# a2f39e83 23-Feb-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: remove cm4008 and cm41xx board support

These are still non-generic boards.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Greg Ungerer <greg.ungerer@opengear.com>
Acked-by: Marek Vasut <marex@denx.de>

# 41fbbbbc 23-Feb-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

ARM: remove jadecpu board support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Matthias Weisser <weisserm@arcor.de>
Acked-by: Marek Vasut <marex@denx.de>

# 94a255df 27-Oct-2014 Jeroen Hofstee <jeroen@myspectrum.nl>

serial: add prototypes for init functions

While at it, sort them.

Cc: Tom Rini <trini@ti.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

# 57d92753 04-Sep-2014 Simon Glass <sjg@chromium.org>

dm: Add a uclass for serial devices

Serial devices support simple byte input/output and a few operations to find
out whether data is available. Add a basic uclass for serial devices to be
used by drivers that are converted to driver model.

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

# 3fb85889 06-Aug-2013 Matthias Fuchs <matthias.fuchs@esd.eu>

ppc4xx: Remove support for PPC405CR CPUs

This patch removes support for the APM 405CR CPU.
This CPU is EOL and no board uses this chip.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>

# 6d6c0bae 11-Dec-2012 Tom Warren <twarren.nvidia@gmail.com>

Tegra30: Add generic Tegra30 build support

This patch adds basic Tegra30 (T30) build support - no specific
board is targeted.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>

# bfb7d7a3 06-Oct-2012 Marek Vasut <marex@denx.de>

serial: Implement default_serial_puts()

U-Boot contains a lot of duplicit implementations of serial_puts()
call which just pipes single characters into the port in loop. Implement
function that does this behavior into common code, so others can make
easy use of it.

This function is called default_serial_puts() and it's sole purpose
is to call putc() in loop on the whole string passed to it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 036036d7 14-Sep-2012 Marek Vasut <marex@denx.de>

serial: Remove CONFIG_SERIAL_MULTI from remaining sources

Remove the parts depending either on disabled CONFIG_SERIAL_MULTI
or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI
is now enabled by default.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 425101e1 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: zoom2: Remove zoom2 serial prototypes from serial.h

Remove the prototypes for zoom2_serial_deviceN from serial.h . This
can't be done right away, as they are referenced from the zoom2
config file. Therefore, adjust the code so the config file only
specifies number of the port. Then, replace the simple return in
default_serial_console() with a switch across possible values, which
returns the zoom2_serial_deviceN . With such adjustment in place,
the exported prototypes in serial.h can be safely removed.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 5ae1de0d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Adjust serial_register_bfin_uart()

Rename the serial_register_bfin_uart() to bfin_initialize_serial()
to be consistent with the rest of the naming. Next, remove it's
prototype from serial.h and properly insert it into serial.c as
the rest of the serial initialization functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# c513d7e5 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Remove the bfin_serialN_device exports from serial.h

Remove the exports from serial.h as they are only used in the blackfin
serial driver. Furthermore, they are only used for registration, which
is handled already inside that driver and default_serial_port() call,
which is also handled in that driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# abc0ed8d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: ns16550: Move serial registration from serial_initialize()

Move the registration of eserialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented ns16550_serial_initialize() function, which is
implemented inside of the ns16550 serial driver allows encapsulation
of eserialN_device within the ns16550 serial driver itself.

Also, remove the exports of eserialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the ns16550 serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Michal Simek <monstr@monstr.eu>

# 918327c8 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: mpc512x: Move serial registration from serial_initialize()

Move the registration of serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented mpc512x_serial_initialize() function, which is
implemented inside of the mpc512x serial driver allows encapsulation
of serialN_device within the mpc512x serial driver itself.

Also, remove the exports of serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the mpx512x serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 87d69229 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: microblaze: Move serial registration from serial_initialize()

Move the registration of xuartlite_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented xuartlite_serial_initialize() function, which is
implemented inside of the serial_xuartlite driver allows encapsulation
of xuartlite_serialN_device within the serial_xuartlite driver itself.

Also, remove the exports of xuartlite_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_xuartlite driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>

# 51d8102f 08-Oct-2012 Tom Rini <trini@konsulko.com>

serial: zynq: Move serial registration from serial_initialize()

Move the registration of zynq_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented zynq_serial_initialize() function, which is
implemented inside of the serial_zynq driver allows encapsulation
of zynq_serialN_device within the serial_zynq driver itself.

Also, remove the exports of zynq_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_zynq driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

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

# b4980515 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s5p: Move serial registration from serial_initialize()

Move the registration of s5p_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s5p_serial_initialize() function, which is
implemented inside of the serial_s5p driver allows encapsulation
of s5p_serialN_device within the serial_s5p driver itself.

Also, remove the exports of s5p_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s5p driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>

# 1fe5c110 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: pxa: Move serial registration from serial_initialize()

Move the registration of serial_XXuart ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented pxa_serial_initialize() function, which is
implemented inside of the serial_pxa driver allows encapsulation
of serial_XXuart within the serial_pxa driver itself.

Also, remove the exports of serial_XXuart from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_pxa driver and
the default console is picked by CONFIG_CONS_IDX macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 28af6385 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s3c24xx: Move serial registration from serial_initialize()

Move the registration of s3c24xx_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s3c24xx_serial_initialize() function, which is
implemented inside of the serial_s3c24xx driver allows encapsulation
of s3c24xx_serialN_device within the serial_s3c24xx driver itself.

Also, remove the exports of s3c24xx_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s3c24xx driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: C Nauman <cnauman@diagraph.com>

# 89143fb3 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Rename .init() and .uninit() in serial_device

Rename .init() to .start() and .uninit() to .stop() in struct
serial_device. This allows aligning struct serial_device with
closer to struct stdio_dev. The real goal here is to allow
these two structures to converge together and eventually make
one to be a superset of the other.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Tom Rini <trini@ti.com>

# 78322d63 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Coding style cleanup of struct serial_device

Do a simple cleanup of the struct serial_device and align it with
current coding style. Checkpatch now reports no errors.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 194846f3 13-Sep-2012 Michal Simek <michal.simek@xilinx.com>

serial: Add Zynq serial driver

The driver is used on Xilinx Zynq platform.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Joe Hershberger <joe.hershberger@gmail.com>
CC: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>

# 7636ebe1 01-Jul-2012 Michal Simek <michal.simek@xilinx.com>

serial: Support serial multi for Microblaze

enable serial multi for Microblaze.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephan Linz <linz@li-pro.net>

# 00a2749d 31-Aug-2012 Allen Martin <amartin@nvidia.com>

tegra20: rename tegra2 -> tegra20

This is make naming consistent with the kernel and devicetree and in
preparation of pulling out the common tegra20 code.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>

# f6add132 10-Nov-2011 Mike Frysinger <vapier@gentoo.org>

net/miiphy/serial: drop duplicate "NAMESIZE" define

A few subsystems are using the same define "NAMESIZE". This has been
working so far because they define it to the same number. However, I
want to change the size of eth_device's NAMESIZE, so rather than tweak
the define names, simply drop references to it. Almost no one does,
and the handful that do can easily be changed to a sizeof().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# ef5a5b00 29-Nov-2011 Gabe Black <gabeblack@chromium.org>

x86: Initial commit for running as a coreboot payload

Add a target for running u-boot as a coreboot payload in boards.cfg, a
board, CPU and a config. This is a skeleton implementation which always
reports the size of memory as 64 MB.

Signed-off-by: Gabe Black <gabeblack@chromium.org>

# 7813ca9b 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: constify serial_assign()

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# a6e6f7f4 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: cosmetic checkpatch compliance

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 49a23e4a 25-Sep-2011 Michal Simek <michal.simek@xilinx.com>

serial: uartlite: Support for SERIAL_MULTI

Add support for SERIAL MULTI for uartlite.

Signed-off-by: Michal Simek <monstr@monstr.eu>

# 1902692a 02-Aug-2011 Wolfgang Denk <wd@denx.de>

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

* 'master' of git://git.denx.de/u-boot-blackfin:
Blackfin: jtag-console: fix timer usage
Blackfin: switch to common display_options()
Blackfin: serial: move early debug strings into .rodata section
Blackfin: adi boards: also set stderr to nc with helper
Blackfin: update anomaly lists to latest public info
Blackfin: serial: convert to bfin_{read,write} helpers
Blackfin: split out async setup
Blackfin: adi boards: enable pretty flash progress output
Blackfin: drop unused dma.h header from start code
Blackfin: portmux: allow header to be included in assembly files
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: enable mmc_spi support
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings
Blackfin: sync MMR read/write helpers with Linux
Blackfin: gpio: optimize free path a little
Blackfin: post: setup default CONFIG_SYS_POST_WORD_ADDR
Blackfin: uart: fix printf warning
Blackfin: add init.elf helper code
Blackfin: dont reset SWRST on newer bf526 parts
Blackfin: adi boards: enable multi serial support by default
Blackfin: uart: add multiple serial support
Blackfin: uart: move debug buffers into local bss


# 7b826c2f 14-May-2011 Mike Frysinger <vapier@gentoo.org>

serial: implement common uart post test

The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data. If we ignore
the loop back part, the rest can be built upon the existing common serial
API. So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it. This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over. So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 1c9a5606 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

serial: drop useless ctlr field

The multi serial support has a "ctlr" field which almost no one uses,
but everyone is forced to set to useless strings. So punt it.

Funny enough, the only code that actually reads this field (the mpc8xx
driver) has a typo where it meant to look for the SCC driver. Fix it
while converting the check to use the name field.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Marek Vasut <marek.vasut@gmail.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>

# 635f330f 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

Blackfin: uart: add multiple serial support

This brings CONFIG_SERIAL_MULTI support to the Blackfin on-chip UARTs.
Ends up adding only ~512bytes per additional UART.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 2ee36781 27-Jan-2011 Tom Warren <twarren.nvidia@gmail.com>

serial: Add Tegra2 serial port support

Signed-off-by: Tom Warren <twarren@nvidia.com>

# 09b4a9cf 07-Sep-2010 Wolfgang Denk <wd@denx.de>

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


# 889a275d 23-Aug-2010 Minkyu Kang <mk7.kang@samsung.com>

ARMV7: S5P: rename from CONFIG_S5PC1XX to CONFIG_S5P

Use the same configuration around S5P SoCs.
(s5pc100, s5pc110, s5pc210 and so on)

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 6052ac83 09-Aug-2010 Matthias Weisser <weisserm@arcor.de>

ARM: Add support for MB86R0x SoCs

Signed-off-by: Matthias Weisser <weisserm@arcor.de>

# bf16500f 23-Apr-2010 Graeme Russ <graeme.russ@gmail.com>

x86: Use CONFIG_SERIAL_MULTI

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>

# 46a3b5c8 24-Mar-2010 Minkyu Kang <mk7.kang@samsung.com>

SAMSUNG: serial: modify name from s5pc1xx to s5p

Because of other s5p series SoC will use these serial functions,
modify function's name and structure's name.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 8e234e33 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc5121: add PSC serial communication routines

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# e3b28e67 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc512x: add multi serial PSC support

Extend mpc512x serial driver to support multiple PSC ports.

Subsequent patches for PDM360NG board support make use of this
functionality by defining CONFIG_SERIAL_MULTI in the board config
file. Additionally the used PSC devices are specified by defining
e.g. CONFIG_SYS_PSC1, CONFIG_SYS_PSC4 and CONFIG_SYS_PSC6.

Support for PSC devices other than 1, 3, 4 and 6 is not added
by this patch because these aren't used currently. In the future
it can be easily added using DECLARE_PSC_SERIAL_FUNCTIONS(N) and
INIT_PSC_SERIAL_STRUCTURE(N) macros in cpu/mpc512x/serial.c.
Additionally you have to add code for registering added
devices in serial_initialize() in common/serial.c.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# fbb0030e 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

serial: struct serial_device: add uninit() entry for drivers

Subsequent patch extends mpc512x serial driver to support
multiple PSC ports. The driver will provide an uninit()
function to stop the serial controller and to disable the
controller's clock. Adding uninit() entry to struct serial_device
allows disabling the serial controller after usage of
a stdio serial device.

This patch adds uninit() entry to the struct serial_device
and fixes initialization of this structure in the code
accordingly.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# 2ec1abea 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

OMAP3 zoom2 Use usbtty if the debug board is not connected.

The preferred serial output comes from the debug board.
When the debug board is disconnected, fall back on using
usbtty from the usb connector on the Zoom2 board.

This shows up as /dev/ttyACM0 in a linux host.

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6299487e 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

USBTTY make some function declarations easier to use.

Zoom2 needs to use these declarations and the include directory is a
better place from them than in the middle of the driver directory.
It did not make sense to create a new file for just a couple of
lines so they were appended to the serial.h

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# dd2c9e6a 01-Oct-2009 Minkyu Kang <mk7.kang@samsung.com>

s5pc1xx: support serial driver

This patch includes the serial driver for s5pc1xx.
s5pc1xx uart driver needs own register setting and clock configuration.
So, need to special driver.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 52cb4d4f 15-May-2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

stdio/device: rework function naming convention

So far the console API uses the following naming convention:

======Extract======
typedef struct device_t;

int device_register (device_t * dev);
int devices_init (void);
int device_deregister(char *devname);
struct list_head* device_get_list(void);
device_t* device_get_by_name(char* name);
device_t* device_clone(device_t *dev);
=======

which is too generic and confusing.

Instead of using device_XX and device_t we change this
into stdio_XX and stdio_dev

This will also allow to add later a generic device mechanism in order
to have support for multiple devices and driver instances.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Edited commit message.

Signed-off-by: Wolfgang Denk <wd@denx.de>

# 039594a4 02-Jul-2009 Poonam Aggrwal <poonam.aggrwal@freescale.com>

8xxx: Second UART port added for MPC85xx, MPC83xx, MPC86xx processors

Defining the next two configs allows to switch the serial port from the
console using the setenv stdin and stdout
1. #define CONFIG_SERIAL_MULTI 1 /* Enable both serial ports */
2. #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* determine from environment */

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

# 660888b7 30-May-2009 Tom Rix <Tom.Rix@windriver.com>

ZOOM2 Add serial support.

Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board.
The default serial is from the USB connector on left side of the debug board.
The USB connector will produce 2 of the 4 UARTS. On your host pick the first
enumeration.

The details of the setting of the serial gpmc setup are not available.
The values were provided by another party.

The serial port set up is the same with Zoom1.
Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow.

The kernel bootargs are
console=ttyS3,115200n8

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# a7c185ed 19-Dec-2007 Harald Welte <laforge@openmoko.org>

ARM: s3c24xx: Multiple serial port support

This patch adds support for CONFIG_SERIAL_MULTI on s3c24x0 CPU's

Signed-off-by: Harald Welte <laforge@openmoko.org>

# dbbd1257 05-Oct-2007 Stefan Roese <sr@denx.de>

ppc4xx: Add PPC405EX support

Signed-off-by: Stefan Roese <sr@denx.de>

# 80172c61 30-Aug-2007 Stefano Babic <sbabic@denx.de>

PXA270: Add support for multiple serial ports.

This patch adds support for multiple serial ports to the PXA target.
FFUART, BTUART and STUART are supported.

Signed-off-by: Stefano Babic <sbabic@denx.de>

# 3cb86f3e 24-Mar-2007 Stefan Roese <sr@denx.de>

[PATCH] Clean up 40EZ/Acadia support

This patch cleans up all the open issue of the preliminary
Acadia support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 0fd30252 30-Aug-2006 Wolfgang Denk <wd@denx.de>

Make the serial driver framework work with CONFIG_SERIAL_MULTI enabled

# c12cffc5 16-Jun-2006 Wolfgang Denk <wd@denx.de>

Add support for CONFIG_SERIAL_MULTI on MPC5xxx
Patch by Martin Krause, 8 Jun 2006

This patch supports two serial consoles on boards with
a MPC5xxx CPU. The console can be switched at runtime
by setting stdin, stdout and stderr to the desired serial
interface (serial0 or serial1). The PSCs to be used as
console port are definded by CONFIG_PSC_CONSOLE
and CONFIG_PSC_CONSOLE2.
See README.serial_multi for details.

# ff36fd85 09-Jan-2005 Wolfgang Denk <wd@denx.de>

* Patch by Leif Lindholm, 23 Sep 2004:
add support for the AMD db1550 board

* Patch by Travis Sawyer, 15 Sep 2004:
Add CONFIG_SERIAL_MULTI support for ppc4xx,
update README.serial_multi

# 281e00a3 01-Aug-2004 Wolfgang Denk <wd@denx.de>

* Code cleanup

* Patch by Sascha Hauer, 28 Jun:
- add generic support for Motorola i.MX architecture
- add support for mx1ads, mx1fs2 and scb9328 boards

* Patches by Marc Leeman, 23 Jul 2004:
- Add define for the PCI/Memory Buffer Configuration Register
- corrected comments in cpu/mpc824x/cpu_init.c

* Add support for multiple serial interfaces
(for example to allow modem dial-in / dial-out)

# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 39a19223 24-Jul-2020 Ovidiu Panait <ovidiu.panait@windriver.com>

drivers: serial: Make serial_initialize return int

serial_initialize is called only during the common init sequence, after
relocation (in common/board_r.c). Because it has a void return value, it
has to wrapped in initr_serial. In order to be able to get rid of this
indirection, make serial_initialize return int.

Remove extern from prototype in order to silence the following checkpatch
warning:
check: extern prototypes should be avoided in .h files

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>

# 18138ab2 06-May-2020 Trevor Woerner <twoerner@gmail.com>

rename symbol: CONFIG_TEGRA -> CONFIG_ARCH_TEGRA

Have this symbol follow the pattern of all other such symbols.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>

# bf4661bc 27-Feb-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add clock member to struct serial_device_info

Some callers of serial_getinfo() would like to know the UART base
clock speed in order to make decision what to pass to OS in some
cases. In particular, ACPI SPCR table expects only certain base
clock speed and thus we have to act accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# b03e0510 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial functions out of common.h

These functions belong in serial.h so move them over.

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

# f516fd99 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial_printf() to the serial header

Move this function header to serial.h since this function is clearly
related to serial. The function itself stays in console.c since we don't
have a single serial file. DM and non-DM each has a separate file so we
would have to either create a new common serial file, or repeat the
function in both serial.c and serial-uclass.c, neither of which seem
worthwhile.

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

# 2310c8ed 14-Nov-2019 Simon Glass <sjg@chromium.org>

serial: usb: Correct the usbtty_...() prototypes

The function declarations in serial.h are not in sync with what is
currently used in usbtty. Fix this by updating the header and including
it, to help catch future such problems.

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

# eab647d5 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Tidy up header file comments

The getconfig() comment is out of date. Fix this and add comments for
recently added functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# a61cbad7 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getinfo() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 3de04e77 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_setconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 67d1b051 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 0171f432 28-Dec-2018 Simon Glass <sjg@chromium.org>

serial: Move new functions to serial.h

We should not be adding new functions to common.h. Move these recently
added functions to serial.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# d5bb4f86 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Introduce ->getinfo() callback

New callback will give a necessary information to fill up ACPI SPCR table,
for example. Maybe used later for other purposes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change ADR_SPACE_SYSTEM_IO to SERIAL_ADDRESS_SPACE_IO to fix build error:
Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7f5db9 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add ->getconfig() callback

In some cases it would be good to know the settings, such as parity,
of current serial console. One example might be an ACPI SPCR table
to generate using these parameters.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 42b54013 21-Nov-2018 Christophe Leroy <christophe.leroy@c-s.fr>

drivers: serial: get rid of non DM mpc8xx driver

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

# 0a168687 02-Nov-2018 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

dm: serial: fix comment on dm_serial_ops setconfig

The comment on this function prototype describes nonexistent
parameters. It seems to be copied from 'setparity'.

Update it to match its the parameter list.

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

# d7c09684 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

sandbox: Add serial test

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

# ad060c05 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

dm: serial: Remove setparity ops

setparity users has been updated to use new setconfig ops,
so we can safely remove setparity ops

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

# cbf53883 03-Aug-2018 Patrice Chotard <patrice.chotard@foss.st.com>

dm: serial: Replace setparity by setconfig

Replace setparity by more generic setconfig ops
to allow uart parity, bits word length and stop bits
number change.

Adds SERIAL_GET_PARITY/BITS/STOP macros.

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>

# 481ea2e3 11-Jul-2018 Tom Rini <trini@konsulko.com>

mips: au1x00: Remove support for these SoCs

The only platform left for the AU1x00 SoCs was the pb1x00 platform, an
apparent clone of the dbau1x00 platform. As pb1x00 had no listed
maintainer I am assuming that it is also orphaned. Remove this platform
and then remove the unused SoC support.

Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

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

dm: serial: Add setparity

Implements serial setparity ops to allow uart parity change.
It allows to select ODD, EVEN or NONE parity.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

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

drivers: serial: remove nonexisting initialisation functions

This patch removes call of serial initialisation functions that
are not implemented anymore.

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

# 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>

# 98f705c9 27-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc: remove 4xx support

There was for long time no activity in the 4xx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in 4xx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# b9f7d881 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xx: remove some "5xx" remains

we removed 5xx support. So delete some forgotten remains.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 9057df88 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 82xx: remove some missed mpc82xx remains

we removed 82xx support. Missed some 82xx remains,
remove them now.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 064b55cf 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512x

There was for long time no activity in the mpx5xxx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in mpc5xxx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 3d16389c 16-May-2016 Lokesh Vutla <lokeshvutla@ti.com>

board: am335x: Allow to choose serial device dynamically

Different AM335x based platforms have different serial consoles. As serial
console is Kconfig option a separate defconfig has to be created for each
platform. So pass the serial device dynamically.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

# 2e2da4c6 08-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

serial: remove altera serial initializations

Both altera_jtag_serial_initialize() and
altera_serial_initialize() are no longer used after
they are converted to driver model.

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

# a2f39e83 23-Feb-2015 Masahiro Yamada <yamada.m@jp.panasonic.com>

ARM: remove cm4008 and cm41xx board support

These are still non-generic boards.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Greg Ungerer <greg.ungerer@opengear.com>
Acked-by: Marek Vasut <marex@denx.de>

# 41fbbbbc 23-Feb-2015 Masahiro Yamada <yamada.m@jp.panasonic.com>

ARM: remove jadecpu board support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Matthias Weisser <weisserm@arcor.de>
Acked-by: Marek Vasut <marex@denx.de>

# 94a255df 27-Oct-2014 Jeroen Hofstee <jeroen@myspectrum.nl>

serial: add prototypes for init functions

While at it, sort them.

Cc: Tom Rini <trini@ti.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

# 57d92753 04-Sep-2014 Simon Glass <sjg@chromium.org>

dm: Add a uclass for serial devices

Serial devices support simple byte input/output and a few operations to find
out whether data is available. Add a basic uclass for serial devices to be
used by drivers that are converted to driver model.

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

# 3fb85889 06-Aug-2013 Matthias Fuchs <matthias.fuchs@esd.eu>

ppc4xx: Remove support for PPC405CR CPUs

This patch removes support for the APM 405CR CPU.
This CPU is EOL and no board uses this chip.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>

# 6d6c0bae 11-Dec-2012 Tom Warren <twarren.nvidia@gmail.com>

Tegra30: Add generic Tegra30 build support

This patch adds basic Tegra30 (T30) build support - no specific
board is targeted.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>

# bfb7d7a3 06-Oct-2012 Marek Vasut <marex@denx.de>

serial: Implement default_serial_puts()

U-Boot contains a lot of duplicit implementations of serial_puts()
call which just pipes single characters into the port in loop. Implement
function that does this behavior into common code, so others can make
easy use of it.

This function is called default_serial_puts() and it's sole purpose
is to call putc() in loop on the whole string passed to it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 036036d7 14-Sep-2012 Marek Vasut <marex@denx.de>

serial: Remove CONFIG_SERIAL_MULTI from remaining sources

Remove the parts depending either on disabled CONFIG_SERIAL_MULTI
or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI
is now enabled by default.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 425101e1 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: zoom2: Remove zoom2 serial prototypes from serial.h

Remove the prototypes for zoom2_serial_deviceN from serial.h . This
can't be done right away, as they are referenced from the zoom2
config file. Therefore, adjust the code so the config file only
specifies number of the port. Then, replace the simple return in
default_serial_console() with a switch across possible values, which
returns the zoom2_serial_deviceN . With such adjustment in place,
the exported prototypes in serial.h can be safely removed.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 5ae1de0d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Adjust serial_register_bfin_uart()

Rename the serial_register_bfin_uart() to bfin_initialize_serial()
to be consistent with the rest of the naming. Next, remove it's
prototype from serial.h and properly insert it into serial.c as
the rest of the serial initialization functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# c513d7e5 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Remove the bfin_serialN_device exports from serial.h

Remove the exports from serial.h as they are only used in the blackfin
serial driver. Furthermore, they are only used for registration, which
is handled already inside that driver and default_serial_port() call,
which is also handled in that driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# abc0ed8d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: ns16550: Move serial registration from serial_initialize()

Move the registration of eserialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented ns16550_serial_initialize() function, which is
implemented inside of the ns16550 serial driver allows encapsulation
of eserialN_device within the ns16550 serial driver itself.

Also, remove the exports of eserialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the ns16550 serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Michal Simek <monstr@monstr.eu>

# 918327c8 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: mpc512x: Move serial registration from serial_initialize()

Move the registration of serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented mpc512x_serial_initialize() function, which is
implemented inside of the mpc512x serial driver allows encapsulation
of serialN_device within the mpc512x serial driver itself.

Also, remove the exports of serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the mpx512x serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 87d69229 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: microblaze: Move serial registration from serial_initialize()

Move the registration of xuartlite_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented xuartlite_serial_initialize() function, which is
implemented inside of the serial_xuartlite driver allows encapsulation
of xuartlite_serialN_device within the serial_xuartlite driver itself.

Also, remove the exports of xuartlite_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_xuartlite driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>

# 51d8102f 08-Oct-2012 Tom Rini <trini@ti.com>

serial: zynq: Move serial registration from serial_initialize()

Move the registration of zynq_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented zynq_serial_initialize() function, which is
implemented inside of the serial_zynq driver allows encapsulation
of zynq_serialN_device within the serial_zynq driver itself.

Also, remove the exports of zynq_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_zynq driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

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

# b4980515 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s5p: Move serial registration from serial_initialize()

Move the registration of s5p_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s5p_serial_initialize() function, which is
implemented inside of the serial_s5p driver allows encapsulation
of s5p_serialN_device within the serial_s5p driver itself.

Also, remove the exports of s5p_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s5p driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>

# 1fe5c110 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: pxa: Move serial registration from serial_initialize()

Move the registration of serial_XXuart ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented pxa_serial_initialize() function, which is
implemented inside of the serial_pxa driver allows encapsulation
of serial_XXuart within the serial_pxa driver itself.

Also, remove the exports of serial_XXuart from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_pxa driver and
the default console is picked by CONFIG_CONS_IDX macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 28af6385 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s3c24xx: Move serial registration from serial_initialize()

Move the registration of s3c24xx_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s3c24xx_serial_initialize() function, which is
implemented inside of the serial_s3c24xx driver allows encapsulation
of s3c24xx_serialN_device within the serial_s3c24xx driver itself.

Also, remove the exports of s3c24xx_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s3c24xx driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: C Nauman <cnauman@diagraph.com>

# 89143fb3 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Rename .init() and .uninit() in serial_device

Rename .init() to .start() and .uninit() to .stop() in struct
serial_device. This allows aligning struct serial_device with
closer to struct stdio_dev. The real goal here is to allow
these two structures to converge together and eventually make
one to be a superset of the other.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Tom Rini <trini@ti.com>

# 78322d63 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Coding style cleanup of struct serial_device

Do a simple cleanup of the struct serial_device and align it with
current coding style. Checkpatch now reports no errors.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 194846f3 13-Sep-2012 Michal Simek <monstr@monstr.eu>

serial: Add Zynq serial driver

The driver is used on Xilinx Zynq platform.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Joe Hershberger <joe.hershberger@gmail.com>
CC: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>

# 7636ebe1 01-Jul-2012 Michal Simek <monstr@monstr.eu>

serial: Support serial multi for Microblaze

enable serial multi for Microblaze.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephan Linz <linz@li-pro.net>

# 00a2749d 31-Aug-2012 Allen Martin <amartin@nvidia.com>

tegra20: rename tegra2 -> tegra20

This is make naming consistent with the kernel and devicetree and in
preparation of pulling out the common tegra20 code.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>

# f6add132 10-Nov-2011 Mike Frysinger <vapier@gentoo.org>

net/miiphy/serial: drop duplicate "NAMESIZE" define

A few subsystems are using the same define "NAMESIZE". This has been
working so far because they define it to the same number. However, I
want to change the size of eth_device's NAMESIZE, so rather than tweak
the define names, simply drop references to it. Almost no one does,
and the handful that do can easily be changed to a sizeof().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# ef5a5b00 29-Nov-2011 Gabe Black <gabeblack@chromium.org>

x86: Initial commit for running as a coreboot payload

Add a target for running u-boot as a coreboot payload in boards.cfg, a
board, CPU and a config. This is a skeleton implementation which always
reports the size of memory as 64 MB.

Signed-off-by: Gabe Black <gabeblack@chromium.org>

# 7813ca9b 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: constify serial_assign()

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# a6e6f7f4 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: cosmetic checkpatch compliance

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 49a23e4a 25-Sep-2011 Michal Simek <monstr@monstr.eu>

serial: uartlite: Support for SERIAL_MULTI

Add support for SERIAL MULTI for uartlite.

Signed-off-by: Michal Simek <monstr@monstr.eu>

# 1902692a 02-Aug-2011 Wolfgang Denk <wd@denx.de>

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

* 'master' of git://git.denx.de/u-boot-blackfin:
Blackfin: jtag-console: fix timer usage
Blackfin: switch to common display_options()
Blackfin: serial: move early debug strings into .rodata section
Blackfin: adi boards: also set stderr to nc with helper
Blackfin: update anomaly lists to latest public info
Blackfin: serial: convert to bfin_{read,write} helpers
Blackfin: split out async setup
Blackfin: adi boards: enable pretty flash progress output
Blackfin: drop unused dma.h header from start code
Blackfin: portmux: allow header to be included in assembly files
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: enable mmc_spi support
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings
Blackfin: sync MMR read/write helpers with Linux
Blackfin: gpio: optimize free path a little
Blackfin: post: setup default CONFIG_SYS_POST_WORD_ADDR
Blackfin: uart: fix printf warning
Blackfin: add init.elf helper code
Blackfin: dont reset SWRST on newer bf526 parts
Blackfin: adi boards: enable multi serial support by default
Blackfin: uart: add multiple serial support
Blackfin: uart: move debug buffers into local bss


# 7b826c2f 14-May-2011 Mike Frysinger <vapier@gentoo.org>

serial: implement common uart post test

The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data. If we ignore
the loop back part, the rest can be built upon the existing common serial
API. So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it. This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over. So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 1c9a5606 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

serial: drop useless ctlr field

The multi serial support has a "ctlr" field which almost no one uses,
but everyone is forced to set to useless strings. So punt it.

Funny enough, the only code that actually reads this field (the mpc8xx
driver) has a typo where it meant to look for the SCC driver. Fix it
while converting the check to use the name field.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Marek Vasut <marek.vasut@gmail.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>

# 635f330f 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

Blackfin: uart: add multiple serial support

This brings CONFIG_SERIAL_MULTI support to the Blackfin on-chip UARTs.
Ends up adding only ~512bytes per additional UART.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 2ee36781 27-Jan-2011 Tom Warren <twarren.nvidia@gmail.com>

serial: Add Tegra2 serial port support

Signed-off-by: Tom Warren <twarren@nvidia.com>

# 09b4a9cf 07-Sep-2010 Wolfgang Denk <wd@denx.de>

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


# 889a275d 23-Aug-2010 Minkyu Kang <mk7.kang@samsung.com>

ARMV7: S5P: rename from CONFIG_S5PC1XX to CONFIG_S5P

Use the same configuration around S5P SoCs.
(s5pc100, s5pc110, s5pc210 and so on)

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 6052ac83 09-Aug-2010 Matthias Weisser <weisserm@arcor.de>

ARM: Add support for MB86R0x SoCs

Signed-off-by: Matthias Weisser <weisserm@arcor.de>

# bf16500f 23-Apr-2010 Graeme Russ <graeme.russ@gmail.com>

x86: Use CONFIG_SERIAL_MULTI

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>

# 46a3b5c8 24-Mar-2010 Minkyu Kang <mk7.kang@samsung.com>

SAMSUNG: serial: modify name from s5pc1xx to s5p

Because of other s5p series SoC will use these serial functions,
modify function's name and structure's name.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 8e234e33 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc5121: add PSC serial communication routines

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# e3b28e67 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc512x: add multi serial PSC support

Extend mpc512x serial driver to support multiple PSC ports.

Subsequent patches for PDM360NG board support make use of this
functionality by defining CONFIG_SERIAL_MULTI in the board config
file. Additionally the used PSC devices are specified by defining
e.g. CONFIG_SYS_PSC1, CONFIG_SYS_PSC4 and CONFIG_SYS_PSC6.

Support for PSC devices other than 1, 3, 4 and 6 is not added
by this patch because these aren't used currently. In the future
it can be easily added using DECLARE_PSC_SERIAL_FUNCTIONS(N) and
INIT_PSC_SERIAL_STRUCTURE(N) macros in cpu/mpc512x/serial.c.
Additionally you have to add code for registering added
devices in serial_initialize() in common/serial.c.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# fbb0030e 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

serial: struct serial_device: add uninit() entry for drivers

Subsequent patch extends mpc512x serial driver to support
multiple PSC ports. The driver will provide an uninit()
function to stop the serial controller and to disable the
controller's clock. Adding uninit() entry to struct serial_device
allows disabling the serial controller after usage of
a stdio serial device.

This patch adds uninit() entry to the struct serial_device
and fixes initialization of this structure in the code
accordingly.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# 2ec1abea 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

OMAP3 zoom2 Use usbtty if the debug board is not connected.

The preferred serial output comes from the debug board.
When the debug board is disconnected, fall back on using
usbtty from the usb connector on the Zoom2 board.

This shows up as /dev/ttyACM0 in a linux host.

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6299487e 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

USBTTY make some function declarations easier to use.

Zoom2 needs to use these declarations and the include directory is a
better place from them than in the middle of the driver directory.
It did not make sense to create a new file for just a couple of
lines so they were appended to the serial.h

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# dd2c9e6a 01-Oct-2009 Minkyu Kang <mk7.kang@samsung.com>

s5pc1xx: support serial driver

This patch includes the serial driver for s5pc1xx.
s5pc1xx uart driver needs own register setting and clock configuration.
So, need to special driver.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 52cb4d4f 15-May-2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

stdio/device: rework function naming convention

So far the console API uses the following naming convention:

======Extract======
typedef struct device_t;

int device_register (device_t * dev);
int devices_init (void);
int device_deregister(char *devname);
struct list_head* device_get_list(void);
device_t* device_get_by_name(char* name);
device_t* device_clone(device_t *dev);
=======

which is too generic and confusing.

Instead of using device_XX and device_t we change this
into stdio_XX and stdio_dev

This will also allow to add later a generic device mechanism in order
to have support for multiple devices and driver instances.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Edited commit message.

Signed-off-by: Wolfgang Denk <wd@denx.de>

# 039594a4 02-Jul-2009 Poonam Aggrwal <poonam.aggrwal@freescale.com>

8xxx: Second UART port added for MPC85xx, MPC83xx, MPC86xx processors

Defining the next two configs allows to switch the serial port from the
console using the setenv stdin and stdout
1. #define CONFIG_SERIAL_MULTI 1 /* Enable both serial ports */
2. #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* determine from environment */

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

# 660888b7 30-May-2009 Tom Rix <Tom.Rix@windriver.com>

ZOOM2 Add serial support.

Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board.
The default serial is from the USB connector on left side of the debug board.
The USB connector will produce 2 of the 4 UARTS. On your host pick the first
enumeration.

The details of the setting of the serial gpmc setup are not available.
The values were provided by another party.

The serial port set up is the same with Zoom1.
Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow.

The kernel bootargs are
console=ttyS3,115200n8

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# a7c185ed 19-Dec-2007 Harald Welte <laforge@openmoko.org>

ARM: s3c24xx: Multiple serial port support

This patch adds support for CONFIG_SERIAL_MULTI on s3c24x0 CPU's

Signed-off-by: Harald Welte <laforge@openmoko.org>

# dbbd1257 05-Oct-2007 Stefan Roese <sr@denx.de>

ppc4xx: Add PPC405EX support

Signed-off-by: Stefan Roese <sr@denx.de>

# 80172c61 30-Aug-2007 Stefano Babic <sbabic@denx.de>

PXA270: Add support for multiple serial ports.

This patch adds support for multiple serial ports to the PXA target.
FFUART, BTUART and STUART are supported.

Signed-off-by: Stefano Babic <sbabic@denx.de>

# 3cb86f3e 24-Mar-2007 Stefan Roese <sr@denx.de>

[PATCH] Clean up 40EZ/Acadia support

This patch cleans up all the open issue of the preliminary
Acadia support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 0fd30252 30-Aug-2006 Wolfgang Denk <wd@pollux.denx.de>

Make the serial driver framework work with CONFIG_SERIAL_MULTI enabled

# c12cffc5 16-Jun-2006 Wolfgang Denk <wd@fifi.denx.de>

Add support for CONFIG_SERIAL_MULTI on MPC5xxx
Patch by Martin Krause, 8 Jun 2006

This patch supports two serial consoles on boards with
a MPC5xxx CPU. The console can be switched at runtime
by setting stdin, stdout and stderr to the desired serial
interface (serial0 or serial1). The PSCs to be used as
console port are definded by CONFIG_PSC_CONSOLE
and CONFIG_PSC_CONSOLE2.
See README.serial_multi for details.

# ff36fd85 09-Jan-2005 Wolfgang Denk <wdenk>

* Patch by Leif Lindholm, 23 Sep 2004:
add support for the AMD db1550 board

* Patch by Travis Sawyer, 15 Sep 2004:
Add CONFIG_SERIAL_MULTI support for ppc4xx,
update README.serial_multi

# 281e00a3 01-Aug-2004 Wolfgang Denk <wdenk>

* Code cleanup

* Patch by Sascha Hauer, 28 Jun:
- add generic support for Motorola i.MX architecture
- add support for mx1ads, mx1fs2 and scb9328 boards

* Patches by Marc Leeman, 23 Jul 2004:
- Add define for the PCI/Memory Buffer Configuration Register
- corrected comments in cpu/mpc824x/cpu_init.c

* Add support for multiple serial interfaces
(for example to allow modem dial-in / dial-out)

# 39a19223 24-Jul-2020 Ovidiu Panait <ovidiu.panait@windriver.com>

drivers: serial: Make serial_initialize return int

serial_initialize is called only during the common init sequence, after
relocation (in common/board_r.c). Because it has a void return value, it
has to wrapped in initr_serial. In order to be able to get rid of this
indirection, make serial_initialize return int.

Remove extern from prototype in order to silence the following checkpatch
warning:
check: extern prototypes should be avoided in .h files

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>

# 18138ab2 06-May-2020 Trevor Woerner <twoerner@gmail.com>

rename symbol: CONFIG_TEGRA -> CONFIG_ARCH_TEGRA

Have this symbol follow the pattern of all other such symbols.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>

# bf4661bc 27-Feb-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add clock member to struct serial_device_info

Some callers of serial_getinfo() would like to know the UART base
clock speed in order to make decision what to pass to OS in some
cases. In particular, ACPI SPCR table expects only certain base
clock speed and thus we have to act accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# b03e0510 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial functions out of common.h

These functions belong in serial.h so move them over.

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

# f516fd99 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial_printf() to the serial header

Move this function header to serial.h since this function is clearly
related to serial. The function itself stays in console.c since we don't
have a single serial file. DM and non-DM each has a separate file so we
would have to either create a new common serial file, or repeat the
function in both serial.c and serial-uclass.c, neither of which seem
worthwhile.

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

# 2310c8ed 14-Nov-2019 Simon Glass <sjg@chromium.org>

serial: usb: Correct the usbtty_...() prototypes

The function declarations in serial.h are not in sync with what is
currently used in usbtty. Fix this by updating the header and including
it, to help catch future such problems.

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

# eab647d5 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Tidy up header file comments

The getconfig() comment is out of date. Fix this and add comments for
recently added functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# a61cbad7 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getinfo() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 3de04e77 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_setconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 67d1b051 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 0171f432 28-Dec-2018 Simon Glass <sjg@chromium.org>

serial: Move new functions to serial.h

We should not be adding new functions to common.h. Move these recently
added functions to serial.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# d5bb4f86 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Introduce ->getinfo() callback

New callback will give a necessary information to fill up ACPI SPCR table,
for example. Maybe used later for other purposes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change ADR_SPACE_SYSTEM_IO to SERIAL_ADDRESS_SPACE_IO to fix build error:
Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7f5db9 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add ->getconfig() callback

In some cases it would be good to know the settings, such as parity,
of current serial console. One example might be an ACPI SPCR table
to generate using these parameters.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 42b54013 21-Nov-2018 Christophe Leroy <christophe.leroy@c-s.fr>

drivers: serial: get rid of non DM mpc8xx driver

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

# 0a168687 02-Nov-2018 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

dm: serial: fix comment on dm_serial_ops setconfig

The comment on this function prototype describes nonexistent
parameters. It seems to be copied from 'setparity'.

Update it to match its the parameter list.

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

# d7c09684 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

sandbox: Add serial test

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

# ad060c05 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

dm: serial: Remove setparity ops

setparity users has been updated to use new setconfig ops,
so we can safely remove setparity ops

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

# cbf53883 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

dm: serial: Replace setparity by setconfig

Replace setparity by more generic setconfig ops
to allow uart parity, bits word length and stop bits
number change.

Adds SERIAL_GET_PARITY/BITS/STOP macros.

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>

# 481ea2e3 11-Jul-2018 Tom Rini <trini@konsulko.com>

mips: au1x00: Remove support for these SoCs

The only platform left for the AU1x00 SoCs was the pb1x00 platform, an
apparent clone of the dbau1x00 platform. As pb1x00 had no listed
maintainer I am assuming that it is also orphaned. Remove this platform
and then remove the unused SoC support.

Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# eae4764f 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

dm: serial: Add setparity

Implements serial setparity ops to allow uart parity change.
It allows to select ODD, EVEN or NONE parity.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

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

drivers: serial: remove nonexisting initialisation functions

This patch removes call of serial initialisation functions that
are not implemented anymore.

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

# 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>

# 98f705c9 27-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc: remove 4xx support

There was for long time no activity in the 4xx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in 4xx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# b9f7d881 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xx: remove some "5xx" remains

we removed 5xx support. So delete some forgotten remains.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 9057df88 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 82xx: remove some missed mpc82xx remains

we removed 82xx support. Missed some 82xx remains,
remove them now.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 064b55cf 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512x

There was for long time no activity in the mpx5xxx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in mpc5xxx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 3d16389c 16-May-2016 Lokesh Vutla <lokeshvutla@ti.com>

board: am335x: Allow to choose serial device dynamically

Different AM335x based platforms have different serial consoles. As serial
console is Kconfig option a separate defconfig has to be created for each
platform. So pass the serial device dynamically.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

# 2e2da4c6 08-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

serial: remove altera serial initializations

Both altera_jtag_serial_initialize() and
altera_serial_initialize() are no longer used after
they are converted to driver model.

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

# a2f39e83 23-Feb-2015 Masahiro Yamada <yamada.m@jp.panasonic.com>

ARM: remove cm4008 and cm41xx board support

These are still non-generic boards.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Greg Ungerer <greg.ungerer@opengear.com>
Acked-by: Marek Vasut <marex@denx.de>

# 41fbbbbc 23-Feb-2015 Masahiro Yamada <yamada.m@jp.panasonic.com>

ARM: remove jadecpu board support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Matthias Weisser <weisserm@arcor.de>
Acked-by: Marek Vasut <marex@denx.de>

# 94a255df 27-Oct-2014 Jeroen Hofstee <jeroen@myspectrum.nl>

serial: add prototypes for init functions

While at it, sort them.

Cc: Tom Rini <trini@ti.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

# 57d92753 04-Sep-2014 Simon Glass <sjg@chromium.org>

dm: Add a uclass for serial devices

Serial devices support simple byte input/output and a few operations to find
out whether data is available. Add a basic uclass for serial devices to be
used by drivers that are converted to driver model.

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

# 3fb85889 06-Aug-2013 Matthias Fuchs <matthias.fuchs@esd.eu>

ppc4xx: Remove support for PPC405CR CPUs

This patch removes support for the APM 405CR CPU.
This CPU is EOL and no board uses this chip.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>

# 6d6c0bae 11-Dec-2012 Tom Warren <twarren.nvidia@gmail.com>

Tegra30: Add generic Tegra30 build support

This patch adds basic Tegra30 (T30) build support - no specific
board is targeted.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>

# bfb7d7a3 06-Oct-2012 Marek Vasut <marex@denx.de>

serial: Implement default_serial_puts()

U-Boot contains a lot of duplicit implementations of serial_puts()
call which just pipes single characters into the port in loop. Implement
function that does this behavior into common code, so others can make
easy use of it.

This function is called default_serial_puts() and it's sole purpose
is to call putc() in loop on the whole string passed to it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 036036d7 14-Sep-2012 Marek Vasut <marex@denx.de>

serial: Remove CONFIG_SERIAL_MULTI from remaining sources

Remove the parts depending either on disabled CONFIG_SERIAL_MULTI
or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI
is now enabled by default.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 425101e1 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: zoom2: Remove zoom2 serial prototypes from serial.h

Remove the prototypes for zoom2_serial_deviceN from serial.h . This
can't be done right away, as they are referenced from the zoom2
config file. Therefore, adjust the code so the config file only
specifies number of the port. Then, replace the simple return in
default_serial_console() with a switch across possible values, which
returns the zoom2_serial_deviceN . With such adjustment in place,
the exported prototypes in serial.h can be safely removed.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 5ae1de0d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Adjust serial_register_bfin_uart()

Rename the serial_register_bfin_uart() to bfin_initialize_serial()
to be consistent with the rest of the naming. Next, remove it's
prototype from serial.h and properly insert it into serial.c as
the rest of the serial initialization functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# c513d7e5 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Remove the bfin_serialN_device exports from serial.h

Remove the exports from serial.h as they are only used in the blackfin
serial driver. Furthermore, they are only used for registration, which
is handled already inside that driver and default_serial_port() call,
which is also handled in that driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# abc0ed8d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: ns16550: Move serial registration from serial_initialize()

Move the registration of eserialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented ns16550_serial_initialize() function, which is
implemented inside of the ns16550 serial driver allows encapsulation
of eserialN_device within the ns16550 serial driver itself.

Also, remove the exports of eserialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the ns16550 serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Michal Simek <monstr@monstr.eu>

# 918327c8 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: mpc512x: Move serial registration from serial_initialize()

Move the registration of serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented mpc512x_serial_initialize() function, which is
implemented inside of the mpc512x serial driver allows encapsulation
of serialN_device within the mpc512x serial driver itself.

Also, remove the exports of serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the mpx512x serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 87d69229 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: microblaze: Move serial registration from serial_initialize()

Move the registration of xuartlite_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented xuartlite_serial_initialize() function, which is
implemented inside of the serial_xuartlite driver allows encapsulation
of xuartlite_serialN_device within the serial_xuartlite driver itself.

Also, remove the exports of xuartlite_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_xuartlite driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>

# 51d8102f 08-Oct-2012 Tom Rini <trini@ti.com>

serial: zynq: Move serial registration from serial_initialize()

Move the registration of zynq_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented zynq_serial_initialize() function, which is
implemented inside of the serial_zynq driver allows encapsulation
of zynq_serialN_device within the serial_zynq driver itself.

Also, remove the exports of zynq_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_zynq driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

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

# b4980515 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s5p: Move serial registration from serial_initialize()

Move the registration of s5p_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s5p_serial_initialize() function, which is
implemented inside of the serial_s5p driver allows encapsulation
of s5p_serialN_device within the serial_s5p driver itself.

Also, remove the exports of s5p_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s5p driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>

# 1fe5c110 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: pxa: Move serial registration from serial_initialize()

Move the registration of serial_XXuart ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented pxa_serial_initialize() function, which is
implemented inside of the serial_pxa driver allows encapsulation
of serial_XXuart within the serial_pxa driver itself.

Also, remove the exports of serial_XXuart from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_pxa driver and
the default console is picked by CONFIG_CONS_IDX macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 28af6385 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s3c24xx: Move serial registration from serial_initialize()

Move the registration of s3c24xx_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s3c24xx_serial_initialize() function, which is
implemented inside of the serial_s3c24xx driver allows encapsulation
of s3c24xx_serialN_device within the serial_s3c24xx driver itself.

Also, remove the exports of s3c24xx_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s3c24xx driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: C Nauman <cnauman@diagraph.com>

# 89143fb3 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Rename .init() and .uninit() in serial_device

Rename .init() to .start() and .uninit() to .stop() in struct
serial_device. This allows aligning struct serial_device with
closer to struct stdio_dev. The real goal here is to allow
these two structures to converge together and eventually make
one to be a superset of the other.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Tom Rini <trini@ti.com>

# 78322d63 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Coding style cleanup of struct serial_device

Do a simple cleanup of the struct serial_device and align it with
current coding style. Checkpatch now reports no errors.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 194846f3 13-Sep-2012 Michal Simek <monstr@monstr.eu>

serial: Add Zynq serial driver

The driver is used on Xilinx Zynq platform.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Joe Hershberger <joe.hershberger@gmail.com>
CC: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>

# 7636ebe1 01-Jul-2012 Michal Simek <monstr@monstr.eu>

serial: Support serial multi for Microblaze

enable serial multi for Microblaze.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephan Linz <linz@li-pro.net>

# 00a2749d 31-Aug-2012 Allen Martin <amartin@nvidia.com>

tegra20: rename tegra2 -> tegra20

This is make naming consistent with the kernel and devicetree and in
preparation of pulling out the common tegra20 code.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>

# f6add132 10-Nov-2011 Mike Frysinger <vapier@gentoo.org>

net/miiphy/serial: drop duplicate "NAMESIZE" define

A few subsystems are using the same define "NAMESIZE". This has been
working so far because they define it to the same number. However, I
want to change the size of eth_device's NAMESIZE, so rather than tweak
the define names, simply drop references to it. Almost no one does,
and the handful that do can easily be changed to a sizeof().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# ef5a5b00 29-Nov-2011 Gabe Black <gabeblack@chromium.org>

x86: Initial commit for running as a coreboot payload

Add a target for running u-boot as a coreboot payload in boards.cfg, a
board, CPU and a config. This is a skeleton implementation which always
reports the size of memory as 64 MB.

Signed-off-by: Gabe Black <gabeblack@chromium.org>

# 7813ca9b 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: constify serial_assign()

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# a6e6f7f4 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: cosmetic checkpatch compliance

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 49a23e4a 25-Sep-2011 Michal Simek <monstr@monstr.eu>

serial: uartlite: Support for SERIAL_MULTI

Add support for SERIAL MULTI for uartlite.

Signed-off-by: Michal Simek <monstr@monstr.eu>

# 1902692a 02-Aug-2011 Wolfgang Denk <wd@denx.de>

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

* 'master' of git://git.denx.de/u-boot-blackfin:
Blackfin: jtag-console: fix timer usage
Blackfin: switch to common display_options()
Blackfin: serial: move early debug strings into .rodata section
Blackfin: adi boards: also set stderr to nc with helper
Blackfin: update anomaly lists to latest public info
Blackfin: serial: convert to bfin_{read,write} helpers
Blackfin: split out async setup
Blackfin: adi boards: enable pretty flash progress output
Blackfin: drop unused dma.h header from start code
Blackfin: portmux: allow header to be included in assembly files
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: enable mmc_spi support
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings
Blackfin: sync MMR read/write helpers with Linux
Blackfin: gpio: optimize free path a little
Blackfin: post: setup default CONFIG_SYS_POST_WORD_ADDR
Blackfin: uart: fix printf warning
Blackfin: add init.elf helper code
Blackfin: dont reset SWRST on newer bf526 parts
Blackfin: adi boards: enable multi serial support by default
Blackfin: uart: add multiple serial support
Blackfin: uart: move debug buffers into local bss


# 7b826c2f 14-May-2011 Mike Frysinger <vapier@gentoo.org>

serial: implement common uart post test

The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data. If we ignore
the loop back part, the rest can be built upon the existing common serial
API. So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it. This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over. So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 1c9a5606 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

serial: drop useless ctlr field

The multi serial support has a "ctlr" field which almost no one uses,
but everyone is forced to set to useless strings. So punt it.

Funny enough, the only code that actually reads this field (the mpc8xx
driver) has a typo where it meant to look for the SCC driver. Fix it
while converting the check to use the name field.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Marek Vasut <marek.vasut@gmail.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>

# 635f330f 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

Blackfin: uart: add multiple serial support

This brings CONFIG_SERIAL_MULTI support to the Blackfin on-chip UARTs.
Ends up adding only ~512bytes per additional UART.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 2ee36781 27-Jan-2011 Tom Warren <twarren.nvidia@gmail.com>

serial: Add Tegra2 serial port support

Signed-off-by: Tom Warren <twarren@nvidia.com>

# 09b4a9cf 07-Sep-2010 Wolfgang Denk <wd@denx.de>

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


# 889a275d 23-Aug-2010 Minkyu Kang <mk7.kang@samsung.com>

ARMV7: S5P: rename from CONFIG_S5PC1XX to CONFIG_S5P

Use the same configuration around S5P SoCs.
(s5pc100, s5pc110, s5pc210 and so on)

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 6052ac83 09-Aug-2010 Matthias Weisser <weisserm@arcor.de>

ARM: Add support for MB86R0x SoCs

Signed-off-by: Matthias Weisser <weisserm@arcor.de>

# bf16500f 23-Apr-2010 Graeme Russ <graeme.russ@gmail.com>

x86: Use CONFIG_SERIAL_MULTI

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>

# 46a3b5c8 24-Mar-2010 Minkyu Kang <mk7.kang@samsung.com>

SAMSUNG: serial: modify name from s5pc1xx to s5p

Because of other s5p series SoC will use these serial functions,
modify function's name and structure's name.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 8e234e33 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc5121: add PSC serial communication routines

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# e3b28e67 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc512x: add multi serial PSC support

Extend mpc512x serial driver to support multiple PSC ports.

Subsequent patches for PDM360NG board support make use of this
functionality by defining CONFIG_SERIAL_MULTI in the board config
file. Additionally the used PSC devices are specified by defining
e.g. CONFIG_SYS_PSC1, CONFIG_SYS_PSC4 and CONFIG_SYS_PSC6.

Support for PSC devices other than 1, 3, 4 and 6 is not added
by this patch because these aren't used currently. In the future
it can be easily added using DECLARE_PSC_SERIAL_FUNCTIONS(N) and
INIT_PSC_SERIAL_STRUCTURE(N) macros in cpu/mpc512x/serial.c.
Additionally you have to add code for registering added
devices in serial_initialize() in common/serial.c.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# fbb0030e 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

serial: struct serial_device: add uninit() entry for drivers

Subsequent patch extends mpc512x serial driver to support
multiple PSC ports. The driver will provide an uninit()
function to stop the serial controller and to disable the
controller's clock. Adding uninit() entry to struct serial_device
allows disabling the serial controller after usage of
a stdio serial device.

This patch adds uninit() entry to the struct serial_device
and fixes initialization of this structure in the code
accordingly.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# 2ec1abea 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

OMAP3 zoom2 Use usbtty if the debug board is not connected.

The preferred serial output comes from the debug board.
When the debug board is disconnected, fall back on using
usbtty from the usb connector on the Zoom2 board.

This shows up as /dev/ttyACM0 in a linux host.

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6299487e 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

USBTTY make some function declarations easier to use.

Zoom2 needs to use these declarations and the include directory is a
better place from them than in the middle of the driver directory.
It did not make sense to create a new file for just a couple of
lines so they were appended to the serial.h

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# dd2c9e6a 01-Oct-2009 Minkyu Kang <mk7.kang@samsung.com>

s5pc1xx: support serial driver

This patch includes the serial driver for s5pc1xx.
s5pc1xx uart driver needs own register setting and clock configuration.
So, need to special driver.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 52cb4d4f 15-May-2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

stdio/device: rework function naming convention

So far the console API uses the following naming convention:

======Extract======
typedef struct device_t;

int device_register (device_t * dev);
int devices_init (void);
int device_deregister(char *devname);
struct list_head* device_get_list(void);
device_t* device_get_by_name(char* name);
device_t* device_clone(device_t *dev);
=======

which is too generic and confusing.

Instead of using device_XX and device_t we change this
into stdio_XX and stdio_dev

This will also allow to add later a generic device mechanism in order
to have support for multiple devices and driver instances.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Edited commit message.

Signed-off-by: Wolfgang Denk <wd@denx.de>

# 039594a4 02-Jul-2009 Poonam Aggrwal <poonam.aggrwal@freescale.com>

8xxx: Second UART port added for MPC85xx, MPC83xx, MPC86xx processors

Defining the next two configs allows to switch the serial port from the
console using the setenv stdin and stdout
1. #define CONFIG_SERIAL_MULTI 1 /* Enable both serial ports */
2. #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* determine from environment */

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

# 660888b7 30-May-2009 Tom Rix <Tom.Rix@windriver.com>

ZOOM2 Add serial support.

Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board.
The default serial is from the USB connector on left side of the debug board.
The USB connector will produce 2 of the 4 UARTS. On your host pick the first
enumeration.

The details of the setting of the serial gpmc setup are not available.
The values were provided by another party.

The serial port set up is the same with Zoom1.
Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow.

The kernel bootargs are
console=ttyS3,115200n8

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# a7c185ed 19-Dec-2007 Harald Welte <laforge@openmoko.org>

ARM: s3c24xx: Multiple serial port support

This patch adds support for CONFIG_SERIAL_MULTI on s3c24x0 CPU's

Signed-off-by: Harald Welte <laforge@openmoko.org>

# dbbd1257 05-Oct-2007 Stefan Roese <sr@denx.de>

ppc4xx: Add PPC405EX support

Signed-off-by: Stefan Roese <sr@denx.de>

# 80172c61 30-Aug-2007 Stefano Babic <sbabic@denx.de>

PXA270: Add support for multiple serial ports.

This patch adds support for multiple serial ports to the PXA target.
FFUART, BTUART and STUART are supported.

Signed-off-by: Stefano Babic <sbabic@denx.de>

# 3cb86f3e 24-Mar-2007 Stefan Roese <sr@denx.de>

[PATCH] Clean up 40EZ/Acadia support

This patch cleans up all the open issue of the preliminary
Acadia support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 0fd30252 30-Aug-2006 Wolfgang Denk <wd@pollux.denx.de>

Make the serial driver framework work with CONFIG_SERIAL_MULTI enabled

# c12cffc5 16-Jun-2006 Wolfgang Denk <wd@fifi.denx.de>

Add support for CONFIG_SERIAL_MULTI on MPC5xxx
Patch by Martin Krause, 8 Jun 2006

This patch supports two serial consoles on boards with
a MPC5xxx CPU. The console can be switched at runtime
by setting stdin, stdout and stderr to the desired serial
interface (serial0 or serial1). The PSCs to be used as
console port are definded by CONFIG_PSC_CONSOLE
and CONFIG_PSC_CONSOLE2.
See README.serial_multi for details.

# ff36fd85 09-Jan-2005 Wolfgang Denk <wdenk>

* Patch by Leif Lindholm, 23 Sep 2004:
add support for the AMD db1550 board

* Patch by Travis Sawyer, 15 Sep 2004:
Add CONFIG_SERIAL_MULTI support for ppc4xx,
update README.serial_multi

# 281e00a3 01-Aug-2004 Wolfgang Denk <wdenk>

* Code cleanup

* Patch by Sascha Hauer, 28 Jun:
- add generic support for Motorola i.MX architecture
- add support for mx1ads, mx1fs2 and scb9328 boards

* Patches by Marc Leeman, 23 Jul 2004:
- Add define for the PCI/Memory Buffer Configuration Register
- corrected comments in cpu/mpc824x/cpu_init.c

* Add support for multiple serial interfaces
(for example to allow modem dial-in / dial-out)

# 18138ab2 06-May-2020 Trevor Woerner <twoerner@gmail.com>

rename symbol: CONFIG_TEGRA -> CONFIG_ARCH_TEGRA

Have this symbol follow the pattern of all other such symbols.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>

# bf4661bc 27-Feb-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add clock member to struct serial_device_info

Some callers of serial_getinfo() would like to know the UART base
clock speed in order to make decision what to pass to OS in some
cases. In particular, ACPI SPCR table expects only certain base
clock speed and thus we have to act accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# b03e0510 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial functions out of common.h

These functions belong in serial.h so move them over.

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

# f516fd99 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial_printf() to the serial header

Move this function header to serial.h since this function is clearly
related to serial. The function itself stays in console.c since we don't
have a single serial file. DM and non-DM each has a separate file so we
would have to either create a new common serial file, or repeat the
function in both serial.c and serial-uclass.c, neither of which seem
worthwhile.

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

# 2310c8ed 14-Nov-2019 Simon Glass <sjg@chromium.org>

serial: usb: Correct the usbtty_...() prototypes

The function declarations in serial.h are not in sync with what is
currently used in usbtty. Fix this by updating the header and including
it, to help catch future such problems.

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

# eab647d5 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Tidy up header file comments

The getconfig() comment is out of date. Fix this and add comments for
recently added functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# a61cbad7 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getinfo() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 3de04e77 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_setconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 67d1b051 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 0171f432 28-Dec-2018 Simon Glass <sjg@chromium.org>

serial: Move new functions to serial.h

We should not be adding new functions to common.h. Move these recently
added functions to serial.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# d5bb4f86 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Introduce ->getinfo() callback

New callback will give a necessary information to fill up ACPI SPCR table,
for example. Maybe used later for other purposes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change ADR_SPACE_SYSTEM_IO to SERIAL_ADDRESS_SPACE_IO to fix build error:
Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7f5db9 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add ->getconfig() callback

In some cases it would be good to know the settings, such as parity,
of current serial console. One example might be an ACPI SPCR table
to generate using these parameters.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 42b54013 21-Nov-2018 Christophe Leroy <christophe.leroy@c-s.fr>

drivers: serial: get rid of non DM mpc8xx driver

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

# 0a168687 02-Nov-2018 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

dm: serial: fix comment on dm_serial_ops setconfig

The comment on this function prototype describes nonexistent
parameters. It seems to be copied from 'setparity'.

Update it to match its the parameter list.

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

# d7c09684 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

sandbox: Add serial test

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

# ad060c05 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

dm: serial: Remove setparity ops

setparity users has been updated to use new setconfig ops,
so we can safely remove setparity ops

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

# cbf53883 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

dm: serial: Replace setparity by setconfig

Replace setparity by more generic setconfig ops
to allow uart parity, bits word length and stop bits
number change.

Adds SERIAL_GET_PARITY/BITS/STOP macros.

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>

# 481ea2e3 11-Jul-2018 Tom Rini <trini@konsulko.com>

mips: au1x00: Remove support for these SoCs

The only platform left for the AU1x00 SoCs was the pb1x00 platform, an
apparent clone of the dbau1x00 platform. As pb1x00 had no listed
maintainer I am assuming that it is also orphaned. Remove this platform
and then remove the unused SoC support.

Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# eae4764f 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

dm: serial: Add setparity

Implements serial setparity ops to allow uart parity change.
It allows to select ODD, EVEN or NONE parity.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

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

drivers: serial: remove nonexisting initialisation functions

This patch removes call of serial initialisation functions that
are not implemented anymore.

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

# 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>

# 98f705c9 27-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc: remove 4xx support

There was for long time no activity in the 4xx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in 4xx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# b9f7d881 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xx: remove some "5xx" remains

we removed 5xx support. So delete some forgotten remains.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 9057df88 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 82xx: remove some missed mpc82xx remains

we removed 82xx support. Missed some 82xx remains,
remove them now.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 064b55cf 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512x

There was for long time no activity in the mpx5xxx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in mpc5xxx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 3d16389c 16-May-2016 Lokesh Vutla <lokeshvutla@ti.com>

board: am335x: Allow to choose serial device dynamically

Different AM335x based platforms have different serial consoles. As serial
console is Kconfig option a separate defconfig has to be created for each
platform. So pass the serial device dynamically.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

# 2e2da4c6 08-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

serial: remove altera serial initializations

Both altera_jtag_serial_initialize() and
altera_serial_initialize() are no longer used after
they are converted to driver model.

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

# a2f39e83 23-Feb-2015 Masahiro Yamada <yamada.m@jp.panasonic.com>

ARM: remove cm4008 and cm41xx board support

These are still non-generic boards.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Greg Ungerer <greg.ungerer@opengear.com>
Acked-by: Marek Vasut <marex@denx.de>

# 41fbbbbc 23-Feb-2015 Masahiro Yamada <yamada.m@jp.panasonic.com>

ARM: remove jadecpu board support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Matthias Weisser <weisserm@arcor.de>
Acked-by: Marek Vasut <marex@denx.de>

# 94a255df 27-Oct-2014 Jeroen Hofstee <jeroen@myspectrum.nl>

serial: add prototypes for init functions

While at it, sort them.

Cc: Tom Rini <trini@ti.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

# 57d92753 04-Sep-2014 Simon Glass <sjg@chromium.org>

dm: Add a uclass for serial devices

Serial devices support simple byte input/output and a few operations to find
out whether data is available. Add a basic uclass for serial devices to be
used by drivers that are converted to driver model.

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

# 3fb85889 06-Aug-2013 Matthias Fuchs <matthias.fuchs@esd.eu>

ppc4xx: Remove support for PPC405CR CPUs

This patch removes support for the APM 405CR CPU.
This CPU is EOL and no board uses this chip.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>

# 6d6c0bae 11-Dec-2012 Tom Warren <twarren.nvidia@gmail.com>

Tegra30: Add generic Tegra30 build support

This patch adds basic Tegra30 (T30) build support - no specific
board is targeted.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>

# bfb7d7a3 06-Oct-2012 Marek Vasut <marex@denx.de>

serial: Implement default_serial_puts()

U-Boot contains a lot of duplicit implementations of serial_puts()
call which just pipes single characters into the port in loop. Implement
function that does this behavior into common code, so others can make
easy use of it.

This function is called default_serial_puts() and it's sole purpose
is to call putc() in loop on the whole string passed to it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 036036d7 14-Sep-2012 Marek Vasut <marex@denx.de>

serial: Remove CONFIG_SERIAL_MULTI from remaining sources

Remove the parts depending either on disabled CONFIG_SERIAL_MULTI
or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI
is now enabled by default.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 425101e1 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: zoom2: Remove zoom2 serial prototypes from serial.h

Remove the prototypes for zoom2_serial_deviceN from serial.h . This
can't be done right away, as they are referenced from the zoom2
config file. Therefore, adjust the code so the config file only
specifies number of the port. Then, replace the simple return in
default_serial_console() with a switch across possible values, which
returns the zoom2_serial_deviceN . With such adjustment in place,
the exported prototypes in serial.h can be safely removed.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 5ae1de0d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Adjust serial_register_bfin_uart()

Rename the serial_register_bfin_uart() to bfin_initialize_serial()
to be consistent with the rest of the naming. Next, remove it's
prototype from serial.h and properly insert it into serial.c as
the rest of the serial initialization functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# c513d7e5 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Remove the bfin_serialN_device exports from serial.h

Remove the exports from serial.h as they are only used in the blackfin
serial driver. Furthermore, they are only used for registration, which
is handled already inside that driver and default_serial_port() call,
which is also handled in that driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# abc0ed8d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: ns16550: Move serial registration from serial_initialize()

Move the registration of eserialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented ns16550_serial_initialize() function, which is
implemented inside of the ns16550 serial driver allows encapsulation
of eserialN_device within the ns16550 serial driver itself.

Also, remove the exports of eserialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the ns16550 serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Michal Simek <monstr@monstr.eu>

# 918327c8 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: mpc512x: Move serial registration from serial_initialize()

Move the registration of serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented mpc512x_serial_initialize() function, which is
implemented inside of the mpc512x serial driver allows encapsulation
of serialN_device within the mpc512x serial driver itself.

Also, remove the exports of serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the mpx512x serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 87d69229 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: microblaze: Move serial registration from serial_initialize()

Move the registration of xuartlite_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented xuartlite_serial_initialize() function, which is
implemented inside of the serial_xuartlite driver allows encapsulation
of xuartlite_serialN_device within the serial_xuartlite driver itself.

Also, remove the exports of xuartlite_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_xuartlite driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>

# 51d8102f 08-Oct-2012 Tom Rini <trini@ti.com>

serial: zynq: Move serial registration from serial_initialize()

Move the registration of zynq_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented zynq_serial_initialize() function, which is
implemented inside of the serial_zynq driver allows encapsulation
of zynq_serialN_device within the serial_zynq driver itself.

Also, remove the exports of zynq_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_zynq driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

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

# b4980515 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s5p: Move serial registration from serial_initialize()

Move the registration of s5p_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s5p_serial_initialize() function, which is
implemented inside of the serial_s5p driver allows encapsulation
of s5p_serialN_device within the serial_s5p driver itself.

Also, remove the exports of s5p_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s5p driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>

# 1fe5c110 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: pxa: Move serial registration from serial_initialize()

Move the registration of serial_XXuart ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented pxa_serial_initialize() function, which is
implemented inside of the serial_pxa driver allows encapsulation
of serial_XXuart within the serial_pxa driver itself.

Also, remove the exports of serial_XXuart from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_pxa driver and
the default console is picked by CONFIG_CONS_IDX macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 28af6385 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s3c24xx: Move serial registration from serial_initialize()

Move the registration of s3c24xx_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s3c24xx_serial_initialize() function, which is
implemented inside of the serial_s3c24xx driver allows encapsulation
of s3c24xx_serialN_device within the serial_s3c24xx driver itself.

Also, remove the exports of s3c24xx_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s3c24xx driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: C Nauman <cnauman@diagraph.com>

# 89143fb3 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Rename .init() and .uninit() in serial_device

Rename .init() to .start() and .uninit() to .stop() in struct
serial_device. This allows aligning struct serial_device with
closer to struct stdio_dev. The real goal here is to allow
these two structures to converge together and eventually make
one to be a superset of the other.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Tom Rini <trini@ti.com>

# 78322d63 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Coding style cleanup of struct serial_device

Do a simple cleanup of the struct serial_device and align it with
current coding style. Checkpatch now reports no errors.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 194846f3 13-Sep-2012 Michal Simek <monstr@monstr.eu>

serial: Add Zynq serial driver

The driver is used on Xilinx Zynq platform.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Joe Hershberger <joe.hershberger@gmail.com>
CC: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>

# 7636ebe1 01-Jul-2012 Michal Simek <monstr@monstr.eu>

serial: Support serial multi for Microblaze

enable serial multi for Microblaze.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephan Linz <linz@li-pro.net>

# 00a2749d 31-Aug-2012 Allen Martin <amartin@nvidia.com>

tegra20: rename tegra2 -> tegra20

This is make naming consistent with the kernel and devicetree and in
preparation of pulling out the common tegra20 code.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>

# f6add132 10-Nov-2011 Mike Frysinger <vapier@gentoo.org>

net/miiphy/serial: drop duplicate "NAMESIZE" define

A few subsystems are using the same define "NAMESIZE". This has been
working so far because they define it to the same number. However, I
want to change the size of eth_device's NAMESIZE, so rather than tweak
the define names, simply drop references to it. Almost no one does,
and the handful that do can easily be changed to a sizeof().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# ef5a5b00 29-Nov-2011 Gabe Black <gabeblack@chromium.org>

x86: Initial commit for running as a coreboot payload

Add a target for running u-boot as a coreboot payload in boards.cfg, a
board, CPU and a config. This is a skeleton implementation which always
reports the size of memory as 64 MB.

Signed-off-by: Gabe Black <gabeblack@chromium.org>

# 7813ca9b 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: constify serial_assign()

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# a6e6f7f4 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: cosmetic checkpatch compliance

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 49a23e4a 25-Sep-2011 Michal Simek <monstr@monstr.eu>

serial: uartlite: Support for SERIAL_MULTI

Add support for SERIAL MULTI for uartlite.

Signed-off-by: Michal Simek <monstr@monstr.eu>

# 1902692a 02-Aug-2011 Wolfgang Denk <wd@denx.de>

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

* 'master' of git://git.denx.de/u-boot-blackfin:
Blackfin: jtag-console: fix timer usage
Blackfin: switch to common display_options()
Blackfin: serial: move early debug strings into .rodata section
Blackfin: adi boards: also set stderr to nc with helper
Blackfin: update anomaly lists to latest public info
Blackfin: serial: convert to bfin_{read,write} helpers
Blackfin: split out async setup
Blackfin: adi boards: enable pretty flash progress output
Blackfin: drop unused dma.h header from start code
Blackfin: portmux: allow header to be included in assembly files
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: enable mmc_spi support
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings
Blackfin: sync MMR read/write helpers with Linux
Blackfin: gpio: optimize free path a little
Blackfin: post: setup default CONFIG_SYS_POST_WORD_ADDR
Blackfin: uart: fix printf warning
Blackfin: add init.elf helper code
Blackfin: dont reset SWRST on newer bf526 parts
Blackfin: adi boards: enable multi serial support by default
Blackfin: uart: add multiple serial support
Blackfin: uart: move debug buffers into local bss


# 7b826c2f 14-May-2011 Mike Frysinger <vapier@gentoo.org>

serial: implement common uart post test

The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data. If we ignore
the loop back part, the rest can be built upon the existing common serial
API. So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it. This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over. So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 1c9a5606 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

serial: drop useless ctlr field

The multi serial support has a "ctlr" field which almost no one uses,
but everyone is forced to set to useless strings. So punt it.

Funny enough, the only code that actually reads this field (the mpc8xx
driver) has a typo where it meant to look for the SCC driver. Fix it
while converting the check to use the name field.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Marek Vasut <marek.vasut@gmail.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>

# 635f330f 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

Blackfin: uart: add multiple serial support

This brings CONFIG_SERIAL_MULTI support to the Blackfin on-chip UARTs.
Ends up adding only ~512bytes per additional UART.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 2ee36781 27-Jan-2011 Tom Warren <twarren.nvidia@gmail.com>

serial: Add Tegra2 serial port support

Signed-off-by: Tom Warren <twarren@nvidia.com>

# 09b4a9cf 07-Sep-2010 Wolfgang Denk <wd@denx.de>

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


# 889a275d 23-Aug-2010 Minkyu Kang <mk7.kang@samsung.com>

ARMV7: S5P: rename from CONFIG_S5PC1XX to CONFIG_S5P

Use the same configuration around S5P SoCs.
(s5pc100, s5pc110, s5pc210 and so on)

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 6052ac83 09-Aug-2010 Matthias Weisser <weisserm@arcor.de>

ARM: Add support for MB86R0x SoCs

Signed-off-by: Matthias Weisser <weisserm@arcor.de>

# bf16500f 23-Apr-2010 Graeme Russ <graeme.russ@gmail.com>

x86: Use CONFIG_SERIAL_MULTI

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>

# 46a3b5c8 24-Mar-2010 Minkyu Kang <mk7.kang@samsung.com>

SAMSUNG: serial: modify name from s5pc1xx to s5p

Because of other s5p series SoC will use these serial functions,
modify function's name and structure's name.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 8e234e33 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc5121: add PSC serial communication routines

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# e3b28e67 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc512x: add multi serial PSC support

Extend mpc512x serial driver to support multiple PSC ports.

Subsequent patches for PDM360NG board support make use of this
functionality by defining CONFIG_SERIAL_MULTI in the board config
file. Additionally the used PSC devices are specified by defining
e.g. CONFIG_SYS_PSC1, CONFIG_SYS_PSC4 and CONFIG_SYS_PSC6.

Support for PSC devices other than 1, 3, 4 and 6 is not added
by this patch because these aren't used currently. In the future
it can be easily added using DECLARE_PSC_SERIAL_FUNCTIONS(N) and
INIT_PSC_SERIAL_STRUCTURE(N) macros in cpu/mpc512x/serial.c.
Additionally you have to add code for registering added
devices in serial_initialize() in common/serial.c.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# fbb0030e 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

serial: struct serial_device: add uninit() entry for drivers

Subsequent patch extends mpc512x serial driver to support
multiple PSC ports. The driver will provide an uninit()
function to stop the serial controller and to disable the
controller's clock. Adding uninit() entry to struct serial_device
allows disabling the serial controller after usage of
a stdio serial device.

This patch adds uninit() entry to the struct serial_device
and fixes initialization of this structure in the code
accordingly.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# 2ec1abea 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

OMAP3 zoom2 Use usbtty if the debug board is not connected.

The preferred serial output comes from the debug board.
When the debug board is disconnected, fall back on using
usbtty from the usb connector on the Zoom2 board.

This shows up as /dev/ttyACM0 in a linux host.

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6299487e 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

USBTTY make some function declarations easier to use.

Zoom2 needs to use these declarations and the include directory is a
better place from them than in the middle of the driver directory.
It did not make sense to create a new file for just a couple of
lines so they were appended to the serial.h

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# dd2c9e6a 01-Oct-2009 Minkyu Kang <mk7.kang@samsung.com>

s5pc1xx: support serial driver

This patch includes the serial driver for s5pc1xx.
s5pc1xx uart driver needs own register setting and clock configuration.
So, need to special driver.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 52cb4d4f 15-May-2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

stdio/device: rework function naming convention

So far the console API uses the following naming convention:

======Extract======
typedef struct device_t;

int device_register (device_t * dev);
int devices_init (void);
int device_deregister(char *devname);
struct list_head* device_get_list(void);
device_t* device_get_by_name(char* name);
device_t* device_clone(device_t *dev);
=======

which is too generic and confusing.

Instead of using device_XX and device_t we change this
into stdio_XX and stdio_dev

This will also allow to add later a generic device mechanism in order
to have support for multiple devices and driver instances.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Edited commit message.

Signed-off-by: Wolfgang Denk <wd@denx.de>

# 039594a4 02-Jul-2009 Poonam Aggrwal <poonam.aggrwal@freescale.com>

8xxx: Second UART port added for MPC85xx, MPC83xx, MPC86xx processors

Defining the next two configs allows to switch the serial port from the
console using the setenv stdin and stdout
1. #define CONFIG_SERIAL_MULTI 1 /* Enable both serial ports */
2. #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* determine from environment */

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

# 660888b7 30-May-2009 Tom Rix <Tom.Rix@windriver.com>

ZOOM2 Add serial support.

Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board.
The default serial is from the USB connector on left side of the debug board.
The USB connector will produce 2 of the 4 UARTS. On your host pick the first
enumeration.

The details of the setting of the serial gpmc setup are not available.
The values were provided by another party.

The serial port set up is the same with Zoom1.
Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow.

The kernel bootargs are
console=ttyS3,115200n8

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# a7c185ed 19-Dec-2007 Harald Welte <laforge@openmoko.org>

ARM: s3c24xx: Multiple serial port support

This patch adds support for CONFIG_SERIAL_MULTI on s3c24x0 CPU's

Signed-off-by: Harald Welte <laforge@openmoko.org>

# dbbd1257 05-Oct-2007 Stefan Roese <sr@denx.de>

ppc4xx: Add PPC405EX support

Signed-off-by: Stefan Roese <sr@denx.de>

# 80172c61 30-Aug-2007 Stefano Babic <sbabic@denx.de>

PXA270: Add support for multiple serial ports.

This patch adds support for multiple serial ports to the PXA target.
FFUART, BTUART and STUART are supported.

Signed-off-by: Stefano Babic <sbabic@denx.de>

# 3cb86f3e 24-Mar-2007 Stefan Roese <sr@denx.de>

[PATCH] Clean up 40EZ/Acadia support

This patch cleans up all the open issue of the preliminary
Acadia support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 0fd30252 30-Aug-2006 Wolfgang Denk <wd@pollux.denx.de>

Make the serial driver framework work with CONFIG_SERIAL_MULTI enabled

# c12cffc5 16-Jun-2006 Wolfgang Denk <wd@fifi.denx.de>

Add support for CONFIG_SERIAL_MULTI on MPC5xxx
Patch by Martin Krause, 8 Jun 2006

This patch supports two serial consoles on boards with
a MPC5xxx CPU. The console can be switched at runtime
by setting stdin, stdout and stderr to the desired serial
interface (serial0 or serial1). The PSCs to be used as
console port are definded by CONFIG_PSC_CONSOLE
and CONFIG_PSC_CONSOLE2.
See README.serial_multi for details.

# ff36fd85 09-Jan-2005 Wolfgang Denk <wdenk>

* Patch by Leif Lindholm, 23 Sep 2004:
add support for the AMD db1550 board

* Patch by Travis Sawyer, 15 Sep 2004:
Add CONFIG_SERIAL_MULTI support for ppc4xx,
update README.serial_multi

# 281e00a3 01-Aug-2004 Wolfgang Denk <wdenk>

* Code cleanup

* Patch by Sascha Hauer, 28 Jun:
- add generic support for Motorola i.MX architecture
- add support for mx1ads, mx1fs2 and scb9328 boards

* Patches by Marc Leeman, 23 Jul 2004:
- Add define for the PCI/Memory Buffer Configuration Register
- corrected comments in cpu/mpc824x/cpu_init.c

* Add support for multiple serial interfaces
(for example to allow modem dial-in / dial-out)

# bf4661bc 27-Feb-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add clock member to struct serial_device_info

Some callers of serial_getinfo() would like to know the UART base
clock speed in order to make decision what to pass to OS in some
cases. In particular, ACPI SPCR table expects only certain base
clock speed and thus we have to act accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# b03e0510 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial functions out of common.h

These functions belong in serial.h so move them over.

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

# f516fd99 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial_printf() to the serial header

Move this function header to serial.h since this function is clearly
related to serial. The function itself stays in console.c since we don't
have a single serial file. DM and non-DM each has a separate file so we
would have to either create a new common serial file, or repeat the
function in both serial.c and serial-uclass.c, neither of which seem
worthwhile.

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

# 2310c8ed 14-Nov-2019 Simon Glass <sjg@chromium.org>

serial: usb: Correct the usbtty_...() prototypes

The function declarations in serial.h are not in sync with what is
currently used in usbtty. Fix this by updating the header and including
it, to help catch future such problems.

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

# eab647d5 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Tidy up header file comments

The getconfig() comment is out of date. Fix this and add comments for
recently added functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# a61cbad7 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getinfo() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 3de04e77 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_setconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 67d1b051 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 0171f432 28-Dec-2018 Simon Glass <sjg@chromium.org>

serial: Move new functions to serial.h

We should not be adding new functions to common.h. Move these recently
added functions to serial.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# d5bb4f86 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Introduce ->getinfo() callback

New callback will give a necessary information to fill up ACPI SPCR table,
for example. Maybe used later for other purposes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change ADR_SPACE_SYSTEM_IO to SERIAL_ADDRESS_SPACE_IO to fix build error:
Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7f5db9 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add ->getconfig() callback

In some cases it would be good to know the settings, such as parity,
of current serial console. One example might be an ACPI SPCR table
to generate using these parameters.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 42b54013 21-Nov-2018 Christophe Leroy <christophe.leroy@c-s.fr>

drivers: serial: get rid of non DM mpc8xx driver

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

# 0a168687 02-Nov-2018 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

dm: serial: fix comment on dm_serial_ops setconfig

The comment on this function prototype describes nonexistent
parameters. It seems to be copied from 'setparity'.

Update it to match its the parameter list.

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

# d7c09684 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

sandbox: Add serial test

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

# ad060c05 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

dm: serial: Remove setparity ops

setparity users has been updated to use new setconfig ops,
so we can safely remove setparity ops

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

# cbf53883 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

dm: serial: Replace setparity by setconfig

Replace setparity by more generic setconfig ops
to allow uart parity, bits word length and stop bits
number change.

Adds SERIAL_GET_PARITY/BITS/STOP macros.

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>

# 481ea2e3 11-Jul-2018 Tom Rini <trini@konsulko.com>

mips: au1x00: Remove support for these SoCs

The only platform left for the AU1x00 SoCs was the pb1x00 platform, an
apparent clone of the dbau1x00 platform. As pb1x00 had no listed
maintainer I am assuming that it is also orphaned. Remove this platform
and then remove the unused SoC support.

Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# eae4764f 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

dm: serial: Add setparity

Implements serial setparity ops to allow uart parity change.
It allows to select ODD, EVEN or NONE parity.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

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

drivers: serial: remove nonexisting initialisation functions

This patch removes call of serial initialisation functions that
are not implemented anymore.

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

# 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>

# 98f705c9 27-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc: remove 4xx support

There was for long time no activity in the 4xx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in 4xx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# b9f7d881 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xx: remove some "5xx" remains

we removed 5xx support. So delete some forgotten remains.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 9057df88 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 82xx: remove some missed mpc82xx remains

we removed 82xx support. Missed some 82xx remains,
remove them now.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 064b55cf 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512x

There was for long time no activity in the mpx5xxx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in mpc5xxx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 3d16389c 16-May-2016 Lokesh Vutla <lokeshvutla@ti.com>

board: am335x: Allow to choose serial device dynamically

Different AM335x based platforms have different serial consoles. As serial
console is Kconfig option a separate defconfig has to be created for each
platform. So pass the serial device dynamically.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

# 2e2da4c6 08-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

serial: remove altera serial initializations

Both altera_jtag_serial_initialize() and
altera_serial_initialize() are no longer used after
they are converted to driver model.

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

# a2f39e83 23-Feb-2015 Masahiro Yamada <yamada.m@jp.panasonic.com>

ARM: remove cm4008 and cm41xx board support

These are still non-generic boards.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Greg Ungerer <greg.ungerer@opengear.com>
Acked-by: Marek Vasut <marex@denx.de>

# 41fbbbbc 23-Feb-2015 Masahiro Yamada <yamada.m@jp.panasonic.com>

ARM: remove jadecpu board support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Matthias Weisser <weisserm@arcor.de>
Acked-by: Marek Vasut <marex@denx.de>

# 94a255df 27-Oct-2014 Jeroen Hofstee <jeroen@myspectrum.nl>

serial: add prototypes for init functions

While at it, sort them.

Cc: Tom Rini <trini@ti.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

# 57d92753 04-Sep-2014 Simon Glass <sjg@chromium.org>

dm: Add a uclass for serial devices

Serial devices support simple byte input/output and a few operations to find
out whether data is available. Add a basic uclass for serial devices to be
used by drivers that are converted to driver model.

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

# 3fb85889 06-Aug-2013 Matthias Fuchs <matthias.fuchs@esd.eu>

ppc4xx: Remove support for PPC405CR CPUs

This patch removes support for the APM 405CR CPU.
This CPU is EOL and no board uses this chip.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>

# 6d6c0bae 11-Dec-2012 Tom Warren <twarren.nvidia@gmail.com>

Tegra30: Add generic Tegra30 build support

This patch adds basic Tegra30 (T30) build support - no specific
board is targeted.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>

# bfb7d7a3 06-Oct-2012 Marek Vasut <marex@denx.de>

serial: Implement default_serial_puts()

U-Boot contains a lot of duplicit implementations of serial_puts()
call which just pipes single characters into the port in loop. Implement
function that does this behavior into common code, so others can make
easy use of it.

This function is called default_serial_puts() and it's sole purpose
is to call putc() in loop on the whole string passed to it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 036036d7 14-Sep-2012 Marek Vasut <marex@denx.de>

serial: Remove CONFIG_SERIAL_MULTI from remaining sources

Remove the parts depending either on disabled CONFIG_SERIAL_MULTI
or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI
is now enabled by default.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 425101e1 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: zoom2: Remove zoom2 serial prototypes from serial.h

Remove the prototypes for zoom2_serial_deviceN from serial.h . This
can't be done right away, as they are referenced from the zoom2
config file. Therefore, adjust the code so the config file only
specifies number of the port. Then, replace the simple return in
default_serial_console() with a switch across possible values, which
returns the zoom2_serial_deviceN . With such adjustment in place,
the exported prototypes in serial.h can be safely removed.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 5ae1de0d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Adjust serial_register_bfin_uart()

Rename the serial_register_bfin_uart() to bfin_initialize_serial()
to be consistent with the rest of the naming. Next, remove it's
prototype from serial.h and properly insert it into serial.c as
the rest of the serial initialization functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# c513d7e5 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Remove the bfin_serialN_device exports from serial.h

Remove the exports from serial.h as they are only used in the blackfin
serial driver. Furthermore, they are only used for registration, which
is handled already inside that driver and default_serial_port() call,
which is also handled in that driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# abc0ed8d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: ns16550: Move serial registration from serial_initialize()

Move the registration of eserialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented ns16550_serial_initialize() function, which is
implemented inside of the ns16550 serial driver allows encapsulation
of eserialN_device within the ns16550 serial driver itself.

Also, remove the exports of eserialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the ns16550 serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Michal Simek <monstr@monstr.eu>

# 918327c8 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: mpc512x: Move serial registration from serial_initialize()

Move the registration of serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented mpc512x_serial_initialize() function, which is
implemented inside of the mpc512x serial driver allows encapsulation
of serialN_device within the mpc512x serial driver itself.

Also, remove the exports of serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the mpx512x serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 87d69229 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: microblaze: Move serial registration from serial_initialize()

Move the registration of xuartlite_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented xuartlite_serial_initialize() function, which is
implemented inside of the serial_xuartlite driver allows encapsulation
of xuartlite_serialN_device within the serial_xuartlite driver itself.

Also, remove the exports of xuartlite_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_xuartlite driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>

# 51d8102f 08-Oct-2012 Tom Rini <trini@ti.com>

serial: zynq: Move serial registration from serial_initialize()

Move the registration of zynq_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented zynq_serial_initialize() function, which is
implemented inside of the serial_zynq driver allows encapsulation
of zynq_serialN_device within the serial_zynq driver itself.

Also, remove the exports of zynq_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_zynq driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

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

# b4980515 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s5p: Move serial registration from serial_initialize()

Move the registration of s5p_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s5p_serial_initialize() function, which is
implemented inside of the serial_s5p driver allows encapsulation
of s5p_serialN_device within the serial_s5p driver itself.

Also, remove the exports of s5p_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s5p driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>

# 1fe5c110 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: pxa: Move serial registration from serial_initialize()

Move the registration of serial_XXuart ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented pxa_serial_initialize() function, which is
implemented inside of the serial_pxa driver allows encapsulation
of serial_XXuart within the serial_pxa driver itself.

Also, remove the exports of serial_XXuart from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_pxa driver and
the default console is picked by CONFIG_CONS_IDX macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 28af6385 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s3c24xx: Move serial registration from serial_initialize()

Move the registration of s3c24xx_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s3c24xx_serial_initialize() function, which is
implemented inside of the serial_s3c24xx driver allows encapsulation
of s3c24xx_serialN_device within the serial_s3c24xx driver itself.

Also, remove the exports of s3c24xx_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s3c24xx driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: C Nauman <cnauman@diagraph.com>

# 89143fb3 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Rename .init() and .uninit() in serial_device

Rename .init() to .start() and .uninit() to .stop() in struct
serial_device. This allows aligning struct serial_device with
closer to struct stdio_dev. The real goal here is to allow
these two structures to converge together and eventually make
one to be a superset of the other.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Tom Rini <trini@ti.com>

# 78322d63 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Coding style cleanup of struct serial_device

Do a simple cleanup of the struct serial_device and align it with
current coding style. Checkpatch now reports no errors.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 194846f3 13-Sep-2012 Michal Simek <monstr@monstr.eu>

serial: Add Zynq serial driver

The driver is used on Xilinx Zynq platform.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Joe Hershberger <joe.hershberger@gmail.com>
CC: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>

# 7636ebe1 01-Jul-2012 Michal Simek <monstr@monstr.eu>

serial: Support serial multi for Microblaze

enable serial multi for Microblaze.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephan Linz <linz@li-pro.net>

# 00a2749d 31-Aug-2012 Allen Martin <amartin@nvidia.com>

tegra20: rename tegra2 -> tegra20

This is make naming consistent with the kernel and devicetree and in
preparation of pulling out the common tegra20 code.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>

# f6add132 10-Nov-2011 Mike Frysinger <vapier@gentoo.org>

net/miiphy/serial: drop duplicate "NAMESIZE" define

A few subsystems are using the same define "NAMESIZE". This has been
working so far because they define it to the same number. However, I
want to change the size of eth_device's NAMESIZE, so rather than tweak
the define names, simply drop references to it. Almost no one does,
and the handful that do can easily be changed to a sizeof().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# ef5a5b00 29-Nov-2011 Gabe Black <gabeblack@chromium.org>

x86: Initial commit for running as a coreboot payload

Add a target for running u-boot as a coreboot payload in boards.cfg, a
board, CPU and a config. This is a skeleton implementation which always
reports the size of memory as 64 MB.

Signed-off-by: Gabe Black <gabeblack@chromium.org>

# 7813ca9b 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: constify serial_assign()

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# a6e6f7f4 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: cosmetic checkpatch compliance

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 49a23e4a 25-Sep-2011 Michal Simek <monstr@monstr.eu>

serial: uartlite: Support for SERIAL_MULTI

Add support for SERIAL MULTI for uartlite.

Signed-off-by: Michal Simek <monstr@monstr.eu>

# 1902692a 02-Aug-2011 Wolfgang Denk <wd@denx.de>

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

* 'master' of git://git.denx.de/u-boot-blackfin:
Blackfin: jtag-console: fix timer usage
Blackfin: switch to common display_options()
Blackfin: serial: move early debug strings into .rodata section
Blackfin: adi boards: also set stderr to nc with helper
Blackfin: update anomaly lists to latest public info
Blackfin: serial: convert to bfin_{read,write} helpers
Blackfin: split out async setup
Blackfin: adi boards: enable pretty flash progress output
Blackfin: drop unused dma.h header from start code
Blackfin: portmux: allow header to be included in assembly files
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: enable mmc_spi support
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings
Blackfin: sync MMR read/write helpers with Linux
Blackfin: gpio: optimize free path a little
Blackfin: post: setup default CONFIG_SYS_POST_WORD_ADDR
Blackfin: uart: fix printf warning
Blackfin: add init.elf helper code
Blackfin: dont reset SWRST on newer bf526 parts
Blackfin: adi boards: enable multi serial support by default
Blackfin: uart: add multiple serial support
Blackfin: uart: move debug buffers into local bss


# 7b826c2f 14-May-2011 Mike Frysinger <vapier@gentoo.org>

serial: implement common uart post test

The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data. If we ignore
the loop back part, the rest can be built upon the existing common serial
API. So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it. This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over. So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 1c9a5606 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

serial: drop useless ctlr field

The multi serial support has a "ctlr" field which almost no one uses,
but everyone is forced to set to useless strings. So punt it.

Funny enough, the only code that actually reads this field (the mpc8xx
driver) has a typo where it meant to look for the SCC driver. Fix it
while converting the check to use the name field.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Marek Vasut <marek.vasut@gmail.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>

# 635f330f 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

Blackfin: uart: add multiple serial support

This brings CONFIG_SERIAL_MULTI support to the Blackfin on-chip UARTs.
Ends up adding only ~512bytes per additional UART.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 2ee36781 27-Jan-2011 Tom Warren <twarren.nvidia@gmail.com>

serial: Add Tegra2 serial port support

Signed-off-by: Tom Warren <twarren@nvidia.com>

# 09b4a9cf 07-Sep-2010 Wolfgang Denk <wd@denx.de>

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


# 889a275d 23-Aug-2010 Minkyu Kang <mk7.kang@samsung.com>

ARMV7: S5P: rename from CONFIG_S5PC1XX to CONFIG_S5P

Use the same configuration around S5P SoCs.
(s5pc100, s5pc110, s5pc210 and so on)

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 6052ac83 09-Aug-2010 Matthias Weisser <weisserm@arcor.de>

ARM: Add support for MB86R0x SoCs

Signed-off-by: Matthias Weisser <weisserm@arcor.de>

# bf16500f 23-Apr-2010 Graeme Russ <graeme.russ@gmail.com>

x86: Use CONFIG_SERIAL_MULTI

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>

# 46a3b5c8 24-Mar-2010 Minkyu Kang <mk7.kang@samsung.com>

SAMSUNG: serial: modify name from s5pc1xx to s5p

Because of other s5p series SoC will use these serial functions,
modify function's name and structure's name.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 8e234e33 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc5121: add PSC serial communication routines

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# e3b28e67 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc512x: add multi serial PSC support

Extend mpc512x serial driver to support multiple PSC ports.

Subsequent patches for PDM360NG board support make use of this
functionality by defining CONFIG_SERIAL_MULTI in the board config
file. Additionally the used PSC devices are specified by defining
e.g. CONFIG_SYS_PSC1, CONFIG_SYS_PSC4 and CONFIG_SYS_PSC6.

Support for PSC devices other than 1, 3, 4 and 6 is not added
by this patch because these aren't used currently. In the future
it can be easily added using DECLARE_PSC_SERIAL_FUNCTIONS(N) and
INIT_PSC_SERIAL_STRUCTURE(N) macros in cpu/mpc512x/serial.c.
Additionally you have to add code for registering added
devices in serial_initialize() in common/serial.c.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# fbb0030e 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

serial: struct serial_device: add uninit() entry for drivers

Subsequent patch extends mpc512x serial driver to support
multiple PSC ports. The driver will provide an uninit()
function to stop the serial controller and to disable the
controller's clock. Adding uninit() entry to struct serial_device
allows disabling the serial controller after usage of
a stdio serial device.

This patch adds uninit() entry to the struct serial_device
and fixes initialization of this structure in the code
accordingly.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# 2ec1abea 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

OMAP3 zoom2 Use usbtty if the debug board is not connected.

The preferred serial output comes from the debug board.
When the debug board is disconnected, fall back on using
usbtty from the usb connector on the Zoom2 board.

This shows up as /dev/ttyACM0 in a linux host.

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6299487e 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

USBTTY make some function declarations easier to use.

Zoom2 needs to use these declarations and the include directory is a
better place from them than in the middle of the driver directory.
It did not make sense to create a new file for just a couple of
lines so they were appended to the serial.h

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# dd2c9e6a 01-Oct-2009 Minkyu Kang <mk7.kang@samsung.com>

s5pc1xx: support serial driver

This patch includes the serial driver for s5pc1xx.
s5pc1xx uart driver needs own register setting and clock configuration.
So, need to special driver.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 52cb4d4f 15-May-2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

stdio/device: rework function naming convention

So far the console API uses the following naming convention:

======Extract======
typedef struct device_t;

int device_register (device_t * dev);
int devices_init (void);
int device_deregister(char *devname);
struct list_head* device_get_list(void);
device_t* device_get_by_name(char* name);
device_t* device_clone(device_t *dev);
=======

which is too generic and confusing.

Instead of using device_XX and device_t we change this
into stdio_XX and stdio_dev

This will also allow to add later a generic device mechanism in order
to have support for multiple devices and driver instances.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Edited commit message.

Signed-off-by: Wolfgang Denk <wd@denx.de>

# 039594a4 02-Jul-2009 Poonam Aggrwal <poonam.aggrwal@freescale.com>

8xxx: Second UART port added for MPC85xx, MPC83xx, MPC86xx processors

Defining the next two configs allows to switch the serial port from the
console using the setenv stdin and stdout
1. #define CONFIG_SERIAL_MULTI 1 /* Enable both serial ports */
2. #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* determine from environment */

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

# 660888b7 30-May-2009 Tom Rix <Tom.Rix@windriver.com>

ZOOM2 Add serial support.

Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board.
The default serial is from the USB connector on left side of the debug board.
The USB connector will produce 2 of the 4 UARTS. On your host pick the first
enumeration.

The details of the setting of the serial gpmc setup are not available.
The values were provided by another party.

The serial port set up is the same with Zoom1.
Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow.

The kernel bootargs are
console=ttyS3,115200n8

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# a7c185ed 19-Dec-2007 Harald Welte <laforge@openmoko.org>

ARM: s3c24xx: Multiple serial port support

This patch adds support for CONFIG_SERIAL_MULTI on s3c24x0 CPU's

Signed-off-by: Harald Welte <laforge@openmoko.org>

# dbbd1257 05-Oct-2007 Stefan Roese <sr@denx.de>

ppc4xx: Add PPC405EX support

Signed-off-by: Stefan Roese <sr@denx.de>

# 80172c61 30-Aug-2007 Stefano Babic <sbabic@denx.de>

PXA270: Add support for multiple serial ports.

This patch adds support for multiple serial ports to the PXA target.
FFUART, BTUART and STUART are supported.

Signed-off-by: Stefano Babic <sbabic@denx.de>

# 3cb86f3e 24-Mar-2007 Stefan Roese <sr@denx.de>

[PATCH] Clean up 40EZ/Acadia support

This patch cleans up all the open issue of the preliminary
Acadia support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 0fd30252 30-Aug-2006 Wolfgang Denk <wd@pollux.denx.de>

Make the serial driver framework work with CONFIG_SERIAL_MULTI enabled

# c12cffc5 16-Jun-2006 Wolfgang Denk <wd@fifi.denx.de>

Add support for CONFIG_SERIAL_MULTI on MPC5xxx
Patch by Martin Krause, 8 Jun 2006

This patch supports two serial consoles on boards with
a MPC5xxx CPU. The console can be switched at runtime
by setting stdin, stdout and stderr to the desired serial
interface (serial0 or serial1). The PSCs to be used as
console port are definded by CONFIG_PSC_CONSOLE
and CONFIG_PSC_CONSOLE2.
See README.serial_multi for details.

# ff36fd85 09-Jan-2005 Wolfgang Denk <wdenk>

* Patch by Leif Lindholm, 23 Sep 2004:
add support for the AMD db1550 board

* Patch by Travis Sawyer, 15 Sep 2004:
Add CONFIG_SERIAL_MULTI support for ppc4xx,
update README.serial_multi

# 281e00a3 01-Aug-2004 Wolfgang Denk <wdenk>

* Code cleanup

* Patch by Sascha Hauer, 28 Jun:
- add generic support for Motorola i.MX architecture
- add support for mx1ads, mx1fs2 and scb9328 boards

* Patches by Marc Leeman, 23 Jul 2004:
- Add define for the PCI/Memory Buffer Configuration Register
- corrected comments in cpu/mpc824x/cpu_init.c

* Add support for multiple serial interfaces
(for example to allow modem dial-in / dial-out)

# b03e0510 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial functions out of common.h

These functions belong in serial.h so move them over.

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

# f516fd99 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move serial_printf() to the serial header

Move this function header to serial.h since this function is clearly
related to serial. The function itself stays in console.c since we don't
have a single serial file. DM and non-DM each has a separate file so we
would have to either create a new common serial file, or repeat the
function in both serial.c and serial-uclass.c, neither of which seem
worthwhile.

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

# 2310c8ed 14-Nov-2019 Simon Glass <sjg@chromium.org>

serial: usb: Correct the usbtty_...() prototypes

The function declarations in serial.h are not in sync with what is
currently used in usbtty. Fix this by updating the header and including
it, to help catch future such problems.

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

# eab647d5 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Tidy up header file comments

The getconfig() comment is out of date. Fix this and add comments for
recently added functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# a61cbad7 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getinfo() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 3de04e77 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_setconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 67d1b051 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 0171f432 28-Dec-2018 Simon Glass <sjg@chromium.org>

serial: Move new functions to serial.h

We should not be adding new functions to common.h. Move these recently
added functions to serial.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# d5bb4f86 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Introduce ->getinfo() callback

New callback will give a necessary information to fill up ACPI SPCR table,
for example. Maybe used later for other purposes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change ADR_SPACE_SYSTEM_IO to SERIAL_ADDRESS_SPACE_IO to fix build error:
Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7f5db9 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add ->getconfig() callback

In some cases it would be good to know the settings, such as parity,
of current serial console. One example might be an ACPI SPCR table
to generate using these parameters.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 42b54013 21-Nov-2018 Christophe Leroy <christophe.leroy@c-s.fr>

drivers: serial: get rid of non DM mpc8xx driver

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

# 0a168687 02-Nov-2018 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

dm: serial: fix comment on dm_serial_ops setconfig

The comment on this function prototype describes nonexistent
parameters. It seems to be copied from 'setparity'.

Update it to match its the parameter list.

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

# d7c09684 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

sandbox: Add serial test

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

# ad060c05 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

dm: serial: Remove setparity ops

setparity users has been updated to use new setconfig ops,
so we can safely remove setparity ops

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

# cbf53883 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

dm: serial: Replace setparity by setconfig

Replace setparity by more generic setconfig ops
to allow uart parity, bits word length and stop bits
number change.

Adds SERIAL_GET_PARITY/BITS/STOP macros.

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>

# 481ea2e3 11-Jul-2018 Tom Rini <trini@konsulko.com>

mips: au1x00: Remove support for these SoCs

The only platform left for the AU1x00 SoCs was the pb1x00 platform, an
apparent clone of the dbau1x00 platform. As pb1x00 had no listed
maintainer I am assuming that it is also orphaned. Remove this platform
and then remove the unused SoC support.

Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# eae4764f 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

dm: serial: Add setparity

Implements serial setparity ops to allow uart parity change.
It allows to select ODD, EVEN or NONE parity.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

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

drivers: serial: remove nonexisting initialisation functions

This patch removes call of serial initialisation functions that
are not implemented anymore.

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

# 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>

# 98f705c9 27-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc: remove 4xx support

There was for long time no activity in the 4xx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in 4xx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# b9f7d881 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xx: remove some "5xx" remains

we removed 5xx support. So delete some forgotten remains.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 9057df88 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 82xx: remove some missed mpc82xx remains

we removed 82xx support. Missed some 82xx remains,
remove them now.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 064b55cf 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512x

There was for long time no activity in the mpx5xxx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in mpc5xxx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 3d16389c 16-May-2016 Lokesh Vutla <lokeshvutla@ti.com>

board: am335x: Allow to choose serial device dynamically

Different AM335x based platforms have different serial consoles. As serial
console is Kconfig option a separate defconfig has to be created for each
platform. So pass the serial device dynamically.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

# 2e2da4c6 08-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

serial: remove altera serial initializations

Both altera_jtag_serial_initialize() and
altera_serial_initialize() are no longer used after
they are converted to driver model.

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

# a2f39e83 23-Feb-2015 Masahiro Yamada <yamada.m@jp.panasonic.com>

ARM: remove cm4008 and cm41xx board support

These are still non-generic boards.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Greg Ungerer <greg.ungerer@opengear.com>
Acked-by: Marek Vasut <marex@denx.de>

# 41fbbbbc 23-Feb-2015 Masahiro Yamada <yamada.m@jp.panasonic.com>

ARM: remove jadecpu board support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Matthias Weisser <weisserm@arcor.de>
Acked-by: Marek Vasut <marex@denx.de>

# 94a255df 27-Oct-2014 Jeroen Hofstee <jeroen@myspectrum.nl>

serial: add prototypes for init functions

While at it, sort them.

Cc: Tom Rini <trini@ti.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

# 57d92753 04-Sep-2014 Simon Glass <sjg@chromium.org>

dm: Add a uclass for serial devices

Serial devices support simple byte input/output and a few operations to find
out whether data is available. Add a basic uclass for serial devices to be
used by drivers that are converted to driver model.

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

# 3fb85889 06-Aug-2013 Matthias Fuchs <matthias.fuchs@esd.eu>

ppc4xx: Remove support for PPC405CR CPUs

This patch removes support for the APM 405CR CPU.
This CPU is EOL and no board uses this chip.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>

# 6d6c0bae 11-Dec-2012 Tom Warren <twarren.nvidia@gmail.com>

Tegra30: Add generic Tegra30 build support

This patch adds basic Tegra30 (T30) build support - no specific
board is targeted.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>

# bfb7d7a3 06-Oct-2012 Marek Vasut <marex@denx.de>

serial: Implement default_serial_puts()

U-Boot contains a lot of duplicit implementations of serial_puts()
call which just pipes single characters into the port in loop. Implement
function that does this behavior into common code, so others can make
easy use of it.

This function is called default_serial_puts() and it's sole purpose
is to call putc() in loop on the whole string passed to it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 036036d7 14-Sep-2012 Marek Vasut <marex@denx.de>

serial: Remove CONFIG_SERIAL_MULTI from remaining sources

Remove the parts depending either on disabled CONFIG_SERIAL_MULTI
or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI
is now enabled by default.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 425101e1 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: zoom2: Remove zoom2 serial prototypes from serial.h

Remove the prototypes for zoom2_serial_deviceN from serial.h . This
can't be done right away, as they are referenced from the zoom2
config file. Therefore, adjust the code so the config file only
specifies number of the port. Then, replace the simple return in
default_serial_console() with a switch across possible values, which
returns the zoom2_serial_deviceN . With such adjustment in place,
the exported prototypes in serial.h can be safely removed.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 5ae1de0d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Adjust serial_register_bfin_uart()

Rename the serial_register_bfin_uart() to bfin_initialize_serial()
to be consistent with the rest of the naming. Next, remove it's
prototype from serial.h and properly insert it into serial.c as
the rest of the serial initialization functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# c513d7e5 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Remove the bfin_serialN_device exports from serial.h

Remove the exports from serial.h as they are only used in the blackfin
serial driver. Furthermore, they are only used for registration, which
is handled already inside that driver and default_serial_port() call,
which is also handled in that driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# abc0ed8d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: ns16550: Move serial registration from serial_initialize()

Move the registration of eserialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented ns16550_serial_initialize() function, which is
implemented inside of the ns16550 serial driver allows encapsulation
of eserialN_device within the ns16550 serial driver itself.

Also, remove the exports of eserialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the ns16550 serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Michal Simek <monstr@monstr.eu>

# 918327c8 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: mpc512x: Move serial registration from serial_initialize()

Move the registration of serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented mpc512x_serial_initialize() function, which is
implemented inside of the mpc512x serial driver allows encapsulation
of serialN_device within the mpc512x serial driver itself.

Also, remove the exports of serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the mpx512x serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 87d69229 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: microblaze: Move serial registration from serial_initialize()

Move the registration of xuartlite_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented xuartlite_serial_initialize() function, which is
implemented inside of the serial_xuartlite driver allows encapsulation
of xuartlite_serialN_device within the serial_xuartlite driver itself.

Also, remove the exports of xuartlite_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_xuartlite driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>

# 51d8102f 08-Oct-2012 Tom Rini <trini@ti.com>

serial: zynq: Move serial registration from serial_initialize()

Move the registration of zynq_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented zynq_serial_initialize() function, which is
implemented inside of the serial_zynq driver allows encapsulation
of zynq_serialN_device within the serial_zynq driver itself.

Also, remove the exports of zynq_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_zynq driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

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

# b4980515 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s5p: Move serial registration from serial_initialize()

Move the registration of s5p_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s5p_serial_initialize() function, which is
implemented inside of the serial_s5p driver allows encapsulation
of s5p_serialN_device within the serial_s5p driver itself.

Also, remove the exports of s5p_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s5p driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>

# 1fe5c110 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: pxa: Move serial registration from serial_initialize()

Move the registration of serial_XXuart ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented pxa_serial_initialize() function, which is
implemented inside of the serial_pxa driver allows encapsulation
of serial_XXuart within the serial_pxa driver itself.

Also, remove the exports of serial_XXuart from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_pxa driver and
the default console is picked by CONFIG_CONS_IDX macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 28af6385 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s3c24xx: Move serial registration from serial_initialize()

Move the registration of s3c24xx_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s3c24xx_serial_initialize() function, which is
implemented inside of the serial_s3c24xx driver allows encapsulation
of s3c24xx_serialN_device within the serial_s3c24xx driver itself.

Also, remove the exports of s3c24xx_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s3c24xx driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: C Nauman <cnauman@diagraph.com>

# 89143fb3 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Rename .init() and .uninit() in serial_device

Rename .init() to .start() and .uninit() to .stop() in struct
serial_device. This allows aligning struct serial_device with
closer to struct stdio_dev. The real goal here is to allow
these two structures to converge together and eventually make
one to be a superset of the other.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Tom Rini <trini@ti.com>

# 78322d63 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Coding style cleanup of struct serial_device

Do a simple cleanup of the struct serial_device and align it with
current coding style. Checkpatch now reports no errors.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 194846f3 13-Sep-2012 Michal Simek <monstr@monstr.eu>

serial: Add Zynq serial driver

The driver is used on Xilinx Zynq platform.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Joe Hershberger <joe.hershberger@gmail.com>
CC: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>

# 7636ebe1 01-Jul-2012 Michal Simek <monstr@monstr.eu>

serial: Support serial multi for Microblaze

enable serial multi for Microblaze.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephan Linz <linz@li-pro.net>

# 00a2749d 31-Aug-2012 Allen Martin <amartin@nvidia.com>

tegra20: rename tegra2 -> tegra20

This is make naming consistent with the kernel and devicetree and in
preparation of pulling out the common tegra20 code.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>

# f6add132 10-Nov-2011 Mike Frysinger <vapier@gentoo.org>

net/miiphy/serial: drop duplicate "NAMESIZE" define

A few subsystems are using the same define "NAMESIZE". This has been
working so far because they define it to the same number. However, I
want to change the size of eth_device's NAMESIZE, so rather than tweak
the define names, simply drop references to it. Almost no one does,
and the handful that do can easily be changed to a sizeof().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# ef5a5b00 29-Nov-2011 Gabe Black <gabeblack@chromium.org>

x86: Initial commit for running as a coreboot payload

Add a target for running u-boot as a coreboot payload in boards.cfg, a
board, CPU and a config. This is a skeleton implementation which always
reports the size of memory as 64 MB.

Signed-off-by: Gabe Black <gabeblack@chromium.org>

# 7813ca9b 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: constify serial_assign()

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# a6e6f7f4 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: cosmetic checkpatch compliance

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 49a23e4a 25-Sep-2011 Michal Simek <monstr@monstr.eu>

serial: uartlite: Support for SERIAL_MULTI

Add support for SERIAL MULTI for uartlite.

Signed-off-by: Michal Simek <monstr@monstr.eu>

# 1902692a 02-Aug-2011 Wolfgang Denk <wd@denx.de>

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

* 'master' of git://git.denx.de/u-boot-blackfin:
Blackfin: jtag-console: fix timer usage
Blackfin: switch to common display_options()
Blackfin: serial: move early debug strings into .rodata section
Blackfin: adi boards: also set stderr to nc with helper
Blackfin: update anomaly lists to latest public info
Blackfin: serial: convert to bfin_{read,write} helpers
Blackfin: split out async setup
Blackfin: adi boards: enable pretty flash progress output
Blackfin: drop unused dma.h header from start code
Blackfin: portmux: allow header to be included in assembly files
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: enable mmc_spi support
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings
Blackfin: sync MMR read/write helpers with Linux
Blackfin: gpio: optimize free path a little
Blackfin: post: setup default CONFIG_SYS_POST_WORD_ADDR
Blackfin: uart: fix printf warning
Blackfin: add init.elf helper code
Blackfin: dont reset SWRST on newer bf526 parts
Blackfin: adi boards: enable multi serial support by default
Blackfin: uart: add multiple serial support
Blackfin: uart: move debug buffers into local bss


# 7b826c2f 14-May-2011 Mike Frysinger <vapier@gentoo.org>

serial: implement common uart post test

The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data. If we ignore
the loop back part, the rest can be built upon the existing common serial
API. So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it. This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over. So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 1c9a5606 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

serial: drop useless ctlr field

The multi serial support has a "ctlr" field which almost no one uses,
but everyone is forced to set to useless strings. So punt it.

Funny enough, the only code that actually reads this field (the mpc8xx
driver) has a typo where it meant to look for the SCC driver. Fix it
while converting the check to use the name field.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Marek Vasut <marek.vasut@gmail.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>

# 635f330f 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

Blackfin: uart: add multiple serial support

This brings CONFIG_SERIAL_MULTI support to the Blackfin on-chip UARTs.
Ends up adding only ~512bytes per additional UART.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 2ee36781 27-Jan-2011 Tom Warren <twarren.nvidia@gmail.com>

serial: Add Tegra2 serial port support

Signed-off-by: Tom Warren <twarren@nvidia.com>

# 09b4a9cf 07-Sep-2010 Wolfgang Denk <wd@denx.de>

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


# 889a275d 23-Aug-2010 Minkyu Kang <mk7.kang@samsung.com>

ARMV7: S5P: rename from CONFIG_S5PC1XX to CONFIG_S5P

Use the same configuration around S5P SoCs.
(s5pc100, s5pc110, s5pc210 and so on)

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 6052ac83 09-Aug-2010 Matthias Weisser <weisserm@arcor.de>

ARM: Add support for MB86R0x SoCs

Signed-off-by: Matthias Weisser <weisserm@arcor.de>

# bf16500f 23-Apr-2010 Graeme Russ <graeme.russ@gmail.com>

x86: Use CONFIG_SERIAL_MULTI

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>

# 46a3b5c8 24-Mar-2010 Minkyu Kang <mk7.kang@samsung.com>

SAMSUNG: serial: modify name from s5pc1xx to s5p

Because of other s5p series SoC will use these serial functions,
modify function's name and structure's name.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 8e234e33 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc5121: add PSC serial communication routines

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# e3b28e67 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc512x: add multi serial PSC support

Extend mpc512x serial driver to support multiple PSC ports.

Subsequent patches for PDM360NG board support make use of this
functionality by defining CONFIG_SERIAL_MULTI in the board config
file. Additionally the used PSC devices are specified by defining
e.g. CONFIG_SYS_PSC1, CONFIG_SYS_PSC4 and CONFIG_SYS_PSC6.

Support for PSC devices other than 1, 3, 4 and 6 is not added
by this patch because these aren't used currently. In the future
it can be easily added using DECLARE_PSC_SERIAL_FUNCTIONS(N) and
INIT_PSC_SERIAL_STRUCTURE(N) macros in cpu/mpc512x/serial.c.
Additionally you have to add code for registering added
devices in serial_initialize() in common/serial.c.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# fbb0030e 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

serial: struct serial_device: add uninit() entry for drivers

Subsequent patch extends mpc512x serial driver to support
multiple PSC ports. The driver will provide an uninit()
function to stop the serial controller and to disable the
controller's clock. Adding uninit() entry to struct serial_device
allows disabling the serial controller after usage of
a stdio serial device.

This patch adds uninit() entry to the struct serial_device
and fixes initialization of this structure in the code
accordingly.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# 2ec1abea 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

OMAP3 zoom2 Use usbtty if the debug board is not connected.

The preferred serial output comes from the debug board.
When the debug board is disconnected, fall back on using
usbtty from the usb connector on the Zoom2 board.

This shows up as /dev/ttyACM0 in a linux host.

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6299487e 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

USBTTY make some function declarations easier to use.

Zoom2 needs to use these declarations and the include directory is a
better place from them than in the middle of the driver directory.
It did not make sense to create a new file for just a couple of
lines so they were appended to the serial.h

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# dd2c9e6a 01-Oct-2009 Minkyu Kang <mk7.kang@samsung.com>

s5pc1xx: support serial driver

This patch includes the serial driver for s5pc1xx.
s5pc1xx uart driver needs own register setting and clock configuration.
So, need to special driver.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 52cb4d4f 15-May-2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

stdio/device: rework function naming convention

So far the console API uses the following naming convention:

======Extract======
typedef struct device_t;

int device_register (device_t * dev);
int devices_init (void);
int device_deregister(char *devname);
struct list_head* device_get_list(void);
device_t* device_get_by_name(char* name);
device_t* device_clone(device_t *dev);
=======

which is too generic and confusing.

Instead of using device_XX and device_t we change this
into stdio_XX and stdio_dev

This will also allow to add later a generic device mechanism in order
to have support for multiple devices and driver instances.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Edited commit message.

Signed-off-by: Wolfgang Denk <wd@denx.de>

# 039594a4 02-Jul-2009 Poonam Aggrwal <poonam.aggrwal@freescale.com>

8xxx: Second UART port added for MPC85xx, MPC83xx, MPC86xx processors

Defining the next two configs allows to switch the serial port from the
console using the setenv stdin and stdout
1. #define CONFIG_SERIAL_MULTI 1 /* Enable both serial ports */
2. #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* determine from environment */

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

# 660888b7 30-May-2009 Tom Rix <Tom.Rix@windriver.com>

ZOOM2 Add serial support.

Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board.
The default serial is from the USB connector on left side of the debug board.
The USB connector will produce 2 of the 4 UARTS. On your host pick the first
enumeration.

The details of the setting of the serial gpmc setup are not available.
The values were provided by another party.

The serial port set up is the same with Zoom1.
Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow.

The kernel bootargs are
console=ttyS3,115200n8

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# a7c185ed 19-Dec-2007 Harald Welte <laforge@openmoko.org>

ARM: s3c24xx: Multiple serial port support

This patch adds support for CONFIG_SERIAL_MULTI on s3c24x0 CPU's

Signed-off-by: Harald Welte <laforge@openmoko.org>

# dbbd1257 05-Oct-2007 Stefan Roese <sr@denx.de>

ppc4xx: Add PPC405EX support

Signed-off-by: Stefan Roese <sr@denx.de>

# 80172c61 30-Aug-2007 stefano babic <sbabic@denx.de>

PXA270: Add support for multiple serial ports.

This patch adds support for multiple serial ports to the PXA target.
FFUART, BTUART and STUART are supported.

Signed-off-by: Stefano Babic <sbabic@denx.de>

# 3cb86f3e 24-Mar-2007 Stefan Roese <sr@denx.de>

[PATCH] Clean up 40EZ/Acadia support

This patch cleans up all the open issue of the preliminary
Acadia support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 0fd30252 30-Aug-2006 Wolfgang Denk <wd@pollux.denx.de>

Make the serial driver framework work with CONFIG_SERIAL_MULTI enabled

# c12cffc5 16-Jun-2006 Wolfgang Denk <wd@fifi.denx.de>

Add support for CONFIG_SERIAL_MULTI on MPC5xxx
Patch by Martin Krause, 8 Jun 2006

This patch supports two serial consoles on boards with
a MPC5xxx CPU. The console can be switched at runtime
by setting stdin, stdout and stderr to the desired serial
interface (serial0 or serial1). The PSCs to be used as
console port are definded by CONFIG_PSC_CONSOLE
and CONFIG_PSC_CONSOLE2.
See README.serial_multi for details.

# ff36fd85 09-Jan-2005 wdenk <wdenk>

* Patch by Leif Lindholm, 23 Sep 2004:
add support for the AMD db1550 board

* Patch by Travis Sawyer, 15 Sep 2004:
Add CONFIG_SERIAL_MULTI support for ppc4xx,
update README.serial_multi

# 281e00a3 01-Aug-2004 wdenk <wdenk>

* Code cleanup

* Patch by Sascha Hauer, 28 Jun:
- add generic support for Motorola i.MX architecture
- add support for mx1ads, mx1fs2 and scb9328 boards

* Patches by Marc Leeman, 23 Jul 2004:
- Add define for the PCI/Memory Buffer Configuration Register
- corrected comments in cpu/mpc824x/cpu_init.c

* Add support for multiple serial interfaces
(for example to allow modem dial-in / dial-out)

# eab647d5 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Tidy up header file comments

The getconfig() comment is out of date. Fix this and add comments for
recently added functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# a61cbad7 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getinfo() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 3de04e77 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_setconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 67d1b051 28-Dec-2018 Simon Glass <sjg@chromium.org>

dm: serial: Adjust serial_getconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# 0171f432 28-Dec-2018 Simon Glass <sjg@chromium.org>

serial: Move new functions to serial.h

We should not be adding new functions to common.h. Move these recently
added functions to serial.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

# d5bb4f86 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Introduce ->getinfo() callback

New callback will give a necessary information to fill up ACPI SPCR table,
for example. Maybe used later for other purposes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change ADR_SPACE_SYSTEM_IO to SERIAL_ADDRESS_SPACE_IO to fix build error:
Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7f5db9 20-Nov-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

dm: serial: Add ->getconfig() callback

In some cases it would be good to know the settings, such as parity,
of current serial console. One example might be an ACPI SPCR table
to generate using these parameters.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 42b54013 21-Nov-2018 Christophe Leroy <christophe.leroy@c-s.fr>

drivers: serial: get rid of non DM mpc8xx driver

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

# 0a168687 02-Nov-2018 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

dm: serial: fix comment on dm_serial_ops setconfig

The comment on this function prototype describes nonexistent
parameters. It seems to be copied from 'setparity'.

Update it to match its the parameter list.

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

# d7c09684 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

sandbox: Add serial test

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

# ad060c05 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

dm: serial: Remove setparity ops

setparity users has been updated to use new setconfig ops,
so we can safely remove setparity ops

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

# cbf53883 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

dm: serial: Replace setparity by setconfig

Replace setparity by more generic setconfig ops
to allow uart parity, bits word length and stop bits
number change.

Adds SERIAL_GET_PARITY/BITS/STOP macros.

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>

# 481ea2e3 11-Jul-2018 Tom Rini <trini@konsulko.com>

mips: au1x00: Remove support for these SoCs

The only platform left for the AU1x00 SoCs was the pb1x00 platform, an
apparent clone of the dbau1x00 platform. As pb1x00 had no listed
maintainer I am assuming that it is also orphaned. Remove this platform
and then remove the unused SoC support.

Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# eae4764f 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

dm: serial: Add setparity

Implements serial setparity ops to allow uart parity change.
It allows to select ODD, EVEN or NONE parity.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

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

drivers: serial: remove nonexisting initialisation functions

This patch removes call of serial initialisation functions that
are not implemented anymore.

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

# 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>

# 98f705c9 27-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc: remove 4xx support

There was for long time no activity in the 4xx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in 4xx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# b9f7d881 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xx: remove some "5xx" remains

we removed 5xx support. So delete some forgotten remains.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 9057df88 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 82xx: remove some missed mpc82xx remains

we removed 82xx support. Missed some 82xx remains,
remove them now.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 064b55cf 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512x

There was for long time no activity in the mpx5xxx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in mpc5xxx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>

# 3d16389c 16-May-2016 Lokesh Vutla <lokeshvutla@ti.com>

board: am335x: Allow to choose serial device dynamically

Different AM335x based platforms have different serial consoles. As serial
console is Kconfig option a separate defconfig has to be created for each
platform. So pass the serial device dynamically.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

# 2e2da4c6 08-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

serial: remove altera serial initializations

Both altera_jtag_serial_initialize() and
altera_serial_initialize() are no longer used after
they are converted to driver model.

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

# a2f39e83 23-Feb-2015 Masahiro Yamada <yamada.m@jp.panasonic.com>

ARM: remove cm4008 and cm41xx board support

These are still non-generic boards.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Greg Ungerer <greg.ungerer@opengear.com>
Acked-by: Marek Vasut <marex@denx.de>

# 41fbbbbc 23-Feb-2015 Masahiro Yamada <yamada.m@jp.panasonic.com>

ARM: remove jadecpu board support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Matthias Weisser <weisserm@arcor.de>
Acked-by: Marek Vasut <marex@denx.de>

# 94a255df 27-Oct-2014 Jeroen Hofstee <jeroen@myspectrum.nl>

serial: add prototypes for init functions

While at it, sort them.

Cc: Tom Rini <trini@ti.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

# 57d92753 04-Sep-2014 Simon Glass <sjg@chromium.org>

dm: Add a uclass for serial devices

Serial devices support simple byte input/output and a few operations to find
out whether data is available. Add a basic uclass for serial devices to be
used by drivers that are converted to driver model.

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

# 3fb85889 06-Aug-2013 Matthias Fuchs <matthias.fuchs@esd.eu>

ppc4xx: Remove support for PPC405CR CPUs

This patch removes support for the APM 405CR CPU.
This CPU is EOL and no board uses this chip.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>

# 6d6c0bae 11-Dec-2012 Tom Warren <twarren.nvidia@gmail.com>

Tegra30: Add generic Tegra30 build support

This patch adds basic Tegra30 (T30) build support - no specific
board is targeted.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>

# bfb7d7a3 06-Oct-2012 Marek Vasut <marex@denx.de>

serial: Implement default_serial_puts()

U-Boot contains a lot of duplicit implementations of serial_puts()
call which just pipes single characters into the port in loop. Implement
function that does this behavior into common code, so others can make
easy use of it.

This function is called default_serial_puts() and it's sole purpose
is to call putc() in loop on the whole string passed to it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 036036d7 14-Sep-2012 Marek Vasut <marex@denx.de>

serial: Remove CONFIG_SERIAL_MULTI from remaining sources

Remove the parts depending either on disabled CONFIG_SERIAL_MULTI
or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI
is now enabled by default.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 425101e1 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: zoom2: Remove zoom2 serial prototypes from serial.h

Remove the prototypes for zoom2_serial_deviceN from serial.h . This
can't be done right away, as they are referenced from the zoom2
config file. Therefore, adjust the code so the config file only
specifies number of the port. Then, replace the simple return in
default_serial_console() with a switch across possible values, which
returns the zoom2_serial_deviceN . With such adjustment in place,
the exported prototypes in serial.h can be safely removed.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 5ae1de0d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Adjust serial_register_bfin_uart()

Rename the serial_register_bfin_uart() to bfin_initialize_serial()
to be consistent with the rest of the naming. Next, remove it's
prototype from serial.h and properly insert it into serial.c as
the rest of the serial initialization functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# c513d7e5 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Remove the bfin_serialN_device exports from serial.h

Remove the exports from serial.h as they are only used in the blackfin
serial driver. Furthermore, they are only used for registration, which
is handled already inside that driver and default_serial_port() call,
which is also handled in that driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>

# abc0ed8d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: ns16550: Move serial registration from serial_initialize()

Move the registration of eserialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented ns16550_serial_initialize() function, which is
implemented inside of the ns16550 serial driver allows encapsulation
of eserialN_device within the ns16550 serial driver itself.

Also, remove the exports of eserialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the ns16550 serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Michal Simek <monstr@monstr.eu>

# 918327c8 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: mpc512x: Move serial registration from serial_initialize()

Move the registration of serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented mpc512x_serial_initialize() function, which is
implemented inside of the mpc512x serial driver allows encapsulation
of serialN_device within the mpc512x serial driver itself.

Also, remove the exports of serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the mpx512x serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>

# 87d69229 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: microblaze: Move serial registration from serial_initialize()

Move the registration of xuartlite_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented xuartlite_serial_initialize() function, which is
implemented inside of the serial_xuartlite driver allows encapsulation
of xuartlite_serialN_device within the serial_xuartlite driver itself.

Also, remove the exports of xuartlite_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_xuartlite driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>

# 51d8102f 08-Oct-2012 Tom Rini <trini@ti.com>

serial: zynq: Move serial registration from serial_initialize()

Move the registration of zynq_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented zynq_serial_initialize() function, which is
implemented inside of the serial_zynq driver allows encapsulation
of zynq_serialN_device within the serial_zynq driver itself.

Also, remove the exports of zynq_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_zynq driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

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

# b4980515 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s5p: Move serial registration from serial_initialize()

Move the registration of s5p_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s5p_serial_initialize() function, which is
implemented inside of the serial_s5p driver allows encapsulation
of s5p_serialN_device within the serial_s5p driver itself.

Also, remove the exports of s5p_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s5p driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>

# 1fe5c110 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: pxa: Move serial registration from serial_initialize()

Move the registration of serial_XXuart ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented pxa_serial_initialize() function, which is
implemented inside of the serial_pxa driver allows encapsulation
of serial_XXuart within the serial_pxa driver itself.

Also, remove the exports of serial_XXuart from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_pxa driver and
the default console is picked by CONFIG_CONS_IDX macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 28af6385 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s3c24xx: Move serial registration from serial_initialize()

Move the registration of s3c24xx_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s3c24xx_serial_initialize() function, which is
implemented inside of the serial_s3c24xx driver allows encapsulation
of s3c24xx_serialN_device within the serial_s3c24xx driver itself.

Also, remove the exports of s3c24xx_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s3c24xx driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: C Nauman <cnauman@diagraph.com>

# 89143fb3 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Rename .init() and .uninit() in serial_device

Rename .init() to .start() and .uninit() to .stop() in struct
serial_device. This allows aligning struct serial_device with
closer to struct stdio_dev. The real goal here is to allow
these two structures to converge together and eventually make
one to be a superset of the other.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Tom Rini <trini@ti.com>

# 78322d63 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Coding style cleanup of struct serial_device

Do a simple cleanup of the struct serial_device and align it with
current coding style. Checkpatch now reports no errors.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>

# 194846f3 13-Sep-2012 Michal Simek <monstr@monstr.eu>

serial: Add Zynq serial driver

The driver is used on Xilinx Zynq platform.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Joe Hershberger <joe.hershberger@gmail.com>
CC: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>

# 7636ebe1 01-Jul-2012 Michal Simek <monstr@monstr.eu>

serial: Support serial multi for Microblaze

enable serial multi for Microblaze.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephan Linz <linz@li-pro.net>

# 00a2749d 31-Aug-2012 Allen Martin <amartin@nvidia.com>

tegra20: rename tegra2 -> tegra20

This is make naming consistent with the kernel and devicetree and in
preparation of pulling out the common tegra20 code.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>

# f6add132 10-Nov-2011 Mike Frysinger <vapier@gentoo.org>

net/miiphy/serial: drop duplicate "NAMESIZE" define

A few subsystems are using the same define "NAMESIZE". This has been
working so far because they define it to the same number. However, I
want to change the size of eth_device's NAMESIZE, so rather than tweak
the define names, simply drop references to it. Almost no one does,
and the handful that do can easily be changed to a sizeof().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# ef5a5b00 29-Nov-2011 Gabe Black <gabeblack@chromium.org>

x86: Initial commit for running as a coreboot payload

Add a target for running u-boot as a coreboot payload in boards.cfg, a
board, CPU and a config. This is a skeleton implementation which always
reports the size of memory as 64 MB.

Signed-off-by: Gabe Black <gabeblack@chromium.org>

# 7813ca9b 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: constify serial_assign()

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# a6e6f7f4 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: cosmetic checkpatch compliance

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 49a23e4a 25-Sep-2011 Michal Simek <monstr@monstr.eu>

serial: uartlite: Support for SERIAL_MULTI

Add support for SERIAL MULTI for uartlite.

Signed-off-by: Michal Simek <monstr@monstr.eu>

# 1902692a 02-Aug-2011 Wolfgang Denk <wd@denx.de>

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

* 'master' of git://git.denx.de/u-boot-blackfin:
Blackfin: jtag-console: fix timer usage
Blackfin: switch to common display_options()
Blackfin: serial: move early debug strings into .rodata section
Blackfin: adi boards: also set stderr to nc with helper
Blackfin: update anomaly lists to latest public info
Blackfin: serial: convert to bfin_{read,write} helpers
Blackfin: split out async setup
Blackfin: adi boards: enable pretty flash progress output
Blackfin: drop unused dma.h header from start code
Blackfin: portmux: allow header to be included in assembly files
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: enable mmc_spi support
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings
Blackfin: sync MMR read/write helpers with Linux
Blackfin: gpio: optimize free path a little
Blackfin: post: setup default CONFIG_SYS_POST_WORD_ADDR
Blackfin: uart: fix printf warning
Blackfin: add init.elf helper code
Blackfin: dont reset SWRST on newer bf526 parts
Blackfin: adi boards: enable multi serial support by default
Blackfin: uart: add multiple serial support
Blackfin: uart: move debug buffers into local bss


# 7b826c2f 14-May-2011 Mike Frysinger <vapier@gentoo.org>

serial: implement common uart post test

The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data. If we ignore
the loop back part, the rest can be built upon the existing common serial
API. So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it. This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over. So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 1c9a5606 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

serial: drop useless ctlr field

The multi serial support has a "ctlr" field which almost no one uses,
but everyone is forced to set to useless strings. So punt it.

Funny enough, the only code that actually reads this field (the mpc8xx
driver) has a typo where it meant to look for the SCC driver. Fix it
while converting the check to use the name field.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Marek Vasut <marek.vasut@gmail.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>

# 635f330f 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

Blackfin: uart: add multiple serial support

This brings CONFIG_SERIAL_MULTI support to the Blackfin on-chip UARTs.
Ends up adding only ~512bytes per additional UART.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 2ee36781 27-Jan-2011 Tom Warren <twarren.nvidia@gmail.com>

serial: Add Tegra2 serial port support

Signed-off-by: Tom Warren <twarren@nvidia.com>

# 09b4a9cf 07-Sep-2010 Wolfgang Denk <wd@denx.de>

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


# 889a275d 23-Aug-2010 Minkyu Kang <mk7.kang@samsung.com>

ARMV7: S5P: rename from CONFIG_S5PC1XX to CONFIG_S5P

Use the same configuration around S5P SoCs.
(s5pc100, s5pc110, s5pc210 and so on)

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 6052ac83 09-Aug-2010 Matthias Weisser <weisserm@arcor.de>

ARM: Add support for MB86R0x SoCs

Signed-off-by: Matthias Weisser <weisserm@arcor.de>

# bf16500f 23-Apr-2010 Graeme Russ <graeme.russ@gmail.com>

x86: Use CONFIG_SERIAL_MULTI

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>

# 46a3b5c8 24-Mar-2010 Minkyu Kang <mk7.kang@samsung.com>

SAMSUNG: serial: modify name from s5pc1xx to s5p

Because of other s5p series SoC will use these serial functions,
modify function's name and structure's name.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 8e234e33 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc5121: add PSC serial communication routines

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# e3b28e67 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc512x: add multi serial PSC support

Extend mpc512x serial driver to support multiple PSC ports.

Subsequent patches for PDM360NG board support make use of this
functionality by defining CONFIG_SERIAL_MULTI in the board config
file. Additionally the used PSC devices are specified by defining
e.g. CONFIG_SYS_PSC1, CONFIG_SYS_PSC4 and CONFIG_SYS_PSC6.

Support for PSC devices other than 1, 3, 4 and 6 is not added
by this patch because these aren't used currently. In the future
it can be easily added using DECLARE_PSC_SERIAL_FUNCTIONS(N) and
INIT_PSC_SERIAL_STRUCTURE(N) macros in cpu/mpc512x/serial.c.
Additionally you have to add code for registering added
devices in serial_initialize() in common/serial.c.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# fbb0030e 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

serial: struct serial_device: add uninit() entry for drivers

Subsequent patch extends mpc512x serial driver to support
multiple PSC ports. The driver will provide an uninit()
function to stop the serial controller and to disable the
controller's clock. Adding uninit() entry to struct serial_device
allows disabling the serial controller after usage of
a stdio serial device.

This patch adds uninit() entry to the struct serial_device
and fixes initialization of this structure in the code
accordingly.

Signed-off-by: Anatolij Gustschin <agust@denx.de>

# 2ec1abea 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

OMAP3 zoom2 Use usbtty if the debug board is not connected.

The preferred serial output comes from the debug board.
When the debug board is disconnected, fall back on using
usbtty from the usb connector on the Zoom2 board.

This shows up as /dev/ttyACM0 in a linux host.

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6299487e 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

USBTTY make some function declarations easier to use.

Zoom2 needs to use these declarations and the include directory is a
better place from them than in the middle of the driver directory.
It did not make sense to create a new file for just a couple of
lines so they were appended to the serial.h

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# dd2c9e6a 01-Oct-2009 Minkyu Kang <mk7.kang@samsung.com>

s5pc1xx: support serial driver

This patch includes the serial driver for s5pc1xx.
s5pc1xx uart driver needs own register setting and clock configuration.
So, need to special driver.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

# 52cb4d4f 15-May-2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

stdio/device: rework function naming convention

So far the console API uses the following naming convention:

======Extract======
typedef struct device_t;

int device_register (device_t * dev);
int devices_init (void);
int device_deregister(char *devname);
struct list_head* device_get_list(void);
device_t* device_get_by_name(char* name);
device_t* device_clone(device_t *dev);
=======

which is too generic and confusing.

Instead of using device_XX and device_t we change this
into stdio_XX and stdio_dev

This will also allow to add later a generic device mechanism in order
to have support for multiple devices and driver instances.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Edited commit message.

Signed-off-by: Wolfgang Denk <wd@denx.de>

# 039594a4 02-Jul-2009 Poonam Aggrwal <poonam.aggrwal@freescale.com>

8xxx: Second UART port added for MPC85xx, MPC83xx, MPC86xx processors

Defining the next two configs allows to switch the serial port from the
console using the setenv stdin and stdout
1. #define CONFIG_SERIAL_MULTI 1 /* Enable both serial ports */
2. #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* determine from environment */

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

# 660888b7 30-May-2009 Tom Rix <Tom.Rix@windriver.com>

ZOOM2 Add serial support.

Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board.
The default serial is from the USB connector on left side of the debug board.
The USB connector will produce 2 of the 4 UARTS. On your host pick the first
enumeration.

The details of the setting of the serial gpmc setup are not available.
The values were provided by another party.

The serial port set up is the same with Zoom1.
Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow.

The kernel bootargs are
console=ttyS3,115200n8

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>

# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

# a7c185ed 19-Dec-2007 Harald Welte <laforge@openmoko.org>

ARM: s3c24xx: Multiple serial port support

This patch adds support for CONFIG_SERIAL_MULTI on s3c24x0 CPU's

Signed-off-by: Harald Welte <laforge@openmoko.org>

# dbbd1257 05-Oct-2007 Stefan Roese <sr@denx.de>

ppc4xx: Add PPC405EX support

Signed-off-by: Stefan Roese <sr@denx.de>

# 80172c61 30-Aug-2007 stefano babic <sbabic@denx.de>

PXA270: Add support for multiple serial ports.

This patch adds support for multiple serial ports to the PXA target.
FFUART, BTUART and STUART are supported.

Signed-off-by: Stefano Babic <sbabic@denx.de>

# 3cb86f3e 24-Mar-2007 Stefan Roese <sr@denx.de>

[PATCH] Clean up 40EZ/Acadia support

This patch cleans up all the open issue of the preliminary
Acadia support.

Signed-off-by: Stefan Roese <sr@denx.de>

# 0fd30252 30-Aug-2006 Wolfgang Denk <wd@pollux.denx.de>

Make the serial driver framework work with CONFIG_SERIAL_MULTI enabled

# c12cffc5 16-Jun-2006 Wolfgang Denk <wd@fifi.denx.de>

Add support for CONFIG_SERIAL_MULTI on MPC5xxx
Patch by Martin Krause, 8 Jun 2006

This patch supports two serial consoles on boards with
a MPC5xxx CPU. The console can be switched at runtime
by setting stdin, stdout and stderr to the desired serial
interface (serial0 or serial1). The PSCs to be used as
console port are definded by CONFIG_PSC_CONSOLE
and CONFIG_PSC_CONSOLE2.
See README.serial_multi for details.

# ff36fd85 09-Jan-2005 wdenk <wdenk>

* Patch by Leif Lindholm, 23 Sep 2004:
add support for the AMD db1550 board

* Patch by Travis Sawyer, 15 Sep 2004:
Add CONFIG_SERIAL_MULTI support for ppc4xx,
update README.serial_multi

# 281e00a3 01-Aug-2004 wdenk <wdenk>

* Code cleanup

* Patch by Sascha Hauer, 28 Jun:
- add generic support for Motorola i.MX architecture
- add support for mx1ads, mx1fs2 and scb9328 boards

* Patches by Marc Leeman, 23 Jul 2004:
- Add define for the PCI/Memory Buffer Configuration Register
- corrected comments in cpu/mpc824x/cpu_init.c

* Add support for multiple serial interfaces
(for example to allow modem dial-in / dial-out)

# 0a168687 02-Nov-2018 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

dm: serial: fix comment on dm_serial_ops setconfig

The comment on this function prototype describes nonexistent
parameters. It seems to be copied from 'setparity'.

Update it to match its the parameter list.

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


# d7c09684 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

sandbox: Add serial test

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


# ad060c05 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

dm: serial: Remove setparity ops

setparity users has been updated to use new setconfig ops,
so we can safely remove setparity ops

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


# cbf53883 03-Aug-2018 Patrice Chotard <patrice.chotard@st.com>

dm: serial: Replace setparity by setconfig

Replace setparity by more generic setconfig ops
to allow uart parity, bits word length and stop bits
number change.

Adds SERIAL_GET_PARITY/BITS/STOP macros.

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>


# 481ea2e3 11-Jul-2018 Tom Rini <trini@konsulko.com>

mips: au1x00: Remove support for these SoCs

The only platform left for the AU1x00 SoCs was the pb1x00 platform, an
apparent clone of the dbau1x00 platform. As pb1x00 had no listed
maintainer I am assuming that it is also orphaned. Remove this platform
and then remove the unused SoC support.

Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>


# eae4764f 17-May-2018 Patrick Delaunay <patrick.delaunay@st.com>

dm: serial: Add setparity

Implements serial setparity ops to allow uart parity change.
It allows to select ODD, EVEN or NONE parity.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>


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

drivers: serial: remove nonexisting initialisation functions

This patch removes call of serial initialisation functions that
are not implemented anymore.

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


# 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>


# 98f705c9 27-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc: remove 4xx support

There was for long time no activity in the 4xx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in 4xx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>


# b9f7d881 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xx: remove some "5xx" remains

we removed 5xx support. So delete some forgotten remains.

Signed-off-by: Heiko Schocher <hs@denx.de>


# 9057df88 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 82xx: remove some missed mpc82xx remains

we removed 82xx support. Missed some 82xx remains,
remove them now.

Signed-off-by: Heiko Schocher <hs@denx.de>


# 064b55cf 13-Jun-2017 Heiko Schocher <hs@denx.de>

powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512x

There was for long time no activity in the mpx5xxx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in mpc5xxx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>


# 3d16389c 16-May-2016 Lokesh Vutla <lokeshvutla@ti.com>

board: am335x: Allow to choose serial device dynamically

Different AM335x based platforms have different serial consoles. As serial
console is Kconfig option a separate defconfig has to be created for each
platform. So pass the serial device dynamically.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 2e2da4c6 08-Oct-2015 Thomas Chou <thomas@wytron.com.tw>

serial: remove altera serial initializations

Both altera_jtag_serial_initialize() and
altera_serial_initialize() are no longer used after
they are converted to driver model.

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


# a2f39e83 23-Feb-2015 Masahiro Yamada <yamada.m@jp.panasonic.com>

ARM: remove cm4008 and cm41xx board support

These are still non-generic boards.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Greg Ungerer <greg.ungerer@opengear.com>
Acked-by: Marek Vasut <marex@denx.de>


# 41fbbbbc 23-Feb-2015 Masahiro Yamada <yamada.m@jp.panasonic.com>

ARM: remove jadecpu board support

This is still a non-generic board.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Matthias Weisser <weisserm@arcor.de>
Acked-by: Marek Vasut <marex@denx.de>


# 94a255df 27-Oct-2014 Jeroen Hofstee <jeroen@myspectrum.nl>

serial: add prototypes for init functions

While at it, sort them.

Cc: Tom Rini <trini@ti.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>


# 57d92753 04-Sep-2014 Simon Glass <sjg@chromium.org>

dm: Add a uclass for serial devices

Serial devices support simple byte input/output and a few operations to find
out whether data is available. Add a basic uclass for serial devices to be
used by drivers that are converted to driver model.

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


# 3fb85889 06-Aug-2013 Matthias Fuchs <matthias.fuchs@esd.eu>

ppc4xx: Remove support for PPC405CR CPUs

This patch removes support for the APM 405CR CPU.
This CPU is EOL and no board uses this chip.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>


# 6d6c0bae 11-Dec-2012 Tom Warren <twarren.nvidia@gmail.com>

Tegra30: Add generic Tegra30 build support

This patch adds basic Tegra30 (T30) build support - no specific
board is targeted.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>


# bfb7d7a3 06-Oct-2012 Marek Vasut <marex@denx.de>

serial: Implement default_serial_puts()

U-Boot contains a lot of duplicit implementations of serial_puts()
call which just pipes single characters into the port in loop. Implement
function that does this behavior into common code, so others can make
easy use of it.

This function is called default_serial_puts() and it's sole purpose
is to call putc() in loop on the whole string passed to it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>


# 036036d7 14-Sep-2012 Marek Vasut <marex@denx.de>

serial: Remove CONFIG_SERIAL_MULTI from remaining sources

Remove the parts depending either on disabled CONFIG_SERIAL_MULTI
or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI
is now enabled by default.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>


# 425101e1 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: zoom2: Remove zoom2 serial prototypes from serial.h

Remove the prototypes for zoom2_serial_deviceN from serial.h . This
can't be done right away, as they are referenced from the zoom2
config file. Therefore, adjust the code so the config file only
specifies number of the port. Then, replace the simple return in
default_serial_console() with a switch across possible values, which
returns the zoom2_serial_deviceN . With such adjustment in place,
the exported prototypes in serial.h can be safely removed.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>


# 5ae1de0d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Adjust serial_register_bfin_uart()

Rename the serial_register_bfin_uart() to bfin_initialize_serial()
to be consistent with the rest of the naming. Next, remove it's
prototype from serial.h and properly insert it into serial.c as
the rest of the serial initialization functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>


# c513d7e5 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: bfin: Remove the bfin_serialN_device exports from serial.h

Remove the exports from serial.h as they are only used in the blackfin
serial driver. Furthermore, they are only used for registration, which
is handled already inside that driver and default_serial_port() call,
which is also handled in that driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>


# abc0ed8d 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: ns16550: Move serial registration from serial_initialize()

Move the registration of eserialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented ns16550_serial_initialize() function, which is
implemented inside of the ns16550 serial driver allows encapsulation
of eserialN_device within the ns16550 serial driver itself.

Also, remove the exports of eserialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the ns16550 serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Michal Simek <monstr@monstr.eu>


# 918327c8 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: mpc512x: Move serial registration from serial_initialize()

Move the registration of serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented mpc512x_serial_initialize() function, which is
implemented inside of the mpc512x serial driver allows encapsulation
of serialN_device within the mpc512x serial driver itself.

Also, remove the exports of serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the mpx512x serial driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>


# 87d69229 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: microblaze: Move serial registration from serial_initialize()

Move the registration of xuartlite_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented xuartlite_serial_initialize() function, which is
implemented inside of the serial_xuartlite driver allows encapsulation
of xuartlite_serialN_device within the serial_xuartlite driver itself.

Also, remove the exports of xuartlite_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_xuartlite driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>


# 51d8102f 08-Oct-2012 Tom Rini <trini@ti.com>

serial: zynq: Move serial registration from serial_initialize()

Move the registration of zynq_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented zynq_serial_initialize() function, which is
implemented inside of the serial_zynq driver allows encapsulation
of zynq_serialN_device within the serial_zynq driver itself.

Also, remove the exports of zynq_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_zynq driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

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


# b4980515 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s5p: Move serial registration from serial_initialize()

Move the registration of s5p_serialN_device ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s5p_serial_initialize() function, which is
implemented inside of the serial_s5p driver allows encapsulation
of s5p_serialN_device within the serial_s5p driver itself.

Also, remove the exports of s5p_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s5p driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>


# 1fe5c110 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: pxa: Move serial registration from serial_initialize()

Move the registration of serial_XXuart ports from default
serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented pxa_serial_initialize() function, which is
implemented inside of the serial_pxa driver allows encapsulation
of serial_XXuart within the serial_pxa driver itself.

Also, remove the exports of serial_XXuart from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_pxa driver and
the default console is picked by CONFIG_CONS_IDX macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>


# 28af6385 12-Sep-2012 Marek Vasut <marex@denx.de>

serial: s3c24xx: Move serial registration from serial_initialize()

Move the registration of s3c24xx_serialN_device ports from
default serial_initialize() into driver specific function called from
serial_initialize(). This slims down the serial_initialize() call
to a bare tracker of all possible serial port registration routines
in U-Boot.

The newly implemented s3c24xx_serial_initialize() function, which is
implemented inside of the serial_s3c24xx driver allows encapsulation
of s3c24xx_serialN_device within the serial_s3c24xx driver itself.

Also, remove the exports of s3c24xx_serialN_device from include/serial.h
as they are no longer needed. This is simply because the implementation of
default_serial_console() is wrapped into the serial_s3c24xx driver and
the default console is picked by CONFIG_SERIAL<N> macro in config file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: C Nauman <cnauman@diagraph.com>


# 89143fb3 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Rename .init() and .uninit() in serial_device

Rename .init() to .start() and .uninit() to .stop() in struct
serial_device. This allows aligning struct serial_device with
closer to struct stdio_dev. The real goal here is to allow
these two structures to converge together and eventually make
one to be a superset of the other.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Tom Rini <trini@ti.com>


# 78322d63 07-Sep-2012 Marek Vasut <marex@denx.de>

serial: Coding style cleanup of struct serial_device

Do a simple cleanup of the struct serial_device and align it with
current coding style. Checkpatch now reports no errors.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>


# 194846f3 13-Sep-2012 Michal Simek <monstr@monstr.eu>

serial: Add Zynq serial driver

The driver is used on Xilinx Zynq platform.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Joe Hershberger <joe.hershberger@gmail.com>
CC: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>


# 7636ebe1 01-Jul-2012 Michal Simek <monstr@monstr.eu>

serial: Support serial multi for Microblaze

enable serial multi for Microblaze.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephan Linz <linz@li-pro.net>


# 00a2749d 31-Aug-2012 Allen Martin <amartin@nvidia.com>

tegra20: rename tegra2 -> tegra20

This is make naming consistent with the kernel and devicetree and in
preparation of pulling out the common tegra20 code.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>


# f6add132 10-Nov-2011 Mike Frysinger <vapier@gentoo.org>

net/miiphy/serial: drop duplicate "NAMESIZE" define

A few subsystems are using the same define "NAMESIZE". This has been
working so far because they define it to the same number. However, I
want to change the size of eth_device's NAMESIZE, so rather than tweak
the define names, simply drop references to it. Almost no one does,
and the handful that do can easily be changed to a sizeof().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>


# ef5a5b00 29-Nov-2011 Gabe Black <gabeblack@chromium.org>

x86: Initial commit for running as a coreboot payload

Add a target for running u-boot as a coreboot payload in boards.cfg, a
board, CPU and a config. This is a skeleton implementation which always
reports the size of memory as 64 MB.

Signed-off-by: Gabe Black <gabeblack@chromium.org>


# 7813ca9b 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: constify serial_assign()

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>


# a6e6f7f4 17-Nov-2011 Gerlando Falauto <gerlando.falauto@keymile.com>

serial: cosmetic checkpatch compliance

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>


# 49a23e4a 25-Sep-2011 Michal Simek <monstr@monstr.eu>

serial: uartlite: Support for SERIAL_MULTI

Add support for SERIAL MULTI for uartlite.

Signed-off-by: Michal Simek <monstr@monstr.eu>


# 7b826c2f 14-May-2011 Mike Frysinger <vapier@gentoo.org>

serial: implement common uart post test

The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data. If we ignore
the loop back part, the rest can be built upon the existing common serial
API. So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it. This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over. So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>


# 1c9a5606 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

serial: drop useless ctlr field

The multi serial support has a "ctlr" field which almost no one uses,
but everyone is forced to set to useless strings. So punt it.

Funny enough, the only code that actually reads this field (the mpc8xx
driver) has a typo where it meant to look for the SCC driver. Fix it
while converting the check to use the name field.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Marek Vasut <marek.vasut@gmail.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>


# 635f330f 29-Apr-2011 Mike Frysinger <vapier@gentoo.org>

Blackfin: uart: add multiple serial support

This brings CONFIG_SERIAL_MULTI support to the Blackfin on-chip UARTs.
Ends up adding only ~512bytes per additional UART.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>


# 2ee36781 27-Jan-2011 Tom Warren <twarren.nvidia@gmail.com>

serial: Add Tegra2 serial port support

Signed-off-by: Tom Warren <twarren@nvidia.com>


# 889a275d 23-Aug-2010 Minkyu Kang <mk7.kang@samsung.com>

ARMV7: S5P: rename from CONFIG_S5PC1XX to CONFIG_S5P

Use the same configuration around S5P SoCs.
(s5pc100, s5pc110, s5pc210 and so on)

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>


# 6052ac83 09-Aug-2010 Matthias Weisser <weisserm@arcor.de>

ARM: Add support for MB86R0x SoCs

Signed-off-by: Matthias Weisser <weisserm@arcor.de>


# bf16500f 23-Apr-2010 Graeme Russ <graeme.russ@gmail.com>

x86: Use CONFIG_SERIAL_MULTI

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>


# 46a3b5c8 24-Mar-2010 Minkyu Kang <mk7.kang@samsung.com>

SAMSUNG: serial: modify name from s5pc1xx to s5p

Because of other s5p series SoC will use these serial functions,
modify function's name and structure's name.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>


# 8e234e33 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc5121: add PSC serial communication routines

Signed-off-by: Anatolij Gustschin <agust@denx.de>


# e3b28e67 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

mpc512x: add multi serial PSC support

Extend mpc512x serial driver to support multiple PSC ports.

Subsequent patches for PDM360NG board support make use of this
functionality by defining CONFIG_SERIAL_MULTI in the board config
file. Additionally the used PSC devices are specified by defining
e.g. CONFIG_SYS_PSC1, CONFIG_SYS_PSC4 and CONFIG_SYS_PSC6.

Support for PSC devices other than 1, 3, 4 and 6 is not added
by this patch because these aren't used currently. In the future
it can be easily added using DECLARE_PSC_SERIAL_FUNCTIONS(N) and
INIT_PSC_SERIAL_STRUCTURE(N) macros in cpu/mpc512x/serial.c.
Additionally you have to add code for registering added
devices in serial_initialize() in common/serial.c.

Signed-off-by: Anatolij Gustschin <agust@denx.de>


# fbb0030e 24-Apr-2010 Anatolij Gustschin <agust@denx.de>

serial: struct serial_device: add uninit() entry for drivers

Subsequent patch extends mpc512x serial driver to support
multiple PSC ports. The driver will provide an uninit()
function to stop the serial controller and to disable the
controller's clock. Adding uninit() entry to struct serial_device
allows disabling the serial controller after usage of
a stdio serial device.

This patch adds uninit() entry to the struct serial_device
and fixes initialization of this structure in the code
accordingly.

Signed-off-by: Anatolij Gustschin <agust@denx.de>


# 5aa02e4d 24-Mar-2010 Minkyu Kang <mk7.kang@samsung.com>

SAMSUNG: serial: modify name from s5pc1xx to s5p

Because of other s5p series SoC will use these serial functions,
modify function's name and structure's name.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>


# 0f1f21a3 24-Mar-2010 Minkyu Kang <mk7.kang@samsung.com>

SAMSUNG: serial: modify name from s5pc1xx to s5p

Because of other s5p series SoC will use these serial functions,
modify function's name and structure's name.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>


# 2ec1abea 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

OMAP3 zoom2 Use usbtty if the debug board is not connected.

The preferred serial output comes from the debug board.
When the debug board is disconnected, fall back on using
usbtty from the usb connector on the Zoom2 board.

This shows up as /dev/ttyACM0 in a linux host.

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>


# 6299487e 30-Oct-2009 Tom Rix <Tom.Rix@windriver.com>

USBTTY make some function declarations easier to use.

Zoom2 needs to use these declarations and the include directory is a
better place from them than in the middle of the driver directory.
It did not make sense to create a new file for just a couple of
lines so they were appended to the serial.h

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>


# dd2c9e6a 01-Oct-2009 Minkyu Kang <mk7.kang@samsung.com>

s5pc1xx: support serial driver

This patch includes the serial driver for s5pc1xx.
s5pc1xx uart driver needs own register setting and clock configuration.
So, need to special driver.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>


# 70746350 01-Oct-2009 Minkyu Kang <mk7.kang@samsung.com>

s5pc1xx: support serial driver

This patch includes the serial driver for s5pc1xx.
s5pc1xx uart driver needs own register setting and clock configuration.
So, need to special driver.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>


# 52cb4d4f 15-May-2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

stdio/device: rework function naming convention

So far the console API uses the following naming convention:

======Extract======
typedef struct device_t;

int device_register (device_t * dev);
int devices_init (void);
int device_deregister(char *devname);
struct list_head* device_get_list(void);
device_t* device_get_by_name(char* name);
device_t* device_clone(device_t *dev);
=======

which is too generic and confusing.

Instead of using device_XX and device_t we change this
into stdio_XX and stdio_dev

This will also allow to add later a generic device mechanism in order
to have support for multiple devices and driver instances.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Edited commit message.

Signed-off-by: Wolfgang Denk <wd@denx.de>


# 039594a4 02-Jul-2009 Poonam Aggrwal <poonam.aggrwal@freescale.com>

8xxx: Second UART port added for MPC85xx, MPC83xx, MPC86xx processors

Defining the next two configs allows to switch the serial port from the
console using the setenv stdin and stdout
1. #define CONFIG_SERIAL_MULTI 1 /* Enable both serial ports */
2. #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* determine from environment */

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# 660888b7 30-May-2009 Tom Rix <Tom.Rix@windriver.com>

ZOOM2 Add serial support.

Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board.
The default serial is from the USB connector on left side of the debug board.
The USB connector will produce 2 of the 4 UARTS. On your host pick the first
enumeration.

The details of the setting of the serial gpmc setup are not available.
The values were provided by another party.

The serial port set up is the same with Zoom1.
Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow.

The kernel bootargs are
console=ttyS3,115200n8

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>


# 6d0f6bcf 16-Oct-2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>


# a7c185ed 19-Dec-2007 Harald Welte <laforge@openmoko.org>

ARM: s3c24xx: Multiple serial port support

This patch adds support for CONFIG_SERIAL_MULTI on s3c24x0 CPU's

Signed-off-by: Harald Welte <laforge@openmoko.org>


# dbbd1257 05-Oct-2007 Stefan Roese <sr@denx.de>

ppc4xx: Add PPC405EX support

Signed-off-by: Stefan Roese <sr@denx.de>


# 80172c61 30-Aug-2007 stefano babic <sbabic@denx.de>

PXA270: Add support for multiple serial ports.

This patch adds support for multiple serial ports to the PXA target.
FFUART, BTUART and STUART are supported.

Signed-off-by: Stefano Babic <sbabic@denx.de>


# 3cb86f3e 24-Mar-2007 Stefan Roese <sr@denx.de>

[PATCH] Clean up 40EZ/Acadia support

This patch cleans up all the open issue of the preliminary
Acadia support.

Signed-off-by: Stefan Roese <sr@denx.de>


# 0fd30252 30-Aug-2006 Wolfgang Denk <wd@pollux.denx.de>

Make the serial driver framework work with CONFIG_SERIAL_MULTI enabled


# c12cffc5 16-Jun-2006 Wolfgang Denk <wd@fifi.denx.de>

Add support for CONFIG_SERIAL_MULTI on MPC5xxx
Patch by Martin Krause, 8 Jun 2006

This patch supports two serial consoles on boards with
a MPC5xxx CPU. The console can be switched at runtime
by setting stdin, stdout and stderr to the desired serial
interface (serial0 or serial1). The PSCs to be used as
console port are definded by CONFIG_PSC_CONSOLE
and CONFIG_PSC_CONSOLE2.
See README.serial_multi for details.


# ff36fd85 09-Jan-2005 wdenk <wdenk>

* Patch by Leif Lindholm, 23 Sep 2004:
add support for the AMD db1550 board

* Patch by Travis Sawyer, 15 Sep 2004:
Add CONFIG_SERIAL_MULTI support for ppc4xx,
update README.serial_multi


# 281e00a3 01-Aug-2004 wdenk <wdenk>

* Code cleanup

* Patch by Sascha Hauer, 28 Jun:
- add generic support for Motorola i.MX architecture
- add support for mx1ads, mx1fs2 and scb9328 boards

* Patches by Marc Leeman, 23 Jul 2004:
- Add define for the PCI/Memory Buffer Configuration Register
- corrected comments in cpu/mpc824x/cpu_init.c

* Add support for multiple serial interfaces
(for example to allow modem dial-in / dial-out)