From: Eugen.Hristev at microchip.com Date: Fri, 29 Mar 2019 09:54:06 +0000 Subject: [U-Boot] [PATCH 03/12 v2] serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL In-Reply-To: <20190326121642.23302-3-sr@denx.de> References: <20190326121642.23302-1-sr@denx.de> <20190326121642.23302-3-sr@denx.de> Message-ID: <60fa6c88-b96b-fac6-749a-5672accc867a@microchip.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de On 26.03.2019 14:16, Stefan Roese wrote: > 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. >=20 > Please note that this fixed clock support is only added to the SPL code > in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL > should not be affected. Hello Stefan, For example, sama5d2_xplained_mmc_defconfig has DM_SERIAL and SPL. This means it's affected ? If so, then it's not OK to take it as-is. And another question, is the rest of your patch series OK if this patch=20 is missing ? Or it's any dependency on this ? the SPL for Gardena will=20 not fit in the SRAM without this patch ? Eugen >=20 > If some boards need a different clock than the one provided with this > patch, then support for this needs to be added later. >=20 > Signed-off-by: Stefan Roese > Cc: Heiko Schocher > Cc: Andreas Bie=C3=9Fmann > Cc: Eugen Hristev > --- > v2: > - Reword patch subject and commit text to make it more clear, that > this change only affects ports with SPL and DM_SERIAL enabled >=20 > drivers/serial/atmel_usart.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) >=20 > 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 *de= v) > =20 > return 0; > } > +#endif > =20 > static int atmel_serial_probe(struct udevice *dev) > { >=20