[U-Boot] [PATCH 03/11] serial: atmel_usart: Use fixed clock value in SPL version

Eugen.Hristev at microchip.com Eugen.Hristev at microchip.com
Wed Mar 20 07:25:46 UTC 2019



On 19.03.2019 17:56, Stefan Roese wrote:
> External E-Mail
> 
> 
> This patch adds an alterative SPL version of atmel_serial_enable_clk().
> This enables the usage of this driver without full clock support (in
> drivers and DT nodes). This saves some space in the SPL image.
> 
> If some boards need a different clock than the one provided with this
> patch, then support for this needs to be added later.
> 
> Signed-off-by: Stefan Roese <sr at denx.de>
> Cc: Heiko Schocher <hs at denx.de>
> Cc: Andreas Bießmann <andreas at biessmann.org>
> Cc: Eugen Hristev <eugen.hristev at microchip.com>
> ---
>   drivers/serial/atmel_usart.c | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/serial/atmel_usart.c b/drivers/serial/atmel_usart.c
> index aa8cdff840..049172baef 100644
> --- a/drivers/serial/atmel_usart.c
> +++ b/drivers/serial/atmel_usart.c
> @@ -218,6 +218,17 @@ static const struct dm_serial_ops atmel_serial_ops = {
>   	.setbrg = atmel_serial_setbrg,
>   };
>   
> +#ifdef CONFIG_SPL_BUILD
> +static int atmel_serial_enable_clk(struct udevice *dev)
> +{
> +	struct atmel_serial_priv *priv = dev_get_priv(dev);
> +
> +	/* Use fixed clock value in SPL */
> +	priv->usart_clk_rate = 132096000;

Hi Stefan,

Does this mean that the SPL will work *if and only if* this clock 
matches the board's clock, for all at91 boards? (thus, boards having a 
different clock , the serial will not function correctly anymore ?)

Eugen

> +
> +	return 0;
> +}
> +#else
>   static int atmel_serial_enable_clk(struct udevice *dev)
>   {
>   	struct atmel_serial_priv *priv = dev_get_priv(dev);
> @@ -245,6 +256,7 @@ static int atmel_serial_enable_clk(struct udevice *dev)
>   
>   	return 0;
>   }
> +#endif
>   
>   static int atmel_serial_probe(struct udevice *dev)
>   {
> 


More information about the U-Boot mailing list