diff mbox

[U-Boot] ls102xa: dm: serial: Disable CONFIG_DM_STDIO for LCD/HDMI display

Message ID 1456823217-11084-1-git-send-email-b18965@freescale.com
State Rejected
Delegated to: York Sun
Headers show

Commit Message

Alison Wang March 1, 2016, 9:06 a.m. UTC
When LCD/HDMI is connected to LS1021ATWR or LS1021AQDS, the console
output should be shown on the monitor.

If CONFIG_DM_SERIAL and CONFIG_DM_STDIO are both enabled, serial device
is registered and added to the stdio list in serial-uclass.c. Then, vga
device will be registered and added to the stdio list in cfb_console.c.
So serial device is at the head of the stdio list and will be chosen as
the input and output device in console_init_r(). It will cause the
console output can't be shown on the monitor.

If CONFIG_DM_STDIO is disabled when using CONFIG_DM_SERIAL. First, vga
device is registered and added to the stdio list in cfb_console.c. Then
serial device will be registered and added to the stdio list in
drv_system_init(). So vga device is at the head of the stdio list and
will be chosen as the input and output device in console_init_r(). The
console output will be shown on the monitor.

The patch is to disabled CONFIG_DM_STDIO for LCD/HDMI display.

Signed-off-by: Alison Wang <alison.wang@nxp.com>
---
 include/configs/ls1021aqds.h | 4 ++++
 include/configs/ls1021atwr.h | 4 ++++
 2 files changed, 8 insertions(+)

Comments

Simon Glass March 13, 2016, 1:54 a.m. UTC | #1
Hi Alison,

On 1 March 2016 at 02:06, Alison Wang <b18965@freescale.com> wrote:
> When LCD/HDMI is connected to LS1021ATWR or LS1021AQDS, the console
> output should be shown on the monitor.
>
> If CONFIG_DM_SERIAL and CONFIG_DM_STDIO are both enabled, serial device
> is registered and added to the stdio list in serial-uclass.c. Then, vga
> device will be registered and added to the stdio list in cfb_console.c.
> So serial device is at the head of the stdio list and will be chosen as
> the input and output device in console_init_r(). It will cause the
> console output can't be shown on the monitor.
>
> If CONFIG_DM_STDIO is disabled when using CONFIG_DM_SERIAL. First, vga
> device is registered and added to the stdio list in cfb_console.c. Then
> serial device will be registered and added to the stdio list in
> drv_system_init(). So vga device is at the head of the stdio list and
> will be chosen as the input and output device in console_init_r(). The
> console output will be shown on the monitor.
>
> The patch is to disabled CONFIG_DM_STDIO for LCD/HDMI display.
>
> Signed-off-by: Alison Wang <alison.wang@nxp.com>

Have you tried enabling CONFIG_CONSOLE_MUX?

> ---
>  include/configs/ls1021aqds.h | 4 ++++
>  include/configs/ls1021atwr.h | 4 ++++
>  2 files changed, 8 insertions(+)
>

[snip]

Regards,
Simon
Alison Wang March 14, 2016, 2:33 a.m. UTC | #2
Hi, Simon,

> On 1 March 2016 at 02:06, Alison Wang <b18965@freescale.com> wrote:
> > When LCD/HDMI is connected to LS1021ATWR or LS1021AQDS, the console
> > output should be shown on the monitor.
> >
> > If CONFIG_DM_SERIAL and CONFIG_DM_STDIO are both enabled, serial
> > device is registered and added to the stdio list in serial-uclass.c.
> > Then, vga device will be registered and added to the stdio list in
> cfb_console.c.
> > So serial device is at the head of the stdio list and will be chosen
> > as the input and output device in console_init_r(). It will cause the
> > console output can't be shown on the monitor.
> >
> > If CONFIG_DM_STDIO is disabled when using CONFIG_DM_SERIAL. First, vga
> > device is registered and added to the stdio list in cfb_console.c.
> > Then serial device will be registered and added to the stdio list in
> > drv_system_init(). So vga device is at the head of the stdio list and
> > will be chosen as the input and output device in console_init_r(). The
> > console output will be shown on the monitor.
> >
> > The patch is to disabled CONFIG_DM_STDIO for LCD/HDMI display.
> >
> > Signed-off-by: Alison Wang <alison.wang@nxp.com>
> 
> Have you tried enabling CONFIG_CONSOLE_MUX?
> 
[Alison Wang] Thanks for your advice. I got your idea, and tried to
enable CONFIG_CONSOLE_MUX and CONFIG_SYS_CONSOLE_IS_IN_ENV. Then after
setting "stdout=serial,vga", the console output is both shown on monitor
and serial terminal.

This patch is not a good way to fix the problem, please abandon it. Enabling
CONFIG_SYS_CONSOLE_IS_IN_ENV is the best way to fix the problem, and Enabling
CONFIG_CONSOLE_MUX could be used to shown the console output on multiple
devices simultaneously.


Best Regards,
Alison Wang
diff mbox

Patch

diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
index ff5ca22..fbb1f46 100644
--- a/include/configs/ls1021aqds.h
+++ b/include/configs/ls1021aqds.h
@@ -384,6 +384,10 @@  unsigned long get_board_ddr_clk(void);
 
 #define CONFIG_BAUDRATE			115200
 
+#ifdef CONFIG_DM_SERIAL
+#undef CONFIG_DM_STDIO
+#endif
+
 /*
  * I2C
  */
diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index 166061d..9054774 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -280,6 +280,10 @@ 
 
 #define CONFIG_BAUDRATE			115200
 
+#ifdef CONFIG_DM_SERIAL
+#undef CONFIG_DM_STDIO
+#endif
+
 /*
  * I2C
  */