From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] serial: add environment control for SERIAL_MULTI
Date: Fri, 26 Oct 2012 00:29:07 +0200 [thread overview]
Message-ID: <201210260029.07853.marex@denx.de> (raw)
In-Reply-To: <1351202390-11415-1-git-send-email-amartin@nvidia.com>
Dear Allen Martin,
> Add a new special environment variable "serial" that allows selection
> of serial device when CONFIG_SERIAL_MULTI is defined. This replaces
> the existing calls to serial_assign() from cmd_nvedit.c and iomux.c
> that were not doing anything.
>
> Signed-off-by: Allen Martin <amartin@nvidia.com>
> ---
> common/cmd_nvedit.c | 7 ++++++-
> common/iomux.c | 10 ----------
> doc/driver-model/UDM-serial.txt | 5 +++--
> 3 files changed, 9 insertions(+), 13 deletions(-)
>
> diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
> index 1f9c674..d1ee07d 100644
> --- a/common/cmd_nvedit.c
> +++ b/common/cmd_nvedit.c
> @@ -238,11 +238,16 @@ int env_check_apply(const char *name, const char
> *oldval, /* Try assigning specified device */
> if (console_assign(console, newval) < 0)
> return 1;
> +#endif /* CONFIG_CONSOLE_MUX */
> + }
>
> +#ifdef CONFIG_SERIAL_MULTI
Drop this, it's default. There's no CONFIG_SERIAL_MULTI in the tree at all
anymore.
> + /* Check for serial redirection */
> + if (strcmp(name, "serial") == 0) {
> if (serial_assign(newval) < 0)
> return 1;
> -#endif /* CONFIG_CONSOLE_MUX */
> }
> +#endif /* CONFIG_SERIAL_MULTI */
>
> /*
> * Some variables like "ethaddr" and "serial#" can be set only once and
> diff --git a/common/iomux.c b/common/iomux.c
> index dbc2312..6a75704 100644
> --- a/common/iomux.c
> +++ b/common/iomux.c
> @@ -135,16 +135,6 @@ int iomux_doenv(const int console, const char *arg)
> */
> if (console_assign(console, start[j]) < 0)
> continue;
> - /*
> - * This was taken from common/cmd_nvedit.c.
> - * This will never work because serial_assign() returns
> - * 1 upon error, not -1.
> - * This would almost always return an error anyway because
> - * serial_assign() expects the name of a serial device, like
> - * serial_smc, but the user generally only wants to set serial.
> - */
> - if (serial_assign(start[j]) < 0)
> - continue;
> cons_set[cs_idx++] = dev;
> }
> free(console_args);
> diff --git a/doc/driver-model/UDM-serial.txt
> b/doc/driver-model/UDM-serial.txt index 9feb2e5..66f3e6b 100644
> --- a/doc/driver-model/UDM-serial.txt
> +++ b/doc/driver-model/UDM-serial.txt
> @@ -26,8 +26,9 @@ and serial_setbrg() are often called from
> platform-dependent places. It's important to consider current
> implementation of CONFIG_SERIAL_MULTI though. This resides in
> common/serial.c and behaves as a multiplexer for serial ports. This, by
> calling serial_assign(), allows user to switch I/O from one serial port
> -to another. Though the environmental variables "stdin", "stdout",
> "stderr" -remain set to "serial".
> +to another. The environment variable "serial" is used to select which of
> the +serial ports is the currently active port. The environmental
> variables +"stdin", "stdout", "stderr" remain set to "serial".
>
> These variables are managed by the IOMUX. This resides in common/iomux.c
> and manages all console input/output from U-Boot. For serial port, only
> one IOMUX is
Best regards,
Marek Vasut
next prev parent reply other threads:[~2012-10-25 22:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-25 21:59 [U-Boot] [PATCH] serial: add environment control for SERIAL_MULTI Allen Martin
2012-10-25 22:29 ` Marek Vasut [this message]
2012-10-25 22:36 ` Tom Rini
2012-10-25 22:36 ` Joe Hershberger
2012-10-25 22:45 ` Stephen Warren
2012-10-25 22:47 ` Joe Hershberger
2012-10-25 22:53 ` Allen Martin
2012-10-25 23:18 ` Joe Hershberger
2012-10-25 23:21 ` Allen Martin
2012-10-25 22:43 ` Stephen Warren
2012-10-25 22:46 ` Joe Hershberger
2012-10-25 22:50 ` Allen Martin
2012-10-25 23:17 ` Joe Hershberger
2012-10-26 10:27 ` Marek Vasut
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201210260029.07853.marex@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.