All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Julien Grall <julien@xen.org>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Wei Liu" <wl@xen.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Julien Grall" <julien.grall@arm.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	xen-devel@lists.xenproject.org,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [XEN PATCH v2 2/2] xen/arm: Configure early printk via Kconfig
Date: Mon, 9 Mar 2020 15:04:48 +0000	[thread overview]
Message-ID: <20200309150448.GD2152@perard.uk.xensource.com> (raw)
In-Reply-To: <4d8d53d7-c0ad-0aaf-e1f3-7ec3b1a25110@xen.org>

On Sun, Mar 08, 2020 at 06:29:02PM +0000, Julien Grall wrote:
> On 06/03/2020 17:42, Anthony PERARD wrote:
> > -  - 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.
> 
> Why did this paragraph and...
> 
> > -  - scif,<BASE_ADDRESS>,<VERSION>
> > -    - SCIF<VERSION> is, optionally, the interface version of the UART.
> > -
> > -      If <VERSION> is not given then the default interface version (SCIF)
> > -      will be used.
> 
> ... this one were removed? They actually provide information to the user of
> what will happen if they parameters are left to their default value.

It was replaced by:
    - pl011
      - CONFIG_EARLY_UART_BAUD_RATE is, optionally a baud rate which should
        be used to configure the UART at start of day.

        Select CONFIG_EARLY_UART_INIT to have the option, if that's set to N
        then the code will not try to initialize the UART, so that bootloader
        or firmware settings can be used for maximum compatibility.
    - scif
      - CONFIG_EARLY_UART_SCIF_VERSION is, optionally, the interface version
        of the UART. Default to version NONE.

So they aren't really removed, just reworked I think. But I probably
need to rework the pl011 one as they may not need to expose
EARLY_UART_INIT to users.


> >     - 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:
> > +predefined configurations via "Enable early printk for a specific platform
> > +(deprecated)".
> >     - brcm: printk with 8250 on Broadcom 7445D0 boards with A15 processors.
> >     - dra7: printk with 8250 on DRA7 platform
> > @@ -58,7 +56,7 @@ the name of the machine:
> >     - xgene-storm: printk with 820 on Xgene storm platform
> >     - zynqmp: printk with Cadence UART for Xilinx ZynqMP SoCs
> 
> 
> I think you want to drop the list of early printk alias as they will be
> invalid after this patch.

Will do.

> > diff --git a/xen/arch/arm/Kconfig.debug b/xen/arch/arm/Kconfig.debug
> > new file mode 100644
> > index 000000000000..5111f89043ca
> > --- /dev/null
> > +++ b/xen/arch/arm/Kconfig.debug
> > @@ -0,0 +1,208 @@
> > +choice
> > +	bool "UART drivers for early printk"
> > +	optional
> > +	help
> > +		Choose one of the UART driver, then you'll have to specifie the
> 
> s/specifie/specify/
> 
> > +		parameters, like the base address.
> > +
> > +		Alternatively, there are platform specific options
> > +	config EARLY_UART_CHOICE_8250
> > +		select EARLY_UART_8250
> > +		bool "8250 driver"
[...]
> > +endchoice
> > +
> > +
> > +choice
> > +	bool "Enable early printk for a specific platform (deprecated)"
> > +	depends on !(EARLY_UART_CHOICE_8250 || EARLY_UART_CHOICE_CADENCE || EARLY_UART_CHOICE_EXYNOS4210 || EARLY_UART_CHOICE_MESON || EARLY_UART_CHOICE_MVEBU || EARLY_UART_CHOICE_PL011 || EARLY_UART_CHOICE_SCIF)
> The split is going to cause confusion to the users because he/she may select
> the UART type first and then lose access to this list.
> 
> Furthermore, the depends on !(...) is pretty horrible to have. This is also
> going to make more difficult to add new UART type (there are a few more
> existing...).
> 
> So I would prefer if we have one list.

That probably can be done. I'll need to add more help, and maybe better
descriptions.

> > +	optional
> > +	help
> > +		Those are platform specific options for early printk. This are
> > +		deprecated and will soon be removed.
> > +
> > +		Select a UART driver instead.
> > +
> > +	config EARLY_PRINTK_BRCM
> > +		bool "printk with 8250 on Broadcom 7445D0 boards with A15 processors"
> > +		select EARLY_UART_8250
[..]
> > +	config EARLY_PRINTK_ZYNQMP
> > +		bool "printk with Cadence UART for Xilinx ZynqMP SoCs"
> > +		select EARLY_UART_CADENCE
> > +		depends on ARM_64
> > +		help
> > +		  Say Y here if you want the early printk support on Xilinx
> > +		  ZynQMP platform.
> 
> This is a bit odd to add a description for one Kconfig and not all the
> other. My preference would be to describe all of them, but I understand this
> will require extra work.

I just kept the description from your patch and didn't bother to write
help messages for the other. :-)
I think I can take the time now to rework the prompts and help messages
of all configuration options.

> > +
> > +endchoice
> > +
> > +
> > +config EARLY_UART_8250
> > +	bool
> > +config EARLY_UART_CADENCE
> > +	bool
> > +config EARLY_UART_EXYNOS4210
> > +	bool
> > +config EARLY_UART_MESON
> > +	bool
> > +config EARLY_UART_MVEBU
> > +	bool
> > +config EARLY_UART_PL011
> > +	bool
> > +config EARLY_UART_SCIF
> > +	bool
> > +
> > +config EARLY_PRINTK
> > +	depends on EARLY_UART_8250 || EARLY_UART_CADENCE || EARLY_UART_EXYNOS4210 || EARLY_UART_MESON || EARLY_UART_MVEBU || EARLY_UART_PL011 || EARLY_UART_SCIF
> 
> Please rework this and let each EARLY_UART_* to select EARLY_PRINTK.

I though that wasn't possible, but it seems to work. I didn't understand
well enough how select worked.  But having:
    config EARLY_UART_8250
        select EARLY_PRINTK
works, so I do that, and remove the long list of dependencies on other
config options.

> > +config EARLY_UART_INIT
> > +	depends on EARLY_UART_PL011
> > +	bool "Initialize UART early"
> > +	default y if EARLY_PRINTK_FASTMODEL
> > +	help
> > +		Select N to keep the settings that the bootloader or firmware
> > +		have selected, for maximum compatibility.
> > +
> > +		Select Y to initialize the UART with a new baud rate.
> 
> At the moment, we rely on the firmware to initialize the UART correctly (and
> not only the baud rate...). But it may be possible that it was done
> incorrectly. So the earlyprintk code may require to reset the UART. In the
> case, the user should have no choice as this as a pretty low impact.
> 
> Can we instead select EARLY_UART_INIT based on whether the BAUD_RATE has
> been selected?

I had issue trying to have _INIT depends on BAUD_RATE != 0. That why I
did this.
But trying again with:
    config EARLY_UART_INIT
            depends on EARLY_UART_PL011 && EARLY_UART_PL011_BAUD_RATE != 0
            def_bool y
seems to work fine. So I'll do that stop exposing _INIT to users.

Thanks,

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

      reply	other threads:[~2020-03-09 15:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06 17:42 [Xen-devel] [XEN PATCH v2 0/2] xen/arm: Configure early printk via Kconfig Anthony PERARD
2020-03-06 17:42 ` [Xen-devel] [XEN PATCH v2 1/2] xen/arm: Rename all early printk macro Anthony PERARD
2020-03-06 23:57   ` Stefano Stabellini
2020-03-09 11:34     ` Anthony PERARD
2020-03-08 17:57   ` Julien Grall
2020-03-09 12:06     ` Anthony PERARD
2020-03-06 17:42 ` [Xen-devel] [XEN PATCH v2 2/2] xen/arm: Configure early printk via Kconfig Anthony PERARD
2020-03-06 23:57   ` Stefano Stabellini
2020-03-08 18:29   ` Julien Grall
2020-03-09 15:04     ` Anthony PERARD [this message]

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=20200309150448.GD2152@perard.uk.xensource.com \
    --to=anthony.perard@citrix.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=julien@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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.