From: Ian Campbell Date: Wed, 11 Mar 2015 14:04:39 +0000 (+0000) Subject: xen: arm: more flexible scheme for specifying early printk device X-Git-Tag: 4.6.0-rc1~921 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=756c3d8054d0bff4397faa5bbb631f8e9da4992a;p=xen.git xen: arm: more flexible scheme for specifying early printk device This allows for early-printk to be specified (for existing UARTS at least) without the need to edit Rules.mk. The existing shortcuts are retained, but in a much more compact fashion. An unused EARLY_PRINTK_BAUD was removed from the zynqmq settings. Signed-off-by: Ian Campbell Reviewed-by: Julien Grall --- diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt index 44df35efb2..7e03955657 100644 --- a/docs/misc/arm/early-printk.txt +++ b/docs/misc/arm/early-printk.txt @@ -7,8 +7,32 @@ Note that selecting this option will limit Xen to a single UART definition. Attempting to boot Xen image on a different platform *will not work*, so this option should not be enable for Xens that are intended to be portable. -CONFIG_EARLY_PRINTK=mach -where mach is the name of the machine: +CONFIG_EARLY_PRINTK=,, + + and are mandatory arguments: + + - is the name of the driver, see xen/arch/arm/arm{32,64}/debug-*.inc + (where corresponds to the wildcarded *). + - is the base physical address of the UART to use + + varies depending on : + + - 8250,, + - is, optionally, the left-shift to apply to the + register offsets within the uart. + - pl011,, + - is, optionally a baud rate which should be used to + configure the UART at start of day. + + If is not given then the code will not try to + initialize the UART, so that bootloader or firmware settings can + be used for maximum compatibility. + - For all other uarts there are no additional options. + +As a convenience it is also possible to select from a list of +predefined configurations using CONFIG_EARLY_PRINTK=mach where mach is +the name of the machine: + - brcm: printk with 8250 on Broadcom 7445D0 boards with A15 processors. - dra7: printk with 8250 on DRA7 platform - exynos5250: printk with the second UART @@ -27,11 +51,7 @@ where mach is the name of the machine: - xgene-storm: printk with 820 on Xgene storm platform - zynqmp: printk with Cadence UART for Xilinx ZynqMP SoCs -The base address and baud rate is hardcoded in xen/arch/arm/Rules.mk, +These settings are 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. diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk index af3448b485..e27f573668 100644 --- a/xen/arch/arm/Rules.mk +++ b/xen/arch/arm/Rules.mk @@ -42,84 +42,45 @@ EARLY_PRINTK := n ifeq ($(debug),y) -ifeq ($(CONFIG_EARLY_PRINTK), brcm) -EARLY_PRINTK_INC := 8250 -EARLY_UART_BASE_ADDRESS := 0xF040AB00 -EARLY_UART_REG_SHIFT := 2 -endif -ifeq ($(CONFIG_EARLY_PRINTK), dra7) -EARLY_PRINTK_INC := 8250 -EARLY_UART_BASE_ADDRESS := 0x4806A000 -EARLY_UART_REG_SHIFT := 2 -endif -ifeq ($(CONFIG_EARLY_PRINTK), fastmodel) -EARLY_PRINTK_INC := pl011 +# See docs/misc/arm/early-printk.txt for syntax + +EARLY_PRINTK_brcm := 8250,0xF040AB00,2 +EARLY_PRINTK_dra7 := 8250,0x4806A000,2 +EARLY_PRINTK_fastmodel := pl011,0x1c090000,115200 +EARLY_PRINTK_exynos5250 := exynos4210,0x12c20000 +EARLY_PRINTK_hip04-d01 := 8250,0xE4007000,2 +EARLY_PRINTK_juno := pl011,0x7ff80000 +EARLY_PRINTK_lager := scif,0xe6e60000 +EARLY_PRINTK_midway := pl011,0xfff36000 +EARLY_PRINTK_omap5432 := 8250,0x48020000,2 +EARLY_PRINTK_seattle := pl011,0xe1010000 +EARLY_PRINTK_sun6i := 8250,0x01c28000,2 +EARLY_PRINTK_sun7i := 8250,0x01c28000,2 +EARLY_PRINTK_thunderx := pl011,0x87e024000000 +EARLY_PRINTK_vexpress := pl011,0x1c090000 +EARLY_PRINTK_xgene-mcdivitt := 8250,0x1c021000,2 +EARLY_PRINTK_xgene-storm := 8250,0x1c020000,2 +EARLY_PRINTK_zynqmp := cadence,0xff000000 + +ifneq ($(EARLY_PRINTK_$(CONFIG_EARLY_PRINTK)),) +EARLY_PRINTK_CFG := $(subst $(comma), ,$(EARLY_PRINTK_$(CONFIG_EARLY_PRINTK))) +else +EARLY_PRINTK_CFG := $(subst $(comma), ,$(CONFIG_EARLY_PRINTK)) +endif + +# Extract configuration from string +EARLY_PRINTK_INC := $(word 1,$(EARLY_PRINTK_CFG)) +EARLY_UART_BASE_ADDRESS := $(word 2,$(EARLY_PRINTK_CFG)) + +# UART specific options +ifeq ($(EARLY_PRINTK_INC),8250) +EARLY_UART_REG_SHIFT := $(word 3,$(EARLY_PRINTK_CFG)) +endif +ifeq ($(EARLY_PRINTK_INC),pl011) +ifneq ($(word 3,$(EARLY_PRINTK_CFG)),) EARLY_PRINTK_INIT_UART := y -EARLY_PRINTK_BAUD := 115200 -EARLY_UART_BASE_ADDRESS := 0x1c090000 -endif -ifeq ($(CONFIG_EARLY_PRINTK), exynos5250) -EARLY_PRINTK_INC := exynos4210 -EARLY_UART_BASE_ADDRESS := 0x12c20000 -endif -ifeq ($(CONFIG_EARLY_PRINTK), hip04-d01) -EARLY_PRINTK_INC := 8250 -EARLY_UART_BASE_ADDRESS := 0xE4007000 -EARLY_UART_REG_SHIFT := 2 -endif -ifeq ($(CONFIG_EARLY_PRINTK), juno) -EARLY_PRINTK_INC := pl011 -EARLY_UART_BASE_ADDRESS := 0x7ff80000 -endif -ifeq ($(CONFIG_EARLY_PRINTK), lager) -EARLY_PRINTK_INC := scif -EARLY_UART_BASE_ADDRESS := 0xe6e60000 -endif -ifeq ($(CONFIG_EARLY_PRINTK), midway) -EARLY_PRINTK_INC := pl011 -EARLY_UART_BASE_ADDRESS := 0xfff36000 -endif -ifeq ($(CONFIG_EARLY_PRINTK), omap5432) -EARLY_PRINTK_INC := 8250 -EARLY_UART_BASE_ADDRESS := 0x48020000 -EARLY_UART_REG_SHIFT := 2 -endif -ifeq ($(CONFIG_EARLY_PRINTK), seattle) -EARLY_PRINTK_INC := pl011 -EARLY_UART_BASE_ADDRESS := 0xe1010000 -endif -ifeq ($(CONFIG_EARLY_PRINTK), sun6i) -EARLY_PRINTK_INC := 8250 -EARLY_UART_BASE_ADDRESS := 0x01c28000 -EARLY_UART_REG_SHIFT := 2 -endif -ifeq ($(CONFIG_EARLY_PRINTK), sun7i) -EARLY_PRINTK_INC := 8250 -EARLY_UART_BASE_ADDRESS := 0x01c28000 -EARLY_UART_REG_SHIFT := 2 -endif -ifeq ($(CONFIG_EARLY_PRINTK), thunderx) -EARLY_PRINTK_INC := pl011 -EARLY_UART_BASE_ADDRESS := 0x87e024000000 -endif -ifeq ($(CONFIG_EARLY_PRINTK), vexpress) -EARLY_PRINTK_INC := pl011 -EARLY_UART_BASE_ADDRESS := 0x1c090000 -endif -ifeq ($(CONFIG_EARLY_PRINTK), xgene-mcdivitt) -EARLY_PRINTK_INC := 8250 -EARLY_UART_BASE_ADDRESS := 0x1c021000 -EARLY_UART_REG_SHIFT := 2 -endif -ifeq ($(CONFIG_EARLY_PRINTK), xgene-storm) -EARLY_PRINTK_INC := 8250 -EARLY_UART_BASE_ADDRESS := 0x1c020000 -EARLY_UART_REG_SHIFT := 2 +EARLY_PRINTK_BAUD := $(word 3,$(EARLY_PRINTK_CFG)) endif -ifeq ($(CONFIG_EARLY_PRINTK), zynqmp) -EARLY_PRINTK_INC := cadence -EARLY_PRINTK_BAUD := 115200 -EARLY_UART_BASE_ADDRESS := 0xff000000 endif ifneq ($(EARLY_PRINTK_INC),)