ARM/early-printk: Improve reusability and add Calxeda support
cover ARM/early-printk: Improve reusability and add Calxeda support
The current early-printk support for ARM is rather hard-coded, making it hard to add machines or tweak settings.
This series slightly moves some code to gather UART settings in xen/arch/arm/Rules.mk instead of the actual .c files. Also it allows two different machines with different settings to share the same driver, which the last patch exploits to add support the Calxeda Midway hardware.
This haven't been extensively tested, but I looked at the generated assembly and did some quick checks on Versatile Express.
Andre Przywara (4):
arm/early-printk: calculate baud rate divisor from user provided
value
arm/early-printk: allow skipping of UART init arm/early-printk: move UART base address to Rules.mk arm/early-printk: add Calxeda Midway UART support
xen/arch/arm/Rules.mk | 13 +++++++++++++ xen/arch/arm/arm32/debug-exynos4210.inc | 6 ++---- xen/arch/arm/arm32/debug-pl011.inc | 6 ++---- xen/arch/arm/arm32/head.S | 2 ++ xen/arch/arm/arm64/debug-pl011.inc | 6 ++---- xen/arch/arm/arm64/head.S | 2 ++ 6 files changed, 23 insertions(+), 12 deletions(-)
Signature · 1 line
1.7.12.1
PATCH 1/4 arm/early-printk: calculate baud rate divisor from user provided value
For early-printk the used baud rate was hardcoded in the code, using precalculated divisor values.
Let the calculation of these values be done by the preprocessor and use a human readable value in xen/arch/arm/Rules.mk to drive this.
--- xen/arch/arm/Rules.mk | 3 +++ xen/arch/arm/arm32/debug-exynos4210.inc | 4 ++-- xen/arch/arm/arm32/debug-pl011.inc | 4 ++-- xen/arch/arm/arm64/debug-pl011.inc | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-)
xen/arch/arm/Rules.mk +3 -0
@@ -45,9 +45,11 @@ ifeq ($(debug),y) # TODO handle UART base address from make command line ifeq ($(CONFIG_EARLY_PRINTK), vexpress) EARLY_PRINTK_INC := pl011 +EARLY_PRINTK_BAUD := 38400 endif ifeq ($(CONFIG_EARLY_PRINTK), exynos5250) EARLY_PRINTK_INC := exynos4210 +EARLY_PRINTK_BAUD := 115200 endif ifneq ($(EARLY_PRINTK_INC),)
@@ -56,4 +58,5 @@ endif CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\" +CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_BAUD=$(EARLY_PRINTK_BAUD) endif
xen/arch/arm/arm32/debug-exynos4210.inc +2 -2
@@ -38,9 +38,9 @@ orr \rd, \rd, #(0x7<<8) str \rd, [\rc, #0x558] - mov \rc, #4 + mov \rc, #(100000000 / EARLY_PRINTK_BAUD % 16) str \rc, [\rb, #UFRACVAL] /* -> UFRACVAL (Baud divisor fraction) */ - mov \rc, #53 + mov \rc, #(100000000 / EARLY_PRINTK_BAUD / 16 - 1) str \rc, [\rb, #UBRDIV] /* -> UBRDIV (Baud divisor integer) */ mov \rc, #3 /* 8n1 */ str \rc, [\rb, #ULCON] /* -> (Line control) */
xen/arch/arm/arm32/debug-pl011.inc +2 -2
@@ -23,9 +23,9 @@ * rc: scratch register 1 * rd: scratch register 2 (unused here) */ .macro early_uart_init rb, rc, rd - mov \rc, #0x0 + mov \rc, #(7372800 / EARLY_PRINTK_BAUD % 16) str \rc, [\rb, #0x28] /* -> UARTFBRD (Baud divisor fraction) */ - mov \rc, #0x4 /* 7.3728MHz / 0x4 == 16 * 115200 */ + mov \rc, #(7372800 / EARLY_PRINTK_BAUD / 16) str \rc, [\rb, #0x24] /* -> UARTIBRD (Baud divisor integer) */ mov \rc, #0x60 /* 8n1 */ str \rc, [\rb, #0x2C] /* -> UARTLCR_H (Line control) */
xen/arch/arm/arm64/debug-pl011.inc +2 -2
@@ -24,9 +24,9 @@ * xb: register which containts the UART base address * c: scratch register number */ .macro early_uart_init xb, c - mov x\c, #0x0 + mov x\c, #(7372800 / EARLY_PRINTK_BAUD % 16) strh w\c, [\xb, #0x28] /* -> UARTFBRD (Baud divisor fraction) */ - mov x\c, #0x4 /* 7.3728MHz / 0x4 == 16 * 115200 */ + mov x\c, #(7372800 / EARLY_PRINTK_BAUD / 16) strh w\c, [\xb, #0x24] /* -> UARTIBRD (Baud divisor integer) */ mov x\c, #0x60 /* 8n1 */ str w\c, [\xb, #0x2C] /* -> UARTLCR_H (Line control) */
Signature · 1 line
1.7.12.1
Re: [PATCH 1/4] arm/early-printk: calculate baud rate divisor from user provided value
Quoted 6 lines · Andre Przywara
For early-printk the used baud rate was hardcoded in the code, using precalculated divisor values.
Let the calculation of these values be done by the preprocessor and use a human readable value inxen/arch/arm/Rules.mkto drive this.Signed-off-by Andre Przywara <[email protected]>
Quoted 77 lines
--- xen/arch/arm/Rules.mk | 3 +++ xen/arch/arm/arm32/debug-exynos4210.inc | 4 ++-- xen/arch/arm/arm32/debug-pl011.inc | 4 ++-- xen/arch/arm/arm64/debug-pl011.inc | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-)xen/arch/arm/Rules.mk +3
-0@@ -45,9 +45,11 @@ ifeq ($(debug),y) # TODO handle UART base address from make command line ifeq ($(CONFIG_EARLY_PRINTK), vexpress) EARLY_PRINTK_INC := pl011 +EARLY_PRINTK_BAUD := 38400 endif ifeq ($(CONFIG_EARLY_PRINTK), exynos5250) EARLY_PRINTK_INC := exynos4210 +EARLY_PRINTK_BAUD := 115200 endif ifneq ($(EARLY_PRINTK_INC),)@@ -56,4 +58,5 @@ endif CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\" +CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_BAUD=$(EARLY_PRINTK_BAUD) endifxen/arch/arm/arm32/debug-exynos4210.inc +2
-2@@ -38,9 +38,9 @@ orr \rd, \rd, #(0x7<<8) str \rd, [\rc, #0x558] - mov \rc, #4 + mov \rc, #(100000000 / EARLY_PRINTK_BAUD % 16) str \rc, [\rb, #UFRACVAL] /* -> UFRACVAL (Baud divisor fraction) */ - mov \rc, #53 + mov \rc, #(100000000 / EARLY_PRINTK_BAUD / 16 - 1) str \rc, [\rb, #UBRDIV] /* -> UBRDIV (Baud divisor integer) */ mov \rc, #3 /* 8n1 */ str \rc, [\rb, #ULCON] /* -> (Line control) */xen/arch/arm/arm32/debug-pl011.inc +2
-2@@ -23,9 +23,9 @@ * rc: scratch register 1 * rd: scratch register 2 (unused here) */ .macro early_uart_init rb, rc, rd - mov \rc, #0x0 + mov \rc, #(7372800 / EARLY_PRINTK_BAUD % 16) str \rc, [\rb, #0x28] /* -> UARTFBRD (Baud divisor fraction) */ - mov \rc, #0x4 /* 7.3728MHz / 0x4 == 16 * 115200 */ + mov \rc, #(7372800 / EARLY_PRINTK_BAUD / 16) str \rc, [\rb, #0x24] /* -> UARTIBRD (Baud divisor integer) */ mov \rc, #0x60 /* 8n1 */ str \rc, [\rb, #0x2C] /* -> UARTLCR_H (Line control) */xen/arch/arm/arm64/debug-pl011.inc +2
-2@@ -24,9 +24,9 @@ * xb: register which containts the UART base address * c: scratch register number */ .macro early_uart_init xb, c - mov x\c, #0x0 + mov x\c, #(7372800 / EARLY_PRINTK_BAUD % 16) strh w\c, [\xb, #0x28] /* -> UARTFBRD (Baud divisor fraction) */ - mov x\c, #0x4 /* 7.3728MHz / 0x4 == 16 * 115200 */ + mov x\c, #(7372800 / EARLY_PRINTK_BAUD / 16) strh w\c, [\xb, #0x24] /* -> UARTIBRD (Baud divisor integer) */ mov x\c, #0x60 /* 8n1 */ str w\c, [\xb, #0x2C] /* -> UARTLCR_H (Line control) */
PATCH 2/4 arm/early-printk: allow skipping of UART init
In reply to Andre PrzywaraWhile 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.
--- xen/arch/arm/Rules.mk | 2 ++ xen/arch/arm/arm32/head.S | 2 ++ xen/arch/arm/arm64/head.S | 2 ++ 3 files changed, 6 insertions(+)
xen/arch/arm/Rules.mk +2 -0
@@ -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
xen/arch/arm/arm32/head.S +2 -0
@@ -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"
xen/arch/arm/arm64/head.S +2 -0
@@ -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
Signature · 1 line
1.7.12.1
Re: [PATCH 2/4] arm/early-printk: allow skipping of UART init
Quoted 7 lines · Andre Przywara
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 inxen/arch/arm/Rules.mkto only initialize theUART when needed.
I'm using the fast model: Fast Models [8.0.60 (Mar 7 2013)] and the UART initialization is needed.
Could you do one of the following option:
1) add fastmodel early printk (with EARLY_PRINTK_INIT_UART=y)
2) document the behavior in docs/misc/arm/early-printk.txt
Quoted 55 lines
Signed-off-by Andre Przywara <[email protected]>--- xen/arch/arm/Rules.mk | 2 ++ xen/arch/arm/arm32/head.S | 2 ++ xen/arch/arm/arm64/head.S | 2 ++ 3 files changed, 6 insertions(+)xen/arch/arm/Rules.mk +2
-0@@ -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) endifxen/arch/arm/arm32/head.S +2
-0@@ -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"xen/arch/arm/arm64/head.S +2
-0@@ -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
Signature · 1 line
Julien
PATCH 3/4 arm/early-printk: move UART base address to Rules.mk
In reply to Andre PrzywaraThe UART memory mapped base address is currently hardcoded in the early-printk UART driver, which denies the driver to be used by two machines with a different mapping.
Move this definition out to xen/arch/arm/Rules.mk, allowing easier user access and later sharing of the driver.
--- xen/arch/arm/Rules.mk | 3 +++ xen/arch/arm/arm32/debug-exynos4210.inc | 2 -- xen/arch/arm/arm32/debug-pl011.inc | 2 -- xen/arch/arm/arm64/debug-pl011.inc | 2 -- 4 files changed, 3 insertions(+), 6 deletions(-)
xen/arch/arm/Rules.mk +3 -0
@@ -46,11 +46,13 @@ ifeq ($(debug),y) ifeq ($(CONFIG_EARLY_PRINTK), vexpress) EARLY_PRINTK_INC := pl011 EARLY_PRINTK_BAUD := 38400 +EARLY_UART_BASE_ADDRESS := 0x1c090000 endif ifeq ($(CONFIG_EARLY_PRINTK), exynos5250) EARLY_PRINTK_INC := exynos4210 EARLY_PRINTK_INIT_UART := y EARLY_PRINTK_BAUD := 115200 +EARLY_UART_BASE_ADDRESS := 0x12c20000 endif ifneq ($(EARLY_PRINTK_INC),)
@@ -61,4 +63,5 @@ 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) +CFLAGS-$(EARLY_PRINTK) += -DEARLY_UART_BASE_ADDRESS=$(EARLY_UART_BASE_ADDRESS) endif
xen/arch/arm/arm32/debug-exynos4210.inc +0 -2
@@ -18,8 +18,6 @@ #include <asm/exynos4210-uart.h> -#define EARLY_UART_BASE_ADDRESS 0x12c20000 - /* Exynos 5 UART initialization * rb: register which contains the UART base address * rc: scratch register 1
xen/arch/arm/arm32/debug-pl011.inc +0 -2
@@ -16,8 +16,6 @@ * GNU General Public License for more details. */ -#define EARLY_UART_BASE_ADDRESS 0x1c090000 - /* PL011 UART initialization * rb: register which contains the UART base address * rc: scratch register 1
xen/arch/arm/arm64/debug-pl011.inc +0 -2
@@ -18,8 +18,6 @@ #include <asm/asm_defns.h> -#define EARLY_UART_BASE_ADDRESS 0x1c090000 - /* PL011 UART initialization * xb: register which containts the UART base address * c: scratch register number */
Signature · 1 line
1.7.12.1
Re: [PATCH 3/4] arm/early-printk: move UART base address to Rules.mk
Quoted 7 lines · Andre Przywara
The UART memory mapped base address is currently hardcoded in the early-printk UART driver, which denies the driver to be used by two machines with a different mapping.
Move this definition out toxen/arch/arm/Rules.mk, allowing easier user access and later sharing of the driver.Signed-off-by Andre Przywara <[email protected]>
Quoted 70 lines
--- xen/arch/arm/Rules.mk | 3 +++ xen/arch/arm/arm32/debug-exynos4210.inc | 2 -- xen/arch/arm/arm32/debug-pl011.inc | 2 -- xen/arch/arm/arm64/debug-pl011.inc | 2 -- 4 files changed, 3 insertions(+), 6 deletions(-)xen/arch/arm/Rules.mk +3
-0@@ -46,11 +46,13 @@ ifeq ($(debug),y) ifeq ($(CONFIG_EARLY_PRINTK), vexpress) EARLY_PRINTK_INC := pl011 EARLY_PRINTK_BAUD := 38400 +EARLY_UART_BASE_ADDRESS := 0x1c090000 endif ifeq ($(CONFIG_EARLY_PRINTK), exynos5250) EARLY_PRINTK_INC := exynos4210 EARLY_PRINTK_INIT_UART := y EARLY_PRINTK_BAUD := 115200 +EARLY_UART_BASE_ADDRESS := 0x12c20000 endif ifneq ($(EARLY_PRINTK_INC),)@@ -61,4 +63,5 @@ 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) +CFLAGS-$(EARLY_PRINTK) += -DEARLY_UART_BASE_ADDRESS=$(EARLY_UART_BASE_ADDRESS) endifxen/arch/arm/arm32/debug-exynos4210.inc +0
-2@@ -18,8 +18,6 @@ #include <asm/exynos4210-uart.h> -#define EARLY_UART_BASE_ADDRESS 0x12c20000 - /* Exynos 5 UART initialization * rb: register which contains the UART base address * rc: scratch register 1xen/arch/arm/arm32/debug-pl011.inc +0
-2@@ -16,8 +16,6 @@ * GNU General Public License for more details. */ -#define EARLY_UART_BASE_ADDRESS 0x1c090000 - /* PL011 UART initialization * rb: register which contains the UART base address * rc: scratch register 1xen/arch/arm/arm64/debug-pl011.inc +0
-2@@ -18,8 +18,6 @@ #include <asm/asm_defns.h> -#define EARLY_UART_BASE_ADDRESS 0x1c090000 - /* PL011 UART initialization * xb: register which containts the UART base address * c: scratch register number */
Re: [PATCH 3/4] arm/early-printk: move UART base address to Rules.mk
Quoted 11 lines · Julien Grall
Quoted 7 lines · Andre Przywara
The UART memory mapped base address is currently hardcoded in the early-printk UART driver, which denies the driver to be used by two machines with a different mapping.
Move this definition out toxen/arch/arm/Rules.mk, allowing easier user access and later sharing of the driver.Signed-off-by Andre Przywara <[email protected]>Reviewed-by Julien Grall <[email protected]>
By the way, could you remove the "# TODO handle UART..." in arch/arm/Rules.mk as you have implemented it?
Thanks,
Julien
Quoted 77 lines
Quoted 62 lines
--- xen/arch/arm/Rules.mk | 3 +++ xen/arch/arm/arm32/debug-exynos4210.inc | 2 -- xen/arch/arm/arm32/debug-pl011.inc | 2 -- xen/arch/arm/arm64/debug-pl011.inc | 2 -- 4 files changed, 3 insertions(+), 6 deletions(-)xen/arch/arm/Rules.mk +3
-0@@ -46,11 +46,13 @@ ifeq ($(debug),y) ifeq ($(CONFIG_EARLY_PRINTK), vexpress) EARLY_PRINTK_INC := pl011 EARLY_PRINTK_BAUD := 38400 +EARLY_UART_BASE_ADDRESS := 0x1c090000 endif ifeq ($(CONFIG_EARLY_PRINTK), exynos5250) EARLY_PRINTK_INC := exynos4210 EARLY_PRINTK_INIT_UART := y EARLY_PRINTK_BAUD := 115200 +EARLY_UART_BASE_ADDRESS := 0x12c20000 endif ifneq ($(EARLY_PRINTK_INC),)@@ -61,4 +63,5 @@ 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) +CFLAGS-$(EARLY_PRINTK) += -DEARLY_UART_BASE_ADDRESS=$(EARLY_UART_BASE_ADDRESS) endifxen/arch/arm/arm32/debug-exynos4210.inc +0
-2@@ -18,8 +18,6 @@ #include <asm/exynos4210-uart.h> -#define EARLY_UART_BASE_ADDRESS 0x12c20000 - /* Exynos 5 UART initialization * rb: register which contains the UART base address * rc: scratch register 1xen/arch/arm/arm32/debug-pl011.inc +0
-2@@ -16,8 +16,6 @@ * GNU General Public License for more details. */ -#define EARLY_UART_BASE_ADDRESS 0x1c090000 - /* PL011 UART initialization * rb: register which contains the UART base address * rc: scratch register 1xen/arch/arm/arm64/debug-pl011.inc +0
-0xen/arch/arm/arm64/debug-pl011.inc line 23
Quoted 8 lines
xen/arch/arm/arm64/debug-pl011.inc +0
-2@@ -18,8 +18,6 @@ #include <asm/asm_defns.h> -#define EARLY_UART_BASE_ADDRESS 0x1c090000 - /* PL011 UART initialization * xb: register which containts the UART base address * c: scratch register number */_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
PATCH 4/4 arm/early-printk: add Calxeda Midway UART support
In reply to Andre PrzywaraWith the help of the last three patches add a stanza to xen/arch/arm/Rules.mk to specify the UART configuration of the Calxeda Midway machine.
The information has been taken from the Linux kernel's .dts file. This can be enabled by adding "CONFIG_EARLY_PRINTK=midway" to Config.mk.
--- xen/arch/arm/Rules.mk | 5 +++++ 1 file changed, 5 insertions(+)
xen/arch/arm/Rules.mk +5 -0
@@ -54,6 +54,11 @@ EARLY_PRINTK_INIT_UART := y EARLY_PRINTK_BAUD := 115200 EARLY_UART_BASE_ADDRESS := 0x12c20000 endif +ifeq ($(CONFIG_EARLY_PRINTK), midway) +EARLY_PRINTK_INC := pl011 +EARLY_PRINTK_BAUD := 115200 +EARLY_UART_BASE_ADDRESS := 0xfff36000 +endif ifneq ($(EARLY_PRINTK_INC),) EARLY_PRINTK := y
Signature · 1 line
1.7.12.1
Re: [PATCH 4/4] arm/early-printk: add Calxeda Midway UART support
Quoted 6 lines · Andre Przywara
With the help of the last three patches add a stanza to
xen/arch/arm/Rules.mkto specify the UART configuration of the Calxeda Midway machine.
The information has been taken from the Linux kernel's .dts file. This can be enabled by adding "CONFIG_EARLY_PRINTK=midway" to Config.mk.
Could add a line in docs/misc/arm/early-printk.txt to document this new early printk?
Thanks,
Julien
Quoted 21 lines
Signed-off-by Andre Przywara <[email protected]>--- xen/arch/arm/Rules.mk | 5 +++++ 1 file changed, 5 insertions(+)xen/arch/arm/Rules.mk +5
-0@@ -54,6 +54,11 @@ EARLY_PRINTK_INIT_UART := y EARLY_PRINTK_BAUD := 115200 EARLY_UART_BASE_ADDRESS := 0x12c20000 endif +ifeq ($(CONFIG_EARLY_PRINTK), midway) +EARLY_PRINTK_INC := pl011 +EARLY_PRINTK_BAUD := 115200 +EARLY_UART_BASE_ADDRESS := 0xfff36000 +endif ifneq ($(EARLY_PRINTK_INC),) EARLY_PRINTK := y
Quoted 10 lines · Andre Przywara
The current early-printk support for ARM is rather hard-coded, making it hard to add machines or tweak settings.
This series slightly moves some code to gather UART settings inxen/arch/arm/Rules.mkinstead of the actual .c files. Also it allows two different machines with different settings to share the same driver, which the last patch exploits to add support the Calxeda Midway hardware.This haven't been extensively tested, but I looked at the generated assembly and did some quick checks on Versatile Express.
Thanks for this patch series, the UART code is now more generic :).
I tried all these patches on the fast model and the arndale board. I didn't see any specific issue.
Cheers,
Julien
Quoted 18 lines
Signed-off-by Andre Przywara <[email protected]>Andre Przywara (4):
arm/early-printk: calculate baud rate divisor from user provided
value
arm/early-printk: allow skipping of UART init arm/early-printk: move UART base address to Rules.mk arm/early-printk: add Calxeda Midway UART supportxen/arch/arm/Rules.mk | 13 +++++++++++++ xen/arch/arm/arm32/debug-exynos4210.inc | 6 ++---- xen/arch/arm/arm32/debug-pl011.inc | 6 ++---- xen/arch/arm/arm32/head.S | 2 ++ xen/arch/arm/arm64/debug-pl011.inc | 6 ++---- xen/arch/arm/arm64/head.S | 2 ++ 6 files changed, 23 insertions(+), 12 deletions(-)