From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Tue, 19 Mar 2019 16:56:24 +0100 Subject: [U-Boot] [PATCH 03/11] serial: atmel_usart: Use fixed clock value in SPL version In-Reply-To: <20190319155632.5680-1-sr@denx.de> References: <20190319155632.5680-1-sr@denx.de> Message-ID: <20190319155632.5680-3-sr@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de 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 Cc: Heiko Schocher Cc: Andreas Bie=C3=9Fmann Cc: Eugen Hristev --- 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 =3D= { .setbrg =3D atmel_serial_setbrg, }; =20 +#ifdef CONFIG_SPL_BUILD +static int atmel_serial_enable_clk(struct udevice *dev) +{ + struct atmel_serial_priv *priv =3D dev_get_priv(dev); + + /* Use fixed clock value in SPL */ + priv->usart_clk_rate =3D 132096000; + + return 0; +} +#else static int atmel_serial_enable_clk(struct udevice *dev) { struct atmel_serial_priv *priv =3D dev_get_priv(dev); @@ -245,6 +256,7 @@ static int atmel_serial_enable_clk(struct udevice *dev) =20 return 0; } +#endif =20 static int atmel_serial_probe(struct udevice *dev) { --=20 2.21.0