summaryrefslogtreecommitdiff
path: root/lib_ppc/board.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2002-12-08 09:53:23 +0000
committerwdenk <wdenk>2002-12-08 09:53:23 +0000
commit228f29ac6e0026e596b3a6fbb640118b9944cdd8 (patch)
treef379b80d2d4be7cf9f25bd59156e53cb00faaf72 /lib_ppc/board.c
parent7c7a23bd5a0bc149d2edd665ec46381726b24e0c (diff)
downloadu-boot-imx-228f29ac6e0026e596b3a6fbb640118b9944cdd8.zip
u-boot-imx-228f29ac6e0026e596b3a6fbb640118b9944cdd8.tar.gz
u-boot-imx-228f29ac6e0026e596b3a6fbb640118b9944cdd8.tar.bz2
* Improve log buffer code; use "loglevel" to decide which messages
to log on the console, too (like in Linux); get rid of "logstart"
Diffstat (limited to 'lib_ppc/board.c')
-rw-r--r--lib_ppc/board.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 0b4147f..a6464f0 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -362,6 +362,7 @@ void board_init_f (ulong bootflag)
* relocate the code and continue running from DRAM.
*
* Reserve memory at end of RAM for (top down in that order):
+ * - kernel log buffer
* - protected RAM
* - LCD framebuffer
* - monitor code
@@ -386,6 +387,14 @@ void board_init_f (ulong bootflag)
(gd->ram_size > 256 << 20) ? 256 << 20 : gd->ram_size;
#endif
+#ifdef CONFIG_LOGBUFFER
+ /* reserve kernel log buffer */
+ addr -= (LOGBUFF_RESERVE);
+# ifdef DEBUG
+ printf ("Reserving %ldk for kernel logbuffer at %08lx\n", LOGBUFF_LEN, addr);
+# endif
+#endif
+
#ifdef CONFIG_PRAM
/*
* reserve protected RAM
@@ -613,9 +622,10 @@ void board_init_r (gd_t *id, ulong dest_addr)
WATCHDOG_RESET ();
#ifdef CONFIG_LOGBUFFER
- logbuff_reset ();
+ logbuff_init_ptrs ();
#endif
#ifdef CONFIG_POST
+ post_output_backlog ();
post_reloc ();
#endif
@@ -929,21 +939,29 @@ void board_init_r (gd_t *id, ulong dest_addr)
bedbug_init ();
#endif
-#ifdef CONFIG_PRAM
+#if defined(CONFIG_PRAM) || defined(CONFIG_LOGBUFFER)
/*
* Export available size of memory for Linux,
* taking into account the protected RAM at top of memory
*/
{
ulong pram;
- char *s;
uchar memsz[32];
+#ifdef CONFIG_PRAM
+ char *s;
if ((s = getenv ("pram")) != NULL) {
pram = simple_strtoul (s, NULL, 10);
} else {
pram = CONFIG_PRAM;
}
+#else
+ pram=0;
+#endif
+#ifdef CONFIG_LOGBUFFER
+ /* Also take the logbuffer into account (pram is in kB) */
+ pram += (LOGBUFF_LEN+LOGBUFF_OVERHEAD)/1024;
+#endif
sprintf (memsz, "%ldk", (bd->bi_memsize / 1024) - pram);
setenv ("mem", memsz);
}