From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Date: Fri, 01 Jul 2011 16:03:42 +0400 Subject: [U-Boot] [PATCH 6/8] Adds wait to atmel_usart serial_init function In-Reply-To: <1309462387-22926-7-git-send-email-awaterman@dawning.com> References: <4E0C6CDC.4020806@dawning.com> <1309462387-22926-1-git-send-email-awaterman@dawning.com> <1309462387-22926-7-git-send-email-awaterman@dawning.com> Message-ID: <4E0DB79E.60301@mvista.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello. On 30-06-2011 23:33, Alex Waterman wrote: > Adds a short busy loop wait to the atmel_usart.c serial_init() > function. > Signed-off-by: Alex Waterman > 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; Why 'volatile'? Also, there shouldn't be an empty line before it but there should be one after it... > 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; > } WBR, Sergei