]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_log.c
rename CFG_ macros to CONFIG_SYS
[karo-tx-uboot.git] / common / cmd_log.c
index 34b36ff1dd8d31ff99781ef2ae52e5b7c95ef7ec..febdb90cfcb243530d2d47d727b78558c03b833a 100644 (file)
@@ -66,6 +66,12 @@ static logbuff_t *log;
 #endif
 static char *lbuf;
 
+unsigned long __logbuffer_base(void)
+{
+       return CONFIG_SYS_SDRAM_BASE + gd->bd->bi_memsize - LOGBUFF_LEN;
+}
+unsigned long logbuffer_base (void) __attribute__((weak, alias("__logbuffer_base")));
+
 void logbuff_init_ptrs (void)
 {
        unsigned long tag, post_word;
@@ -75,8 +81,8 @@ void logbuff_init_ptrs (void)
        log = (logbuff_t *)CONFIG_ALT_LH_ADDR;
        lbuf = (char *)CONFIG_ALT_LB_ADDR;
 #else
-       log = (logbuff_t *)(gd->bd->bi_memsize-LOGBUFF_LEN) - 1;
-       lbuf = log->buf;
+       log = (logbuff_t *)(logbuffer_base ()) - 1;
+       lbuf = (char *)log->buf;
 #endif
 
        /* Set up log version */
@@ -107,7 +113,7 @@ void logbuff_init_ptrs (void)
        if ((s = getenv ("loglevel")) != NULL)
                console_loglevel = (int)simple_strtoul (s, NULL, 10);
 
-       gd->post_log_word |= LOGBUFF_INITIALIZED;
+       gd->flags |= GD_FLG_LOGINIT;
 }
 
 void logbuff_reset (void)
@@ -168,7 +174,7 @@ static void logbuff_puts (const char *s)
 
 void logbuff_log(char *msg)
 {
-       if ((gd->post_log_word & LOGBUFF_INITIALIZED)) {
+       if ((gd->flags & GD_FLG_LOGINIT)) {
                logbuff_printk (msg);
        } else {
                /* Can happen only for pre-relocated errors as logging */