History log of /u-boot/include/iomux.h
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 9dc775aa 06-Apr-2022 Sean Anderson <seanga2@gmail.com>

IOMUX: Fix access past end of console_devices

We should only access console_devices[file][i] once we have checked that i
< cd_count[file]. Otherwise, we will access uninitialized memory at the end
of the loop. console_devices[file][i] should not be NULL, but putting the
assignment in the loop condition allows us to ensure that i is checked
beforehand. This isn't a bug, but it does make valgrind stop complaining.

Fixes: 400797cad3 ("IOMUX: Split out for_each_console_dev() helper macro")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Andrew Scull <ascull@google.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

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

# 1a459660 08-Jul-2013 Wolfgang Denk <wd@denx.de>

Add GPL-2.0+ SPDX-License-Identifier to source files

Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>

# d7be3056 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

stdio: constify "name" arg in public api

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

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

# 16a28ef2 06-Nov-2008 Gary Jennejohn <garyj@denx.de>

IOMUX: Add console multiplexing support.

Modifications to support console multiplexing. This is controlled using
CONFIG_SYS_CONSOLE_MUX in the board configuration file.

This allows a user to specify multiple console devices in the environment
with a command like this: setenv stdin serial,nc. As a result, the user can
enter text on both the serial and netconsole interfaces.

All devices - stdin, stdout and stderr - can be set in this manner.

1) common/iomux.c and include/iomux.h contain the environment setting
implementation.
2) doc/README.iomux contains a somewhat more detailed description.
3) The implementation in (1) is called from common/cmd_nvedit.c to
handle setenv and from common/console.c to handle initialization of
input/output devices at boot time.
4) common/console.c also contains the code needed to poll multiple console
devices for input and send output to all devices registered for output.
5) include/common.h includes iomux.h and common/Makefile generates iomux.o
when CONFIG_SYS_CONSOLE_MUX is set.

Signed-off-by: Gary Jennejohn <garyj@denx.de>

# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 694cd561 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Introduce iomux_replace_device()

Some console devices may appear or disappear at run time. In order to
support such a hotplug mechanism introduce a new iomux_replace_device()
helper to update the list of devices without altering environment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 400797ca 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out for_each_console_dev() helper macro

It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# b672c161 11-Feb-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

IOMUX: Split out iomux_match_device() helper

Deduplicate the code used in a few places by splitting out a common helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# e645b9bd 21-Dec-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

console: move search_device() from iomux.h to console.h

search_device() is defined in console.c. Move its declaration
to an appropriate header file.

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


# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

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


# 1a459660 08-Jul-2013 Wolfgang Denk <wd@denx.de>

Add GPL-2.0+ SPDX-License-Identifier to source files

Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>


# 32ff4b7f 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

stdio: constify "name" arg in public api

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


# d7be3056 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

stdio: constify "name" arg in public api

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


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


# 16a28ef2 06-Nov-2008 Gary Jennejohn <garyj@denx.de>

IOMUX: Add console multiplexing support.

Modifications to support console multiplexing. This is controlled using
CONFIG_SYS_CONSOLE_MUX in the board configuration file.

This allows a user to specify multiple console devices in the environment
with a command like this: setenv stdin serial,nc. As a result, the user can
enter text on both the serial and netconsole interfaces.

All devices - stdin, stdout and stderr - can be set in this manner.

1) common/iomux.c and include/iomux.h contain the environment setting
implementation.
2) doc/README.iomux contains a somewhat more detailed description.
3) The implementation in (1) is called from common/cmd_nvedit.c to
handle setenv and from common/console.c to handle initialization of
input/output devices at boot time.
4) common/console.c also contains the code needed to poll multiple console
devices for input and send output to all devices registered for output.
5) include/common.h includes iomux.h and common/Makefile generates iomux.o
when CONFIG_SYS_CONSOLE_MUX is set.

Signed-off-by: Gary Jennejohn <garyj@denx.de>