INTERACTIVE_CONSOLE for misc-embedded.c and watchdog issue
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.
arch/ppc/boot/simple/misc-embedded.c +11 -1
@@ -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);
Quoted 8 lines · Marcelo Tosatti
The following patch against
misc-embedded.cadds anINTERACTIVE_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.
Signature · 2 lines
Tom Rini http://gate.crashing.org/~trini/
Hi Tom,
Quoted 9 lines · Tom Rini
Quoted 7 lines · Marcelo Tosatti
The following patch against
misc-embedded.cadds anINTERACTIVE_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.
Quoted 6 lines
Quoted 1 line
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/orinclude/asm-ppc/and I don't know if that's a good idea...
arch/ppc/platforms/ surely. You have a problem with that?
Quoted 2 lines
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?