]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
arm/early-printk: allow skipping of UART init
authorAndre Przywara <andre.przywara@calxeda.com>
Fri, 24 May 2013 13:47:27 +0000 (15:47 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 30 May 2013 08:20:29 +0000 (09:20 +0100)
While it seems obvious to initialize the UART before using it, chances
are that some firmware code or the bootloader already did this.
So it may actually be a good idea to skip the initialization, in fact
this fixes early printk on my TC2 Versatile Express.
So provide an option in xen/arch/arm/Rules.mk to only initialize the
UART when needed.

Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
docs/misc/arm/early-printk.txt
xen/arch/arm/Rules.mk
xen/arch/arm/arm32/head.S
xen/arch/arm/arm64/head.S

index 10c30531f6111cdb9004f18b1664bae2f0d74437..965add56b8122ff7366a75ae276a41b392e9a064 100644 (file)
@@ -14,5 +14,9 @@ where mach is the name of the machine:
 
 The baud rate is hardcoded in xen/arch/arm/Rules.mk,
 see there when adding support for new machines.
+If not explicitly requested with "EARLY_PRINTK_INIT_UART := y" in Rules.mk,
+the code will not try to initialize the UART, so that bootloader or
+firmware settings can be used for maximum compatibility. The baud rate
+parameter is ignored in this case.
 
 By default early printk is disabled.
index b4d690716a8f6288f8bae45b378e155d11e9ec15..fdcf73e453995577d6d8644aed8c2b7462f6f04c 100644 (file)
@@ -49,6 +49,7 @@ EARLY_PRINTK_BAUD := 38400
 endif
 ifeq ($(CONFIG_EARLY_PRINTK), exynos5250)
 EARLY_PRINTK_INC := exynos4210
+EARLY_PRINTK_INIT_UART := y
 EARLY_PRINTK_BAUD := 115200
 endif
 
@@ -57,6 +58,7 @@ EARLY_PRINTK := y
 endif
 
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK
+CFLAGS-$(EARLY_PRINTK_INIT_UART) += -DEARLY_PRINTK_INIT_UART
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\"
 CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_BAUD=$(EARLY_PRINTK_BAUD)
 endif
index ec7f64061334aae4ee260de75e798a99ef5c8abb..0588d54709d7dd6a5a2f74f1033e875e5c1a5938 100644 (file)
@@ -369,7 +369,9 @@ fail:   PRINT("- Boot failed -\r\n")
  * r11: Early UART base address
  * Clobbers r0-r2 */
 init_uart:
+#ifdef EARLY_PRINTK_INIT_UART
         early_uart_init r11, r1, r2
+#endif
         adr   r0, 1f
         b     puts                  /* Jump to puts */
 1:      .asciz "- UART enabled -\r\n"
index 89559469ad13c2ba9673717c925d75074c95ce7a..21b7e4d7415033e162a7953d3cf4a1cc80e2128f 100644 (file)
@@ -116,7 +116,9 @@ boot_cpu:
 #ifdef EARLY_PRINTK
         ldr   x23, =EARLY_UART_BASE_ADDRESS /* x23 := UART base address */
         cbnz  x22, 1f
+#ifdef EARLY_PRINTK_INIT_UART
         bl    init_uart                 /* CPU 0 sets up the UART too */
+#endif
 1:      PRINT("- CPU ")
         mov   x0, x22
         bl    putn