[U-Boot] [PATCH 2/5] Serial: Add UART support for Marvell ARMADA 100 SoCs.

Prafulla Wadaskar prafulla at marvell.com
Wed Oct 27 12:40:11 CEST 2010



> -----Original Message-----
> From: Stefan Roese [mailto:sr at denx.de]
> Sent: Wednesday, October 27, 2010 3:24 PM
> To: u-boot at lists.denx.de; Prabhanjan Sarnaik
> Cc: Prafulla Wadaskar; Manas Saksena; Lei Wen; Eric Miao
> Subject: Re: [U-Boot] [PATCH 2/5] Serial: Add UART support for Marvell
> ARMADA 100 SoCs.
> 
> Hi Prafulla,
> 
> On Wednesday 27 October 2010 15:53:21 Prafulla Wadaskar wrote:
> > ARMADA 100 SoCs has NS16550 compatible UART peripheral
> > This patch enables the same for ARMADA100 platforms
> >
> > Signed-off-by: Mahavir Jain <mjain at marvell.com>
> > Signed-off-by: Prafulla WADASKAR <prafulla at marvell.com>
> > ---
> >  drivers/serial/ns16550.c |   16 ++++++++++++++++
> >  drivers/serial/serial.c  |    3 +++
> >  2 files changed, 19 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
> > index 32f24de..e57ed1f 100644
> > --- a/drivers/serial/ns16550.c
> > +++ b/drivers/serial/ns16550.c
> > @@ -26,7 +26,15 @@
> >
> >  void NS16550_init (NS16550_t com_port, int baud_divisor)
> >  {
> > +#ifdef CONFIG_ARMADA100
> > +	/*
> > +	 * For ARMADA 100 Based Processors bit 6 in IER register
> > +	 * represents UART Unit Enable bit.
> > +	 */
> > +	serial_out((1 << 6), &com_port->ier);
> > +#else
> >  	serial_out(0x00, &com_port->ier);
> > +#endif
> 
> These board/platform specific driver additions are really ugly. A better
> way
> to do this would be something like this:
> 
> Add this to your board/platform header:
> 
> #define CONFIG_SYS_NS16550_IER	(1 << 6)
> 
> And then to ns16550.c or even ns16550.h:
> 
> #ifndef CONFIG_SYS_NS16550_IER
> #define CONFIG_SYS_NS16550_IER	0x00
> #endif
> 
> This macro can now be used unconditionally when initializing this "ier"
> register:
> 
>   	serial_out(CONFIG_SYS_NS16550_IER, &com_port->ier);

Thanks...
I will do it for next version post.

Regards..
Prafulla . .


More information about the U-Boot mailing list