diff mbox

[U-Boot] README: Fix how to for serial console when CONFIG_CFB_CONSOLE is defined

Message ID 1336593952-5808-1-git-send-email-fabio.estevam@freescale.com
State Rejected
Headers show

Commit Message

Fabio Estevam May 9, 2012, 8:05 p.m. UTC
Fix how to force serial console when CONFIG_CFB_CONSOLE is defined.

Tested on a mx51evk board.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 README |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

Wolfgang Denk May 20, 2012, 7:13 p.m. UTC | #1
Dear Fabio Estevam,

In message <1336593952-5808-1-git-send-email-fabio.estevam@freescale.com> you wrote:
> Fix how to force serial console when CONFIG_CFB_CONSOLE is defined.
> 
> Tested on a mx51evk board.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  README |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/README b/README
> index 79016e6..9fc4618 100644
> --- a/README
> +++ b/README
> @@ -615,7 +615,8 @@ The following options need to be configured:
>  
>  		When CONFIG_CFB_CONSOLE is defined, video console is
>  		default i/o. Serial console can be forced with
> -		environment 'console=serial'.
> +		by placing 'setenv("stdout", "serial");' inside
> +		board_late_init().
>  
>  		When CONFIG_SILENT_CONSOLE is defined, all console
>  		messages (by U-Boot and Linux!) can be silenced with

I think it is actually a pretty bad idea to do this.

One pretty basic rule in U-Boot is not to forcibly mess with
environment variable settings that affect operation of U-Boot when the
user might want to do things differently - otherwise we could as well
hard-code behaviour in the first place.

In this situation, no code is needed to perform such an operation.  If
you want to do this, just enable the PREBOOT feature and define a
default "preboot" command as "setenv stdout serial".  THe effect is
the same, but now the user still has a chance to change behavious as
he deems fit.

Best regards,

Wolfgang Denk
Fabio Estevam May 21, 2012, 2:23 p.m. UTC | #2
Hi Wolfgang,

On Sun, May 20, 2012 at 4:13 PM, Wolfgang Denk <wd@denx.de> wrote:

> In this situation, no code is needed to perform such an operation.  If
> you want to do this, just enable the PREBOOT feature and define a
> default "preboot" command as "setenv stdout serial".  THe effect is
> the same, but now the user still has a chance to change behavious as
> he deems fit.

I tried the "no code" approach initially (following the README) and it
did not allow me to redirect the console output to serial port.

Only when I placed 'setenv("stdout", "serial");' inside
board_late_init() worked for me.

Regards,

Fabio Estevam
Wolfgang Denk May 21, 2012, 7:01 p.m. UTC | #3
Dear Fabio Estevam,

In message <CAOMZO5AieZMn1d0LiE6Kd3o8KdHxE1_s80REqzAXyCcQWtGJEA@mail.gmail.com> you wrote:
> 
> I tried the "no code" approach initially (following the README) and it
> did not allow me to redirect the console output to serial port.

Did you try the approach I just described?  I have used this for many
years on several boards (although I did not test it recently).

Best regards,

Wolfgang Denk
diff mbox

Patch

diff --git a/README b/README
index 79016e6..9fc4618 100644
--- a/README
+++ b/README
@@ -615,7 +615,8 @@  The following options need to be configured:
 
 		When CONFIG_CFB_CONSOLE is defined, video console is
 		default i/o. Serial console can be forced with
-		environment 'console=serial'.
+		by placing 'setenv("stdout", "serial");' inside
+		board_late_init().
 
 		When CONFIG_SILENT_CONSOLE is defined, all console
 		messages (by U-Boot and Linux!) can be silenced with