public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Gary Jennejohn <garyj@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] IOMUX: Add console multiplexing support.
Date: Sun, 14 Sep 2008 16:45:30 +0200	[thread overview]
Message-ID: <20080914164530.0a59c6ca@peedub.jennejohn.org> (raw)


Since this patch touches net/eth.c it is being sent separately.

When CONFIG_IO_MUX, CONFIG_NETCONSOLE and CFG_CONSOLE_IS_IN_ENV are all
defined together it is possible that nc (netconsole) is defined as an
output device.  In this case it is necessary to set GD_FLG_DEVINIT
after the network devices have been initialized, otherwise u-boot
might try to send output to a device before it is ready, which leads
to various errors.

Signed-off-by: Gary Jennejohn <garyj@denx.de>
---
 net/eth.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/net/eth.c b/net/eth.c
index 432dd60..94b6e3a 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -26,6 +26,11 @@
 #include <net.h>
 #include <miiphy.h>
 
+#if defined(CONFIG_IO_MUX) && defined(CONFIG_NETCONSOLE) && \
+	defined(CFG_CONSOLE_IS_IN_ENV)
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 #if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)
 
 /*
@@ -256,6 +261,15 @@ int eth_initialize(bd_t *bis)
 		putc ('\n');
 	}
 
+#if defined(CONFIG_IO_MUX) && defined(CONFIG_NETCONSOLE) && \
+	defined(CFG_CONSOLE_IS_IN_ENV)
+	/*
+	 * Must do this very late because a network device may be set as a
+	 * console at boot time.
+	 */
+	gd->flags |= GD_FLG_DEVINIT;	/* device initialization completed */
+#endif
+
 	return eth_number;
 }
 
@@ -532,6 +546,16 @@ int eth_initialize(bd_t *bis)
 #if defined(CONFIG_DRIVER_TI_EMAC)
 	davinci_eth_miiphy_initialize(bis);
 #endif
+
+#if defined(CONFIG_IO_MUX) && defined(CONFIG_NETCONSOLE) && \
+	defined(CFG_CONSOLE_IS_IN_ENV)
+	/*
+	 * Must do this very late because a network device may be set as a
+	 * console at boot time.
+	 */
+	gd->flags |= GD_FLG_DEVINIT;	/* device initialization completed */
+#endif
+
 	return 0;
 }
 #endif
-- 
1.5.4.3


---
Gary Jennejohn
*********************************************************************
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
*********************************************************************

             reply	other threads:[~2008-09-14 14:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-14 14:45 Gary Jennejohn [this message]
2008-09-14 16:07 ` [U-Boot] [PATCH 2/2] IOMUX: Add console multiplexing support Wolfgang Denk
2008-09-14 17:19   ` Gary Jennejohn
2008-09-14 18:34     ` Wolfgang Denk
2008-09-15  8:46       ` Gary Jennejohn
2008-09-15 11:08         ` Wolfgang Denk
2008-10-20 11:58 ` [U-Boot] [PATCH 2/2 V2] " Gary Jennejohn
2008-10-20 13:24   ` Wolfgang Denk
2008-10-20 13:57     ` Gary Jennejohn
2008-10-20 16:26       ` Gary Jennejohn
2008-10-20 19:43         ` Wolfgang Denk
2008-10-20 20:13           ` Ben Warren
2008-10-21  9:45             ` Gary Jennejohn
2008-10-21 10:34               ` Wolfgang Denk
2008-10-21 11:32                 ` Gary Jennejohn
2008-10-20 19:32       ` Wolfgang Denk

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=20080914164530.0a59c6ca@peedub.jennejohn.org \
    --to=garyj@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox