All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: "Andreas Färber" <afaerber@suse.de>,
	linux-arm-kernel@lists.infradead.org
Cc: Carlo Caione <carlo@caione.org>, Jonathan Corbet <corbet@lwn.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>
Subject: Re: [PATCH] tty: serial: meson: Implement earlycon support
Date: Sun, 7 Feb 2016 20:22:20 -0800	[thread overview]
Message-ID: <56B817FC.4000604@hurleysoftware.com> (raw)
In-Reply-To: <1454878635-24396-1-git-send-email-afaerber@suse.de>

Hi Andreas,

On 02/07/2016 12:57 PM, Andreas Färber wrote:
> Reuse the existing console write implementation for implementing
> DT-based and command-line-based earlycon support.
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  Documentation/kernel-parameters.txt |  6 ++++++
>  drivers/tty/serial/meson_uart.c     | 13 +++++++++++++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 602065c..90801ac 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -1030,6 +1030,12 @@ Such letter suffixes can also be entirely omitted.
>  			the driver will use only 32-bit accessors to read/write
>  			the device registers.
>  
> +		meson_serial,<addr>
> +			Start an early, polled-mode console on a meson serial
> +			port at the specified address. The serial port must
> +			already be setup and configured. Options are not yet
> +			supported.
> +
>  		msm_serial,<addr>
>  			Start an early, polled-mode console on an msm serial
>  			port at the specified address. The serial port
> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
> index b12a37b..6f89567 100644
> --- a/drivers/tty/serial/meson_uart.c
> +++ b/drivers/tty/serial/meson_uart.c
> @@ -548,6 +548,19 @@ static int __init meson_serial_console_init(void)
>  }
>  console_initcall(meson_serial_console_init);
>  
> +static int __init
> +meson_serial_early_console_setup(struct earlycon_device *device, const char *opt)
> +{
> +	if (!device->port.membase)
> +		return -ENODEV;
> +
> +	device->con->write = meson_serial_console_write;

meson_serial_console_write() is not appropriate for earlycon; it assumes the
earlycon port is the same as the driver port (it isn't).


> +	return 0;
> +}
> +EARLYCON_DECLARE(meson_serial, meson_serial_early_console_setup);
> +OF_EARLYCON_DECLARE(meson_serial, "amlogic,meson-uart",
> +		    meson_serial_early_console_setup);

With today's linux-next (or Greg's tty-next tree), it is no longer necessary to
declare separate earlycon's when you want both; OF_EARLYCON_DECLARE() declares
both a devicetree-enabled earlycon and automatically provides for a command line
earlycon of the same name.

Regards,
Peter Hurley

> +
>  #define MESON_SERIAL_CONSOLE	(&meson_serial_console)
>  #else
>  #define MESON_SERIAL_CONSOLE	NULL
> 


WARNING: multiple messages have this Message-ID (diff)
From: peter@hurleysoftware.com (Peter Hurley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] tty: serial: meson: Implement earlycon support
Date: Sun, 7 Feb 2016 20:22:20 -0800	[thread overview]
Message-ID: <56B817FC.4000604@hurleysoftware.com> (raw)
In-Reply-To: <1454878635-24396-1-git-send-email-afaerber@suse.de>

Hi Andreas,

On 02/07/2016 12:57 PM, Andreas F?rber wrote:
> Reuse the existing console write implementation for implementing
> DT-based and command-line-based earlycon support.
> 
> Signed-off-by: Andreas F?rber <afaerber@suse.de>
> ---
>  Documentation/kernel-parameters.txt |  6 ++++++
>  drivers/tty/serial/meson_uart.c     | 13 +++++++++++++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 602065c..90801ac 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -1030,6 +1030,12 @@ Such letter suffixes can also be entirely omitted.
>  			the driver will use only 32-bit accessors to read/write
>  			the device registers.
>  
> +		meson_serial,<addr>
> +			Start an early, polled-mode console on a meson serial
> +			port at the specified address. The serial port must
> +			already be setup and configured. Options are not yet
> +			supported.
> +
>  		msm_serial,<addr>
>  			Start an early, polled-mode console on an msm serial
>  			port at the specified address. The serial port
> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
> index b12a37b..6f89567 100644
> --- a/drivers/tty/serial/meson_uart.c
> +++ b/drivers/tty/serial/meson_uart.c
> @@ -548,6 +548,19 @@ static int __init meson_serial_console_init(void)
>  }
>  console_initcall(meson_serial_console_init);
>  
> +static int __init
> +meson_serial_early_console_setup(struct earlycon_device *device, const char *opt)
> +{
> +	if (!device->port.membase)
> +		return -ENODEV;
> +
> +	device->con->write = meson_serial_console_write;

meson_serial_console_write() is not appropriate for earlycon; it assumes the
earlycon port is the same as the driver port (it isn't).


> +	return 0;
> +}
> +EARLYCON_DECLARE(meson_serial, meson_serial_early_console_setup);
> +OF_EARLYCON_DECLARE(meson_serial, "amlogic,meson-uart",
> +		    meson_serial_early_console_setup);

With today's linux-next (or Greg's tty-next tree), it is no longer necessary to
declare separate earlycon's when you want both; OF_EARLYCON_DECLARE() declares
both a devicetree-enabled earlycon and automatically provides for a command line
earlycon of the same name.

Regards,
Peter Hurley

> +
>  #define MESON_SERIAL_CONSOLE	(&meson_serial_console)
>  #else
>  #define MESON_SERIAL_CONSOLE	NULL
> 

  reply	other threads:[~2016-02-08  4:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-07 20:57 [PATCH] tty: serial: meson: Implement earlycon support Andreas Färber
2016-02-07 20:57 ` Andreas Färber
2016-02-07 20:57 ` Andreas Färber
2016-02-08  4:22 ` Peter Hurley [this message]
2016-02-08  4:22   ` Peter Hurley
2016-02-08 11:50   ` Andreas Färber
2016-02-08 11:50     ` Andreas Färber

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=56B817FC.4000604@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=afaerber@suse.de \
    --cc=carlo@caione.org \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.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.