All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: julien.grall@linaro.org, tim@xen.org, stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH 2/2] xen: arm: more flexible scheme for specifying early printk device
Date: Wed, 11 Mar 2015 14:17:38 +0000	[thread overview]
Message-ID: <1426083458.21353.247.camel@citrix.com> (raw)
In-Reply-To: <1426083115-29406-2-git-send-email-ian.campbell@citrix.com>

On Wed, 2015-03-11 at 14:11 +0000, Ian Campbell wrote:

Sorry, I was too lazy to write a cover letter for these changes and
forgot that would mean that git send-email wouldn't thread them.

> 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 <ian.campbell@citrix.com>
> ---
>  docs/misc/arm/early-printk.txt |   34 +++++++++---
>  xen/arch/arm/Rules.mk          |  114 ++++++++++++++--------------------------
>  2 files changed, 65 insertions(+), 83 deletions(-)
> 
> diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
> index 44df35e..7e03955 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=<INC>,<BASE_ADDRESS>,<OTHER_OPTIONS>
> +
> +<INC> and <BASE_ADDRESS> are mandatory arguments:
> +
> +  - <INC> is the name of the driver, see xen/arch/arm/arm{32,64}/debug-*.inc
> +    (where <INC> corresponds to the wildcarded *).
> +  - <BASE_ADDRESS> is the base physical address of the UART to use
> +
> +<OTHER_OPTIONS> varies depending on <INC>:
> +
> +  - 8250,<BASE_ADDRESS>,<REG_SHIFT>
> +    - <REG_SHIFT> is, optionally, the left-shift to apply to the
> +      register offsets within the uart.
> +  - pl011,<BASE_ADDRESS>,<BAUD_RATE>
> +    - <BAUD_RATE> is, optionally a baud rate which should be used to
> +      configure the UART at start of day.
> +
> +      If <BAUD_RATE> 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 af3448b..b45cb69 100644
> --- a/xen/arch/arm/Rules.mk
> +++ b/xen/arch/arm/Rules.mk
> @@ -42,84 +42,46 @@ 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
> +
> +COMMA := ,
> +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),)

  reply	other threads:[~2015-03-11 14:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11 14:11 [PATCH 2/2] xen: arm: more flexible scheme for specifying early printk device Ian Campbell
2015-03-11 14:17 ` Ian Campbell [this message]
2015-03-11 14:19 ` Andrew Cooper
2015-03-11 14:40   ` Ian Campbell
2015-03-11 14:47 ` Julien Grall
2015-03-11 14:59   ` Ian Campbell
2015-03-20 12:28   ` Ian Campbell
2015-03-12 11:03 ` Tim Deegan
2015-03-12 16:51   ` Ian Campbell
2015-03-12 17:35     ` Tim Deegan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426083458.21353.247.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.