ARM: vexpress: Config option for early printk console
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-vexpress / include / mach / uncompress.h
index 7dab5596b86831936e59053207c9721c7dabbdd1..1e472eb0bbdcc907f725fbba1e13e6f38a43c6f8 100644 (file)
@@ -27,6 +27,7 @@
 
 static unsigned long get_uart_base(void)
 {
+#if defined(CONFIG_DEBUG_VEXPRESS_UART0_DETECT)
        unsigned long mpcore_periph;
 
        /*
@@ -42,6 +43,13 @@ static unsigned long get_uart_base(void)
                return UART_BASE;
        else
                return UART_BASE_RS1;
+#elif defined(CONFIG_DEBUG_VEXPRESS_UART0_CA9)
+       return UART_BASE;
+#elif defined(CONFIG_DEBUG_VEXPRESS_UART0_RS1)
+       return UART_BASE_RS1;
+#else
+       return 0;
+#endif
 }
 
 /*
@@ -51,6 +59,9 @@ static inline void putc(int c)
 {
        unsigned long base = get_uart_base();
 
+       if (!base)
+               return;
+
        while (AMBA_UART_FR(base) & (1 << 5))
                barrier();
 
@@ -61,6 +72,9 @@ static inline void flush(void)
 {
        unsigned long base = get_uart_base();
 
+       if (!base)
+               return;
+
        while (AMBA_UART_FR(base) & (1 << 3))
                barrier();
 }