Patchwork [U-Boot,6/8] Adds wait to atmel_usart serial_init function

login
register
mail settings
Submitter Alex.Waterman.awaterman@dawning.com
Date June 30, 2011, 7:14 p.m.
Message ID <1309461299-22604-7-git-send-email-awaterman@dawning.com>
Download mbox | patch
Permalink /patch/102818/
State Superseded
Delegated to: Reinhard Meyer
Headers show

Comments

Alex.Waterman.awaterman@dawning.com - June 30, 2011, 7:14 p.m.
From: Alex Waterman <awaterman@dawning.com>

Adds a short busy loop wait to the atmel_usart.c serial_init()
function.

Signed-off-by: Alex Waterman <awaterman@dawning.com>
---
 drivers/serial/atmel_usart.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Patch

diff --git a/drivers/serial/atmel_usart.c b/drivers/serial/atmel_usart.c
index e326b2b..e355706 100644
--- a/drivers/serial/atmel_usart.c
+++ b/drivers/serial/atmel_usart.c
@@ -47,6 +47,8 @@  void serial_setbrg(void)
 
 int serial_init(void)
 {
+
+	volatile int i = 0;
 	atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
 
 	writel(USART3_BIT(RSTRX) | USART3_BIT(RSTTX), &usart->cr);
@@ -61,6 +63,10 @@  int serial_init(void)
 			   | USART3_BF(NBSTOP, USART3_NBSTOP_1)),
 			   &usart->mr);
 
+	/* Short wait to let the serial port init. */
+	for (; i < 10000; i++)
+		;
+
 	return 0;
 }