Patchwork [U-Boot,v4,4/7] Serial: ns16550: Add support for CONFIG_SYS_NS16550_IER macro

login
register
mail settings
Submitter Prafulla Wadaskar
Date Dec. 7, 2010, 5:06 p.m.
Message ID <1291741587-12484-4-git-send-email-prafulla@marvell.com>
Download mbox | patch
Permalink /patch/74533/
State Accepted
Headers show

Comments

Prafulla Wadaskar - Dec. 7, 2010, 5:06 p.m.
On some processors this ier register configuration is different
for ex. Marvell Armada100

This patch introduce CONFIG_SYS_NS16550_IER macro support to
unconditionally initialize this register.

Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
---
Changelog v3:
macro defination CONFIG_SYS_NS16550_IER moved from ns16550.h to ns16550.c

 drivers/serial/ns16550.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
Prafulla Wadaskar - Dec. 11, 2010, 2:13 p.m.
> -----Original Message-----
> From: Prafulla Wadaskar [mailto:prafulla@marvell.com]
> Sent: Tuesday, December 07, 2010 10:36 PM
> To: u-boot@lists.denx.de
> Cc: Lei Wen; Eric Miao; Yu Tang; Kiran Vedere; Manas Saksena; Prabhanjan
> Sarnaik; Ashish Karkare; Prafulla Wadaskar
> Subject: [PATCH v4 4/7] Serial: ns16550: Add support for
> CONFIG_SYS_NS16550_IER macro
> 
> On some processors this ier register configuration is different
> for ex. Marvell Armada100
> 
> This patch introduce CONFIG_SYS_NS16550_IER macro support to
> unconditionally initialize this register.
> 
> Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
> ---
> Changelog v3:
> macro defination CONFIG_SYS_NS16550_IER moved from ns16550.h to ns16550.c
> 
>  drivers/serial/ns16550.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
>

Applied to u-boot-marvell.git master branch

Regards..
Prafulla ..

Patch

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 32f24de..8eeb48f 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -24,9 +24,13 @@ 
 #define serial_in(y) 	readb(y)
 #endif
 
+#ifndef CONFIG_SYS_NS16550_IER
+#define CONFIG_SYS_NS16550_IER  0x00
+#endif /* CONFIG_SYS_NS16550_IER */
+
 void NS16550_init (NS16550_t com_port, int baud_divisor)
 {
-	serial_out(0x00, &com_port->ier);
+	serial_out(CONFIG_SYS_NS16550_IER, &com_port->ier);
 #if defined(CONFIG_OMAP) && !defined(CONFIG_OMAP3_ZOOM2)
 	serial_out(0x7, &com_port->mdr1);	/* mode select reset TL16C750*/
 #endif
@@ -52,7 +56,7 @@  void NS16550_init (NS16550_t com_port, int baud_divisor)
 #ifndef CONFIG_NS16550_MIN_FUNCTIONS
 void NS16550_reinit (NS16550_t com_port, int baud_divisor)
 {
-	serial_out(0x00, &com_port->ier);
+	serial_out(CONFIG_SYS_NS16550_IER, &com_port->ier);
 	serial_out(UART_LCR_BKSE | UART_LCRVAL, &com_port->lcr);
 	serial_out(0, &com_port->dll);
 	serial_out(0, &com_port->dlm);