From patchwork Tue Mar 22 20:40:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Rigby X-Patchwork-Id: 742 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:45:20 -0000 Delivered-To: patches@linaro.org Received: by 10.204.113.5 with SMTP id y5cs17053bkp; Tue, 22 Mar 2011 13:40:52 -0700 (PDT) Received: by 10.43.54.66 with SMTP id vt2mr1991047icb.300.1300826451991; Tue, 22 Mar 2011 13:40:51 -0700 (PDT) Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.212.172]) by mx.google.com with ESMTPS id f8si18253079ibb.51.2011.03.22.13.40.51 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Mar 2011 13:40:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.172 is neither permitted nor denied by best guess record for domain of john.rigby@linaro.org) client-ip=209.85.212.172; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.172 is neither permitted nor denied by best guess record for domain of john.rigby@linaro.org) smtp.mail=john.rigby@linaro.org Received: by mail-px0-f172.google.com with SMTP id 6so4119324pxi.17 for ; Tue, 22 Mar 2011 13:40:51 -0700 (PDT) Received: by 10.142.12.16 with SMTP id 16mr4525511wfl.253.1300826451264; Tue, 22 Mar 2011 13:40:51 -0700 (PDT) Received: from localhost.localdomain (c-76-23-54-220.hsd1.ut.comcast.net [76.23.54.220]) by mx.google.com with ESMTPS id n4sm9096243wfl.2.2011.03.22.13.40.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Mar 2011 13:40:50 -0700 (PDT) From: John Rigby To: u-boot@lists.denx.de Cc: Rabin Vincent , patches@linaro.org Subject: [PATCH 1/4] p101x: extra init for u8500 Date: Tue, 22 Mar 2011 14:40:16 -0600 Message-Id: <1300826419-18632-2-git-send-email-john.rigby@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1300826419-18632-1-git-send-email-john.rigby@linaro.org> References: <1300826419-18632-1-git-send-email-john.rigby@linaro.org> From: Rabin Vincent empty fifo on init program receive line control register on u8500 Signed-off-by: Rabin Vincent --- drivers/serial/serial_pl01x.c | 10 ++++++++++ drivers/serial/serial_pl01x.h | 4 ++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c index 5dfcde8..22ada8f 100644 --- a/drivers/serial/serial_pl01x.c +++ b/drivers/serial/serial_pl01x.c @@ -112,6 +112,12 @@ int serial_init (void) unsigned int remainder; unsigned int fraction; + /* Empty RX fifo if necessary */ + if (readl(®s->pl011_cr) & UART_PL011_CR_UARTEN) { + while (!(readl(®s->fr) & UART_PL01x_FR_RXFE)) + readl(®s->dr); + } + /* First, disable everything */ writel(0, ®s->pl011_cr); @@ -134,6 +140,10 @@ int serial_init (void) writel(UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN, ®s->pl011_lcrh); +#ifdef CONFIG_U8500 + /* program receive line control register */ + writel(0x70, ®s->pl011_rlcr); +#endif /* Finally, enable the UART */ writel(UART_PL011_CR_UARTEN | UART_PL011_CR_TXE | UART_PL011_CR_RXE, ®s->pl011_cr); diff --git a/drivers/serial/serial_pl01x.h b/drivers/serial/serial_pl01x.h index b670c24..fdd3911 100644 --- a/drivers/serial/serial_pl01x.h +++ b/drivers/serial/serial_pl01x.h @@ -43,7 +43,11 @@ struct pl01x_regs { u32 pl010_lcrl; /* 0x10 Line control register, low byte */ u32 pl010_cr; /* 0x14 Control register */ u32 fr; /* 0x18 Flag register (Read only) */ +#ifdef CONFIG_U8500 + u32 pl011_rlcr; /* 0x1c Receive line control register */ +#else u32 reserved; +#endif u32 ilpr; /* 0x20 IrDA low-power counter register */ u32 pl011_ibrd; /* 0x24 Integer baud rate register */ u32 pl011_fbrd; /* 0x28 Fractional baud rate register */