mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Claudiu.Beznea@microchip.com>
To: <michael@walle.cc>, <richard.genoud@gmail.com>,
	<gregkh@linuxfoundation.org>, <jirislaby@kernel.org>,
	<Nicolas.Ferre@microchip.com>, <alexandre.belloni@bootlin.com>
Cc: <linux-serial@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tty: serial: atmel: add earlycon support
Date: Thu, 17 Feb 2022 09:12:45 +0000	[thread overview]
Message-ID: <9e499fdb-19dc-9b5a-0eb7-618acfd61605@microchip.com> (raw)
In-Reply-To: <20220216161822.1071245-1-michael@walle.cc>

Hi Micheal,

On 16.02.2022 18:18, Michael Walle wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Add early console support which relies on the bootloader for the
> initialization of the UART.
> Please note, that the compatibles are taken from at91-usart MFD
> driver.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
>  drivers/tty/serial/atmel_serial.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index 2d09a89974a2..50fc6d51ff0d 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -2673,6 +2673,30 @@ static struct console atmel_console = {
>         .data           = &atmel_uart,
>  };
> 
> +static void atmel_serial_early_write(struct console *con, const char *s,
> +                                    unsigned int n)
> +{
> +       struct earlycon_device *dev = con->data;
> +
> +       uart_console_write(&dev->port, s, n, atmel_console_putchar);
> +}
> +
> +static int __init atmel_early_console_setup(struct earlycon_device *device,
> +                                           const char *options)
> +{
> +       if (!device->port.membase)
> +               return -ENODEV;
> +
> +       device->con->write = atmel_serial_early_write;
> +
> +       return 0;
> +}
> +
> +OF_EARLYCON_DECLARE(atmelserial, "atmel,at91rm9200-usart",
> +                   atmel_early_console_setup);
> +OF_EARLYCON_DECLARE(atmelserial, "atmel,at91sam9260-usart",


For consistency with the rest of the naming in this file could you name it
atmel_serial?

Also, it would be good to select SERIAL_EARLYCON in Kconfig to have it
available also for production w/o changing defconfigs.

Thank you,
Claudiu Beznea

> +                   atmel_early_console_setup);
> +
>  #define ATMEL_CONSOLE_DEVICE   (&atmel_console)
> 
>  #else
> --
> 2.30.2
> 


  reply	other threads:[~2022-02-17  9:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16 16:18 Michael Walle
2022-02-17  9:12 ` Claudiu.Beznea [this message]
2022-02-17  9:28   ` Michael Walle

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=9e499fdb-19dc-9b5a-0eb7-618acfd61605@microchip.com \
    --to=claudiu.beznea@microchip.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=richard.genoud@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®