linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* INTERACTIVE_CONSOLE for misc-embedded.c and watchdog issue
@ 2005-11-17 15:17 Marcelo Tosatti
  2005-11-28 23:27 ` Tom Rini
  0 siblings, 1 reply; 3+ messages in thread
From: Marcelo Tosatti @ 2005-11-17 15:17 UTC (permalink / raw)
  To: Tom Rini; +Cc: linux-ppc-embedded



Hi Tom,

The following patch against misc-embedded.c adds an INTERACTIVE_CONSOLE
#define to guard reading from console (causes unecessary delay in some
situations).

Its an adaptation of misc.c's define, a difference being that platform
headers define "NO_INTERACTIVE_CONSOLE" if required.

What do you think?

Another issue is the watchdog - if it is active all 8xx systems
should fail to boot because load_kernel() (and the gzip functions)
don't calm the dog.

Our internal kernels always have sprinkled "service_wdt()" calls
around "load_kernel()".

Adding hooks for the wdt to be service there (and possibly other places)
is terrible, but is there any other solution so early?

Setting up a HW timer with early setup code might be possible, 
but sounds quite complicated.

Of course, with U-Boot all of this is a non-issue, but for simple
bootloaders (which I suppose are quite common) it is a nasty problem.


diff --git a/arch/ppc/boot/simple/misc-embedded.c b/arch/ppc/boot/simple/misc-embedded.c
index 3865f3f..85e3e24 100644
--- a/arch/ppc/boot/simple/misc-embedded.c
+++ b/arch/ppc/boot/simple/misc-embedded.c
@@ -23,6 +23,10 @@
 
 #include "nonstdio.h"
 
+#ifndef NO_INTERACTIVE_CONSOLE
+#define INTERACTIVE_CONSOLE
+#endif
+
 /* The linker tells us where the image is. */
 extern char __image_begin, __image_end;
 extern char __ramdisk_begin, __ramdisk_end;
@@ -82,8 +86,11 @@ embed_config(bd_t **bdp)
 unsigned long
 load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *bp)
 {
+#ifdef INTERACTIVE_CONSOLE
 	char *cp, ch;
-	int timer = 0, zimage_size;
+	int timer = 0;
+#endif
+	int zimage_size;
 	unsigned long initrd_size;
 
 	/* First, capture the embedded board information.  Then
@@ -187,6 +194,8 @@ load_kernel(unsigned long load_addr, int
 #endif
 	while ( *cp )
 		putc(*cp++);
+
+#ifdef INTERACTIVE_CONSOLE
 	while (timer++ < 5*1000) {
 		if (tstc()) {
 			while ((ch = getc()) != '\n' && ch != '\r') {
@@ -211,6 +220,7 @@ load_kernel(unsigned long load_addr, int
 		udelay(1000);  /* 1 msec */
 	}
 	*cp = 0;
+#endif
 	puts("\nUncompressing Linux...");
 
 	gunzip(0, 0x400000, zimage_start, &zimage_size);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: INTERACTIVE_CONSOLE for misc-embedded.c and watchdog issue
  2005-11-17 15:17 INTERACTIVE_CONSOLE for misc-embedded.c and watchdog issue Marcelo Tosatti
@ 2005-11-28 23:27 ` Tom Rini
  2005-12-02 18:24   ` Marcelo Tosatti
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Rini @ 2005-11-28 23:27 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: linux-ppc-embedded

On Thu, Nov 17, 2005 at 01:17:30PM -0200, Marcelo Tosatti wrote:

> The following patch against misc-embedded.c adds an INTERACTIVE_CONSOLE
> #define to guard reading from console (causes unecessary delay in some
> situations).
> 
> Its an adaptation of misc.c's define, a difference being that platform
> headers define "NO_INTERACTIVE_CONSOLE" if required.
> 
> What do you think?

Please put a comment above the #ifndef stating where the define should
be.  But I have a feeling that's going to be somewhere under
arch/ppc/platforms/ or include/asm-ppc/ and I don't know if that's a
good idea...

I've got a vauge idea on how we can handle this a little bit more
cleanly, in the merge tree.

-- 
Tom Rini
http://gate.crashing.org/~trini/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: INTERACTIVE_CONSOLE for misc-embedded.c and watchdog issue
  2005-11-28 23:27 ` Tom Rini
@ 2005-12-02 18:24   ` Marcelo Tosatti
  0 siblings, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2005-12-02 18:24 UTC (permalink / raw)
  To: Tom Rini; +Cc: linux-ppc-embedded

Hi Tom,

On Mon, Nov 28, 2005 at 04:27:38PM -0700, Tom Rini wrote:
> On Thu, Nov 17, 2005 at 01:17:30PM -0200, Marcelo Tosatti wrote:
> 
> > The following patch against misc-embedded.c adds an INTERACTIVE_CONSOLE
> > #define to guard reading from console (causes unecessary delay in some
> > situations).
> > 
> > Its an adaptation of misc.c's define, a difference being that platform
> > headers define "NO_INTERACTIVE_CONSOLE" if required.
> > 
> > What do you think?
> 
> Please put a comment above the #ifndef stating where the define should
> be.  But I have a feeling that's going to be somewhere under
> arch/ppc/platforms/ or include/asm-ppc/ and I don't know if that's a
> good idea...

arch/ppc/platforms/ surely. You have a problem with that?

> I've got a vauge idea on how we can handle this a little bit more
> cleanly, in the merge tree.

How's that? Should I cancel the patch, then? 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-12-02 18:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-17 15:17 INTERACTIVE_CONSOLE for misc-embedded.c and watchdog issue Marcelo Tosatti
2005-11-28 23:27 ` Tom Rini
2005-12-02 18:24   ` Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).