From patchwork Thu Jun 30 19:14:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex.Waterman.awaterman@dawning.com X-Patchwork-Id: 102818 X-Patchwork-Delegate: info@emk-elektronik.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 4F215B6F18 for ; Fri, 1 Jul 2011 05:45:26 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A279A280F4; Thu, 30 Jun 2011 21:45:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1cyyyHx7QohN; Thu, 30 Jun 2011 21:45:24 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 083F6280D2; Thu, 30 Jun 2011 21:45:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 041C6280D2 for ; Thu, 30 Jun 2011 21:45:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uuox1BjZM8Ie for ; Thu, 30 Jun 2011 21:45:18 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from victoria.dawning.com (mail.dawning.com [63.247.149.203]) by theia.denx.de (Postfix) with ESMTPS id 0F3E8280CA for ; Thu, 30 Jun 2011 21:45:16 +0200 (CEST) Received: from victoria.dawning.com (victoria.dawning.com [127.0.0.1]) by victoria.dawning.com (8.14.4/8.14.4) with ESMTP id p5UJFRYN022660; Thu, 30 Jun 2011 15:15:27 -0400 Received: (from alex@localhost) by victoria.dawning.com (8.14.4/8.14.4/Submit) id p5UJFRwm022659; Thu, 30 Jun 2011 15:15:27 -0400 From: To: u-boot@lists.denx.de Date: Thu, 30 Jun 2011 15:14:57 -0400 Message-Id: <1309461299-22604-7-git-send-email-awaterman@dawning.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1309461299-22604-1-git-send-email-awaterman@dawning.com> References: <4E0C6CDC.4020806@dawning.com> <1309461299-22604-1-git-send-email-awaterman@dawning.com> Cc: sedji.gaouaou@atmel.com Subject: [U-Boot] [PATCH 6/8] Adds wait to atmel_usart serial_init function X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Alex Waterman Adds a short busy loop wait to the atmel_usart.c serial_init() function. Signed-off-by: Alex Waterman --- drivers/serial/atmel_usart.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) 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; }