mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Alexander Shiyan <eagle.alexander923@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] serial: ns16550: Adding compatibility for the AM437X platforms
Date: Thu, 9 Jun 2022 09:26:26 +0200	[thread overview]
Message-ID: <20220609072626.GZ1615@pengutronix.de> (raw)
In-Reply-To: <20220607100337.18277-1-eagle.alexander923@gmail.com>

On Tue, Jun 07, 2022 at 01:03:36PM +0300, Alexander Shiyan wrote:
> Adding compatibility for AM437X platforms.
> Since the serial node is not populated with a clock node,
> let's add an additional driver variable to set the default clock speed.
> 
> Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
> ---
>  drivers/serial/serial_ns16550.c | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c
> index f93a89ab95..fb6af42e00 100644
> --- a/drivers/serial/serial_ns16550.c
> +++ b/drivers/serial/serial_ns16550.c
> @@ -42,8 +42,9 @@ struct ns16550_priv {
>  };
>  
>  struct ns16550_drvdata {
> -        void (*init_port)(struct console_device *cdev);
> -        const char *linux_console_name;
> +	void (*init_port)(struct console_device *cdev);
> +	const char *linux_console_name;
> +	unsigned int clk_default;
>  };
>  
>  static inline struct ns16550_priv *to_ns16550_priv(struct console_device *cdev)
> @@ -362,6 +363,12 @@ static __maybe_unused struct ns16550_drvdata omap_drvdata = {
>  	.linux_console_name = "ttyO",
>  };
>  
> +static __maybe_unused struct ns16550_drvdata am43xx_drvdata = {
> +	.init_port = ns16550_omap_init_port,
> +	.linux_console_name = "ttyO",
> +	.clk_default = 48000000,
> +};
> +
>  static __maybe_unused struct ns16550_drvdata jz_drvdata = {
>  	.init_port = ns16550_jz_init_port,
>  };
> @@ -472,6 +479,9 @@ static int ns16550_probe(struct device_d *dev)
>  	else
>  		ns16550_probe_dt(dev, priv);
>  
> +	if (devtype->clk_default && !priv->plat.clock)
> +		priv->plat.clock = devtype->clk_default;
> +
>  	if (!priv->plat.clock) {
>  		priv->clk = clk_get(dev, NULL);
>  		if (IS_ERR(priv->clk)) {
> @@ -537,6 +547,9 @@ static struct of_device_id ns16550_serial_dt_ids[] = {
>  	}, {
>  		.compatible = "ti,omap4-uart",
>  		.data = &omap_drvdata,
> +	}, {
> +		.compatible = "ti,am4372-uart",
> +		.data = &am43xx_drvdata,
>  	},
>  #endif
>  #if IS_ENABLED(CONFIG_MACH_MIPS_XBURST)
> -- 
> 2.32.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      parent reply	other threads:[~2022-06-09  7:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07 10:03 Alexander Shiyan
2022-06-07 10:03 ` [PATCH 2/2] serial: ns16550: Remove redundant driver data for generic ns16550 variants Alexander Shiyan
2022-06-09  7:26 ` Sascha Hauer [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=20220609072626.GZ1615@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=eagle.alexander923@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