public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo.tosatti@cyclades•com>
To: Tom Rini <trini@kernel•crashing.org>
Cc: linux-ppc-embedded <linuxppc-embedded@ozlabs•org>
Subject: INTERACTIVE_CONSOLE for misc-embedded.c and watchdog issue
Date: Thu, 17 Nov 2005 13:17:30 -0200	[thread overview]
Message-ID: <20051117151730.GA10180@logos.cnet> (raw)



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);

             reply	other threads:[~2005-11-17 20:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-17 15:17 Marcelo Tosatti [this message]
2005-11-28 23:27 ` INTERACTIVE_CONSOLE for misc-embedded.c and watchdog issue Tom Rini
2005-12-02 18:24   ` Marcelo Tosatti

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=20051117151730.GA10180@logos.cnet \
    --to=marcelo.tosatti@cyclades$(echo .)com \
    --cc=linuxppc-embedded@ozlabs$(echo .)org \
    --cc=trini@kernel$(echo .)crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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