summaryrefslogtreecommitdiff
path: root/drivers/serial/atmel_usart.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-04-09 12:10:40 -0400
committerTom Rini <trini@konsulko.com>2019-04-09 12:10:40 -0400
commit5a451f11c800cde986386aa7cab464b40260ae3c (patch)
tree0c38454238a3ee787ba72f304fc25b7921845222 /drivers/serial/atmel_usart.c
parent1d63ec3fa40e4899ad1d74d5ed3c926acfda54f2 (diff)
parent7bf9bca7c0a9fe5c63e8fd5c2aa63884d76dace0 (diff)
Merge tag 'u-boot-atmel-2019.07-a' of git://git.denx.de/u-boot-atmel
First set of u-boot-atmel features and fixes for 2019.07 cycle
Diffstat (limited to 'drivers/serial/atmel_usart.c')
-rw-r--r--drivers/serial/atmel_usart.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/serial/atmel_usart.c b/drivers/serial/atmel_usart.c
index aa8cdff8408..c450a4e08a3 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,
};
+#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_CLK)
+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 = CONFIG_SPL_UART_CLOCK;
+
+ 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)
{