]> Git Repo - J-u-boot.git/blobdiff - arch/blackfin/cpu/serial.h
blackfin: Correct early serial mess output in BYPASS boot mode.
[J-u-boot.git] / arch / blackfin / cpu / serial.h
index 9200339668369609661a25e32862e5da88796240..d67fd81c0964c5dbf087915d6490119a78f8b190 100644 (file)
@@ -78,19 +78,31 @@ static inline void serial_early_puts(const char *s)
 #else
 
 .macro serial_early_init
-#ifdef CONFIG_DEBUG_EARLY_SERIAL
+#if defined(CONFIG_DEBUG_EARLY_SERIAL) && defined(BFIN_BOOT_BYPASS)
        call _serial_initialize;
 #endif
 .endm
 
 .macro serial_early_set_baud
-#ifdef CONFIG_DEBUG_EARLY_SERIAL
+#if defined(CONFIG_DEBUG_EARLY_SERIAL) && defined(BFIN_BOOT_BYPASS)
        R0.L = LO(CONFIG_BAUDRATE);
        R0.H = HI(CONFIG_BAUDRATE);
        call _serial_set_baud;
 #endif
 .endm
 
+#if CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS
+#define update_serial_early_string_addr \
+       R1.L = _start; \
+       R1.H = _start; \
+       R0 = R0 - R1; \
+       R1.L = 0; \
+       R1.H = 0x2000; \
+       R0 = R0 + R1;
+#else
+#define update_serial_early_string_addr
+#endif
+
 /* Since we embed the string right into our .text section, we need
  * to find its address.  We do this by getting our PC and adding 2
  * bytes (which is the length of the jump instruction).  Then we
@@ -108,6 +120,7 @@ static inline void serial_early_puts(const char *s)
        .previous; \
        R0.L = 7b; \
        R0.H = 7b; \
+       update_serial_early_string_addr \
        call _serial_puts;
 #else
 # define serial_early_puts(str)
This page took 0.027918 seconds and 4 git commands to generate.